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
- STM32 MC Ecosystem ecosystem
- STM32 MC SDK Usageusage
- 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 installweb 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 STM32 MCU families implementingon 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 (STM32 MC FW) library
- Currently only the PMSM FOC control is available for all configurations
- PMSM
-
- 6-step and asynchronous motor FOC getting started
-
- examples, available within X-CUBE-MCSDK
- 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)
- STM32 MC
-
motor profiler (STM32 MC MP)
- PC tools able to measure the
-
- motor parameters automatically and to update the STM32 MC FW library, through the ST MC
-
- workbench
1.2 What are the changes Changes from previous version?[edit]
Please, referRefer to the STM32 MC SDK
Release Notesrelease 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,
- 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
- New algorithms, such as discontinuous PWM, single shunt phase shift, and overmodulation
- New
-
- 6-step examples 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.
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
- 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 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
- compliance, use
- version 5.4.6.
- If you want a well-established mature SDK version
- , use
- version 5.4.6.
- If you use an STM32F1 MCU,
- choose version 5.4.6.
- For dual-motor
- applications, use
- version 5.4.6.
However,:
- If you need new debug capabilities and dumping features to mature your application, use
- version 5.Y.
- If you are interested by
- the
- PWM, single shunt phase shift, or overmodulation feature, use
- version 5.Y.
- If you want to use the new STSPING4, use
- version 5.Y.
- For asynchronous motor
- applications, use
- version 5.Y.
1.5 What is the STM32 MC Motor Profiler tool?motor profiler[edit]
This
is atool
thatautomatically
measuremeasures the electrical parameters of PMSM motors. The
specificationcharacteristics of an electric motor may not be known and
iscan be determined in less than a minute.
The algorithm determines the motor parameters
neededrequired to configure the STM32 MC FW
librarylibrary: stator resistance
Rs;Rs, stator inductance
Ls;Ls, back EMF constant
;, motor
ionertiainertia, and friction.
Refer to the STM32
MC SDK tools documentmotor 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 Pilotmotor 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 Workbenchmotor workbench.
It is built on a brand-new communication protocol that allows
forfaster 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.
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 Startedgetting started manual (UM2374). Then, start either from
eithera motor control example project, or
fromdesign a new project
design.
Tips :
Don’t
![]() |
|
|
2.2 How to handle a project made with a previous version of the STM32 MC Workbench?workbench[edit]
The STM32 MC
Workbenchworkbench automatically migrates
automaticallyan older *.stmcx file to the current version.
Note that beforeBefore 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
tothe user application software itself, refer to "How to migrate motor control application software from STM32 MC SDK v4.3 to v5.x" (AN5143).
Tips:
![]() |
|
|
![]() |
Projects generated with STM32 MC SDK version 5.4.x cannot be reused with the new |
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 fromTwo solutions are possible:
Either- Start from a motor control application software example
- provided in the “./Projects” directory for all supported
- IDEs, IARTM,
- Keil® 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 :
Don’t
![]() |
|
|
2.4 Why does not the STM32 Motor Profiler motor profiler tool doesn’t recognize my motor?[edit]
If the STM32
Motor Profilermotor 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.
![]() |
The STM32 MC |
motor profiler has the following limitation |
: it cannot |
profile motors with |
Rs < 1 Ω |
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’tdoes not start immediately
for. The reason can be 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.
- When the
- “on-the-
- fly startup” feature is enabled
-
, this feature starts a detection phase before driving any motor:
- When the rotation is detected, it skips the
-
- startup 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
-
- .
2.6 How to choose the basic set of ramp-up parameters for a given motor?[edit]
Most of the time,
we have noticed thatsetting 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”
- 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”
- 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
runstart, fine-tune these parameters.
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 (
- for example, 30 kHz).
- Whatever the motor, a lower PWM frequency (
- for example, 16 kHz) is
- sufficient.
- Whatever the motor, check the maximum PWM frequency capability for the selected MCU.
- 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).
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).
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
fromin the following
situationsituations:
- A wrong current sensing topology is selected.
- In this case, 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.
- 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.
2.10 Why do I have a “Speed feedback” fault message during the acceleration phase and why does the motor stopsstop?[edit]
Often, thisThis 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
- . 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:
-
- Decrease the observer gain G2 by successive steps : /2, /4, /6, /8.
- 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).
- The
- startup phase ends too early.
-
The possible solutions are the following:
-
- Increase the “Consecutive successful start-up output tests” parameter (it must not be set to
-
- a value higher than 4-5);
-
- Set the “Minimum
-
- startup output speed” parameter to 15% of your maximum application speed, then
-
- decrease it
-
- progressively.
![]() |
|
|
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, thisThis fault message typically appears because
there is insufficientthe current provided to support the required speed acceleration is not sufficient.
1.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.
- Increase the
-
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
-
- startup phase more deterministic, and follow the FAQ on "Basic parameters settings for the ramp-up".
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, thisThis 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 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:
- 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.
- The reliability capture window of the estimator is too small. The possible
-
solutions are the following:
- Increase the “Speed ramp final value” parameter up to 40% of the maximum application speed
-
- .
- Decrease the “Minimum
-
- startup output speed” parameter down to 10% of the maximum application speed.
2.13 How to interface the STM32 MC Firmware firmware library?[edit]
Several motor control APIs are implemented to offer basic
interactioninteractions with the firmware library.
Please, referRefer to the
on-lineonline firmware reference information
, which contains all these details and morethat contains the below information and more:
- From the STM32 MC
- workbench menu
- : select Documentation and select Firmware Reference
- .
- From the Windows
- Startup menu: select an ST Motor Control SDK
- 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
Powerpower board range.
Of course, theThe best case is of course when the maximum current of the motor is part of the current range offered by the selected
Powerpower 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 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
- 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.
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
KpKP gain and
act onadjust the
KiKI gain (evaluating the speed regulation) to check over/
under-shootingundershooting during transients.
2.17 How to tune the PI speed regulator?[edit]
Among the possible ways, an example is described
as followsbelow:
- Run the motor and connect it to the STM32 MC
- workbench.
- Open the
- monitor mode and switch on the plotter window
- .
- 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
- with oscillations around the 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 the trend of regulated variable is too slow or not stabilize, then increase KI.
2.18 How to connect ICS with the MC FW library?[edit]
OurThe implemented ICS requires
usage on 2using two phases from a
3three-phase power supply.
The STM32 MC FW library operates only on
Phasephase U and
Phase V, this is where the user must connect each ICSphase 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]
TheFOC brings the following
benefitsbenefits:
- Better energy efficiency
- Improved responsiveness of speed control
- 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-
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.
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.
![]() |
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
- New algorithms
- such as discontinuous PWM,
- single shunt phase shift
- and overmodulation
- 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
- STSPING4 support
- MISRA support for STM32G4
- 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 |
+ | {{DISPLAYTITLE:Frequently asked questions (FAQ)}} |
__NOTOC__ |
__NOTOC__ |
||
− | This page contains some |
+ | 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''']] |
− | # [[# |
+ | # [[#Using the STM32 MC SDK|STM32 MC '''SDK usage''']] |
− | # [[# |
+ | # [[#STM32 MC SDK features|STM32 MC '''SDK features''']] |
'''Acronyms and abbreviations''' |
'''Acronyms and abbreviations''' |
||
− | * FOC = |
+ | * FOC = field oriented control (algorithm) |
− | * MC = |
+ | * MC = motor control
|
− | * PMSM = |
+ | * PMSM = permanent magnet synchronous motor
|
− | * SDK = |
+ | * SDK = software development kit
|
− | == STM32 |
+ | == STM32 motor control ecosystem == |
− | === |
+ | === 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. |
||
− | + | 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: |
|
− | + | * STM32 MC firmware (STM32 MC FW) library |
|
− | |||
− | The STM32 MC SDK is running |
||
− | * STM32 MC |
||
** Currently only the PMSM FOC control is available for all configurations |
** Currently only the PMSM FOC control is available for all configurations |
||
− | ** PMSM |
+ | ** PMSM 6-step and asynchronous motor FOC getting started examples, available within X-CUBE-MCSDK |
− | * STM32 MC |
+ | * STM32 MC workbench (STM32 MC WB) |
− | ** PC |
+ | ** 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 |
+ | * STM32 MC motor profiler (STM32 MC MP) |
− | ** PC tools able to measure the |
+ | ** PC tools able to measure the motor parameters automatically and to update the STM32 MC FW library, through the ST MC workbench
|
− | < |
+ | <br> |
− | === |
+ | === Changes from previous version === |
+ | Refer to the STM32 MC SDK release note provided with each released version. |
||
− | + | === Overview of the STM32 MC SDK version 5.Y === |
|
− | + |
The STM32 MC SDK is available in two versions of the '''X-CUBE-MCSDK''' deliverable: |
|
− | + | * STM32 MC SDK version 5.4.6, that corrects few problems of the 5.4 series. It is fully compatible with previous versions. |
|
− | |||
− | == |
||
− | |||
− | STM32 MC SDK is available in two versions of the |
||
− | * STM32 MC SDK version 5.4.6, |
||
* 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 |
+ | ** 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 |
+ | ** New 6-step examples compatible with the new STM32 MC motor pilot
|
− | ** |
+ | ** A new sensorless asynchronous motor example compatible with the new STM32 MC motor pilot
|
− | ** New |
+ | ** New STSPING4 support. |
− | The main |
+ | The main limitations of STM32 MC SDK version 5.Y are: |
− | * |
+ | * 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 |
+ | * 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. |
− | |||
− | === |
+ | === Choosing between STM32 MC SDK 5.4.6 and 5.Y versions === |
− | + | * 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 |
+ | * If you want a well-established mature SDK version, use version 5.4.6.
|
− | * If you want a well established mature SDK version |
+ | * If you use an STM32F1 MCU, choose version 5.4.6.
|
− | * If you use STM32F1, |
+ | * For dual-motor applications, use version 5.4.6.
|
− | * For dual motor |
+ |
However,: |
− | + | * 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 |
+ | * If you are interested by the PWM, single shunt phase shift, or overmodulation feature, use version 5.Y.
|
− | * If you are interested by |
+ | * If you want to use the new STSPING4, use version 5.Y.
|
− | * If you want to use the new STSPING4, use |
+ | * For asynchronous motor applications, use version 5.Y.
|
− | * For asynchronous motor |
||
− | |||
− | === |
+ | === 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. |
||
− | < |
+ |
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. |
− | |||
− | + |
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]). |
|
− | + | === 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. |
||
− | + | It is built on a brand-new communication protocol that allows faster and more reliable 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. |
|
− | + | == Using the STM32 MC SDK ==
|
|
− | |||
− | + | === 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. |
||
− | + | {{Info | |
|
− | + |
* Do not forget to create and save your project into your dedicated working directory.}}
|
|
− | == STM32 MC |
+ | === How to handle a project made with a previous version of the STM32 MC workbench === |
− | + |
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).
|
|
− | + |
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]). |
|
− | |||
− | + | {{Info | |
|
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* Get a copy of all your original files. |
* Get a copy of all your original files. |
||
− | * |
+ | * 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 5.Y version.}} |
|
− | < |
+ |
=== How to get a project framework for a particular IDE (such as IAR<sup>TM</sup> or Keil<sup>®</sup>) === |
− | |||
− | + |
Two solutions are possible: |
|
− | + |
* 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. |
||
− | + | {{Info | |
|
− | * |
+ | * Do not forget to create and save your project into a dedicated working directory.}}
|
− | |||
− | === Why the STM32 |
+ | === 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: |
|
− | If the STM32 |
+ | * 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 | 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.}}
|
|
− | |||
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]]. |
||
− | + | === Why does not my motor start immediately? === |
|
− | |||
− | === Why does my motor |
||
− | + | 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 |
+ | # 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 |
+ | # When the “on-the-fly startup” feature is enabled, this feature starts a detection phase before driving any motor: |
− | # When the |
+ |
#* 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 |
+ |
#* When no rotation is detected, it launches the startup phase, such as alignment or ramp-up.
|
− | * When |
||
− | |||
− | === 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 === |
− | + | Most of the time, setting the ramp-up parameters as follows ensures a correct start of the motor: |
|
− | Most of the 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” |
+ | * 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” |
+ | * 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 |
+ | After a first successful start, fine-tune these parameters. |
[[File:DriveManagement_StartUp-Parameters1.png|center]] |
[[File:DriveManagement_StartUp-Parameters1.png|center]] |
||
− | |||
− | === How to choose the PWM frequency and the FOC execution rate |
+ | === How to choose the PWM frequency and the FOC execution rate === |
− | + | 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 |
||
− | * |
+ | * For high-speed or low-inductance motors, use a high PWM frequency (for example, 30 kHz). |
− | * |
+ | * Whatever the motor, a lower PWM frequency (for example, 16 kHz) is sufficient. |
− | * |
+ | * Whatever the motor, check the maximum PWM frequency capability for the selected MCU. |
− | * |
+ | * 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). |
− | |||
− | === Why do I have an “FOC duration” fault message and the motor |
+ | === Why do I have an “FOC duration” fault message and the motor does not even try to start? === |
− | |||
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 |
+ | 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]] |
||
− | |||
=== 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? === |
||
− | + | This fault message appears in the following situations: |
|
− | This fault message appears |
+ | # 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. |
+ | # A wrong current sensing parameter is set. To solve this issue, check and correct the current sensing parameters. [[File:PowerStage_CurrentSensing.png|center]] |
− | # A |
+ | # 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 |
||
[[File:DriveManagement_DriveSettings2.png|center]] |
[[File:DriveManagement_DriveSettings2.png|center]] |
||
− | |||
− | === Why do I have a “Speed feedback” fault message during the acceleration phase and the motor |
+ | === Why do I have a “Speed feedback” fault message during the acceleration phase and why does the motor stop? === |
− | + |
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. |
|
− | |||
− | + |
# 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: |
|
− | * |
+ |
#*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). |
− | + |
#The startup phase ends too early. The possible solutions are the following: |
|
− | + |
#*Increase the “Consecutive successful start-up output tests” parameter (it must not be set to a value higher than 4-5); |
|
− | * |
+ |
#*Set the “Minimum startup output speed” parameter to 15% of your maximum application speed, then decrease it progressively. |
− | * |
||
[[File:DriveManagement_StartUp-Parameters2.png|center]] |
[[File:DriveManagement_StartUp-Parameters2.png|center]] |
||
− | + | {{Info | |
|
− | * Smooth the speed variation between the “Minimum |
+ | * Smooth the speed variation between the “Minimum startup output speed” and the “Speed ramp final value” by adjusting the “Speed ramp duration”.}}
|
− | |||
− | === Why do I have a |
+ | === Why do I have a “Startup failure” error message during the rev-up phase and why does the motor stop? === |
− | + |
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:
|
|
− | + |
#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. |
|
− | + |
# Increase the 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 startup 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]] |
||
− | |||
− | === Why do I have a |
+ | === Why do I have a “Startup failure” error message during the acceleration following the rev-up phase and the motor stop? === |
− | + |
This fault message often appears following an abrupt torque variations demand at the end of the startup 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: |
|
− | + |
#* 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 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 “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. |
− | |||
− | |||
− | |||
[[File:DriveManagement_StartUp-Parameters4.png|center]] |
[[File:DriveManagement_StartUp-Parameters4.png|center]] |
||
− | |||
− | === How to interface the STM32 MC |
+ | === How to interface the STM32 MC firmware library === |
− | + | Several motor control APIs are implemented to offer basic interactions with the firmware library. |
|
− | Several motor control APIs are implemented to offer basic |
||
− | + |
Refer to the online firmware reference information that contains the below information and more: |
|
− | * From the STM32 MC |
+ | * From the STM32 MC workbench menu: select Documentation and select Firmware Reference.
|
− | * From the Windows |
+ | * From the Windows Startup menu: select an ST Motor Control SDK and open the corresponding reference manual. |
− | |||
− | === How to choose the hardware |
+ | === How to choose the hardware power board === |
− | + | 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 |
||
− | As a consequence, the motor spin must adapted to the selected |
+ | As a consequence, the motor spin must be adapted to the selected power board range. |
− | + |
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. |
|
− | |||
− | === How to debug a motor control application |
+ | === How to debug a motor control application === |
− | + | 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 |
||
− | The reason is that during the break, |
+ | 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 |
+ | * 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 |
+ | * 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]] |
||
− | |||
− | === How to make the current more sinusoidal when the motor spins |
+ | === How to make the current more sinusoidal when the motor spins === |
− | |||
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 |
+ | Decrease the KP gain and adjust the KI gain (evaluating the speed regulation) to check over/undershooting during transients. |
− | |||
− | === How to tune the PI speed regulator |
+ | === How to tune the PI speed regulator === |
− | + | Among the possible ways, an example is described below: |
|
− | Among the possible ways, an example is described |
+ | # Run the motor and connect it to the STM32 MC workbench.
|
− | # Run the motor and connect it to the STM32 MC |
+ | # Open the monitor mode and switch on the plotter window.
|
− | # Open the |
+ | # 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 |
+ |
#* If the regulated variable oscillates around a value, decrease KI or increase KP. |
− | * If regulated variable oscillates around a value, |
+ |
#* 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]] |
||
− | |||
− | === How to connect ICS with the MC FW library |
+ | === How to connect ICS with the MC FW library === |
− | + |
The implemented ICS requires using two phases from a three-phase power supply. |
|
− | |||
− | The STM32 MC FW library operates only on |
+ | The STM32 MC FW library operates only on phase U and phase V. Connect each ICS to these phases. |
− | |||
− | === Why |
+ | === Why using FOC as opposed to 6-step control for PMSM drive? === |
− | + | FOC brings the following benefits: |
|
− | + | * Better energy efficiency |
|
− | * Better energy efficiency |
+ | * Improved responsiveness of speed control |
− | * |
+ | * Accurate positioning control |
− | * |
+ | * Lower acoustic noise |
− | * Lower acoustic noise |
||
− | |||
− | === Why |
+ | === Why using 3-shunt as opposed to a 1-shunt resistor implementation for current measurement? === |
− | + | Using the 1-shunt implementation for measurement is the cheapest solution. |
|
− | Using the 1- |
||
− | However, some |
+ | However, some motors (such as low-inductance motors) require current measurements on two phases simultaneously. Only the 3-shunt implementation manages this configuration. |
− | |||
== 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? === |
||
− | |||
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. |
||
− | |||
=== Does the STM32 MC SDK support dual drive motors? === |
=== Does the STM32 MC SDK support dual drive motors? === |
||
− | + | 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 | This functionality has been temporarily removed in the STM32 MC SDK version 5.Y}}
|
|
− | |||
− | |||
=== 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? === |
||
− | |||
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. |
||
− | |||
=== What are the new features of STM32 MC SDK version 5.Y? === |
=== What are the new features of STM32 MC SDK version 5.Y? === |
||
− | + |
The STM32 MC SDK version 5.Y is a first step in our innovative roadmap. It includes: |
|
− | STM32 MC SDK version 5.Y |
+ | * 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 |
+ | * New algorithms such as discontinuous PWM, single shunt phase shift and overmodulation
|
− | * New algorithms |
+ | * New 6-step examples compatible with the new STM32 MC motor pilot
|
− | * New 6 step examples compatible with the new STM32 MC |
+ | * New sensorless asynchronous motor example compatible with the new STM32 MC motor pilot
|
− | * New sensorless asynchronous motor example compatible with the new STM32 MC |
+ | * New STSPING4 support |
− | * New |
+ | * MISRA support for STM32G4 Series
|
− | * MISRA support for STM32G4 |
||
− | |||
− | |||
<noinclude> |
<noinclude> |
||
− | [[Category:Motor Control | |
+ | [[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> |