Motor drives are a key feature of the automated industrial market. STMicroelectronics, with years of experience in motor control, offers a variety of dedicated hardware and software solutions for motors. To meet diverse application needs, the STMC (Motor Control) ecosystem contains comprehensive solutions, such as evaluation boards, firmware (FW) libraries, and related documentation.
The STMC ecosystem now includes a new firmware library for permanent magnet synchronous motor (PMSM) control called STM32PMSMFOCSDKv4.0. These tools represent the culmination of STMicroelectronics' years of deep knowledge and system experience in CNC and power system solutions, helping to shorten customer product development cycles and accelerate the evaluation of STMicroelectronics products. In fact, STMicroelectronics supports a wide range of motor controls in automation and industrial applications, thanks to its innovative product portfolio, including power transistors, intelligent power modules, motor driver chips, and the latest microcontrollers.
PMSMFOCSDK features and dedicated algorithms enhance the practical value of STMicroelectronics' industrial motor drive product evaluation.
To achieve this goal, hardware and firmware solutions must work together. Furthermore, to achieve the highest motor control performance, several different dedicated algorithms have been added to the familiar three-phase brushless motor vector control (FOC) technology.
Figure 1: Automation and Industrial Motor Control
STMicroelectronics began developing vector control technology many years ago, and in 2009 released its first firmware library for three-phase motor control supporting STM32 microcontrollers and STM32 motor control development boards. Since then, this solution has been continuously improved, with the addition of numerous features:
• Sensorless permanent magnet motor control (two complementary algorithms, back EMF state estimator, and high-frequency injection)
• The firmware library is fully configurable and supports the entire STM32F product line (F0, F1, F2, F3, F4), as well as STMicroelectronics' power stage products (such as SLLIMM® intelligent power modules) or discrete solutions (power MOSFETs, IGBTs, gate drivers).
• Configure the firmware library via PC software (STMCWorkbench) to help users set up the system and enable real-time communication between the PC and the firmware.
Dual-drive motor control that simultaneously drives two motors using a single microcontroller.
Other functions include: flux weakening, MTPA (maximum torque-to-current ratio) for internal magnet motors, and positive feedback current regulation.
Firmware, when used in conjunction with hardware tools (control level + power level or overall solution), helps users quickly begin product prototyping.
Figure 2: Permanent Magnet Synchronous Motor Control Ecosystem
New features in STM32FOCSDKv4.0
STM32FOCSDKV4.0 is the latest 2014 version of this firmware library. Its main architectural improvements are in firmware usability. Enhanced usability helps users accelerate product design and shorten development cycles—two key factors for success in the electronics industry. To further improve the usability of software development tools, STMicroelectronics' motor control ecosystem has added many features, from source code to PC graphical user interface software, and comes with a suite of development resources, including technical documentation, FAQs, presentations, software examples, use cases, tutorials, and videos. All resources are included in the standard software and firmware packages, which users can download from the STMicroelectronics website www.st.com. For complete C language source code, users must request it from their local STMicroelectronics representative office.
The STM32FOCSDKV4.0 ecosystem includes two major tools needed for rapid and efficient design: firmware libraries and PC graphical user interface software.
From the cost-effective 48MHz Cortex-M0STM32F030x to the STM32F30x integrating various analog IP modules, and the state-of-the-art 180MHz Cortex-M4STM32F4 supporting floating-point instructions, the renowned STM32 vector control firmware library supports the entire STM32F product line. From small motors for medical applications to large servo motors for factory automation or electric traction, STM32 covers a wide range of motor control applications. Unlike other brands' motor control solutions, the STM32FOC firmware library employs an object-oriented approach, which is why STMicroelectronics' firmware library supports different series of microcontrollers.
In addition to retaining the rigorous software abstraction layer structure of the previous version, version V4.0 simplifies Workspaces, reducing the number of projects to be configured each time. Furthermore, the firmware library now supports the KEIL Microvision integrated development environment, which previously only supported IAREmbeddedWorkbench.
The Motor Control Application Programming Interface (API), the flagship technology of the previous version, has been updated with new features in the new version. In addition, the new software package includes a set of software examples. Users can utilize the functions exported from the Motor Control API to implement typical use cases and apply them to their final application designs, such as:
• Set the speed reference value based on the analog input voltage;
• The output PWM signal maintains a proportional relationship with the measured speed value;
• Real-time modification of controller parameters such as bandwidth;
• Real-time modification of speed sensor and position sensor parameters in the control loop
All the code needed to implement this functionality is included in the software examples, which can serve as a foundation for creating more complex projects or as a reference guide for understanding the logic behind the API itself. The motor control library also acts as a black box, illustrating how to issue commands to the motor, such as start, stop, or decelerate, and can also be used to receive motor feedback signals, such as measurements of speed, torque, or power. The firmware library also allows customers to focus on top-level application development, leveraging specific strategic knowledge to design differentiated solutions.
Figure 3: MCSDK 4.0 user interface
In version 4.0, the firmware user interface has two communication channels. If the control board has an LCD screen, a lightweight (small code) LCD graphical user interface can be implemented. The simplified LCD allows users to customize the graphical user interface more flexibly and add more user-interactive firmware functions. If the control board does not have an LCD screen, a real-time communication channel can be established between the firmware and the PC via USART. V4.0 can also establish a fast one-way communication channel, allowing the firmware to continuously send data to the PC at maximum rate, excluding control bytes used to monitor rapidly changing variables.
Other new features of Workbench:
• The sensorless startup setup window features enhanced current application and acceleration graphical user interface, providing users with the benefit of visualized parameter descriptions.
• The Workbench projects bundled with the tools offer richer configurations, covering a variety of reference design boards.
• The link between Workbench and technical documentation has been strengthened. After entering a new project in the program menu, users are directly redirected to technical documentation: Quickstart, User Manual, Developer Manual, and API Reference Manual.
Furthermore, Workbench has fully supported digital PFC plug-in boards since the previous version, and now also allows users to set the power stage AC input range and handle implemented safety functions such as overcurrent and overvoltage, enabling users to set appropriate thresholds at the drive management level.
Zero-speed control using high-frequency injection method
The improvements in the new firmware go beyond just user experience and ease of use. Version 4.0 includes a new sensorless control algorithm and the previous version's "state-of-the-art" BEMF state estimator. The new sensorless control algorithm, called "High-Frequency Injection (HFI)," is suitable for internal magnet permanent magnet synchronous motors (PMSMs). In this type of motor, the magnets are not mounted on the rotor surface but are embedded in the rotor's core. Internal magnet permanent magnet synchronous motors exhibit inductance anisotropy, which is readily apparent from the relationship between the windings and the quadrants and the direct axis (Lq differs from Ld).
Figure 4: Magnetic structure of the motor
High-frequency injection utilizes the anisotropy of the magnetic structure to detect the angular position of low-speed and stationary rotors. This sensorless detection technology expands the speed detection range of back electromotive force (BEMF) estimators or reverse electromagnetic force detection technologies. Because the BEMF amplitude is proportional to the motor speed, it is difficult to detect when the motor is stationary or at extremely low speeds due to its small amplitude. Based on a completely different physical principle, high-frequency injection can control motors operating at low speeds. A pulsating field is injected into the motor, and the electrical angle is calculated using the current within the motor's magnetic structure. To avoid generating additional torque, the injection frequency must be set higher than the fundamental frequency. This is analogous to scanning the motor with X-rays to detect the rotor's electrical position relative to the anisotropy of the magnetic structure. This method is suitable for the stationary to low-speed range, working in conjunction with a BEMF estimator to automatically switch control methods in real time based on the motor speed. This new algorithm belongs to STMicroelectronics' numerous innovative patented technologies in its motor control SDKs, offering several advantages:
Zero speed full torque
·Low speed operation
• Sensorless start-up, no reverse rotation
Fastest sensorless start
Sensorless forward (clockwise) and reverse (counterclockwise) speed detection
In addition, this solution can enhance the value of applications that benefit from startup efficiency, including air compressors, low-speed operation or reverse rotation (washing machines or industrial automation , electric bicycles or traction motors), and many other emerging applications.
STMicroelectronics Hardware Tools
STMicroelectronics provides evaluation boards for its motor control firmware library, allowing users to evaluate STMicroelectronics products, such as Smart Power Modules (SLLIMM®), IGBTs, gate drivers, motor control chips, and microcontrollers, within actual motor control systems. For three-phase motor control applications, we will primarily focus on the following:
This flexible, modular system comprises a control board and a power board. The control board is equipped with any STM32F0, F1, F2, F3, or F4 microcontroller, along with a rich set of peripherals, such as MEMS, temperature sensors, external memory, an LCD screen, a transceiver, and a camera. The power board contains a frequency converter based on SLLIMM® (Small Molded Low Loss Intelligent Power Module) or discrete devices such as power MOSFETs or IGBTs and gate drivers. The control board and power board can be connected via STMicroelectronics' standard "Motor Control Connector," ensuring full compatibility between the control and power levels.
Figure 5: Flexible system control board and power board
1. Single-board motor drive solution: Integrates all the functions required for motor drive on a single circuit board, suitable for certain specific applications: air conditioners, ceiling fans, dishwashers, etc.; taking STEVAL-IHM034V2 as an example, this solution can drive a permanent magnet synchronous motor (PMSM) of up to 1.4kW. By connecting another circuit board, it can drive two motors (FOC) simultaneously.
Figure 6: Complete motor driver
in conclusion
We briefly introduced the new features of the latest version of MCFOCSDK. STMicroelectronics' automation and industrial control solutions are constantly adding new features, technologies and products to expand STMicroelectronics' motor control ecosystem, in line with the trend of ease of use and rapid evaluation, while focusing on design issues such as energy efficiency, integration and cost optimization.