Difference between revisions of "STM32MotorControl:Frequently Asked Questions"

[quality revision] [quality revision]
m (Escoda Michael moved page STM32 MC Frequently Asked Questions to STM32MotorControl:Frequently Asked Questions without leaving a redirect)
m
 


This page contains some Frequently Asked Questions frequently asked questions (FAQ) related to Motor Control motor control with STM32 (STM32 MC).

Main sections

  1. STM32 MC Ecosystem ecosystem
  2. STM32 MC SDK Usageusage
  3. STM32 MC SDK Featuresfeatures

Acronyms and abbreviations

  • FOC = Field Oriented Control field oriented control (algorithm)
  • MC = Motor Controlmotor control
  • PMSM = Permanent Magnet Synchronous Motorpermanent magnet synchronous motor
  • SDK = Software Development Kitsoftware development kit

1 STM32 Motor Control Ecosystemmotor control ecosystem[edit]

1.1 What is the purpose Overview of the STM32 MC SDK?[edit]

The ST

Motor Control Ecosystem includes also the STM32 Motor Control Software Development Kit (download the "

motor control ecosystem includes the STM32 motor control software development kit (to install it, download it from the X-CUBE-MCSDK

" deliverable to install

web page). Its purpose is to speed up the evaluation and development of a FOC

algorithm (Field Oriented Control) and six steps for Permanent Magnet Synchronous Motor

or 6-step algorithm for permanent magnet synchronous motor (PMSM) applications.

The STM32 MC SDK is running

with the STM32 MCU families implementing

on STM32 MCUs that implement an advanced timer (refer to the appropriate release note for more information)

, and it

. It is composed of:

  • STM32 MC
Firmware
  • firmware (STM32 MC FW) library
    • Currently only the PMSM FOC control is available for all configurations
    • PMSM
Six Step and Asynchronous
    • 6-step and asynchronous motor FOC getting started
in the MCSDK as examples
    • examples, available within X-CUBE-MCSDK
  • STM32 MC
Workbench
  • workbench (STM32 MC WB)
    • PC
Graphical User Interface
    • graphical user interface (GUI) tools to configure the FOC firmware library parameters and to perform real-time monitoring (monitoring with the STM32 MC WB only, up to version 5.4.6)
  • STM32 MC
Motor Profiler
  • motor profiler (STM32 MC MP)
    • PC tools able to measure the
Motor Parameter
    • motor parameters automatically and to update the STM32 MC FW library, through the ST MC
Workbench usage
    • workbench


1.2 What are the changes Changes from previous version?[edit]

Please, refer

Refer to the STM32 MC SDK

Release Notes

release note provided with each released version.

1.3 What is Overview of the STM32 MC SDK Version version 5.Y?[edit]

The STM32 MC SDK is available in two versions of the

"

X-CUBE-MCSDK

"

deliverable:

  • STM32 MC SDK version 5.4.6,
correcting
  • that corrects few problems of the 5.4 series. It is fully compatible with previous versions.
  • STM32 MC SDK version 5.Y, that is a first step in our innovative roadmap. It includes:
    • A new communication protocol and its associated monitoring tools, the SM32 MC
Motor Pilot
    • motor pilot
    • New algorithms, such as discontinuous PWM, single shunt phase shift, and overmodulation
    • New
six
    • 6-step examples compatible with the new STM32 MC
Motor PilotNew
    • motor pilot
    • A new sensorless asynchronous motor example compatible with the new STM32 MC
Motor Pilot
    • motor pilot
    • New
STSpinG4
    • STSPING4 support.

The main

limitation

limitations of STM32 MC SDK version 5.Y are:

Project
  • The projects generated with STM32 MC SDK version 5.4 deliveries are not
be
  • compatible with version 5.Y.
  • STM32 MC SDK version 5.Y does not support STM32F1
series
  • Series.
  • STM32 MC SDK version 5.Y does not support dual-motor applications.

1.4 How do I choose Choosing between STM32 MC SDK 5.4.6 and 5.Y versions?[edit]

  • If you are already using STM32 MC SDK version 5.4 and need to keep the
compliancy
  • compliance, use
the
  • version 5.4.6.
  • If you want a well-established mature SDK version
with no surprise
  • , use
the
  • version 5.4.6.
  • If you use an STM32F1 MCU,
use the
  • choose version 5.4.6.
  • For dual-motor
application
  • applications, use
the
  • version 5.4.6.
But

However,:

  • If you need new debug capabilities and dumping features to mature your application, use
the
  • version 5.Y.
  • If you are interested by
any of
  • the
following features: discontinuous
  • PWM, single shunt phase shift, or overmodulation feature, use
the
  • version 5.Y.
  • If you want to use the new STSPING4, use
the
  • version 5.Y.
  • For asynchronous motor
application
  • applications, use
the
  • version 5.Y.

1.5 What is the STM32 MC Motor Profiler tool?motor profiler[edit]

This

is a

tool

that

automatically

measure

measures the electrical parameters of PMSM motors. The

specification

characteristics of an electric motor may not be known and

is

can be determined in less than a minute.

The algorithm determines the motor parameters

needed

required to configure the STM32 MC FW

library 

library: stator resistance

Rs;

Rs, stator inductance

Ls;

Ls, back EMF constant

;

, motor

ionertia

inertia, and friction.

Refer to the STM32

MC SDK tools document

motor control SDK user manual for more details (UM2380).

1.6 What is the STM32 MC Motor Pilot tool?motor pilot[edit]

The STM32 MC

Motor Pilot

motor pilot is a new control and monitoring PC tool, available in version 5.Y

, which replaced the monitor

. It replaces the monitoring tool currently delivered with the STM32 MC

Motor Workbench

motor workbench.

It is built on a brand-new communication protocol that allows

for

faster and more reliable

communication

communications while consuming less MIPS from the MCU.

With this protocol, internal motor control signals are monitored in real-time with no or controlled subsampling.

2 Using the STM32 MC SDK Usage[edit]

2.1 How to create a motor control project?[edit]

First read the STM32 MC SDK

- Getting Started

getting started manual (UM2374). Then, start either from

either

a motor control example project, or

from

design a new project

design

.

Tips :

Don’t
Info white.png Information
  • Do not forget to create and save your project into
the
  • your dedicated working directory.

2.2 How to handle a project made with a previous version of the STM32 MC Workbench?workbench[edit]

The STM32 MC

Workbench

workbench automatically migrates

automatically

an older *.stmcx file to the current version.

Note that before

Before the migration, an information window pops

-

up requesting confirmation. Click yes if you agree with this conversion (

note that

after migration, the previous configuration is lost

after migration

).

Regarding

to

the user application software itself, refer to "How to migrate motor control application software from STM32 MC SDK v4.3 to v5.x" (AN5143).

Tips:
Info white.png Information
  • Get a copy of all your original files.
Don’t
  • Do not forget to create and save your project into your dedicated working directory.
Warning white.png Warning
:
Projects generated with STM32 MC SDK version 5.4.x cannot be reused with the new
version
5.Y version.

2.3 How to get a project framework for a particular IDE (such as IARTM, KEIL or Keil®, …)?[edit]

User may start from 

Two solutions are possible:

Either
  • Start from a motor control application software example
as
  • provided in the “./Projects” directory for all supported
IDE :
  • IDEs, IARTM,
KEIL
  • Keil® or GCC based (
Read its
  • read the attached ReadMe.txt file)
;
  • .
Either
  • Use a
pre-configured
  • preconfigured motor control application example project
,
  • or a newly created one, via the STM32 MC
Workbench usage
  • workbench. Then, select the
user selects the wanted
  • required IDE
,
  • as well as the STM32CubeMX version,
before to generate his/her
  • and generate the motor control application software example.

Tips :

Don’t
Info white.png Information
  • Do not forget to create and save your project into
your
  • a dedicated working directory.

2.4 Why does not the STM32 Motor Profiler motor profiler tool doesn’t recognize my motor?[edit]

If the STM32

Motor Profiler

motor profiler tool does not recognize your motor, proceed as follows:

  • Apply a nominal voltage.
  • Select the power stage with the proper current range.
  • Fill the nominal motor speed parameter or play with this value.
  • Decrease the nominal current parameter.
  • Decrease the applied bus voltage.
Warning white.png Warning
:
The STM32 MC
Motor Profiler
motor profiler has the following limitation
. It
: it cannot
recognize
profile motors with
Rs >
Rs < 1 Ω
, Ls >
or Ls < 1 mH.

If you still face problems, profile your motor manually using the following procedure: How To manually configure the motor parameters.

2.5 Why does not my motor not start immediately?[edit]

Although your motor is running fine, it

doesn’t

does not start immediately

for

. The reason can be one of the following

reason

:

  1. During initialization, a motor alignment is
needed
  1. required to start from a known position. In other words, it means that the initialization phase sets a static stator vector and waits until the rotor vector aligns with this position.
  2. When the
“On
  1. “on-the-
Fly
  1. fly startup” feature is enabled
. Before any motor drive
  1. , this feature starts a detection phase before driving any motor:
    • When the rotation is detected, it skips the
start-up
    • startup phase and runs directly in the close-loop mode.
    • When
the
    • no rotation is
not
    • detected, it
runs the start-up phase : alignment,
    • launches the startup phase, such as alignment or ramp-up
, …
    • .

2.6 How to choose the basic set of ramp-up parameters for a given motor?[edit]

Most of the time,

we have noticed that

setting the ramp-up parameters as

follow,

follows ensures a correct start of the motor

starts the first time 

:

  • Check the box “Include alignment before ramp-up”
;
  • .
  • Set the motor alignment “Duration” to 2000 ms
;
  • .
  • Set the motor alignment “Final current ramp value”
from
  • to ½ of the nominal motor current (in A)
;
  • .
  • Set the “Speed ramp duration” to 3000 ms
;
  • .
  • Set the “Speed ramp final value” to 30% of the maximal motor speed (in RPM);
  • Set the “Current ramp final value”
from
  • to ½ of the nominal motor current (in A)
;
  • .
  • Set the “Minimum start-up output speed” to 15% of the maximal motor speed (in RPM).

After a first successful

run

start, fine-tune these parameters.

DriveManagement StartUp-Parameters1.png

2.7 How to choose the PWM frequency and the FOC execution rate?[edit]

The choice of the PWM frequency and the FOC execution rate is a compromise between available speed and switching losses

. In case of a high speed motor or a low inductance motor, you have to

:

  • For high-speed or low-inductance motors, use a high PWM frequency (
e.g.
  • for example, 30 kHz).
In other cases
  • Whatever the motor, a lower PWM frequency (
e.g.
  • for example, 16 kHz) is
enough for most cases
  • sufficient.
In all cases
  • Whatever the motor, check the maximum PWM frequency capability for the selected MCU.
In case of a
  • For low-inductance
motor
  • motors,
it is possible to increase
  • the FOC execution rate can be increased while keeping a high PWM frequency to save CPU load, or
to
  • migrate to a lower performance MCU (
e.g.
  • for example PWM = 30 kHz and
a
  • FOC execution rate = 2
means
  • mean that the FOC algorithm runs
@
  • at 15 kHz).

2.8 Why do I have an “FOC duration” fault message and the motor don’t does not even try to start?[edit]

This fault message appears when the FOC execution rate is too high and the FOC algorithm computation does not fit in the PWM period.

Open the "Drive Settings" window and decrease the ratio between the PWM period execution rate in the "Torque and flux regulators" section as shown below (for example increase this execution rate by one

for example

).

DriveManagement DriveSettings1.png

2.9 Why do I have an “Over current” fault message and the motor does not even try to start?[edit]

This fault message appears

from

in the following

situation 

situations:

  1. A wrong current sensing topology is selected.
Check
  1. In this case, check and select the right current sensing configuration.
  2. A
Wrong
  1. wrong current sensing parameter is set.
Check
  1. To solve this issue, check and correct the current sensing parameters.
    PowerStage CurrentSensing.png
  2. The current regulation loop bandwidth is too high for the
HW
  1. hardware setup.
Open
  1. In this case, open the "Drive Settings" window and decrease the current regulation loop cut-off frequency (for example down to 2000 rad/s for a 3-shunt topology and 1000 rad/s for a 1-shunt topology). Typical maximum current regulation loop bandwidth values are 9000 rad/s for a 3-shunt topology and 4500 rad/s for a 1-shunt topology.
DriveManagement DriveSettings2.png

2.10 Why do I have a “Speed feedback” fault message during the acceleration phase and why does the motor stopsstop?[edit]

Often, this

This fault message often appears following an abrupt torque variation demand at the end of the

start-up

startup phase. As a result, the "Back-EMF estimator" is spoilt.

1.
  1. The observer gain G2 is too high
and this
  1. . This makes the speed reconstruction
a bit
  1. too noisy to be used by the speed PI gains
(
  1. , thus causing an estimator reliability
trouble)
  1. issue.
Possible solutions are 
  1. The possible solutions are the following:
Decreasing
    • Decrease the observer gain G2 by successive steps : /2, /4, /6, /8.
      DriveManagement SpeedPositionFeedbackManagement1.png
    • Run the motor in torque mode until the
trouble
    • issue disappears. The
draw back
    • drawback is that the speed regulator gains are not optimal. Trim the gain values (refer to the dedicated FAQ).
2.
  1. The
start-up
  1. startup phase ends too early.
Possible solutions are 
  1. The possible solutions are the following:
Increasing
    • Increase the “Consecutive successful start-up output tests” parameter (it must not be set to
more
    • a value higher than 4-5);
Setting
    • Set the “Minimum
start-up
    • startup output speed” parameter to 15% of your maximum application speed, then
decreasing
    • decrease it
for fine tuning
    • progressively.
DriveManagement StartUp-Parameters2.png
Tips :
Info white.png Information
  • Smooth the speed variation between the “Minimum
start-up
  • startup output speed” and the “Speed ramp final value” by adjusting the “Speed ramp duration”.

2.11 Why do I have a “Start-up “Startup failure” error message during the rev-up phase and why does the motor stop?[edit]

Typically, this

This fault message typically appears because

there is insufficient

the current provided to support the required speed acceleration is not sufficient.

1.

To solve this issue, proceed as follows:

  1. Decrease the speed acceleration
rate 
  1. rate:
    • Increase the “Speed ramp duration” parameter
;
    • .
    • Set the “Speed ramp final value” parameter to 30% of your maximum application speed.
2.
  1. Increase the
start-up current 
  1. startup current:
    • Increase the “Current ramp initial value” parameter
;
    • .
    • Increase the “Current ramp final value” parameter up to the “Nominal Current” parameter of the motor
;
    • .
    • Check the “Include alignment before ramp-up” box to make the
start-up
    • startup phase more deterministic, and follow the FAQ on "Basic parameters settings for the ramp-up".
DriveManagement StartUp-Parameters3.png

2.12 Why do I have a “Start-up “Startup failure” error message during the acceleration following the rev-up phase and the motor stop?[edit]

Often, this

This fault message often appears following an abrupt

Torque

torque variations demand at the end of the

start-up

startup phase. This spoils the Back-EMF estimator.

1.
  1. The observer gain G2 is too high
and this results in a noisy
  1. . This makes the speed reconstruction
for the PI speed gains used (causing estimator reliability trouble). Possible solutions are 
  1. too noisy to be used by the speed PI gain, thus causing an estimator reliability issue. The possible solutions are the following:
    • Decrease the observer gain G2 by successive steps : /2, /4, /6, /8.
      DriveManagement SpeedPositionFeedbackManagement1.png
    • Increase the “Variance threshold” parameter to release the check
mechanism 
    • mechanism:
Up
    • up to 80% for Observer+PLL,
Up
    • up to 400% for Observer+CORDIC.
      DriveManagement SpeedPositionFeedbackManagement2.png
2.
  1. The reliability capture window of the estimator is too small. The possible
solution is 
  1. solutions are the following:
    • Increase the “Speed ramp final value” parameter up to 40% of the maximum application speed
;
    • .
    • Decrease the “Minimum
start-up
    • startup output speed” parameter down to 10% of the maximum application speed.
DriveManagement StartUp-Parameters4.png

2.13 How to interface the STM32 MC Firmware firmware library?[edit]

Several motor control APIs are implemented to offer basic

interaction

interactions with the firmware library.

Please, refer

Refer to the

on-line

online firmware reference information

, which contains all these details and more 

that contains the below information and more:

  • From the STM32 MC
Workbench
  • workbench menu
(Documentation ->
  • : select Documentation and select Firmware Reference
);
  • .
  • From the Windows
Start-up menu (
  • Startup menu: select an ST Motor Control SDK
xxx -> Reference Manual xxx)
  • and open the corresponding reference manual.

2.14 How to choose the hardware Power power board?[edit]

While it is not true for the nominal bus voltage,

usually,

the maximum current (torque) used by your application is usually different from the maximum current of the motor.

As a consequence, the motor spin must be adapted to the selected

Power

power board range.

Of course, the

The best case is of course when the maximum current of the motor is part of the current range offered by the selected

Power

power board.

2.15 How to debug a motor control application?[edit]

A motor control application cannot use the standard debug mechanism which

are HW or SW

consists in hardware or software breakpoints for holding the program.

The reason is that during the break,

your

the application loses the real rotor position with respect to the needed magnetic field computation phasing defined by the firmware execution.

So, the DAC (or an emulated DAC, thanks to a PWM output) and/or the USART communication are used as outlined below:

  • The DAC generates a voltage
reflecting
  • that reflects the internal signals (for example currents, B-EMF voltage, or reconstructed angle). Then, it provides the capability to scope this waveform during the motor spin.
Best
  • The best solution is to dedicate two
pins of a
  • DAC output pins.
  • The USART provides data, but at a lower rate than the DAC. It requires the two Tx/Rx pins and the STM32 MC
Workbench
  • workbench tool to monitor the data.
STMCWB Monitoring1.png

2.16 How to make the current more sinusoidal when the motor spins?[edit]

One possible cause is that the PI gains of the speed regulator are incorrect.

Decrease the

Kp

KP gain and

act on

adjust the

Ki

KI gain (evaluating the speed regulation) to check over/

under-shooting

undershooting during transients.

2.17 How to tune the PI speed regulator?[edit]

Among the possible ways, an example is described

as follows

below:

  1. Run the motor and connect it to the STM32 MC
Workbench,
  1. workbench.
  2. Open the
Monitor
  1. monitor mode and switch on the plotter window
on,
  1. .
  2. In the “Final ramp speed” box, enter the new reference speed (for example change the speed from 2,000 RPM to 4,000 RPM).
  3. In the plotter windows, check the measured speed reaction. It may either exhibit a fast reaction
but present oscillation
  1. with oscillations around the final value, or have a slow reaction
, refer
  1. . Refer to the following solutions:
    • If the regulated variable oscillates around a value,
then
    • decrease KI or increase KP.
    • If the trend of regulated variable is too slow or not stabilize, then increase KI.
STMCWB Plotting1.png

2.18 How to connect ICS with the MC FW library?[edit]

Our

The implemented ICS requires

usage on 2

using two phases from a

3

three-phase power supply.

The STM32 MC FW library operates only on

Phase

phase U and

Phase V, this is where the user must connect each ICS

phase V. Connect each ICS to these phases.

2.19 Why use the using FOC as opposed to a 6-Steps step control for PMSM drive?[edit]

The

FOC brings the following

benefits 

benefits:

  • Better energy efficiency
;
Improver
  • Improved responsiveness of speed control
;
Precise
  • Accurate positioning control
;
  • Lower acoustic noise
.

2.20 Why use the using 3-Shunts shunt as opposed to a 1-Shunt shunt resistor implementation for current measurement?[edit]

Using the 1-

Shunt

shunt implementation for measurement is the cheapest solution.

However, some

motor (for example a low inductance motor

motors (such as low-inductance motors) require current measurements on two phases simultaneously. Only the 3-

Shunts

shunt implementation

manage

manages this configuration.

3 STM32 MC SDK features[edit]

3.1 Does the STM32 MC SDK support power factor corrector?[edit]

Yes, it does.

Power factor correction examples are accessible from the STM32 MC Workbench first page, in the example list.

3.2 Does the STM32 MC SDK support dual drive motors?[edit]

Yes, the STM32 MC SDK supports dual-drive motors using only one MCU.

Warning white.png Warning
:
This functionality has been temporarily removed in the STM32 MC SDK version 5.Y

3.3 Does the STM32 MC SDK provide project examples using FOC or 6-Steps control for PMSM drive?[edit]

Yes, the STM32 MC SDK provides project examples to demonstrate FOC and 6-Steps control implementations.

They are accessible from STM32 MC Workbench first page.

3.4 What are the new features of STM32 MC SDK version 5.Y?[edit]

The STM32 MC SDK version 5.Y

,

is a first step in our innovative roadmap. It includes:

  • A new communication protocol and its associated monitoring tools, the STM32 MC
Motor Pilot
  • motor pilot
  • New algorithms
like
  • such as discontinuous PWM,
Single
  • single shunt phase shift
, Overmodulation
  • and overmodulation
  • New 6-step examples compatible with the new STM32 MC
Motor Pilot
  • motor pilot
  • New sensorless asynchronous motor example compatible with the new STM32 MC
Motor Pilot
  • motor pilot
  • New
STSpinG4
  • STSPING4 support
  • MISRA support for STM32G4
series
  • Series


{{DISPLAYTITLE:Frequently Asked Questionsasked questions (FAQ)}}
__NOTOC__

This page contains some Frequently Asked Questionsfrequently asked questions (FAQ) related to Motor Controlmotor control with STM32 (STM32 MC).

'''Main sections'''
# [[#STM32_Motor_Control_Ecosystemmotor_control_ecosystem|STM32 MC '''Ecosystemecosystem''']]
# [[#STM32_MC_SDK_Usage#Using the STM32 MC SDK|STM32 MC '''SDK Usageusage''']]
# [[#STM32_ MC_ SDK_Features features|STM32 MC '''SDK Featuresfeatures''']]

'''Acronyms and abbreviations'''
* FOC = Field Oriented Controlfield oriented control (algorithm)
* MC = Motor Controlmotor control

* PMSM = Permanent Magnet Synchronous Motor
* SDK = Software Development Kit

== STM32 Motor Control Ecosystem ==
=== What is the purpose permanent magnet synchronous motor
* SDK = software development kit

== STM32 motor control ecosystem ==
=== Overview of the STM32 MC SDK? ===
<div class="mw-collapsible  mw-collapsed">

The ST Motor Control Ecosystem includes also the STM32 Motor Control Software Development Kit (download the "X-CUBE-MCSDK" deliverable to install ===
The ST motor control ecosystem includes the STM32 motor control software development kit (to install it, download it from the X-CUBE-MCSDK web page). Its purpose is to speed up the evaluation and development of a FOC algorithm (Field Oriented Control) and six steps for Permanent Magnet Synchronous Motoror 6-step algorithm for permanent magnet synchronous motor (PMSM) applications.

The STM32 MC SDK is running with the on STM32 MCU families implementingMCUs that implement an advanced timer (refer to the appropriate release note for more information), and it . It is composed of:
* STM32 MC Firmwarefirmware (STM32 MC FW) library
** Currently only the PMSM FOC control is available for all configurations
** PMSM Six Step 6-step and Asynchronousasynchronous motor FOC getting started in the MCSDK as examples
* STM32 MC Workbenchexamples, available within X-CUBE-MCSDK
* STM32 MC workbench (STM32 MC WB)
** PC Graphical User Interfacegraphical user interface (GUI) tools to configure the FOC firmware library parameters and to perform real -time monitoring (monitoring with the STM32 MC WB only, up to version 5.4.6)
* STM32 MC Motor Profilermotor profiler (STM32 MC MP)
** PC tools able to measure the Motor Parametermotor parameters automatically and to update the STM32 MC FW library, through the ST MC Workbench usage</div>


=== What are the changes from previous version? ===
<div class="mw-collapsible  mw-collapsed">

Please, refer workbench<br>


=== Changes from previous version ===
Refer to the STM32 MC SDK Release Notesrelease note provided with each released version.</div>


=== What is

=== Overview of the STM32 MC SDK Versionversion 5.Y? ===<div class="mw-collapsible  mw-collapsed"> ===
The STM32 MC SDK is available in two versions of the "'''X-CUBE-MCSDK"''' deliverable:
* STM32 MC SDK version 5.4.6, correcting that corrects few problems of the 5.4 series. It is fully compatible with previous versions.
* STM32 MC SDK version 5.Y, that is a first step in our innovative roadmap. It includes:
**  A new communication protocol and its associated monitoring tools, the SM32 MC Motor Pilotmotor pilot 

** New algorithms, such as discontinuous PWM, single shunt phase shift, and overmodulation
** New six 6-step examples compatible with the new STM32 MC Motor Pilot
** New motor pilot
** A new sensorless asynchronous motor example compatible with the new STM32 MC Motor Pilotmotor pilot 

** New STSpinG4STSPING4 support.

The main limitationlimitations of STM32 MC SDK version 5.Y are:
* Project The projects generated with STM32 MC SDK version 5.4 deliveries are not be compatible with version 5.Y.

* STM32 MC SDK version 5.Y does not support STM32F1 seriesSeries.

* STM32 MC SDK version 5.Y does not support dual motor.</div>


=== How do I choose -motor applications.

=== Choosing between STM32 MC SDK 5.4.6 and 5.Y versions? ===<div class="mw-collapsible  mw-collapsed">
 ===* If you are already using  STM32 MC SDK version 5.4 and need to keep the compliancycompliance, use the version 5.4.6.

* If you want a well -established mature SDK version with no surprise, use the , use version 5.4.6.

* If you use an STM32F1, use the  MCU, choose version 5.4.6.

* For dual -motor applicationapplications, use the version 5.4.6

But.
However,:
* If you need new debug capabilities and dumping features to mature your application, use the version 5.Y.

* If you are interested by any of the following features: discontinuous PWM, single shunt phase shift, or overmodulation feature, use the version 5.Y.

* If you want to use the new STSPING4, use the version 5.Y.

* For asynchronous motor application applications, use the version 5.Y
</div>


=== What is the STM32 MC Motor Profiler tool? ===
<div class="mw-collapsible  mw-collapsed">

This is a tool that automatically measure.

=== STM32 MC motor profiler ===
This tool automatically measures the electrical parameters of PMSM motors. The specificationcharacteristics of an electric motor may not be known and is can be determined in less than a minute.

The algorithm determines the motor parameters neededrequired to configure the STM32 MC FW library : stator resistance Rs;R<sub>s</sub>, stator inductance Ls;L<sub>s</sub>, back EMF constant;, motor ionertiainertia, and friction.

Refer to the STM32 MC motor control SDK tools documentuser manual for more details ([https://www.st.com/resource/en/user_manual/dm00486148-stm32-motor-control-sdk-v54-tools-stmicroelectronics.pdf UM2380]).
</div>


=== What is the STM32 MC Motor Pilot tool? ===
<div class="mw-collapsible  mw-collapsed">

The STM32 MC Motor Pilot=== STM32 MC motor pilot ===
The STM32 MC motor pilot is a new control and monitoring PC tool , available in version 5.Y, which replaced. It replaces the monitor monitoring tool currently delivered with the STM32 MC Motor Workbenchmotor workbench.

It is built on a brand -new communication protocol that allows for faster and more reliable communicationcommunications while consuming less MIPS from the MCU.

With this protocol, internal motor control signals are monitored in real -time with no or controlled subsampling.</div>


== 

== Using the STM32 MC SDK Usage ==

=== How to create a motor control project? ===
<div class="mw-collapsible  mw-collapsed">
 ===First read the STM32 MC SDK - Getting Started getting started manual ([https://www.st.com/resource/en/user_manual/dm00484271-getting-started-with-stm32-motor-control-sdk-v50-stmicroelectronics.pdf UM2374]). Then, start either from either a motor control example project, or fromdesign a new project design.

''Tips :
* Don’t .

{{Info | 
* Do not forget to create and save your project into theyour dedicated working directory.''</div>

}}
=== How to handle a project made with a previous version of the STM32 MC Workbench? ===
<div class="mw-collapsible  mw-collapsed">
workbench ===
The STM32 MC Workbench workbench automatically migrates automaticallyan older *.stmcx file to the current version. Note that before Before the migration, an information window pops- up requesting confirmation. Click yes if you agree with this conversion (note thatafter migration, the previous configuration is lost after migration).

Regarding to the user application software itself, refer to "How to migrate motor control application software from STM32 MC SDK v4.3 to v5.x" ([https://www.st.com/resource/en/application_note/dm00477952-how-to-migrate-motor-control-application-software-from-sdk-v43-to-sdk-v5x-stmicroelectronics.pdf AN5143]).
''Tips:{{Info | * Get a copy of all your original files.
* Don’t Do not forget to create and save your project into your dedicated working directory.''

''Warning:
*}}

{{Warning | Projects generated with  STM32 MC SDK version 5.4.x cannot be reused with the new version 5.Y''</div> version.}}


=== How to get a project framework for a particular IDE (such as IAR<sup>TM</sup>, KEIL or Keil<sup>®</sup>, …)? ===
<div class="mw-collapsible  mw-collapsed">

User may start from :

Either) ===

Two solutions are possible:

* Start from a motor control application software example as provided in the “./Projects” directory for all supported IDE : IDEs, IAR<sup>TM</sup>, KEILKeil<sup>®</sup> or GCC based (Read itsread the attached ReadMe.txt file);

Either.
* Use a pre-configuredpreconfigured motor control application example project, or a newly created one, via the STM32 MC Workbench usageworkbench. Then, the user selects the wanted IDE,select the required IDE as well as the STM32CubeMX version, before to and generate his/herthe motor control application software example.
''Tips :
* Don’t {{Info | 
* Do not forget to create and save your project into youra dedicated working directory.''</div>


=== Why the STM32 Motor Profiler tool doesn’t recognize my motor? ===
<div class="mw-collapsible  mw-collapsed">

If the STM32 Motor Profiler}}

=== Why does not the STM32 motor profiler tool recognize my motor? ===

If the STM32 motor profiler tool does not recognize your motor, proceed  as follows:
* Apply a nominal voltage.

* Select the power stage with the proper current range.

* Fill the nominal motor speed parameter or play with this value.

* Decrease the nominal current parameter.

* Decrease the applied bus voltage.
''{{Warning:
*  |  The STM32 MC Motor Profilermotor profiler has the following limitation. It: it cannot recognizeprofile motors with Rs > 1 Ω, Ls > 1 mH''R<sub>s</sub> < 1 Ω or L<sub>s</sub> < 1 mH.}}


If you still face problems, profile your motor manually using the following procedure: [[STM32MotorControl:How_To_manually_configure_the_motor_parameters|How To manually configure the motor parameters]].
</div>
=== Why does not my motor not start immediately? ===
<div class="mw-collapsible  mw-collapsed">
Although your motor is running fine, it doesn’t does not start immediately for . The reason can be one of the following reason:
# During initialization, a motor alignment is neededrequired to start from a known position. In other words, it means that the initialization phase sets a static stator vector and waits until the rotor vector aligns with this position.
# When the “On“on-the-Flyfly startup” feature is enabled. Before any motor drive, this feature starts a detection phase: before driving any motor:
#* When the rotation is detected, it skips the start-upstartup phase and runs directly in the close-loop mode.#* When theno rotation is not detected, it runslaunches the start-upstartup phase : alignment, ramp-up, …</div>

, such as alignment or ramp-up.
=== How to choose the basic set of ramp-up parameters for a given motor? ===
<div class="mw-collapsible  mw-collapsed">
 ===
Most of the time, we have noticed that setting the ramp-up parameters as follow, the motor starts the first time follows ensures a correct start of the motor:
* Check the box “Include alignment before ramp-up”;.

* Set the motor alignment “Duration” to 2000 ms;.

* Set the motor alignment “Final current ramp value” fromto ½ of the nominal motor current (in A);.

* Set the “Speed ramp duration” to 3000 ms;.

* Set the “Speed ramp final value” to 30% of the maximal motor speed (in RPM);
* Set the “Current ramp final value” fromto ½ of the nominal motor current (in A);.

* Set the “Minimum start-up output speed” to 15% of the maximal motor speed (in RPM).

After a first successful runstart, fine -tune these parameters.

[[File:DriveManagement_StartUp-Parameters1.png|center]]</div>


=== How to choose the PWM frequency and the FOC execution rate? ===
<div class="mw-collapsible  mw-collapsed">
 ===
The choice of the PWM frequency and the FOC execution rate is a compromise between available speed and switching losses.

* In case of a high speed motor or a low inductance motor, you have to :

* For high-speed or low-inductance motors, use a high PWM frequency (e.g. for example, 30 kHz).
* In other casesWhatever the motor, a lower PWM frequency (e.g. for example, 16 kHz) is enough for most cases.
* In all casessufficient.
* Whatever the motor, check the maximum PWM frequency capability for the selected MCU.
* In case of a low inductance motor, it is possible to increase For low-inductance motors, the FOC execution rate can be increased while keeping a high PWM frequency to save CPU load, or to migrate to a lower performance MCU (e.g. for example PWM = 30 kHz and a FOC execution rate = 2 means mean that the FOC algorithm runs @at 15 kHz).</div>


=== Why do I have an “FOC duration” fault message and the motor don’t does not even try to start? === 
<div class="mw-collapsible  mw-collapsed">
This fault message appears when the FOC execution rate is too high and the FOC algorithm computation does not fit in the PWM period.

Open the "Drive Settings" window and decrease the ratio between the PWM period execution rate in the "Torque and flux regulators" section as shown below (for example increase this execution rate by one for example).

[[File:DriveManagement_DriveSettings1.png|center]]</div>


=== Why do I have an “Over current” fault message and the motor does not even try to start? === 
<div class="mw-collapsible  mw-collapsed">
This fault message appears fromin the following situation situations:
# A wrong current sensing topology is selected. Check In this case, check and select the right current sensing configuration.
# A Wrongwrong current sensing parameter is set. Check To solve this issue, check and correct the current sensing parameters. [[File:PowerStage_CurrentSensing.png|center]]
# The current regulation loop bandwidth is too high for the HWhardware setup. Open In this case, open the "Drive Settings" window and decrease the current regulation loop cut-off frequency (for example down to 2000 rad/s for a 3-shunt topology and 1000 rad/s for a 1-shunt topology). Typical maximum current regulation loop bandwidth values are 9000 rad/s for a 3-shunt topology and 4500 rad/s for a 1-shunt topology.
[[File:DriveManagement_DriveSettings2.png|center]]</div>


=== Why do I have a “Speed feedback” fault message during the acceleration phase and why does the motor stops? === 
<div class="mw-collapsible  mw-collapsed">

Often, this fault message stop? === 

This fault message often appears following an abrupt torque variation demand at the end of the start-upstartup phase. As a result, the "Back-EMF estimator" is spoilt.
* 1. # The observer gain G2 is too high and this . This makes the speed reconstruction a bit too noisy to be used by the speed PI gains (, thus causing an estimator reliability trouble). Possible solutions are :
** Decreasing issue. The possible solutions are the following:
#*Decrease the observer gain G2 by successive steps : /2, /4, /6, /8.
[[File:DriveManagement_SpeedPositionFeedbackManagement1.png|center]]** #*Run the motor in torque mode until the troubleissue disappears. The draw back drawback is that the speed regulator gains are not optimal. Trim the gain values (refer to the dedicated FAQ).* 2. The start-up #The startup phase ends too early. Possible The possible solutions are :
** Increasing the following:
#*Increase the “Consecutive successful start-up output tests” parameter (it must not be set to more a value higher than 4-5);** Setting #*Set the “Minimum start-upstartup output speed” parameter to 15% of your maximum application speed, then decreasingdecrease it for fine tuningprogressively.
[[File:DriveManagement_StartUp-Parameters2.png|center]]
''Tips :{{Info | * Smooth the speed variation between the “Minimum start-upstartup output speed” and the “Speed ramp final value” by adjusting the “Speed ramp duration”.''</div>

}}
=== Why do I have a “Start-up“Startup failure” error message during the rev-up phase and why does the motor stop? ===
<div class="mw-collapsible  mw-collapsed">

Typically, this fault message appears because there is insufficient This fault message typically appears because the current provided to support the required speed acceleration.
* 1. Decrease  is not sufficient. To solve this issue, proceed as follows:
#Decrease the speed acceleration rate :
**:
#* Increase the “Speed ramp duration” parameter;
**.
#* Set the “Speed ramp final value” parameter to 30% of your maximum application speed.* 2. # Increase the start-upstartup current :
**:
#* Increase the “Current ramp initial value” parameter;
**.
#* Increase the “Current ramp final value” parameter up to the “Nominal Current” parameter of the motor;
**.
#* Check the “Include alignment before ramp-up” box to make the start-upstartup phase more deterministic, and follow the FAQ on "Basic parameters settings for the ramp-up".
[[File:DriveManagement_StartUp-Parameters3.png|center]]</div>


=== Why do I have a “Start-up“Startup failure” error message during the acceleration following the rev-up phase and the motor stop? ===
<div class="mw-collapsible  mw-collapsed">

Often, this fault message This fault message often appears following an abrupt Torquetorque variations demand at the end of the start-upstartup phase. This spoils the Back-EMF estimator.* 1.The #The observer gain G2 is too high and this results in a noisy the speed reconstruction for the PI speed gains used (causing estimator reliability trouble). Possible solutions are :
**. This makes the speed reconstruction too noisy to be used by the speed PI gain, thus causing an estimator reliability issue. The possible solutions are the following:
#* Decrease the observer gain G2 by successive steps : /2, /4, /6, /8.
[[File:DriveManagement_SpeedPositionFeedbackManagement1.png|center]]**#* Increase the “Variance threshold” parameter to release the check mechanism : Up: up to 80% for Observer+PLL, Upup to 400% for Observer+CORDIC.
[[File:DriveManagement_SpeedPositionFeedbackManagement2.png|center]]* 2. The #The reliability capture window of the estimator is too small. The possible solution is :
**solutions are the following:
#* Increase the “Speed ramp final value” parameter up to 40% of the maximum application speed;
**.
#* Decrease the “Minimum start-upstartup output speed” parameter down to 10% of the maximum application speed.
[[File:DriveManagement_StartUp-Parameters4.png|center]]</div>


=== How to interface the STM32 MC Firmwarefirmware library? ===
<div class="mw-collapsible  mw-collapsed">
 ===
Several motor control APIs are implemented to offer basic interactioninteractions with the firmware library.
Please, refer Refer to the on-lineonline firmware reference information, which that contains all these detailsthe below information and more :
* From the STM32 MC Workbenchworkbench menu (: select Documentation -> and select Firmware Reference);.

* From the Windows Start-upStartup menu (: select an ST Motor Control SDK xxx -> Reference Manual xxx).</div>

and open the corresponding reference manual.
=== How to choose the hardware Powerpower board? ===
<div class="mw-collapsible  mw-collapsed">
 ===
While it is not true for the nominal bus voltage, usually, the maximum current (torque) used by your application is usually different from the maximum current of the motor.

As a consequence, the motor spin must be adapted to the selected Powerpower board range.
Of course, the The best case is of course when the maximum current of the motor is part of the current range offered by the selected Powerpower board.</div>


=== How to debug a motor control application? ===
<div class="mw-collapsible  mw-collapsed">
 ===
A motor control application cannot use the standard debug mechanism which are HW or SWconsists in hardware or software breakpoints for holding the program.

The reason is that during the break, yourthe application loses the real rotor position with respect to the needed magnetic field computation phasing defined by the firmware execution.

So, the DAC (or an emulated DAC, thanks to a PWM output) and/or the USART communication are used as outlined below:
* The DAC generates a voltage reflecting that reflects the internal signals (for example currents, B-EMF voltage, or reconstructed angle). Then, it provides the capability to scope this waveform during the motor spin. Best The best solution is to dedicate two pins of a DAC outputDAC output pins. * The USART provides data, but at a lower rate than the DAC. It requires the two Tx/Rx pins and the STM32 MC Workbenchworkbench tool to monitor the data.
[[File:STMCWB_Monitoring1.png|center]]</div>


=== How to make the current more sinusoidal when the motor spins? ===
<div class="mw-collapsible  mw-collapsed">
 ===
One possible cause is that the PI gains of the speed regulator are incorrect.

Decrease the KpKP gain and act on adjust the KiKI gain (evaluating the speed regulation) to check over/under-shootingundershooting during transients.</div>


=== How to tune the PI speed regulator? ===
<div class="mw-collapsible  mw-collapsed">
 ===
Among the possible ways, an example is described as followsbelow:
# Run the motor and connect it to the STM32 MC Workbench,workbench.

# Open the Monitormonitor mode and switch on the plotter window on,.# In the “Final ramp speed” box, enter the new reference speed (for example change the speed from 2 ,000 RPM to 4 ,000 RPM).
# In the plotter windows, check the measured speed reaction. It may either exhibit a fast reaction but present oscillation around with oscillations around the final value, or have a slow reaction, refer. Refer to the following solutions:#* If the regulated variable oscillates around a value, then decrease KI or increase KP.#* If the trend of regulated variable is too slow or not stabilize, then increase KI.
[[File:STMCWB_Plotting1.png|center]]</div>


=== How to connect ICS with the MC FW library? ===
<div class="mw-collapsible  mw-collapsed">

Our implemented ICS requires usage on 2 phases from a 3  ===

The implemented ICS requires using two phases from a three-phase power supply.

The STM32 MC FW library operates only on Phasephase U and Phasephase V, this is where the user must connect each ICS.</div>


=== Why use the . Connect each ICS to these phases.

=== Why using FOC as opposed to a 6-Stepsstep control for PMSM drive? ===
<div class="mw-collapsible  mw-collapsed">

The FOC brings the following benefits :
* Better energy efficiency;
* Improver

* Improved responsiveness of speed control;
* Precise

* Accurate positioning control;

* Lower acoustic noise.</div>



=== Why use the using 3-Shuntsshunt as opposed to a 1-Shuntshunt resistor implementation for current measurement? ===
<div class="mw-collapsible  mw-collapsed">
Using the 1-Shuntshunt implementation for measurement is the cheapest solution.

However, some motor (for example a low inductance motormotors (such as low-inductance motors) require current measurements on two phases simultaneously. Only the 3-Shuntsshunt implementation managemanages this configuration.</div>


== STM32 MC SDK features ==

=== Does the STM32 MC SDK support power factor corrector? ===
<div class="mw-collapsible  mw-collapsed">
Yes, it does.

Power factor correction examples are accessible from the STM32 MC Workbench first page, in the example list.</div>

  
=== Does the STM32 MC SDK support dual drive motors? ===
<div class="mw-collapsible  mw-collapsed">
Yes, the STM32 MC SDK supports dual -drive motors using only one MCU.
''{{Warning:
* | This functionality has been temporarily removed in the STM32 MC SDK version 5.Y''</div>

}}
=== Does the STM32 MC SDK provide project examples using FOC or 6-Steps control for PMSM drive? ===
<div class="mw-collapsible  mw-collapsed">
Yes, the STM32 MC SDK provides project examples to demonstrate FOC and 6-Steps control implementations.

They are accessible from STM32 MC Workbench first page.</div>


=== What are the new features of STM32 MC SDK version 5.Y? ===
<div class="mw-collapsible  mw-collapsed">The STM32 MC SDK version 5.Y, is a first step in our innovative roadmap. It includes:  
* A new communication protocol and its associated monitoring tools, the STM32 MC Motor Pilotmotor pilot 

* New algorithms like such as discontinuous PWM, Singlesingle shunt phase shift, Overmodulation and overmodulation* New 6 -step examples compatible with the new STM32 MC Motor Pilotmotor pilot

* New sensorless asynchronous motor example compatible with the new STM32 MC Motor Pilotmotor pilot 

* New STSpinG4STSPING4 support
* MISRA support for STM32G4 series</div>

Series
<noinclude>

[[Category:Motor Control | 00090]]
{{PublicationRequestId | 19720 | 04/22/2021 | CS.GREGORY}}{{PublicationRequestId | 23231| 15/04/2021 | }}</noinclude>
(78 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Frequently Asked Questions (FAQ)}}
+
{{DISPLAYTITLE:Frequently asked questions (FAQ)}}
 
__NOTOC__
 
__NOTOC__
   
This page contains some Frequently Asked Questions (FAQ) related to Motor Control with STM32 (STM32 MC).
+
This page contains some frequently asked questions (FAQ) related to motor control with STM32 (STM32 MC).
   
 
'''Main sections'''
 
'''Main sections'''
# [[#STM32_Motor_Control_Ecosystem|STM32 MC '''Ecosystem''']]
+
# [[#STM32_motor_control_ecosystem|STM32 MC '''ecosystem''']]
# [[#STM32_MC_SDK_Usage|STM32 MC '''SDK Usage''']]
+
# [[#Using the STM32 MC SDK|STM32 MC '''SDK usage''']]
# [[#STM32_MC_SDK_Features|STM32 MC '''SDK Features''']]
+
# [[#STM32 MC SDK features|STM32 MC '''SDK features''']]
   
 
'''Acronyms and abbreviations'''
 
'''Acronyms and abbreviations'''
* FOC = Field Oriented Control (algorithm)
+
* FOC = field oriented control (algorithm)
* MC = Motor Control
+
* MC = motor control
* PMSM = Permanent Magnet Synchronous Motor
+
* PMSM = permanent magnet synchronous motor
* SDK = Software Development Kit
+
* SDK = software development kit
   
== STM32 Motor Control Ecosystem ==
+
== STM32 motor control ecosystem ==
=== What is the purpose of the STM32 MC SDK? ===
+
=== Overview of the STM32 MC SDK ===
  +
The ST motor control ecosystem includes the STM32 motor control software development kit (to install it, download it from the X-CUBE-MCSDK web page). Its purpose is to speed up the evaluation and development of a FOC or 6-step algorithm for permanent magnet synchronous motor (PMSM) applications.
   
<div class="mw-collapsible  mw-collapsed">
+
The STM32 MC SDK is running on STM32 MCUs that implement an advanced timer (refer to the appropriate release note for more information). It is composed of:
The ST Motor Control Ecosystem includes also the STM32 Motor Control Software Development Kit (download the "X-CUBE-MCSDK" deliverable to install). Its purpose is to speed up the evaluation and development of a FOC algorithm (Field Oriented Control) and six steps for Permanent Magnet Synchronous Motor (PMSM) applications.
+
* STM32 MC firmware (STM32 MC FW) library
 
 
The STM32 MC SDK is running with the STM32 MCU families implementing an advanced timer (refer to the appropriate release note for more information), and it is composed of:
 
* STM32 MC Firmware (STM32 MC FW) library
 
 
** Currently only the PMSM FOC control is available for all configurations
 
** Currently only the PMSM FOC control is available for all configurations
** PMSM Six Step and Asynchronous motor FOC getting started in the MCSDK as examples
+
** PMSM 6-step and asynchronous motor FOC getting started examples, available within X-CUBE-MCSDK
* STM32 MC Workbench (STM32 MC WB)
+
* STM32 MC workbench (STM32 MC WB)
** PC Graphical User Interface (GUI) tools to configure the FOC firmware library parameters and to perform real time monitoring (monitoring with the STM32 MC WB only up to version 5.4.6)
+
** PC graphical user interface (GUI) tools to configure the FOC firmware library parameters and to perform real-time monitoring (monitoring with the STM32 MC WB only, up to version 5.4.6)
* STM32 MC Motor Profiler (STM32 MC MP)
+
* STM32 MC motor profiler (STM32 MC MP)
** PC tools able to measure the Motor Parameter automatically and to update the STM32 MC FW library, through the ST MC Workbench usage
+
** PC tools able to measure the motor parameters automatically and to update the STM32 MC FW library, through the ST MC workbench
</div>
+
<br>
   
=== What are the changes from previous version? ===
+
=== Changes from previous version ===
  +
Refer to the STM32 MC SDK release note provided with each released version.
   
<div class="mw-collapsible  mw-collapsed">
+
=== Overview of the STM32 MC SDK version 5.Y ===
Please, refer to the STM32 MC SDK Release Notes provided with each released version.
+
The STM32 MC SDK is available in two versions of the '''X-CUBE-MCSDK''' deliverable:
</div>
+
* STM32 MC SDK version 5.4.6, that corrects few problems of the 5.4 series. It is fully compatible with previous versions.
 
 
=== What is the STM32 MC SDK Version 5.Y? ===
 
<div class="mw-collapsible  mw-collapsed">
 
STM32 MC SDK is available in two versions of the "X-CUBE-MCSDK" deliverable:
 
* STM32 MC SDK version 5.4.6, correcting few problems of the 5.4 series. It is fully compatible with previous versions.
 
 
* STM32 MC SDK version 5.Y, that is a first step in our innovative roadmap. It includes:
 
* STM32 MC SDK version 5.Y, that is a first step in our innovative roadmap. It includes:
**  A new communication protocol and its associated monitoring tools, the SM32 MC Motor Pilot
+
**  A new communication protocol and its associated monitoring tools, the SM32 MC motor pilot
** New algorithms such as discontinuous PWM, single shunt phase shift, overmodulation
+
** New algorithms, such as discontinuous PWM, single shunt phase shift, and overmodulation
** New six step examples compatible with the new STM32 MC Motor Pilot
+
** New 6-step examples compatible with the new STM32 MC motor pilot
** New sensorless asynchronous motor example compatible with the new STM32 MC Motor Pilot
+
** A new sensorless asynchronous motor example compatible with the new STM32 MC motor pilot
** New STSpinG4 support.
+
** New STSPING4 support.
   
The main limitation of STM32 MC SDK version 5.Y are:
+
The main limitations of STM32 MC SDK version 5.Y are:
* Project generated with STM32 MC SDK version 5.4 deliveries are not be compatible with version 5.Y
+
* The projects generated with STM32 MC SDK version 5.4 deliveries are not compatible with version 5.Y.
* STM32 MC SDK version 5.Y does not support STM32F1 series
+
* STM32 MC SDK version 5.Y does not support STM32F1 Series.
* STM32 MC SDK version 5.Y does not support dual motor.
+
* STM32 MC SDK version 5.Y does not support dual-motor applications.
</div>
 
   
=== How do I choose between STM32 MC SDK 5.4.6 and 5.Y versions? ===
+
=== Choosing between STM32 MC SDK 5.4.6 and 5.Y versions ===
<div class="mw-collapsible  mw-collapsed">
+
* If you are already using STM32 MC SDK version 5.4 and need to keep the compliance, use version 5.4.6.
* If you are already using STM32 MC SDK version 5.4 and need to keep the compliancy, use the version 5.4.6
+
* If you want a well-established mature SDK version, use version 5.4.6.
* If you want a well established mature SDK version with no surprise, use the version 5.4.6
+
* If you use an STM32F1 MCU, choose version 5.4.6.
* If you use STM32F1, use the version 5.4.6
+
* For dual-motor applications, use version 5.4.6.
* For dual motor application, use the version 5.4.6
+
However,:
But:
+
* If you need new debug capabilities and dumping features to mature your application, use version 5.Y.
* If you need new debug capabilities and dumping features to mature your application, use the version 5.Y
+
* If you are interested by the PWM, single shunt phase shift, or overmodulation feature, use version 5.Y.
* If you are interested by any of the following features: discontinuous PWM, single shunt phase shift, overmodulation, use the version 5.Y
+
* If you want to use the new STSPING4, use version 5.Y.
* If you want to use the new STSPING4, use the version 5.Y
+
* For asynchronous motor applications, use version 5.Y.
* For asynchronous motor application , use the version 5.Y
 
</div>
 
   
=== What is the STM32 MC Motor Profiler tool? ===
+
=== STM32 MC motor profiler ===
  +
This tool automatically measures the electrical parameters of PMSM motors. The characteristics of an electric motor may not be known and can be determined in less than a minute.
   
<div class="mw-collapsible  mw-collapsed">
+
The algorithm determines the motor parameters required to configure the STM32 MC FW library: stator resistance R<sub>s</sub>, stator inductance L<sub>s</sub>, back EMF constant, motor inertia, and friction.
This is a tool that automatically measure the electrical parameters of PMSM motors. The specification of an electric motor may not be known and is determined in less than a minute.
 
   
The algorithm determines the motor parameters needed to configure the STM32 MC FW library : stator resistance Rs; stator inductance Ls; back EMF constant; motor ionertia and friction.
+
Refer to the STM32 motor control SDK user manual for more details ([https://www.st.com/resource/en/user_manual/dm00486148-stm32-motor-control-sdk-v54-tools-stmicroelectronics.pdf UM2380]).
   
Refer to the STM32 MC SDK tools document for more details ([https://www.st.com/resource/en/user_manual/dm00486148-stm32-motor-control-sdk-v54-tools-stmicroelectronics.pdf UM2380]).
+
=== STM32 MC motor pilot ===
  +
The STM32 MC motor pilot is a new control and monitoring PC tool, available in version 5.Y. It replaces the monitoring tool currently delivered with the STM32 MC motor workbench.
   
</div>
+
It is built on a brand-new communication protocol that allows faster and more reliable communications while consuming less MIPS from the MCU.
   
=== What is the STM32 MC Motor Pilot tool? ===
+
With this protocol, internal motor control signals are monitored in real-time with no or controlled subsampling.
   
<div class="mw-collapsible  mw-collapsed">
+
== Using the STM32 MC SDK ==
The STM32 MC Motor Pilot is a new control and monitoring PC tool in version 5.Y, which replaced the monitor currently delivered with the STM32 MC Motor Workbench.
 
   
It is built on a brand new communication protocol that allows for faster and more reliable communication while consuming less MIPS from the MCU.
+
=== How to create a motor control project ===
  +
First read the STM32 MC SDK getting started manual ([https://www.st.com/resource/en/user_manual/dm00484271-getting-started-with-stm32-motor-control-sdk-v50-stmicroelectronics.pdf UM2374]). Then, start either from a motor control example project, or design a new project.
   
With this protocol, internal motor control signals are monitored in real time with no or controlled subsampling.
+
{{Info |
</div>
+
* Do not forget to create and save your project into your dedicated working directory.}}
   
== STM32 MC SDK Usage ==
+
=== How to handle a project made with a previous version of the STM32 MC workbench ===
   
=== How to create a motor control project? ===
+
The STM32 MC workbench automatically migrates an older *.stmcx file to the current version. Before the migration, an information window pops up requesting confirmation. Click yes if you agree with this conversion (after migration, the previous configuration is lost).
   
<div class="mw-collapsible  mw-collapsed">
+
Regarding the user application software itself, refer to "How to migrate motor control application software from STM32 MC SDK v4.3 to v5.x" ([https://www.st.com/resource/en/application_note/dm00477952-how-to-migrate-motor-control-application-software-from-sdk-v43-to-sdk-v5x-stmicroelectronics.pdf AN5143]).
First read the STM32 MC SDK - Getting Started manual ([https://www.st.com/resource/en/user_manual/dm00484271-getting-started-with-stm32-motor-control-sdk-v50-stmicroelectronics.pdf UM2374]). Then, start from either a motor control example project, or from a new project design.
 
   
''Tips :
+
{{Info |
* Don’t forget to create and save your project into the dedicated working directory.''
 
</div>
 
 
 
=== How to handle a project made with previous version of the STM32 MC Workbench? ===
 
 
 
<div class="mw-collapsible  mw-collapsed">
 
The STM32 MC Workbench migrates automatically older *.stmcx file to the current version. Note that before the migration, an information window pops-up requesting confirmation. Click yes if you agree with this conversion (note that the previous configuration is lost after migration).
 
 
 
Regarding to the user application software itself, refer to "How to migrate motor control application software from STM32 MC SDK v4.3 to v5.x" ([https://www.st.com/resource/en/application_note/dm00477952-how-to-migrate-motor-control-application-software-from-sdk-v43-to-sdk-v5x-stmicroelectronics.pdf AN5143]).
 
 
 
''Tips:
 
 
* Get a copy of all your original files.
 
* Get a copy of all your original files.
* Don’t forget to create and save your project into your dedicated working directory.''
+
* Do not forget to create and save your project into your dedicated working directory.}}
 
 
''Warning:
 
* Projects generated with  STM32 MC SDK version 5.4.x cannot be reused with the new version 5.Y''
 
</div>
 
   
=== How to get a project framework for particular IDE (IAR<sup>TM</sup>, KEIL<sup>®</sup>, …)? ===
+
{{Warning | Projects generated with STM32 MC SDK version 5.4.x cannot be reused with the new 5.Y version.}}
   
<div class="mw-collapsible  mw-collapsed">
+
=== How to get a project framework for a particular IDE (such as IAR<sup>TM</sup> or Keil<sup>®</sup>) ===
User may start from :
 
   
Either a motor control application software example as provided in the “./Projects” directory for all supported IDE : IAR<sup>TM</sup>, KEIL<sup>®</sup> or GCC based (Read its attached ReadMe.txt file);
+
Two solutions are possible:
   
Either a pre-configured motor control application example project, or a newly created one, via the STM32 MC Workbench usage. Then, the user selects the wanted IDE, as well as the STM32CubeMX version, before to generate his/her motor control application software example.
+
* Start from a motor control application software example provided in the “./Projects” directory for all supported IDEs, IAR<sup>TM</sup>, Keil<sup>®</sup> or GCC based (read the attached ReadMe.txt file).
  +
* Use a preconfigured motor control application example project or a newly created one, via the STM32 MC workbench. Then, select the required IDE as well as the STM32CubeMX version, and generate the motor control application software example.
   
''Tips :
+
{{Info |
* Don’t forget to create and save your project into your dedicated working directory.''
+
* Do not forget to create and save your project into a dedicated working directory.}}
</div>
 
   
=== Why the STM32 Motor Profiler tool doesn’t recognize my motor? ===
+
=== Why does not the STM32 motor profiler tool recognize my motor? ===
   
<div class="mw-collapsible  mw-collapsed">
+
If the STM32 motor profiler tool does not recognize your motor, proceed as follows:
If the STM32 Motor Profiler tool does not recognize your motor, proceed as follows:
+
* Apply a nominal voltage.
* Apply a nominal voltage
+
* Select the power stage with the proper current range.
* Select the power stage with proper current range
+
* Fill the nominal motor speed parameter or play with this value.
* Fill the nominal motor speed parameter or play with this value
+
* Decrease the nominal current parameter.
* Decrease the nominal current parameter
 
 
* Decrease the applied bus voltage.
 
* Decrease the applied bus voltage.
   
''Warning:
+
{{Warning The STM32 MC motor profiler has the following limitation: it cannot profile motors with R<sub>s</sub> < 1 Ω or L<sub>s</sub> < 1 mH.}}
* The STM32 MC Motor Profiler has the following limitation. It cannot recognize motors with Rs > 1 Ω, Ls > 1 mH''
 
   
 
If you still face problems, profile your motor manually using the following procedure: [[STM32MotorControl:How_To_manually_configure_the_motor_parameters|How To manually configure the motor parameters]].
 
If you still face problems, profile your motor manually using the following procedure: [[STM32MotorControl:How_To_manually_configure_the_motor_parameters|How To manually configure the motor parameters]].
   
</div>
+
=== Why does not my motor start immediately? ===
 
 
=== Why does my motor not start immediately? ===
 
   
<div class="mw-collapsible  mw-collapsed">
+
Although your motor is running fine, it does not start immediately. The reason can be one of the following:
Although your motor is running fine, it doesn’t start immediately for one of the following reason:
+
# During initialization, a motor alignment is required to start from a known position. In other words, it means that the initialization phase sets a static stator vector and waits until the rotor vector aligns with this position.
# During initialization, a motor alignment is needed to start from a known position. In other words, it means the initialization phase sets a static stator vector and waits until the rotor vector aligns with this position.
+
# When the “on-the-fly startup” feature is enabled, this feature starts a detection phase before driving any motor:
# When the “On-the-Fly startup” feature is enabled. Before any motor drive, this feature starts a detection phase:
+
#* When the rotation is detected, it skips the startup phase and runs directly in the close-loop mode.
* When the rotation is detected, it skips the start-up phase and runs directly in the close-loop mode.
+
#* When no rotation is detected, it launches the startup phase, such as alignment or ramp-up.
* When the rotation is not detected, it runs the start-up phase : alignment, ramp-up, …
 
</div>
 
   
=== How to choose the basic set of ramp-up parameters for a motor? ===
+
=== How to choose the basic set of ramp-up parameters for a given motor ===
   
<div class="mw-collapsible  mw-collapsed">
+
Most of the time, setting the ramp-up parameters as follows ensures a correct start of the motor:
Most of the time, we have noticed that setting the ramp-up parameters as follow, the motor starts the first time :
+
* Check the box “Include alignment before ramp-up”.
* Check the box “Include alignment before ramp-up”;
+
* Set the motor alignment “Duration” to 2000 ms.
* Set the motor alignment “Duration” to 2000 ms;
+
* Set the motor alignment “Final current ramp value” to ½ of the nominal motor current (in A).
* Set the motor alignment “Final current ramp value” from ½ of nominal motor current (in A);
+
* Set the “Speed ramp duration” to 3000 ms.
* Set the “Speed ramp duration” to 3000 ms;
+
* Set the “Speed ramp final value” to 30% of the maximal motor speed (in RPM);
* Set the “Speed ramp final value” to 30% of maximal motor speed (in RPM);
+
* Set the “Current ramp final value” to ½ of the nominal motor current (in A).
* Set the “Current ramp final value” from ½ of nominal motor current (in A);
+
* Set the “Minimum start-up output speed” to 15% of the maximal motor speed (in RPM).
* Set the “Minimum start-up output speed” to 15% of maximal motor speed (in RPM).
 
   
After a first successful run, fine tune these parameters.
+
After a first successful start, fine-tune these parameters.
   
 
[[File:DriveManagement_StartUp-Parameters1.png|center]]
 
[[File:DriveManagement_StartUp-Parameters1.png|center]]
</div>
 
   
=== How to choose the PWM frequency and the FOC execution rate? ===
+
=== How to choose the PWM frequency and the FOC execution rate ===
   
<div class="mw-collapsible  mw-collapsed">
+
The choice of the PWM frequency and the FOC execution rate is a compromise between available speed and switching losses:
The choice of the PWM frequency and the FOC execution rate is a compromise between available speed and switching losses.
 
   
* In case of a high speed motor or a low inductance motor, you have to use a high PWM frequency (e.g. 30 kHz).
+
* For high-speed or low-inductance motors, use a high PWM frequency (for example, 30 kHz).
* In other cases, a lower PWM frequency (e.g. 16 kHz) is enough for most cases.
+
* Whatever the motor, a lower PWM frequency (for example, 16 kHz) is sufficient.
* In all cases, check the maximum PWM frequency capability for the selected MCU.
+
* Whatever the motor, check the maximum PWM frequency capability for the selected MCU.
* In case of a low inductance motor, it is possible to increase the FOC execution rate while keeping a high PWM frequency to save CPU load, or to migrate to a lower performance MCU (e.g. PWM = 30 kHz and a FOC execution rate = 2 means the FOC algorithm runs @ 15 kHz).
+
* For low-inductance motors, the FOC execution rate can be increased while keeping a high PWM frequency to save CPU load, or migrate to a lower performance MCU (for example PWM = 30 kHz and FOC execution rate = 2 mean that the FOC algorithm runs at 15 kHz).
</div>
 
   
=== Why do I have an “FOC duration” fault message and the motor don’t even try to start? ===  
+
=== Why do I have an “FOC duration” fault message and the motor does not even try to start? ===  
   
<div class="mw-collapsible  mw-collapsed">
 
 
This fault message appears when the FOC execution rate is too high and the FOC algorithm computation does not fit in the PWM period.
 
This fault message appears when the FOC execution rate is too high and the FOC algorithm computation does not fit in the PWM period.
   
Open the "Drive Settings" window and decrease the ratio between the PWM period execution rate in the "Torque and flux regulators" section as shown below (increase this execution rate by one for example).
+
Open the "Drive Settings" window and decrease the ratio between the PWM period execution rate in the "Torque and flux regulators" section as shown below (for example increase this execution rate by one).
   
 
[[File:DriveManagement_DriveSettings1.png|center]]
 
[[File:DriveManagement_DriveSettings1.png|center]]
</div>
 
   
 
=== Why do I have an “Over current” fault message and the motor does not even try to start? ===  
 
=== Why do I have an “Over current” fault message and the motor does not even try to start? ===  
   
<div class="mw-collapsible  mw-collapsed">
+
This fault message appears in the following situations:
This fault message appears from the following situation :
+
# A wrong current sensing topology is selected. In this case, check and select the right current sensing configuration.
# A wrong current sensing topology is selected. Check and select the right current sensing configuration.
+
# A wrong current sensing parameter is set. To solve this issue, check and correct the current sensing parameters. [[File:PowerStage_CurrentSensing.png|center]]
# A Wrong current sensing parameter is set. Check and correct the current sensing parameters.
+
# The current regulation loop bandwidth is too high for the hardware setup. In this case, open the "Drive Settings" window and decrease the current regulation loop cut-off frequency (for example down to 2000 rad/s for a 3-shunt topology and 1000 rad/s for a 1-shunt topology). Typical maximum current regulation loop bandwidth values are 9000 rad/s for a 3-shunt topology and 4500 rad/s for a 1-shunt topology.
[[File:PowerStage_CurrentSensing.png|center]]
 
# The current regulation loop bandwidth is too high for the HW setup. Open the "Drive Settings" window and decrease the current regulation loop cut-off frequency (for example down to 2000 rad/s for a 3-shunt topology and 1000 rad/s for a 1-shunt topology). Typical maximum current regulation loop bandwidth values are 9000 rad/s for a 3-shunt topology and 4500 rad/s for a 1-shunt topology.
 
 
[[File:DriveManagement_DriveSettings2.png|center]]
 
[[File:DriveManagement_DriveSettings2.png|center]]
</div>
 
   
=== Why do I have a “Speed feedback” fault message during the acceleration phase and the motor stops? ===  
+
=== Why do I have a “Speed feedback” fault message during the acceleration phase and why does the motor stop? ===  
   
<div class="mw-collapsible  mw-collapsed">
+
This fault message often appears following an abrupt torque variation demand at the end of the startup phase. As a result, the "Back-EMF estimator" is spoilt.
Often, this fault message appears following an abrupt torque variation demand at the end of the start-up phase. As a result, the "Back-EMF estimator" is spoilt.
 
   
* 1. The observer gain G2 is too high and this makes the speed reconstruction a bit noisy to be used by the speed PI gains (causing estimator reliability trouble). Possible solutions are :
+
# The observer gain G2 is too high. This makes the speed reconstruction too noisy to be used by the speed PI gains, thus causing an estimator reliability issue. The possible solutions are the following:
** Decreasing the observer gain G2 by successive steps : /2, /4, /6, /8.
+
#*Decrease the observer gain G2 by successive steps : /2, /4, /6, /8.[[File:DriveManagement_SpeedPositionFeedbackManagement1.png|center]]
[[File:DriveManagement_SpeedPositionFeedbackManagement1.png|center]]
+
#*Run the motor in torque mode until the issue disappears. The drawback is that the speed regulator gains are not optimal. Trim the gain values (refer to the dedicated FAQ).
** Run the motor in torque mode until the trouble disappears. The draw back is that the speed regulator gains are not optimal. Trim the gain values (refer to the dedicated FAQ).
+
#The startup phase ends too early. The possible solutions are the following:
* 2. The start-up phase ends too early. Possible solutions are :
+
#*Increase the “Consecutive successful start-up output tests” parameter (it must not be set to a value higher than 4-5);
** Increasing the “Consecutive successful start-up output tests” parameter (not set to more than 4-5);
+
#*Set the “Minimum startup output speed” parameter to 15% of your maximum application speed, then decrease it progressively.
** Setting the “Minimum start-up output speed” parameter to 15% of your maximum application speed, then decreasing it for fine tuning.
 
 
[[File:DriveManagement_StartUp-Parameters2.png|center]]
 
[[File:DriveManagement_StartUp-Parameters2.png|center]]
   
''Tips :
+
{{Info |
* Smooth the speed variation between the “Minimum start-up output speed” and the “Speed ramp final value” by adjusting the “Speed ramp duration”.''
+
* Smooth the speed variation between the “Minimum startup output speed” and the “Speed ramp final value” by adjusting the “Speed ramp duration”.}}
</div>
 
   
=== Why do I have a “Start-up failure” error message during the rev-up phase and the motor stop? ===
+
=== Why do I have a “Startup failure” error message during the rev-up phase and why does the motor stop? ===
   
<div class="mw-collapsible  mw-collapsed">
+
This fault message typically appears because the current provided to support the required speed acceleration is not sufficient. To solve this issue, proceed as follows:
Typically, this fault message appears because there is insufficient current provided to support the required speed acceleration.
+
#Decrease the speed acceleration rate:
* 1. Decrease the speed acceleration rate :
+
#* Increase the “Speed ramp duration” parameter.
** Increase the “Speed ramp duration” parameter;
+
#* Set the “Speed ramp final value” parameter to 30% of your maximum application speed.
** Set the “Speed ramp final value” parameter to 30% of your maximum application speed.
+
# Increase the startup current:
* 2. Increase the start-up current :
+
#* Increase the “Current ramp initial value” parameter.
** Increase the “Current ramp initial value” parameter;
+
#* Increase the “Current ramp final value” parameter up to the “Nominal Current” parameter of the motor.
** Increase the “Current ramp final value” parameter up to the “Nominal Current” parameter of the motor;
+
#* Check the “Include alignment before ramp-up” box to make the startup phase more deterministic, and follow the FAQ on "Basic parameters settings for the ramp-up".
** Check the “Include alignment before ramp-up” box to make the start-up phase more deterministic, and follow the FAQ on "Basic parameters settings for the ramp-up".
 
 
[[File:DriveManagement_StartUp-Parameters3.png|center]]
 
[[File:DriveManagement_StartUp-Parameters3.png|center]]
</div>
 
   
=== Why do I have a “Start-up failure” error message during the acceleration following the rev-up phase and the motor stop? ===
+
=== Why do I have a “Startup failure” error message during the acceleration following the rev-up phase and the motor stop? ===
   
<div class="mw-collapsible  mw-collapsed">
+
This fault message often appears following an abrupt torque variations demand at the end of the startup phase. This spoils the Back-EMF estimator.
Often, this fault message appears following an abrupt Torque variations demand at the end of the start-up phase. This spoils the Back-EMF estimator.
+
#The observer gain G2 is too high. This makes the speed reconstruction too noisy to be used by the speed PI gain, thus causing an estimator reliability issue. The possible solutions are the following:
* 1.The observer gain G2 is too high and this results in a noisy the speed reconstruction for the PI speed gains used (causing estimator reliability trouble). Possible solutions are :
+
#* Decrease the observer gain G2 by successive steps : /2, /4, /6, /8.[[File:DriveManagement_SpeedPositionFeedbackManagement1.png|center]]
** Decrease the observer gain G2 by successive steps : /2, /4, /6, /8.
+
#* Increase the “Variance threshold” parameter to release the check mechanism: up to 80% for Observer+PLL, up to 400% for Observer+CORDIC.[[File:DriveManagement_SpeedPositionFeedbackManagement2.png|center]]
[[File:DriveManagement_SpeedPositionFeedbackManagement1.png|center]]
+
#The reliability capture window of the estimator is too small. The possible solutions are the following:
** Increase the “Variance threshold” parameter to release the check mechanism : Up to 80% for Observer+PLL, Up to 400% for Observer+CORDIC.
+
#* Increase the “Speed ramp final value” parameter up to 40% of the maximum application speed.
[[File:DriveManagement_SpeedPositionFeedbackManagement2.png|center]]
+
#* Decrease the “Minimum startup output speed” parameter down to 10% of the maximum application speed.
* 2. The reliability capture window of the estimator is too small. The possible solution is :
 
** Increase the “Speed ramp final value” parameter up to 40% of the maximum application speed;
 
** Decrease the “Minimum start-up output speed” parameter down to 10% of the maximum application speed.
 
 
[[File:DriveManagement_StartUp-Parameters4.png|center]]
 
[[File:DriveManagement_StartUp-Parameters4.png|center]]
</div>
 
   
=== How to interface the STM32 MC Firmware library? ===
+
=== How to interface the STM32 MC firmware library ===
   
<div class="mw-collapsible  mw-collapsed">
+
Several motor control APIs are implemented to offer basic interactions with the firmware library.
Several motor control APIs are implemented to offer basic interaction with the firmware library.
 
   
Please, refer to the on-line firmware reference information, which contains all these details and more :
+
Refer to the online firmware reference information that contains the below information and more:
* From the STM32 MC Workbench menu (Documentation -> Firmware Reference);
+
* From the STM32 MC workbench menu: select Documentation and select Firmware Reference.
* From the Windows Start-up menu (ST Motor Control SDK xxx -> Reference Manual xxx).
+
* From the Windows Startup menu: select an ST Motor Control SDK and open the corresponding reference manual.
</div>
 
   
=== How to choose the hardware Power board? ===
+
=== How to choose the hardware power board ===
   
<div class="mw-collapsible  mw-collapsed">
+
While it is not true for the nominal bus voltage, the maximum current (torque) used by your application is usually different from the maximum current of the motor.
While it is not true for the nominal bus voltage, usually, the maximum current (torque) used by your application is different from the maximum current of the motor.
 
   
As a consequence, the motor spin must adapted to the selected Power board range.
+
As a consequence, the motor spin must be adapted to the selected power board range.
   
Of course, the best case is when the maximum current of the motor is part of the current range offered by the selected Power board.
+
The best case is of course when the maximum current of the motor is part of the current range offered by the selected power board.
</div>
 
   
=== How to debug a motor control application? ===
+
=== How to debug a motor control application ===
   
<div class="mw-collapsible  mw-collapsed">
+
A motor control application cannot use the standard debug mechanism which consists in hardware or software breakpoints for holding the program.
A motor control application cannot use the standard debug mechanism which are HW or SW breakpoints for holding the program.
 
   
The reason is that during the break, your application loses the real rotor position with respect to the needed magnetic field computation phasing defined by the firmware execution.
+
The reason is that during the break, the application loses the real rotor position with respect to the needed magnetic field computation phasing defined by the firmware execution.
   
 
So, the DAC (or an emulated DAC, thanks to a PWM output) and/or the USART communication are used as outlined below:
 
So, the DAC (or an emulated DAC, thanks to a PWM output) and/or the USART communication are used as outlined below:
* The DAC generates a voltage reflecting internal signals (for example currents, B-EMF voltage, or reconstructed angle). Then, it provides capability to scope this waveform during the motor spin. Best is to dedicate two pins of a DAC output
+
* The DAC generates a voltage that reflects the internal signals (for example currents, B-EMF voltage, or reconstructed angle). Then, it provides the capability to scope this waveform during the motor spin. The best solution is to dedicate two DAC output pins.
* The USART provides data, but at a lower rate than the DAC. It requires the two Tx/Rx pins and the STM32 MC Workbench tool to monitor the data.
+
* The USART provides data, but at a lower rate than the DAC. It requires the two Tx/Rx pins and the STM32 MC workbench tool to monitor the data.
 
[[File:STMCWB_Monitoring1.png|center]]
 
[[File:STMCWB_Monitoring1.png|center]]
</div>
 
   
=== How to make the current more sinusoidal when the motor spins? ===
+
=== How to make the current more sinusoidal when the motor spins ===
   
<div class="mw-collapsible  mw-collapsed">
 
 
One possible cause is that the PI gains of the speed regulator are incorrect.
 
One possible cause is that the PI gains of the speed regulator are incorrect.
   
Decrease the Kp gain and act on the Ki gain (evaluating the speed regulation) to check over/under-shooting during transients.
+
Decrease the KP gain and adjust the KI gain (evaluating the speed regulation) to check over/undershooting during transients.
</div>
 
   
=== How to tune the PI speed regulator? ===
+
=== How to tune the PI speed regulator ===
   
<div class="mw-collapsible  mw-collapsed">
+
Among the possible ways, an example is described below:
Among the possible ways, an example is described as follows:
+
# Run the motor and connect it to the STM32 MC workbench.
# Run the motor and connect it to the STM32 MC Workbench,
+
# Open the monitor mode and switch on the plotter window.
# Open the Monitor mode and switch the plotter window on,
+
# In the “Final ramp speed” box, enter the new reference speed (for example change the speed from 2,000 RPM to 4,000 RPM).
# In the “Final ramp speed” box, enter the new reference speed (for example change speed from 2 000 RPM to 4 000 RPM).
+
# In the plotter windows, check the measured speed reaction. It may either exhibit a fast reaction with oscillations around the final value, or have a slow reaction. Refer to the following solutions:
# In the plotter windows, check the measured speed reaction. It may exhibit a fast reaction but present oscillation around final value, or have a slow reaction, refer to the following solutions:
+
#* If the regulated variable oscillates around a value, decrease KI or increase KP.
* If regulated variable oscillates around a value, then decrease KI or increase KP.
+
#* If the trend of regulated variable is too slow or not stabilize, then increase KI.
* If the trend of regulated variable is too slow or not stabilize, then increase KI.
 
 
[[File:STMCWB_Plotting1.png|center]]
 
[[File:STMCWB_Plotting1.png|center]]
</div>
 
   
=== How to connect ICS with the MC FW library? ===
+
=== How to connect ICS with the MC FW library ===
   
<div class="mw-collapsible  mw-collapsed">
+
The implemented ICS requires using two phases from a three-phase power supply.
Our implemented ICS requires usage on 2 phases from a 3 phase power supply.
 
   
The STM32 MC FW library operates only on Phase U and Phase V, this is where the user must connect each ICS.
+
The STM32 MC FW library operates only on phase U and phase V. Connect each ICS to these phases.
</div>
 
   
=== Why use the FOC as opposed to a 6-Steps control for PMSM drive? ===
+
=== Why using FOC as opposed to 6-step control for PMSM drive? ===
   
<div class="mw-collapsible  mw-collapsed">
+
FOC brings the following benefits:
The FOC brings the following benefits :
+
* Better energy efficiency
* Better energy efficiency;
+
* Improved responsiveness of speed control
* Improver responsiveness of speed control;
+
* Accurate positioning control
* Precise positioning control;
+
* Lower acoustic noise
* Lower acoustic noise.
 
</div>
 
   
=== Why use the 3-Shunts as opposed to a 1-Shunt resistor implementation for current measurement? ===
+
=== Why using 3-shunt as opposed to a 1-shunt resistor implementation for current measurement? ===
   
<div class="mw-collapsible  mw-collapsed">
+
Using the 1-shunt implementation for measurement is the cheapest solution.
Using the 1-Shunt implementation for measurement is the cheapest solution.
 
   
However, some motor (for example a low inductance motor) require current measurements on two phases simultaneously. Only the 3-Shunts implementation manage this configuration.
+
However, some motors (such as low-inductance motors) require current measurements on two phases simultaneously. Only the 3-shunt implementation manages this configuration.
</div>
 
   
 
== STM32 MC SDK features ==
 
== STM32 MC SDK features ==
Line 334: Line 269:
 
=== Does the STM32 MC SDK support power factor corrector? ===
 
=== Does the STM32 MC SDK support power factor corrector? ===
   
<div class="mw-collapsible  mw-collapsed">
 
 
Yes, it does.
 
Yes, it does.
   
 
Power factor correction examples are accessible from the STM32 MC Workbench first page, in the example list.
 
Power factor correction examples are accessible from the STM32 MC Workbench first page, in the example list.
</div>
 
 
    
 
    
 
=== Does the STM32 MC SDK support dual drive motors? ===
 
=== Does the STM32 MC SDK support dual drive motors? ===
   
<div class="mw-collapsible  mw-collapsed">
+
Yes, the STM32 MC SDK supports dual-drive motors using only one MCU.
Yes, the STM32 MC SDK supports dual drive motors using only one MCU.
 
   
''Warning:
+
{{Warning | This functionality has been temporarily removed in the STM32 MC SDK version 5.Y}}
* This functionality has been temporarily removed in the STM32 MC SDK version 5.Y''
 
</div>
 
   
 
=== Does the STM32 MC SDK provide project examples using FOC or 6-Steps control for PMSM drive? ===
 
=== Does the STM32 MC SDK provide project examples using FOC or 6-Steps control for PMSM drive? ===
   
<div class="mw-collapsible  mw-collapsed">
 
 
Yes, the STM32 MC SDK provides project examples to demonstrate FOC and 6-Steps control implementations.
 
Yes, the STM32 MC SDK provides project examples to demonstrate FOC and 6-Steps control implementations.
   
 
They are accessible from STM32 MC Workbench first page.
 
They are accessible from STM32 MC Workbench first page.
</div>
 
   
 
=== What are the new features of STM32 MC SDK version 5.Y? ===
 
=== What are the new features of STM32 MC SDK version 5.Y? ===
   
<div class="mw-collapsible  mw-collapsed">
+
The STM32 MC SDK version 5.Y is a first step in our innovative roadmap. It includes:   
STM32 MC SDK version 5.Y, is a first step in our innovative roadmap. It includes:   
+
* A new communication protocol and its associated monitoring tools, the STM32 MC motor pilot
* A new communication protocol and its associated monitoring tools, the STM32 MC Motor Pilot
+
* New algorithms such as discontinuous PWM, single shunt phase shift and overmodulation
* New algorithms like discontinuous PWM, Single shunt phase shift, Overmodulation
+
* New 6-step examples compatible with the new STM32 MC motor pilot
* New 6 step examples compatible with the new STM32 MC Motor Pilot
+
* New sensorless asynchronous motor example compatible with the new STM32 MC motor pilot
* New sensorless asynchronous motor example compatible with the new STM32 MC Motor Pilot
+
* New STSPING4 support
* New STSpinG4 support
+
* MISRA support for STM32G4 Series
* MISRA support for STM32G4 series
 
</div>
 
 
 
   
 
<noinclude>
 
<noinclude>
[[Category:Motor Control | 000]]
+
[[Category:Motor Control | 90]]
 
{{PublicationRequestId | 19720 | 04/22/2021 | CS.GREGORY}}
 
{{PublicationRequestId | 19720 | 04/22/2021 | CS.GREGORY}}
  +
{{PublicationRequestId | 23231| 15/04/2021 | }}
 
</noinclude>
 
</noinclude>