Um2380 stm32 Motor Control SDK v54 Tools Stmicroelectronics
Um2380 stm32 Motor Control SDK v54 Tools Stmicroelectronics
User manual
STM32 motor control SDK v5.4 tools
Introduction
The STM32 motor control software development kit (MC SDK) is part of the
STMicroelectronics motor-control ecosystem. It is referenced as X-CUBE-MCSDK or
X-CUBE-MCSDK-FUL according to the software license agreement applied. It includes the:
• ST MC FOC firmware library for permanent-magnet synchronous motor (PMSM) field-
oriented control (FOC)
• ST MC Workbench software tool, a graphical user interface for the configuration of the MC
FOC firmware library parameters, including the ST Motor Profiler tool (MP)
The STM32 motor control software development kit allows evaluation of the performance of
STM32 microcontrollers in applications driving single or dual three-phase permanent-
magnet synchronous motors within the STM32 ecosystem.
This user manual details the use of the software tools in STM32 motor control software
development kit.
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Reference documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 ST Motor Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1 Launching the ST Motor Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Hardware setup configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Hardware setup connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4 Motor profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Profiled motor saving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.6 Motor spinning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7 Closing the ST Motor Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
List of tables
List of figures
Figure 1. ST Motor Profiler - Icon and location in the start program list. . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 2. ST MC Workbench - GUI expanded top view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 3. ST Motor Profiler - Startup GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 4. ST Motor Profiler - Hardware setup list examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 5. ST Motor Profiler - SM-PMSM parameters example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 6. ST Motor Profiler - I-PMSM parameters example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 7. ST Motor Profiler - Configured GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 8. ST Motor Profiler - Download status window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 9. ST Motor Profiler - Connected GUI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 10. ST Motor Profiler - Profiled motor GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 11. ST Motor Profiler - Save window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 12. ST Motor Profiler - Spin control window (Start). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 13. ST Motor Profiler - Spin control window (Stop). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 14. ST Motor Profiler - Tool closure confirmation window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 15. ST MC Workbench - Icon and location in the start program list . . . . . . . . . . . . . . . . . . . . . 19
Figure 16. ST MC Workbench - GUI (Launch window) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 17. ST MC Workbench - New Project window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 18. ST MC Workbench - New Project Info window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 19. ST MC Workbench - Hardware configuration window (global view) . . . . . . . . . . . . . . . . . . 24
Figure 20. ST MC Workbench - File menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 21. ST MC Workbench - Project saving confirmation window . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 22. ST MC Workbench - Project Save As window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 23. ST MC Workbench - Project Properties window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 24. ST MC Workbench - Recent project list confirmation window . . . . . . . . . . . . . . . . . . . . . . 28
Figure 25. ST MC Workbench - Project deleting confirmation window . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 26. ST MC Workbench - Tools menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 27. ST MC Workbench - Pin Assignment window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 28. ST MC Workbench - Pin Assignment check window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 29. ST MC Workbench - Pin Assignment reset window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 30. ST MC Workbench - Information window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 31. ST MC Workbench - Script progress window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 32. ST MC Workbench - User information sheet example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 33. ST MC Workbench - Monitor window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 34. ST MC Workbench - User information sheet cleared . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 35. ST MC Workbench - User information log file example . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 36. ST MC Workbench - Help menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 37. ST MC Workbench - About window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 38. ST MC Workbench - Documentation menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 39. ST MC Workbench - Motor window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 40. ST MC Workbench - Motor parameter GUI (Surface Mounted PMSM) . . . . . . . . . . . . . . . 36
Figure 41. ST MC Workbench - Motor parameter GUI (Internal PMSM) . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 42. ST MC Workbench - Sensor parameter GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Figure 43. ST MC Workbench - Save motor parameter window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Figure 44. ST MC Workbench - Power Stage window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Figure 45. ST MC Workbench - AC Input Info GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 46. ST MC Workbench - Rated Bus Voltage Info GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 47. ST MC Workbench - Bus Voltage Sensing GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 48. ST MC Workbench - Temperature Sensing GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1 General information
The MC SDK is used for the development of motor-control applications running on STM32
32-bit microcontrollers based on Arm®(a) Cortex® processor(s).
The ST MC workbench software tool provides an easy way to configure motor control
application software matching hardware setup. The projects generated from this basis are
compatible with the use of STM32CubeMX for further extension or modification of the
application.
ST MC Workbench runs on a Windows® 7/10-based PC system equipped with a USB
Type- A connector for connecting to the application board.
Refer to the STM32 MC SDK release note for all information about possible use of the ST
MC Workbench software tool.
Note: ST MC Workbench provides contextual information tips when the cursor goes over
parameters in the GUI window.1
1.1 Definitions
Table 1 lists the acronyms that are relevant for a better understanding of this document.
a. Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
STMicroelectronics documents
The following documents are available from the www.st.com web page:
• STM32F0 Series product data sheets
• STM32F1 Series product data sheets
• STM32F3 Series product data sheets
• STM32F4 Series product data sheets
• STM32F7 Series product data sheets
• STM32L4 Series product data sheets
• STM32G0 Series product data sheets
• STM32G4 Series product data sheets
• X-NUCLEO-IHM expansion boards FOR motor control - Selection guide on-line
presentation
2 ST Motor Profiler
The ST Motor Profiler software tool is used to identify the motor’s main PMSM
characteristics, which are further transferred to the ST MC Workbench.
Figure 1. ST Motor Profiler - Icon and location in the start program list
Click on the STMicroelectronics hardware setup to select it and configure the ST Motor
Profiler tool.
As an example, Figure 4 shows the selection of the P-NUCLEO-IHM001 motor control
Nucleo Pack with NUCLEO-F302R8 and X-NUCLEO-IHM07M1.
After hardware setup selection, fill in the parameter fields with the motor information:
• The number of pole pairs (mandatory field)
• The Max Speed (optional field)
By default, the ST Motor Profiler tool searches for the maximum allowed speed
matching the motor and the hardware setup used.
• The Max Current allowed by the motor (optional field)
By default, it is the maximum peak current deliverable by the hardware setup.
• The nominal DC bus voltage used by the hardware setup (optional field)
By default, it is the power supply stage, either the bus voltage for low voltage
applications (DC voltage), or the RMS value for high voltage applications (AC voltage).
• The magnetic built-in type (mandatory field)
By default, the SM-PMSM is selected.
• The Ld / Lq ratio (mandatory field) only when I-PMSM built-in is selected (as shown in
Figure 6)
Figure 5 gives example values for the BR2804-1700KV-1 motor provided with the
P-NUCLEO-IHM001 hardware setup.
Once the connection is requested, a status widows is displayed, as shown in Figure 8. Its
content depends on the hardware setup history.
Once the connection is successful, the Start Profile button is proposed in the GUI (see
Figure 9).
Figure 13 shows the two additional steps to stop the motor properly through the spin control
window:
4. Click on the Stop button to stop activating motor control
5. Click on the Done button
If the motor parameters have not been saved yet and need to be, proceed as follows:
1. Select the No button in the confirmation window
2. Click on the Connect button, as shown in Figure 7
3. Save the motor parameters, as detailed in Section 2.5
Clicking on the Yes button closes the ST Motor Profiler software tool, unsaved motor
parameters being lost.
Launch the ST MC Workbench software tool either by clicking on its icon, or running it
directly from the installation folder tree, as shown in Figure 15.
Figure 15. ST MC Workbench - Icon and location in the start program list
The ST MC Workbench GUI features three different areas (numbered boxes in Figure 16):
1. User-buttons: used to start a new project, to load a previous one, or to launch the ST
Motor Profiler software tool
2. Recent Project: used to load a recent project
3. Example Projects: used to load a project example
The created project imports the hardware settings according to the selected boards and
motor profiling results. It also imports other settings like the PWM frequency and the startup
acceleration used during motor profiling.
After a few seconds, a New Project Info window is displayed where the motor operating
conditions can be checked, as shown in Figure 18.
Clicking on the OK button opens the same GUI (as if loading an existing project), as detailed
in Section 3.2.
The following sections provide detailed informations about the areas shown in Figure 19:
• Section 3.3: Icons and Menu area
• Section 3.4: Configuring a project
• Section 3.5: Main hardware settings
• Section 3.6: User information
Load an existing project Load and open an existing project, as shown in Figure 19
Clear the log Clear the user information sheet, as shown in Figure 34
Check the pin assignment of the MCU as well as the pins left available, as
Pins assignment
shown in Figure 27
Generate or Open the GUI to Generate or to Update the MC application project files for
Update the project the selected IDE, as shown in Figure 33
3.4.1 Motor
Figure 39 shows the Motor window used for motor configuration. The user has to click on
the motor or on the sensor to pop-up the GUI for parameter settings:
• the motor parameter GUI is shown in Figure 40
• the sensors GUI is shown in Figure 42
The PMSM motor parameters are imported from the ST Motor Profiler tool (refer to
Section 2) or entered manually, as shown in Figure 40.
The selection of the sensors used (all selection configuration are allowed) and the setting of
sensor parameters is illustrated in Figure 42.
Click on the Save parameters buttons (refer to Figure 40 and Figure 42) to reuse the
parameters in a following new project. The save motor parameter window asks for a name
and a short description of the set parameter, as shown Figure 43.
Figure 45 shows the AC Input Info GUI where the user applies the pre-defined AC voltage
range or customizes it according to the hardware setup. In addition, an input over-voltage
protection is set by default to the maximum AC voltage. To modify it, uncheck the box and
enter the desired threshold value.
Figure 46 shows the Rated Bus Voltage Info GUI where the user configures the DC bus
voltage input range (minimum and maximum rated values), as well as the nominal voltage.
The sensing implementation topology and related values can then be defined, as shown in
Figure 47. The inverse value of the DC bus voltage divider is automatically computed.
Figure 48 shows the Temperature Sensing GUI where the user configures the temperature
sensing range as a function of the hardware setup. In addition, an input over-temperature
protection is set by default to the maximum working temperature. To modify it, uncheck the
box and enter the desired threshold value. The hysteresis value can be updated as well by
the user.
Figure 49 shows the Current Sensing GUI where the user selects the current sensing
topology, and defines the conditioning method. Clicking on the Calculate button displays the
Current Sensing Gain Calculator GUI, which is useful for setting the amplifying network gain
value.
Figure 50 shows the Amplifying Network Gain Calculator GUI where the user configures the
sensing implementation topology and related values.
Figure 52 shows the Power drivers GUI where the user parameterizes each power driver
(one per motor phase) with its high- and low-side values.
Note: The user can easily force the same settings for all three power drivers by ticking the “Force
same values for U, V, W Driver” checkbox.
When the low-side driver is not hardware driven and complemented from the high side, the
HW inserted dead-time definition is useless. Otherwise, the dead-time must reflect the
implemented hardware electrical characteristics.
Select the Share signal enable checkbox to save the two other remaining Low side driver
enabling pins (refer to Control stage).
Figure 53 shows the Power Switches GUI where the user configures the six power switches
according to their electrical characteristics.
Figure 54 shows the Dissipative Brake GUI where the user selects the active signal polarity
used for the braking usage.
Figure 55 shows the Inrush Current Limiter GUI where the user selects the active signal
polarity used for the Inrush Current Limiter. This GUI offers the possibility to configure the
activation startup if needed.
Figure 56 shows the Power Factor Correction GUI where the user reflects hardware settings
and defines the PFC firmware parameters.
The following figures detail the Speed/Position Feedback Management GUI, where the user
selects and configures the sensor(-less) as the main one, and eventually the auxiliary as
another one, measuring the motor speed or position.
• Through the Sensor-less (Luenberger observer + PLL) selection (Figure 59), user
configures the sensor-less estimator. User may also customize the Luenberger
observer and the PLL PI filters.
• Through the Sensor-less (Luenberger observer + Cordic) selection (Figure 60), user
configures the sensor-less estimator. User may also customize the Luenberger
observer PI filter.
• Through the Quadrature encoder selection (Figure 61), user parametrizes the sensor
usage. User choses the counter direction.
• Through the Hall sensors selection (Figure 62), user parametrizes the sensor usage.
• Through the Auxiliary sensor tab, user selects and configures a second sensor(-less),
measuring the motor speed or position. To avoid mistakes, user can select only the
supported but remaining sensor(-less) when enabled (Figure 63).
Figure 64 shows the Drive Settings GUI, where the user configures the PWM generation,
the Speed or the Torque regulator, the Flux regulator and the default control settings.
The PWM frequency is used to drive the power switches, while the PWM idle state for High
and Low sides are usually Turn-Off (area 1).
The Speed or the Torque regulator (areas 2 and 4) configures the algorithm execution rate
(or Medium Frequency Task) linked with the Systick frequency usage. It is also the place
where user may customize the Speed or the Torque PI filters.
User selects the default control mode (Speed or Torque) and its parameters in area 3.
The flux regulator (area 4) configures the motor flux control execution rate (or High
Frequency Task) linked with the number of PWM periods. User may also customize this PI
filter.
Figure 65 shows the Sensing and Firmware Protection GUI where the user configures the
DC Bus voltage protection mechanism. From this interface the user can recall the other
protection mechanism GUI, Temperature and AC Input voltage.
The following figures show the Start-Up Parameters GUI, where the user customizes the
motor ramp-up phase during a start-up sequence. User chooses between normal Rev-Up or
On-the-Fly start-up, and between Basic or Advanced profiles.
• Through the Basic Rev-Up phase (Figure 66), user defines the motor speed ramp and
its current consumption during that timeframe. When enabled, he also defines the
transition duration between the open-loop and the close-loop.
• Through the Basic On-The-Fly phase (Figure 67), user defines the motor speed ramp
and its current consumption during that timeframe. Then, he also provides the speed
detection duration for the estimator convergence before testing the loop closure.
• Through the Advanced Rev-Up phase (Figure 68), user defines up to five ramps for the
motor speed and its current consumption during a provided duration. Then, user
choses the first ramp to start from. When enabled, he also defines the transition
duration between the open-loop and the close-loop.
• Through the Advanced On-The-Fly phase (Figure 69), user defines up to three ramps
for the motor speed and its current consumption during a provided duration. Then, user
also provides the speed detection duration for the estimator convergence before
testing the loop closure.
During this ramp-up phase, the loop is tested as a closed one when the estimated speed
range is within the provided variance (band tolerance). It is based from a minimum output
speed. User defines the number of consecutive passed tests to consider the loop as closed.
Figure 70 shows the Additional Features and PFC settings GUI, where the user selects the
additional features usable for its motor control.
Note that when the Flux Weakening feature is selected, user parametrizes the PI filter, as
well as the upper limit of the voltage to apply.
The Inrush Current Limiter button is popping-up the GUI shown in Figure 55.
Figure 71 shows the FreeRTOS GUI, where the user enables and configures, Timer and IT
usage supporting the OS, for its motor control application.
Figure 73 shows the MCU and Clock Frequency GUI, where the user selects the MCU
used, as well as its clocking information.
Figure 74 shows the Analog Input and Protection GUI, where the user selects the MCU pin
assignments and configures the analog input parameters.
Figure 74. ST MC Workbench – Analog Input and Protection GUI (Phase current feedback)
Through the Bus voltage feedback tab (Figure 75), user selects and configures the ADC for
the DC bus voltage acquisition as well as its input pin usage.
A click on the Bus Voltage Partitioning button pops-up the GUI shown in Figure 47.
Through the Temperature feedback tab (Figure 76), user selects and configures the ADC for
the temperature image acquisition (usually an NTC resistor) as well as its input pin usage.
Through the PFC stage feedback tab (Figure 77), user selects and configures the ADC for
the PFC current sensing and the AC voltage sensing, as well as their input pins usage.
Figure 78 shows the DAC functionality GUI, where the user selects the DAC channel used
for debug (if any) and the data to output.
Figure 79 shows the Digital I/O GUI, where the user configures the Timers used to
• control the power switches
• control the PFC driver
• configure the serial communication link for the UART
• interface the Encoder or the Hall sensors for the speed/position acquisition
• configure the Inrush Current Limiter.
Figure 80 shows the User Interface Add-on GUI, where the user configures the interface for
the control board usage: LCD (if supported), a Start/Stop push-button, and/or the serial
communication link with software application.
Double clicking on any of the parameters in the Motor column directly displays the full
configuration GUI (refer to Section 3.4).
Note: This sheet is not configurable.
Connect or disconnect
Displays the plotting window with the speed measured and the
Plot speed data
speed reference, as shown in Figure 84.
Figure 84 shows the plotting window with an example illustrating the measured speed vs.
the reference.
Figure 84. ST MC Workbench - Plotting window
When using the expert dashboard register view, the user has access to the additional icons
shown in Figure 88:
• The first additional icon is used to import a configuration from another ST MC
Workbench project through the import register configuration window shown in
Figure 89
• The second additional icon is used to set the registers value to default ones
These icons are available only when the periodic write and read of registers has been
suspended, or before the connection to the board.
The motor profiling algorithm is intended for rapid evaluation of the ST MC solution. It can
be used to drive any three-phase PMSM without any specific instrument or special skill.
Although the performed measurements are not as precise as with a proper instrumentation,
ST Motor Profiler measurements are optimized (green color in Figure 10) when:
• the stator resistance is greater than 1 Ω
• the stator inductance is greater than 1 mH
It is important to choose the appropriate HW according to the characteristics of the motor.
For instance, the maximum current should match the maximum current of the board as
closely as possible.
The ST Motor Profiler can be used only with compatible STMicroelectronics evaluation
boards.
Warning: Use the ST Motor Profiler tool to refer to the list of supported
systems.
5 Revision history
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order
acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or
the design of Purchasers’ products.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other
product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.