Motor Control Software
Researchers at NASA have developed a model that can be used to automatically generate code for flight software in various electrified aircraft. This unique architecture helps increase efficiency throughout the motor control software development process.
Quick Facts
Overview
In an aircraft’s propulsion system, a motor controller takes measurements as inputs and returns a control signal that allows a motor to spin and operate.
To improve design and testing processes, one of NASA’s key goals is developing a scalable control architecture for use on several electrified aircraft concepts. This architecture allows for automatic generation of motor control software from a simulation environment, making the development process quicker and more efficient compared to traditional software development practices.
Generating Code from Controller Models
Code generation is the process of creating conventional text code from visual models. The motor controller is developed in a simulation where it is connected to other components of a motor power system. In the simulation environment, the controller operates a power converter to control a motor. Code generation is used to automatically convert the controller in simulation to code that can be loaded onto a real controller in a physical system. The controller model that runs in the simulation becomes the code that runs real-life hardware.
Using this development approach is much quicker than writing traditional control software for complex control algorithms. The visual controller model is also easier to follow, and the tight integration with simulation allows for more in-depth analysis during hardware and software integration.
Development Benefits of Code Generation
- Shortens motor controller development time
- Visual model is easier to follow
- Full system simulation increases confidence and safety going into physical testing
- New algorithms can be implemented and tested fully in simulation prior to hardware testing
- Helps developers more easily find, understand, and debug problems
- Iterative approach between simulation and hardware testing allows simulation to become more accurate and gives future controller models developed in simulation a higher chance of initial success on hardware
Flight Certification Benefits of Code Generation
- Visual models can represent on a single screen what would be hundreds or thousands of lines of code, making the full model much easier to navigate through than the full code base
- Software can be analyzed at the model level using tools to identify design flaws
- Generated code can be analyzed using static code analysis tools to identify design defects, errors, cyclomatic complexity, software quality metrics, as well as to verify and prove that design errors can’t occur
- Code can be generated to adhere to various coding standards
- Models can be analyzed for checks on coding, modeling, or high-integrity software development standards, metrics, and software quality objectives
- Models and generated code can be assessed for Modified Condition/Decision Coverage (MC/DC) to measure testing coverage
- Models can be assessed for dead logic, division by zero, overflow, and other design errors
- Model tools can generate MC/DC test cases based on coverage objectives
- Code generation can help improve inefficiencies at the model level to prioritize model performance, and address model problems and design defects early in development
Application and Next Steps
Code generation has successfully been used in the High Lift Motor Controller (HLMC) that was developed under NASA’s X-57 fully electric aircraft project. The development process was able to decrease development times and lessen the differences between simulation and the real world.
Having a scaled control architecture allowed X-57’s system to be implemented on NASA’s Advanced Air Transport Technology (AATT) 250-kilowatt converter and eventually NASA’s 1.4-megawatt High-Efficiency Megawatt Motor (HEMM).
Although hardware interfaces differ between aircraft, the control algorithm, which is the most challenging part, is mostly the same and can be reused on different electrified aircraft studies.