Um3027 How To Use stm32 Motor Control SDK v60 Workbench Stmicroelectronics
Um3027 How To Use stm32 Motor Control SDK v60 Workbench Stmicroelectronics
User manual
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:
• ST MC FOC firmware library for permanent magnet synchronous motor (PMSM) field-oriented control (FOC)
• ST MC 6-step firmware library
• ST motor profiler
• ST motor pilot
• ST MC workbench software tool, a graphical user interface (GUI) for the configuration of MC SDK firmware
library parameters
This user manual explains how to use the ST MC workbench software tool included within the MC SDK firmware
version 6.0.
1 General information
The ST MC workbench software tool is part of the MC SDK that is used for the development of motor control
applications running on STM32 32-bit microcontrollers, based on the Arm® Cortex®‑M processor.
The ST MC workbench provides the user with an easy and friendly way to configure his MC application software
matching his hardware setup.
When completed, the user can directly generate his project which is compatible with the STM32CubeMX usage
for a further MC application extension.
The ST MC workbench runs on a PC system using Windows® and requires a USB Type-A connector.
Note: Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
2 Related documents
Reference Document
Application note How to migrate motor control application software from SDK v4.3 to SDK
[AN5143]
v5.x
Application note Guidelines for control and customization of power boards with STM32 MC
[AN5166]
SDK v5.0
Application note Position control of a three-phase permanent magnet motor using X-CUBE-
[AN5464]
MCSDK or X-CUBE-MCSDK-FUL
[DB3548] Data brief STM32 MC SDK software expansion for STM32Cube
[UM2374](1) User manual Getting started with STM32 motor control SDK v5.x
[UM2380](1) User manual Getting started with STM32 motor control SDK v5.x
[UM3026](1) User manual Getting started with STM32 motor control SDK v6.0
[UM3027](1) User manual Workbench tools for STM32 motor control SDK 6.0
[wiki] Refer to the motor control pages at the wiki.st.com/stm32mcu STMicroelectronics wiki site
1. UM3026 and UM3027 are respectively the evolutions of UM2374 and UM2380 for MC SDK 6.0.
3 ST motor-control workbench
Launch the ST motor-control workbench software tool by clicking either its icon (Figure 1) or running directly from
the installation folder.
The ST MC workbench GUI presents the following home area (start-up page) where there are the following
sections:
1. The user buttons area (Area 1 in Figure 2) to start either a new project or load a previous one, as well as
launch the ST Motor Profiler or Motor Pilot software tools.
2. The recent projects area (Area 2 in Figure 2) to load a user's recent project.
3. The example projects area (Area 3 in Figure 2) to load a project example.
Label area
In this area, the field name is shown with optionally a number notification bullet that shows specific notes on the
field. The bullet must be info (Blue), warning (Orange), or error (Red), and the specific messages pop up on the
bullet mouse over.
Editing area
In this area, the user can set its value. The field (Edit or combo) assumes different styles depending on its editing
state:
• Field with default value: No value specified by the user (Value in light grey). The default value can be
changed silently by the application itself.
• Field with default value in editing mode (Value in light grey): The user can edit its value. The user can
transform the default value into an explicit user value by clicking the upper-right small icon ( ).
Edit fields
• Field with explicit user value (Value in black): The explicit user value cannot be recalculated by the
application. The user can reset the field to its default value by pressing the upper-right small icon ( ).
• Field with error on value (Value in red): The user must review the field or reset the field to its default pressing
the upper-right small icon.
3.2.2 Motors
In the Motors step, the user selects the motor to use in the project. The user can select a Generic Motor or a
Profiled Motor. The Profiled Motors are identified by an icon (Refer to the example in Figure 5). This step
is not available in case the user selects as Hardware an ST MC kit (Refer to the example in Figure 9. ST MC
workbench – New project window – Kit). The list provides a set of motors delivered with the application as well as
the user motors.
3.2.5 Bridge
In the Bridge step, a list of available adapters is shown to be selected. The bridge selection allows the usage of
boards (power and control) that are not directly connectable because they have different connectors, such as ST
morpho or motor‑control connectors.
3.2.6 Kit
The Kit step allows the selection of available supported kits. A kit is composed of a control board, a power board,
and a motor.
3.2.7 Inverter
The Inverter step allows the selection of available inverters. The inverter is a complete board, meaning a single
board with both power and control parts.
A post‑selection procedure is executed to check if the configuration allows the creation of the project. If the user
selection is not valid a dialog pops up to inform the user that the choices do not allow the project creation and ask
to refine them (Figure 11).
Otherwise, the user selection is valid, a motorcontrol project is created, and the project view (Figure 12) is shown
with all the information that depends on the selected boards and motor.
3.4.1.1 Home
Clicking provides the user with an easy way to close the current project and come back to the home
view (Figure 2. ST MC workbench – GUI (Home view)). When not already saved, a confirmation window pops up
(Figure 14) asking the user to save the current project or not, as well as to cancel the action, then go back to the
hardware configuration window (Figure 13).
3.4.1.2 Save
• Save: Saves the user's current project. When not already saved, a file manager window pops up to save the
user's current project as a new one (Figure 16).
• Save as…: Saves the user project as a new file. A file manager window pops up to save the user project as
a new one (Figure 16).
Clicking generates the user application project files. If the project file is not already saved,
an information window pops up to indicate that this project needs to be saved before to generate. Use the Save &
Generate button to save and generate.
A window pops up (Figure 18) to allow the user to select the target toolchain, firmware package version, drive
type, and generate the motor‑control firmware application throw the selected STM32CubeMX.
3.4.1.5 About
Clicking the About menu opens a window showing some application information and useful links.
• Product Folder: Clicking it opens the product folder page for the MCU selected.
• Pin usage & Conflicts: To control the pin assignment of the MCU and receive feedback about the pin
conflicts (Figure 21).
Moving over Control Board a window pops up to give general information about the control board selected
and it shows:
• Data Brief folder: Clicking it opens the relative data brief.
• Product Folder: Clicking it opens the relative product folder page.
Moving over Power Board, a window pops up, gives general information about the selected power board,
and shows:
• Data Brief folder: Clicking it opens the relative data brief page.
• Product Folder: Clicking it opens the relative product folder page.
The user can change only the configurations that are available for the specific selected hardware. In the case
shown in Figure 25, the Start/Stop is available only on the PC13 pin. If the hardware selected allows more
possibilities a combo is available to allow the user to select the right pin to use. The Start/Stop feature can be
disabled if the user does not want to use it.
3.5.3 Motor
This step is relative to the motor parameters. The default values are loaded from the selected motor during the
creation of the project (Figure 5. ST MC workbench – New project window – Motors). The user can modify each
motor parameter (Figure 26) and activate and configure the Hall sensor or quadrature encoder for the used motor
(Figure 27).
Figure 30. ST MC workbench – PWM generation – High side and three enables
Figure 32. ST MC workbench – Current sensing – FOC 3-shunt internal amplification – Internal gain
Figure 33. ST MC workbench – Current sensing – FOC 3-shunt internal amplification – External gain
3.5.9 Speed‑sensing
In the Speed-Sensing step, the user can select the speed sensing to use. There are different speed sensing
modes that are available for both main and auxiliary sensors. The auxiliary sensor is optional and disabled by
default. The speed sensing modes depend on the selected algorithm (FOC or 6-step).
Revision history
Table 2. Document revision history
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Related documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 ST motor-control workbench. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.1 Editing field behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2 New project wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2.1 General Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2.2 Motors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.3 Power board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.4 Control board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.5 Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.6 Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.7 Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.8 Creating the project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Loading an existing project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 Project view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4.1 Toolbar area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4.2 Hardware information area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4.3 Project steps and hardware configuration details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Project wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.1 Product Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.5.2 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.5.3 Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.5.4 Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.5.5 PWM Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.5.6 Current Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.5.7 Bus voltage sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.5.8 Temperature sensing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.5.9 Speed‑sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.5.10 Drive settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
List of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
List of figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
List of tables
Table 1. Reference documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Table 2. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
List of figures
Figure 1. ST MC workbench – Icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Figure 2. ST MC workbench – GUI (Home view). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Figure 3. ST MC workbench – Editing field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Figure 4. ST MC workbench – New project window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 5. ST MC workbench – New project window – Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 6. ST MC workbench – New project window – Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 7. ST MC workbench – New project window – Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 8. ST MC workbench – New project window – Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 9. ST MC workbench – New project window – Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 10. ST MC workbench – New project window – Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 11. ST MC workbench – New project creation error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 12. ST MC workbench – Project view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 13. ST MC workbench – Project view (Global view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 14. ST MC workbench – Close project confirmation window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 15. ST MC workbench – Save menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 16. ST MC workbench – Project save as window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 17. ST MC workbench – Save and generate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 18. ST MC workbench – Project generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 19. ST MC workbench – About. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 20. ST MC workbench – MCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 21. ST MC workbench – Pin usage & Conflicts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 22. ST MC workbench – Control board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 23. ST MC workbench – Power board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 24. ST MC workbench – Project Info. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 25. ST MC workbench – User interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 26. ST MC workbench – Motor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 27. ST MC workbench – Motor – Hall effect – Quadrature encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 28. ST MC workbench – Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 29. ST MC workbench - PWM Generation - High and low side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 30. ST MC workbench – PWM generation – High side and three enables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 31. ST MC workbench – Current sensing – FOC 3-shunt external amplification . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 32. ST MC workbench – Current sensing – FOC 3-shunt internal amplification – Internal gain . . . . . . . . . . . . . . . 24
Figure 33. ST MC workbench – Current sensing – FOC 3-shunt internal amplification – External gain . . . . . . . . . . . . . . . 25
Figure 34. ST MC workbench – 6-step – Current mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 35. ST MC workbench – 6-step – Current mode disabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 36. ST MC workbench – Current sensing – Over-current protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 37. ST MC workbench – Bus voltage sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 38. ST MC workbench – Temperature sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 39. ST MC workbench – Speed‑sensing – Observer PLL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 40. ST MC workbench – Speed-sensing – Observer Cordic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 41. ST MC workbench – Speed‑sensing – Quadrature encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 42. ST MC workbench – Speed‑sensing – Hall sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 43. ST MC workbench – Speed‑sensing – Sensor-less start-up parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 44. ST MC workbench – 6-step sensor‑less ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 45. ST MC workbench – 6-step – Sensor‑less – Start-up parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 46. ST MC workbench – Drive settings – Speed control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 47. ST MC workbench – Drive Settings – Torque control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 48. ST MC workbench – Drive settings – Position control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37