Video length is 20:05

From Idea to MCU Deployment: Applying Tiny Machine Learning to FOC for PMSMs

Danilo Pau, STMicroelectronics

Field-oriented control (FOC) is an efficient technique for controlling permanent magnet synchronous motors (PMSMs), managing torque and speed by decoupling stator current into orthogonal components: direct axis current (Id) and quadrature axis current (Iq). Modeled in Simulink®, FOC systems use two proportional-integral-derivative (PID) controllers. The first PID controller regulates speed by comparing reference speed with measured speed and outputs reference current Iq. The second PID controller takes the reference currents and measured currents to output direct and quadrature voltages (Vd and Vq). However, PID control can result in suboptimal performance due to deviations and overshoot in the reference current Iq.

To enhance FOC performance, this talk proposes a two-step approach. Using MATLAB® tools for AI, a tiny neural network (NN) was devised and integrated to correct deviations in the reference current Iq generated by the speed PID controller. The NN is trained, pruned, and quantized using MATLAB tools for AI on data extracted from use cases to predict errors and provide corrective signals. These signals are added to the PID controller's output, resulting in near-optimal reference current Iq with minimized deviation and overshoot. The NN's inputs include multiplexed signals of reference speed, measured speed, and the initial reference current generated by the PID controller. The corrected Iq, along with the Id reference (maintained at zero for maximum electromagnetic torque), is then used by a secondary PID controller to generate quadrature (Vq) and direct (Vd) voltage commands, which are transformed via a Park transformation and utilized by an inverter to control a 4-pole pairs PMSM.

To study the deployability of the tiny NN-enhanced controller, inference time and memory footprint will be tested using the ST Edge AI Developer Cloud platform. This ensures the NN is deployable and performs well with respect to real-time PMSM control requirements.

Published: 6 Nov 2024