Smarter Motor Control with Edge AI
Researchers developed a tiny neural network that enhances the accuracy of the motor control systems used in electric vehicles.
Machine learning algorithms have a remarkable ability to recognize complex patterns in data that elude the human eye. Recognizing patterns has many applications in areas such as disease diagnosis, image classification, and fraud detection. As these algorithms continue to be optimized to run effectively on less powerful edge computing platforms, the number of use cases is continuing to increase. By running these machine learning algorithms on-device, they can be used as real-time control systems, for example, for all sorts of machinery — such as electric motors — enabling it to operate more efficiently than was previously possible with traditional control systems.
One such machine is the Permanent Magnet Synchronous Motor (PMSM), which is widely used in electric vehicles, industrial automation, and aerospace applications. PMSMs are valued for their high torque, power density, and energy efficiency. However, ensuring precise control over these motors is a complex challenge, particularly when faced with external disturbances and variations in system parameters due to temperature changes and wear over time.
For decades, Proportional-Integral (PI) controllers have been the go-to solution for controlling PMSMs due to their simplicity and ease of implementation. These controllers adjust the motor’s input based on the difference between desired and actual performance, correcting errors over time. However, PI controllers struggle to handle nonlinear dynamics and changing conditions, which can lead to reduced efficiency and performance fluctuations. Furthermore, improper tuning of PI controllers can result in overshoot, oscillations, and slower response times, limiting the overall effectiveness of motor control.
To address these challenges, more advanced control strategies such as Model Predictive Control (MPC) have been explored. MPC uses a predictive model of the motor’s behavior to optimize control inputs dynamically. While this approach significantly improves precision and robustness, it comes with a major drawback — high computational complexity. Running MPC on resource-constrained microcontrollers introduces unacceptable latency, making it impractical for real-time control applications in embedded systems.
A more practical solution was just proposed by researchers at the University of Pavia and STMicroelectronics that is called TinyFC, a lightweight feed-forward neural network designed to enhance Field-Oriented Control (FOC) of PMSMs. TinyFC is a compact neural network consisting of just 1,400 parameters, making it suitable for deployment on low-power microcontrollers while maintaining high control accuracy. Unlike traditional PI controllers, TinyFC is capable of learning and adapting to nonlinear motor behaviors, improving overall performance.
The development of TinyFC involved extensive optimization techniques, including pruning, hyperparameter tuning, and 8-bit integer quantization, ensuring that the neural network remains efficient in terms of both computation and memory usage. These efforts resulted in one of the major advantages of TinyFC, which is its ability to reduce overshoot — an issue commonly associated with PI controllers — by up to 87.5%. In fact, a pruned version of the model completely eliminated overshoot.
To validate the effectiveness of TinyFC, researchers conducted high-fidelity simulations in Simulink, a widely used modeling environment. A dataset was collected to mimic the motor’s response to various speed inputs, particularly focusing on nonlinear behaviors. The neural network was then trained using this dataset and fine-tuned for optimal performance. Once trained, TinyFC was deployed to an STMicroelectronics NUCLEO-G474RE development board, which integrated it into the FOC speed control unit of a test motor.
Experiments demonstrated significant improvements in motor control performance compared to traditional PI controllers. The neural network effectively reduced the deviation between the reference speed signal and the measured speed, significantly correcting overshoot. Additionally, parameter optimization led to a 75.7% reduction in model complexity while maintaining accuracy. The pruned TinyFC model further enhanced control stability, completely eliminating overshoot.
In addition to improving motor performance, TinyFC’s success demonstrates the growing potential of tiny neural networks in edge computing applications. By bringing machine learning to microcontrollers, these models enable intelligent, real-time applications in power-efficient devices, reducing the need for cloud computing and improving privacy.