STM32 MC Motor Profiler - Start-up guide

From X_CUBE_MCSDK version 6.1 the Motor Profiler tools is included inside the Motor Pilot tool.


1 Motor Profiler

Warning white.png Warning
In order to launch the profiler, the motor pilot must be started from your windows executable and not from the Workbench. We will remove this limitation in the next release.

The Motor Profiler software is now integrated to the Motor Pilot as a QML file. It allows the user to:

  • automatically detect the board,
  • do a profiling with the Hall sensors,
  • detect the number of Pole pairs with guided detection.

The homepage has a similar look to the previous tool. It is possible from the homepage to make a manual selection of boards, and to launch the automatic detection of boards.

Once the board is selected, it is also possible to launch Motor profiling, to launch the Hall profiling and to save the data of the profiled motor.

STM32 MC profiler home page.png

1.1 Start Motor Profiling

1.1.1 Select the board manually

To manually select a board, click the Select boards button as in the picture below.

STM32 MC select board button profiler.png

On the board selection page, search for boards by filtering by control board name (text field 1) or by power board name (text field 2).

STM32 MC select board screen.png

1.1.2 Connect board

After selecting the boards, the Connect button becomes active, and you can start the connection to the board.

STM32 MC selected board home screen.png

If a firmware profiler is present on the board and the board checks are error free, go to the Set profiling parameter chapter. Otherwise, you can install a compatible profiler firmware using the UI. Accept to use the profiler.

STM32 MC motor profiler image.png

The firmware present on the board is erased. The new profiler firmware is flashed on the board, and we restart the connection with the board.

STM32 MC flash firmware steps.png

If the connection is successful, go to Set profiler parameter chapter.

1.1.3 Detect boards

A new feature of this profiler allows the possibility to automatically detect control board and power board. To do so, the Motor profiler reads the information from the firmware and displays the detected boards. To start the automatic detection, click the Detect board button.

STM32 MC detect board button.png

The profiler tries to detect the boards. Several tests are done:

  1. Check if an ST-Link is connected to the computer.
  2. Check if the MCU uid detected by the ST-Link is supported by the Profiler.
  3. Check if the board name written on the ST-link is supported by the Profiler.
  4. Try to connect with uart to the board.
  5. If the uart connection was successful, check if Firmware is Profiler firmware.
  6. Check if the control board detected on the firmware is the same as the one detected with ST-Link. Also, check if it is known on the profiler database.
  7. Check if the power board detected on the firmware it is known on the profiler database.
STM32 MC check firmware profiler.png

When these checks are successful, the interface displays the board. Otherwise, the user is offered a choice close to what was detected.

STM32 MC check board failed.png

1.1.4 Profiling parameter

STM32 MC profiler parameter.png

After connecting the card, you can start profiling. For this purpose, it is necessary to fill in the field of the Pole pair (in red). For a more efficient profiling, you can fill in the fields in green if you have the necessary data. If you don't know the number of even Poles, go to the chapter About Pole pair detection.

1.1.5 Start profiling

Click Start Profile to profile the motor. First, the electrical parameters are identified, then the mechanical ones. When profiling is completed, all the motor measurements are shown on the bottom of screen.

STM32 MC profiling finished.png

If the profiling process takes too long, the information entered is incorrect: the max speed value is too high or too low.

STM32 MC too many time.png

1.1.6 Start hall profiling

The Hall profiling feature is a new feature that has been added to the profiler. It allows to use the hall sensors to have a better control of the motor. To run the hall profiler, click the Start Hall profiling button.

STM32 MC hall profiler start.png


When you click the Start Hall profiling button, a new interface appears on the lower part of the profiler. A warning message appears to signal the user to check the connection of the Hall sensors.

STM32 MC start hall profiler config.png

This window warns the user that the connectors of the hall sensors are incorrectly connected. It indicates which of these connectors are incorrectly connected, to easily change them if access to the connectors is available. Enter your changes and click Continue. Otherwise, the user can cancel the profiling.

STM32 MC incorrect pins hall profiler.png

You must also confirm that the motor is running in the correct direction to get consistent results.

STM32 MC confirm rotation hall profiler.png

Profiling is done on both directions of rotation and displayed on the screen: On the left, the results of the placement of the electric angle when the motor turns in the opposite direction of the desired direction. On the right, the electric angle when the motor turns in the right direction. On top of the screen, it is indicated the average value of the electric angle to enter on the workbench.

STM32 MC hall profiler results.png

1.2 Save results

STM32 MC save profiling results.png

Click the Save button (Top Figure) to store the motor measurements for a later usage with the ST Motor Control workbench software tool. Figure Top shows the saving window in that case. The user can then provide motor information: Naming profiled motor and Provide details about profiled motor.


1.3 Pole pair detection

Pole pair detection is a new feature that comes with this profiler and does not require a power generator to detect the pole pair number. To use this feature, click the Detect pole pairs button which will open a new window.

STM32 MC Pole pair start detection.png

To start detection, click Next.

STM32 MC set power pole pair detection.png

In this window, enter the value of the current to be injected to make the motor strong enough to be able to turn it manually afterwards. The value entered must be close to 15% of the maximum current that the motor can support. Otherwise, the motor may overheat.

STM32 MC mark pole pair detection.png

Please apply a mark on the fixed part of the motor and the rotating part, then you can turn the rotating part and count the number of Pole Pair. The firmware then prepares the motor by applying a current ramp of the value entered in the previous step.

STM32 MC load pole pair detection.png


You have 15 seconds to make a complete rotation of the rotating part of the motor and must count the number of notches. This number will be the number of Pole Pairs. Then, click Finish.

STM32 MC pole pair detection started.png

Finally, you can can enter the number of Pole Pairs found, then close the window and start the Motor profiling.

STM32 MC pole pair detection finished.png

1.4 Errors

1.4.1 Firmware errors

STM32 MC firmware errors.png
  • FOC Duration: This fault appears when the FOC execution rate is too high and the FOC algorithm computation does not fit in the PWM period.
  • Over Voltage: This fault appears when an overvoltage is applied to the power board.
  • Under Voltage: This fault appears when an undervoltage is applied to the power board.
  • Over heat: This fault appears when the power board is overheated.
  • Speed feed back: This fault appears when the estimated speed is not reliable during the rev-up phases.
  • Over current: This fault appears when an overvoltage is applied to the power board.
  • Software error: This fault appears when a software error occurs, these errors are independent of the motor operation.


1.4.2 Pole pair required

STM32 MC Pole pair required v2.png

This fault appears when the user forgot to write the Pole pairs value. In this case, the pole pairs text field is displayed in red.

1.4.3 Too many devices

STM32 MC to many devices.png

This fault appears when 2 devices with ST-Link are connected to the computer. Only one device must be connected at a time.

1.4.4 Old firmware

STM32 MC Old St-Link firmware v2.png

This error appears when an old ST-Link firmware is used, it is necessary to have a recent ST-Link firmware for the checks made by the profiler to be carried out correctly.

1.4.5 No ST-Link ready to use

STM32 MC no stlink v2.png

This error appears when the ST-Link are used by another software (CubeProgrammer, Iar). The checks made by the ST-Link can not be made. This prevents the profiler from working properly.

1.4.6 Error detected

STM32 MC error profiler.png

This error appears when one of the errors present in the Firmware chapter is present. You must acknowledge the faults to start the profile.