This content is not included in your SAE MOBILUS subscription, or you are not logged in.

Application of Auto-Coding for Rapid and Efficient Motor Control Development

Journal Article
ISSN: 1946-4614, e-ISSN: 1946-4622
Published April 01, 2014 by SAE International in United States
Application of Auto-Coding for Rapid and Efficient Motor Control Development
Citation: Walters, J., Harianto, C., Kelly, E., and Sugiarto, T., "Application of Auto-Coding for Rapid and Efficient Motor Control Development," SAE Int. J. Passeng. Cars – Electron. Electr. Syst. 7(2):481-490, 2014,
Language: English


In hybrid and electric vehicles, the control of the electric motor is a critical component of vehicle functions such as motoring, generating, engine-starting and braking. The efficient and accurate control of motor torque is performed by the motor controller. It is a complex system incorporating sensor sampling, data processing, controls, diagnostics, and 3-phase Pulse Width Modulation (PWM) generation which are executed in sub-100 uSec periods. Due to the fast execution rates, care must be taken in the software coding phase to ensure the algorithms will not exceed the target processor's throughput capability.
Production motor control development often still follows the path of customer requirements, component requirements, simulation, hand-code, and verification test due to the concern for processor throughput. In the case of vehicle system controls, typically executed no faster than 5-10 mSec periods, auto-coding tools are used for algorithm development as well as testing. The advantages of auto-coding to greatly speed the development process by linking the tools for simulation, code generation and testing early in the development process as well as to more easily investigate performance issues late in the process are well known. It is not uncommon, however, to lose coding efficiency with this approach. While the loss of efficiency may be tolerable for slow periods, it is not acceptable at faster periods used in motor controls as it will preclude the algorithms from executing or drive unnecessarily expensive solutions.
This paper will present an auto-coding process applied to motor controls, including full implementation on a production permanent magnet motor drive. Best practices for implementing requirements into models that generate efficient code will be highlighted. An overview of the issues associated with model-based documentation will also be covered. The use of test vectors at the component, model and hardware-in-the-loop (HIL) level will be presented to show the benefits derived from using a formalized process and the natural linkage to a SPICE® compliant process. A timing study performed during dynamometer testing detailing the differences between the original hand-code and the model-based code will be presented.