As ST recently released X-CUBE-MCSDK 6.3.2, let us delve into its firmware libraries and its Graphical User Interface (GUI) to see how it can help create motor control applications. Designed for permanent magnet synchronous (PMSM) and BLDC motors using FOC (Field-oriented control) or 6-steps, it has gained popularity since we launched it in 2018 because it helps engineers bring their solutions to market faster. For instance, the algorithms from ST will maximize efficiency and facilitate the implementation of critical features like on-the-fly startup for air conditioning fans, a single shunt for cost-effective solutions, flux weakening for washing machines, and a rotor’s angular position detection for sensorless applications.
X-CUBE-MCSDK: Latest highlights
HSO
Over the years, X-CUBE-MCSDK has received new algorithms that have changed what is capable on BLDC motors and PMSM, such as HSO or high-sensitivity observer. In a nutshell, HSO is a field-oriented control algorithm that enables an application to figure out the rotor’s position and speed without needing a sensor. It’s particularly useful with PMSM sensorless motors running at low speeds in home appliances, for instance, because cost is such a critical factor. To attract new customers, manufacturers must lower their bill of materials, which means doing away with sensors and using more cost-effective MCUs, like an STM32G4. By using HSO, engineers can meet those constraints.
ZeST
ZeST (zero-speed full torque) is another algorithm meant to optimize the operations of sensorless motors by enabling them to recover from a complete stop. Combined with HSO, it can detect when a motor is no longer rotating and immediately resume operations. Accordingly, since most applications don’t need to know if a motor has ceased turning, most developers will only need to use HSO, which has been available in X-CUBE-SDK since version 6.2. However, engineers working on applications that could use ZeST can reach out to their local ST representative and seek to enable the STM32 ZeST and implement the feature in their application.
The idea behind HSO and ZeST isn’t new, and more seasoned engineers will be familiar with the phase-locked loop (PLL) observer, a technique (also found in X-CUBE-MCSDK) that determines the rotor position and speed without a sensor. However, combining HSO and ZeST helps alleviate some of PLL’s shortcomings, such as its inability to work under a minimum motor speed. Additionally, HSO and ZeST take advantage of the STM32G4 to run without maximizing CPU usage, despite how advanced these algorithms are. HSO and ZeST also have a shorter start-up time and do not generate high peak current, resulting in an energy saving between 15% and 40% in a typical washing machine application.
Regular updates
X-CUBE-MCSDK receives regular updates. Before version 6.3.1 in September 2024, we launched version 6.3 in May 2024, which brought support for new MCUs, like the STM32C0, our new entry-level device, and new STSPIN32 devices like the STSPIN32G4. It also added a new Board Designer tool and the ability to spec user boards using JSON to simplify developments. And while all versions of X-CUBE-MCSDK are mindful of legacy support, previous versions have also brought new features like BLCD six-step motors, monitoring, and profiling. Put simply, X-CUBE-MCSDK is a unique way to create motor control applications because it demystifies complex notions and makes modern algorithms and development paradigms more accessible.
X-CUBE-MCSDK and its robust firmware architecture
A significant advantage of the new SDK resides in the use of a different programming paradigm to ensure developers get a code that is a lot easier to customize and debug. Before X-CUBE-MCSDK, certain aspects of our libraries used object-oriented concepts inherited from C++. We rewrote them to something more approachable in C to simplify application development. For example, we no longer cast some expressions to void, a popular method in C++ to suppress compiler warnings, but that tends to complicate debugging operations drastically. Porting libraries to C also helped optimize applications as teams can more easily improve performance and efficiency.
X-CUBE-MCSDK was thus a major internal overhaul accompanied by massive updates to our SDK’s libraries. Indeed, previous versions used older code that was no longer standard on STM32 MCUs. STM32Cube is the de facto solution for all developments on our microcontrollers. It offers Hardware Abstraction Layers (HAL), increases portability between STM32 MCUs, and offers low-level APIs, drivers, and other Middleware components to make the ST ecosystem more accessible and efficient. X-CUBE-MCSDK brought the same standard libraries, so developers familiar with STM32Cube could have a much easier time with the code and reuse a significant chunk of their application from one project to the next.
X-CUBE-MCSDK and its flexible GUI
Aside from internal modifications that may not always be obvious, the new SDK works in conjunction with STM32CubeMX. Indeed, X-CUBE-MCSDK still uses MC-Workbench, a graphical tool where engineers can enter their motor and sensors’ parameters to generate custom code for their setup. When developers want to change the preselected configuration, such as the STM32 part number, the pinout configuration, the clock configuration, or add peripherals for new communication interfaces, they can more easily generate a new code for their application by using STM32CubeMX. They are also free to customize projects and add custom code (extra PID control loop, for instance) within tags created by STM32CubeMX.
The ST Community is fond of the STM32CubeMX configuration tool because it uses STM32Cube libraries and an intuitive interface to quickly generate header files, taking complex design operations out of developers’ hands. Using a step-by-step process, it’s easy to configure pinouts, clock trees, and peripherals, as well as resolve conflicts, among other things. If designers working on a motor control application decide to use another MCU in the middle of their prototyping phase, they will merely need to open STM32CubeMX, and will much more quickly port the work done on the previous MCU. X-CUBE-MCSDK thus brought a new level of flexibility.
ST teams are already working on the next updates. In the meantime, the best way to start working on a motor control solution is to check out our dedicated Wiki and ask questions on our Community forum. The Wiki will guide users by showing them how to run example applications on ST development boards to hasten prototyping. It’s also a quick way to see how we implemented our libraries and can thus serve as the basis for a project. For instance, the page on the six-step algorithm helps engineers with less experience understand what is happening while also providing a walkthrough of the GUI and compatible boards.