Getting started with Motor Control

Revision as of 12:58, 31 August 2020 by Registered User
Under construction.png Coming soon

1. Characterize your first motor by means of ST Motor Profiler

Clock.png 25min

Target description
This tutorial enables you to use ST Motor Profiler and after applying it you will be able to :

  • Connect the motor control pack to your computer.
  • Start the motor and monitor its speed.

Prerequisites

  • Computer with Windows 7 (or higher)
  • ST-Link utility installed

Hardware

Software

  • ST Motor Profiler

Literature

  • P-Nucleo-IHM03 user manual
  • UM2374 STM32 motor control SDK.user manual.

1.1. Install ST Motor Profiler

To install the Motor Profiler, the STM32 Motor Control Software Development Kit should be installed on your computer, using the following link It will get installed automatically with the MotorControl Workbench while following the installation steps.
profiler.png

1.2. Connect the package to the computer

In this tutorial we will be working the P-NUCLEO-IHM03 Motor Control package and to start our application we should contact our pack to the computer.
After setting up the boards and motor properly, let us launch the Motor Profiler application.

  • The first step to do is to select the boards we are using by clicking on Select Boards button

File:select.png boards.jpg

  • By referring to the user manual, the following parameters regarding the motor characteristics can be defined: Pole Pairs, Max Speed, Max Current, VBus.
  • After defining the values, the next step is to click on “Connect” button and check the motor working correctly.

Please make sure to upgrade the ST-Link version so to not have problems with launching the application.

1.3. Start the test

After finishing the connection between the boards and the computer, it is now the time to start the test.

  • Click on Start Profile button.

When clicking, the motor will start rotating in a high speed and the electrical as well as the mechanical models will get established as shown in the following photo.
connect.png

1.4. Monitor the speed

After checking that the motor is connected and working properly, the next step is to make it work while controlling its speed.

  • Click on Play button and the following window appears.
  • By moving the cursor, the speed can be monitored

Now you are able to:

  • Start your own motor application
  • Set and properly use the ST Motor Control pack

2. Start the motor using ST Motor Control Workbench

Clock.png 45min

Target description
This tutorial enables you to use ST Motor Control Workbench and after applying it you will be able to :

  • Connect the motor control pack to your computer.
  • Start the motor

Prerequisites

  • Computer with Windows 7 (or higher)
  • ST-Link utility installed

Hardware

Software

Literature

2.1. Install Motor Control Workbench

2.2. Start the first application

Since the pack used is the P-Nucleo-IHM03 it is mandatory to select the appropriate boards used.
First step to do so is to click on New Project and to select the NUCLEO-G431RB as control board & X-NUCLEO-IHM16M1 as power board and later click on ok as enumerated in the next photo:
selectboard.jpg
After finishing selecting the pack's boards, another window appears that allows the user to check the details and set the values of the different caracteristics.
It is recommended to check some of the different values and try to use the user manual of the power control as well as the control board in order to understand them.
Later, just click on the generate file button presented in the photo below, and save the project in the appropriate directory. motorgenera.png
Then a window that allows to choose the IDE to use, and the drive type appears. Just click on Generate and after the software finishes generating the .ioc file, do not change any parameter, just click on Run STM32CubeMX.
The .ioc file is open now and the next step is to simply generate the code in the STM32CubeIDE and do not forget to update the project information in the Project Manager section
Once STM32CubeIDE is open and the code is generated, the only step to do is to connect the pack and to debug the program.
The program has been installed on the command board and once clicking on the user button, the engine rotates correctly.
Now you are able to:

  • Start your first application using MotorControl Workbench
  • Generate the motor control code
  • Rotate the engine