Difference between revisions of "STM32MotorControl:SDK AC induction motor"

[unchecked revision] [quality revision]
m (Undo revision 11994 by Laurent Capella (talk))
(Tag: Undo)
m
 


1 Introduction[edit]

The demonstration firmware example projects for ACIM shows how the STM32 MC SDK can be used to drive an asynchronous induction motor (ACIM) in field-oriented control (FOC) using a sensorless state observer algorithm to estimate the electrical and mechanical speed and position of the rotor and the rotor flux, or in V/F open-loop sensorless mode.

The provided application examples are intended to be used in a system composed of the NUCLEO-G431RB and the STEVAL-IHM023V3 boards, connected with the X-NUCLEO-IHM09M1 expansion board.

2 Main features[edit]

  • STM32 G4 Support of induction motors.
  • Vector control algorithms:
    • Self-sensing Field Oriented Control (LSO-FOC) (Sensorless)
  • Scalar control algorithms:
    • Open Loop V/f
  • API function available to send the application commands to the motor driver using the STM32 MC motor pilot tool.
  • PC GUI for firmware project update and dedicated induction motor parameters settings (ACIM GUI).

3 Hardware and Software setup[edit]

3.1 Hardware prerequisites[edit]

  • 1x High voltage 3 phase motor driver board: (STEVAL-IHM023V3),
  • 1x STM32 Nucleo development board: (NUCLEO-G431RB),
  • 1x Motor control connector expansion board: (X-NUCLEO-IHM09M1),
  • 1x DC power supply (max 400 Vdc),
  • 1x USB type A to mini-B USB cable,
  • 1x 3-Phase ACIM up to 1 kW.
STEVAL-IHM023V3
NUCLEO-G431RB
NUCLEO-IHM09M1


3.2 Software prerequisites[edit]

  • X-CUBE-MCSDK version 5.Y.0 or later
  • STM32 MC Motor Control Workbench 5.Y.0 or later
    • Only for the first example project generation.
  • STM32CubeMx, version 6.2.0 or later
  • STM32Cube MCU Package for STM32G4 Series, version 1.3.0 or later
  • STM32 MC motor pilot v1.0 or later.
  • STSW-LINK009: ST-LINK/V2-1 USB driver,
  • STSW-LINK004: STM32 ST-LINK utility,
    • Only to update ST-LINK firmware to the last version.
  • A Windows PC with the supported development toolchain:
    • IAR Embedded Workbench IDE – ARM

For more information, refer to the related documentation on STMicroelectronics website[1].

3.3 Field Oriented Control FW example for Induction Motors[edit]

3.3.1 Hardware configuration[edit]

  1. NUCLEO-G431RB
    1. Remove SB6. This disables LD2 but allows the use of DAC Ch2 on the PA5 pin for tuning or debugging.
    2. If the Nucleo board is powered by USB during the motor test with JP5 fitting pin 1 and 2, and in case of encoder sensor usage, connect a DC voltage source (7 to 12 V) on the VIN pin to provide the required E5V voltage to the MC_25 pin of the motor-control connector. For more information, refer to UM1724.
  2. X-NUCLEO-IHM09M1
    1. Remove R2, R3, R13, R18 R21, R22, R23 resistors.
  3. Stack the X-NUCLEO-IHM09M1 on the STM32 Nucleo board using the ST morpho-connector.
  4. Connect the X-NUCLEO-IHM09M1 to the STEVAL-IHM023V3 using the Motor control connector.
  5. Connect the STM32 Nucleo board to the PC through the USB cable.
  6. STEVAL-IHM023V3
    1. Set jumpers W1, W3, W5, W11 in 2-3 position
    2. Set jumpers W9 and W13 in 3Sh position
    3. Set jumper W14 Open
    4. Set jumper W10 Closed
    5. Check the board's user manual (UM1823) for more details.

3.3.2 How to use the STM32 MC firmware examples[edit]

  1. Open the related example files with the STM32 MC Workbench program:
    • ACIM-NUCLEOG431RB-IHM023V3-VF_OL.stmcx, or
    • ACIM-NUCLEOG431RB-IHM023V3-LSO_FOC.stmcx
  2. Save the file into another empty working folder. BEWARE: do not change the name of the .stmcx file, otherwise, the example will not work properly;
  3. Click on the Tool->Generation menu item. This pops up a dialog window that let the user select various parameters:
    • Select version 6.2.0 or later for STM32CubeMX;
    • Select your installed IDE version for IAR EWARM;
    • Select STM32 FW V1.3.0 or later for the Firmware Package version;
    • Make sure to check the box about the HAL usage for the Drive Type.
    • Then, click on the UPDATE button.
  4. It is possible to configure further the generated project (for instance adjusting the motor parameters or the coefficients of the regulators) using the ACIMGUI present in the installation folder, under \Utilities\PC_Software\ACIMGUI.
  5. Once launched the ACIMGUI you have to select the .acimx file present in the generated project folder. According to the application needs, modify the parameters in the GUI and click the "update" project button.
    • Do not use the STM32 MC WB anymore to generate the FW configuration, use instead the ACIMGUI.
  6. Open the generated project with the selected IDE;
  7. Build the project and load the resulting binary image into your MCU board;
  8. Reset your MCU board;
  9. Run the example
    • Use the BLUE button on the board to start and stop the motor.
    • Alternatively, the ST motor pilot.

The ACIM GUI therefore carries out the following tasks:

  • Tuning of the PI controllers used by the motor control firmware.
  • Update of the firmware project.

The next pages will explain how to use the ACIM GUI and the STM32 MC motor pilot, respectively, to configure the firmware, send commands to the motor, and perform the debug of the solution.

4 How to use the software tools[edit]

4.1 ACIM GUI[edit]

4.1.1 V/f Open loop mode[edit]

STM32 MC image007.jpg
  1. The ACIM Mode dropdown menu helps to identify the main configuration of the ACIM firmware example. In this case MAIN_VF_OL mode. Do not change it. If you require to change this configuration, select the correct example project in the STM32 MC Workbench and generate a new working folder.
  2. Set the required parameters. (see Note 1)
  3. Save the project. Do not change the destination folder or filename.
  4. Click the Generate button.


Note 1:

  • Ensure to avoid inserting letters in the numerical fields or not valid values, due to typing errors, to avoid undesired behavior of the motor and/or the hardware. The ACIMGUI does not perform any validity check on the inserted values.


4.1.2 Luenberger State Observer - Field Oriented Control (LSO-FOC) mode (without speed sensor)[edit]

STM32 MC image010.jpg
  1. The ACIM Mode dropdown menu helps to identify the main configuration of the ACIM firmware example. In this case MAIN_LSO_FOC mode. Do not change it. If you require to change this configuration, select the correct example project in the ST MC Workbench and generate a new working folder.
  2. Set the required parameters. (see note 4)
  3. Refer to Appendix A of this document to have more info about the measure of some parameters.
  4. Save the project. Do not change the destination folder or filename.
  5. Click on the Generate command.
  6. The project will be updated with the correct values of the gains (Kp and Ki) of the speed and current PI regulators.
  • If the user intends to modify manually the gains can select the Manual Edit checkbox and adjust their value.
  • In this case, make sure the divisors are a power of 2 to avoid compiling errors of the FW.


Note 4:

  • Ensure to avoid inserting letters in the numerical fields or not valid values, due to typing errors, to avoid undesired behavior of the motor and/or the hardware. The ACIM GUI does not perform any validity check on the inserted values.

4.1.3 Information about the parameter to be inserted[edit]

STM32 MC image011.png
  • Pole pairs is the number of rotor electromagnetic pole pairs.
  • Rr is the rotor phase resistance expressed in Ohm.
  • Rs is the stator phase resistance expressed in Ohm.
  • Lls is the stator phase leakage inductance expressed in Henry.
  • Llr is the rotor phase leakage inductance expressed in Henry.
  • Lms is the rotor phase magnetizing inductance expressed in Henry.
  • In is the rated nominal phase motor current expressed in amperes RMS.
  • Im is the magnetizing phase current that corresponds to the no-load test phase current. In the case of FOC, it is the value fixed for Id current. It is expressed in amperes RMS.
  • Vn is the rated phase to neutral voltage expressed in volts RMS.
  • Fn is the rated motor frequency expressed in Hz.


STM32 MC image012.jpg
  • PWM frequency is the frequency of gate signals and of the high-frequency task, which manages the electromagnetic field angle computation and the duty cycle computation.
  • Validation Tick is the number of consecutive Speed Loop task ticks when the measured Id current is into the [Low BW limit, UP BW limit] bandwidth. It is used at any startup to magnetize the motor before generating torque.
  • Low BW limit and UP BW limit are the bandwidth limits and they are expressed in %


STM32 MC image013.jpg
  • Execution frequency of speed regulator section is the frequency of Medium Frequency task that manages the motor control state machine and then the speed loop execution.


STM32 MC image014.jpg
  • LSO gain is the empiric value to set to guarantee the stability of the LSO (between 1-1.5)


STM32 MC image015.jpg
  • Target Speed is the default value that the speed control will take into account at the first Start Motor command; in this case, the user has not previously executed the Exec ramp command. (For more details of STM32 MC WB monitor window commands, refer to the dedicated slides of this document).
  • Max Speed is the maximum mechanical speed that FW will allow to set as target speed. It can be chosen considering the minimum value between the maximum motor speed and the maximum speed readable by the sensor; or simply considering the max application speed, if it is not higher than the motor and sensor max velocity.
  • Inertia is the rotor + load inertia coefficient.
  • Friction is the rotor + load friction coefficient.



STM32 MC image018.jpg

Kf (Vrms/Hz) Flux constant is the value of the flux maintained constant during the V/f control. The user can calculate it by dividing the nominal phase peak voltage by nominal frequency. If necessary, he can adjust to find the best value that provides the maximum torque with the maximum speed range according to the user’s application. Voltage offset is the peak value of voltage used to compensate the voltage drop on the stator winding at a very low frequency. (Below the Min Frequency). Min Frequency is used to fix the Voltage offset if the applied frequency is below the threshold.


STM32 MC image019.jpg

The Bandwidth field is the PI regulator bandwidth used for its tuning. High values increase the reactivity of the regulator but can introduce noise and fast oscillation on the controlled quantity.


4.2 Real time comunication[edit]

4.2.1 ST motor pilot[edit]

Starting from the MCSDK 5.Y.0 version, the serial communication between the motor control firmware and the PC is managed with the STM32 MC motor pilot program.

The ACIM firmware examples are configured to use the STM32 MC motor pilot to send the basic commands like start and stop, set target speed, visualization, and clearing of fault conditions.

5 Appendix A - How to measure the motor electrical parameters with standard tests[edit]

5.1 Measurement setup[edit]

STM32 MC image028.png

5.2 Electrical model of the motor at steady state[edit]

Figure 2 - Single-phase equivalent circuit referred to the stator of a 3-Phase IM
STM32 MC image030.png


Where:

Parameter Comment
R_s (Ω) Stator phase winding resistance
L_ls (H) Stator Leakage inductance
R_Fe (Ω) Equivalent iron loss resistance
L_ms(H) Magnetizing inductance
L_lr^'(H) Rotor leakage inductance referred to stator
R_r^'(Ω) Equivalent rotor phase resistance
Φ_n(Wb) Nominal magnetizing flux

5.3 DC Test[edit]

During the DC test, a continuous electromagnetic field is generated. It means the equivalent impedance of the motor is resistive and only the stator has to be considered.

It consists of measuring the resistance between two stator windings with a multimeter.

STM32 MC image029.jpg
STM32 MC image030.png


5.4 No-Load test – Rotating test[edit]

No-load: slip s = 0 (ωre ≅ ωe)

STM32 MC image038.jpg

Since I0 is equal to the magnetizing current, it is lower than the nominal current. In, the voltage drop on the Rs and Ls parameters is negligible concerning the nominal phase voltage, Vn. It is so possible to consider the following equivalent circuit:

STM32 MC image040.jpg

The term R_Fe represent the iron-losses and its value is higher than the magnetizing impedance module, Z_m= ω_e L_ms, so it is reasonable to consider, I_(m, RMS)≅ I_(0, RMS)


5.5 Blocked-Rotor test[edit]

The rotor is mechanically blocked: slip s = 1 (ωre = 0)

Since I_br is equal to I_n and is higher than the magnetizing current (no-load current), I_br, (I_br >> I_m) the magnetizing branch is negligible in respect of the series one. It is so possible to consider the following equivalent circuit:

STM32 MC image053.jpg


6 Appendix B - Block diagrams and principles about the implemented ACIM control methods[edit]

6.1 Legend of symbols[edit]

  • fe = stator frequency, Hz
  • ωe = stator pulsation, rad/s
  • ωre = rotor electrical pulsation, rad/s
  • ωslip = slip pulsation, rad/s
  • n*r = mech. target speed, rpm
  • nr,fbk = mech. target speed, rpm
  • τr = Lr/Rr = electrical rotor time constant, s
  • I*qd = q-d reference frame reference current vector
  • Iqd,fbk = q-d reference frame measured current vector
  • Vqd = q-d reference frame voltage vector
  • Vαβ = α-β reference frame voltage vector
  • θλr = rotor flux position

6.2 Constant airgap flux operation - V/f[edit]

6.2.1 Open loop block diagram[edit]

Figure 3 - Torque-speed curves at constant V/f ratio
STM32 MC image059.png

Advantages

  • Simple control.
  • No speed sensors.
  • Motor electrical model not required.

Drawback and Limitations

  • Low efficiency.
  • Low control dynamics.
  • No speed control.


STM32 MC image060.jpg
  • Although the stable region curve slope remains constant, maintaining the V/f = const., an increase/decrease of the mechanical load causes a variation of the rotor speed (modifying the slip frequency to provide the required torque).


6.3 Field Oriented control[edit]

6.3.1 Luenberger State Observer–FOC (LSO-FOC) – solution without speed sensor[edit]

STM32 MC image066.jpg

Advantages

  • High efficiency.
  • High control dynamics.
  • Speed sensor not required both for rotor flux position estimation and for speed loop execution.

Drawback and Limitations

  • Motor electrical model is required.
  • Motor parameters variation dependency (i.e. variation of resistances with the temperature) badly affecting the efficiency and/or the speed estimation accuracy.
  • Complexity of estimator model.
  • Empiric setting of the observer gain.

7 References[edit]



{{DISPLAYTITLE: STM32 MC SDK AC Induction Motor (new in V5.Y)}}

== Introduction ==

The demonstration firmware example projects for ACIM shows how the STM32 MC SDK can be used to drive an asynchronous induction motor (ACIM) in field-oriented control (FOC) using a sensorless state observer algorithm to estimate the electrical and mechanical speed and position of the rotor and the rotor flux, or in V/F open-loop sensorless mode.

The provided application examples are intended to be used in a system composed of the NUCLEO-G431RB and the STEVAL-IHM023V3 boards, connected with the X-NUCLEO-IHM09M1 expansion board.

== Main features ==

* STM32 G4 Support of induction motors.
* Vector control algorithms:<!-- ** Field Oriented Control with speed sensor (I-FOC) -->

** Self-sensing Field Oriented Control (LSO-FOC) (Sensorless)
* Scalar control algorithms:
** Open Loop V/f<!-- ** Closed Loop V/f -->

* API function available to send the application commands to the motor driver using the STM32 MC motor pilot tool.
* PC GUI for firmware project update and dedicated induction motor parameters settings ('''ACIM GUI''').

== Hardware and Software setup ==

=== Hardware prerequisites ===

* 1x High voltage 3 phase motor driver board: ('''STEVAL-IHM023V3'''),
* 1x STM32 Nucleo development board: ('''NUCLEO-G431RB'''),
* 1x Motor control connector expansion board: ('''X-NUCLEO-IHM09M1'''),
* 1x  DC power supply (max 400 Vdc),
* 1x  USB type A to mini-B USB cable,
* 1x 3-Phase ACIM up to 1 kW.

[[file:STEVAL-IHM023V3.jpg|frame|center|STEVAL-IHM023V3]]
[[file:STM32_MC_image004.jpg|frame|left|NUCLEO-G431RB]]
[[file:STM32_MC_image006.png|frame|right|NUCLEO-IHM09M1]]
<br clear=all>


=== Software prerequisites ===

* X-CUBE-MCSDK version 5.Y.0 or later
* STM32 MC Motor Control Workbench 5.Y.0 or later
** Only for the first example project generation.
* STM32CubeMx, version 6.2.0 or later
* STM32Cube MCU Package for STM32G4 Series, version 1.3.0 or later
* STM32 MC motor pilot v1.0 or later.
* STSW-LINK009: ST-LINK/V2-1 USB driver,
* STSW-LINK004: STM32 ST-LINK utility,
** Only to update ST-LINK firmware to the last version.
* A Windows PC with the supported development toolchain:
** IAR Embedded Workbench IDE – ARM

For more information, refer to the related documentation on  STMicroelectronics website<ref>[http://www.st.com STMicroelectronics website]</ref>.

=== Field Oriented Control FW example for Induction Motors ===

==== Hardware configuration  ====

# NUCLEO-G431RB
##Remove SB6. This disables LD2 but allows the use of DAC Ch2 on the PA5 pin for tuning or debugging.
## If the Nucleo board is powered by USB during the motor test with JP5 fitting pin 1 and 2, and in case of encoder sensor usage, connect a DC voltage source (7 to 12 V) on the VIN pin to provide the required E5V voltage to the MC_25 pin of the motor-control connector. For more information, refer to UM1724.
# X-NUCLEO-IHM09M1
## Remove R2, R3, R13, R18 R21, R22, R23 resistors.
# Stack the X-NUCLEO-IHM09M1 on the STM32 Nucleo board using the ST morpho-connector.
#  Connect the X-NUCLEO-IHM09M1 to the STEVAL-IHM023V3 using the Motor control connector.
#  Connect the STM32 Nucleo board to the PC through the USB cable.
#  STEVAL-IHM023V3 
## Set jumpers W1, W3, W5, W11 in 2-3 position
## Set jumpers W9 and W13 in 3Sh position
## Set jumper W14 Open
## Set jumper W10 Closed 
## Check the board's user manual (UM1823) for more details.

==== How to use the STM32 MC firmware examples ====

# Open the related example files with the STM32 MC Workbench program:
#* ''ACIM-NUCLEOG431RB-IHM023V3-VF_OL.stmcx'', or
#* ''ACIM-NUCLEOG431RB-IHM023V3-LSO_FOC.stmcx'' 
#Save the file into another empty working folder. '''BEWARE: do not change the name of the .stmcx file, otherwise, the example will not work properly''';
# Click on the Tool->Generation menu item. This pops up a dialog window that let the user select various parameters:
#* Select version 6.2.0 or later for STM32CubeMX;
#* Select your installed IDE version for IAR EWARM;
#* Select STM32 FW V1.3.0 or later for the Firmware Package version;
#* Make sure to check the box about the HAL usage for the Drive Type.
#* Then, click on the '''UPDATE''' button.
# It is possible to configure further the generated project (for instance adjusting the motor parameters or the coefficients of the regulators) using the ACIMGUI present in the installation folder, under ''\Utilities\PC_Software\ACIMGUI''.
# Once launched the ACIMGUI you have to select the .acimx file present in the generated project folder. According to the application needs, modify the parameters in the GUI and click the "update" project button.
#* '''Do not use the STM32 MC WB''' anymore to generate the FW configuration, use instead the ACIMGUI.
# Open the generated project with the selected IDE;
# Build the project and load the resulting binary image into your MCU board;
# Reset your MCU board;
# Run the example
#* Use the BLUE button on the board to start and stop the motor.
#* Alternatively, the ST motor pilot.

The '''ACIM GUI''' therefore carries out the following tasks:
* Tuning of the PI controllers used by the motor control firmware.
* Update of the firmware project.
The next pages will explain how to use the '''ACIM GUI''' and the STM32 MC motor pilot, respectively, to configure the firmware, send commands to the motor, and perform the debug of the solution.

== How to use the software tools ==

=== ACIM GUI ===

==== V/f Open loop mode ====

[[file:STM32_MC_image007.jpg|left]]

# The ACIM Mode dropdown menu helps to identify the main configuration of the ACIM firmware example. In this case '''MAIN_VF_OL''' mode. '''Do not change it.''' If you require to change this configuration, select the correct example project in the STM32 MC Workbench and generate a new working folder. 
# Set the required parameters. (see Note 1)
# Save the project. '''Do not change the destination folder or filename.''' 
# Click the Generate button. 
<br clear=all>

Note 1:
* Ensure to avoid inserting letters in the numerical fields or not valid values, due to typing errors, to avoid undesired behavior of the motor and/or the hardware. The ACIMGUI does not perform any validity check on the inserted values.
<!--==== V/f closed loop mode ====

[[file:STM32_MC_image008.jpg|left]]

# Select the '''MAIN_VF_CL''' mode from the ACIM mode menu.
# Set the required parameters. (see Note 2)
# Refer to the Appendix A of this document to have more information about the measure of some parameters.
# Save the project (Optional) in a user folder to load it in the future.
# Click on the Generate command. 
# The header (.h) file generated will contain also the value of the gains (Kp and Ki) of the speed PI regulator.
* If the user intends to modify manually the gains can select the Manual Edit checkbox and adjust their value.
<br clear=all>
Note 2:
* Ensure to avoid inserting letters in the numerical fields or not valid values, due to typing errors, to avoid undesired behavior of the motor and/or the hardware. The ACIM GUI does not perform any validity check on the inserted values.-->
<!--==== Indirect Field Oriented Control (IFOC) mode (with speed sensor) ====

[[file:STM32_MC_image009.jpg|left]]

# Select the MAIN_IFOC mode from the ACIM mode menu.
# Set the required parameters. (see Note 3)
# Refer to the Appendix A of this document to have more information about the measure of some parameters.
# Save the project (Optional) in a user folder to load it in the future.
# Click on the Generate command.
# The header (.h) file generated will contain also the value of the gains (Kp and Ki) of the speed and current PI regulators.
* If the user intends to modify manually the gains can select the Manual Edit checkbox and adjust their value.
* In this case, make sure the divisors are a power of 2 to avoid compiling errors of the FW.
<br clear=all>
Note 3:
* Ensure to avoid inserting letters in the numerical fields or not valid values, due to typing errors, to avoid undesired behavior of the motor and/or the hardware. The ACIMGUI does not perform any validity check on the inserted values.-->

==== Luenberger State Observer - Field Oriented Control (LSO-FOC) mode (without speed sensor) ====

[[file:STM32_MC_image010.jpg|left]]

# The ACIM Mode dropdown menu helps to identify the main configuration of the ACIM firmware example. In this case '''MAIN_LSO_FOC''' mode. '''Do not change it.''' If you require to change this configuration, select the correct example project in the ST MC Workbench and generate a new working folder.
# Set the required parameters. (see note 4)
# Refer to Appendix A of this document to have more info about the measure of some parameters.
# Save the project.  '''Do not change the destination folder or filename.''' 
# Click on the Generate command.
# The project will be updated with the correct values of the gains (Kp and Ki) of the speed and current PI regulators.
* If the user intends to modify manually the gains can select the Manual Edit checkbox and adjust their value. 
* In this case, make sure the divisors are a power of 2 to avoid compiling errors of the FW.
<br clear=all>

Note 4:
* Ensure to avoid inserting letters in the numerical fields or not valid values, due to typing errors, to avoid undesired behavior of the motor and/or the hardware. The ACIM GUI does not perform any validity check on the inserted values.

==== Information about the parameter to be inserted ====

[[file:STM32_MC_image011.png|left]]

* '''Pole pairs''' is the number of rotor electromagnetic pole pairs. 
* '''Rr''' is the rotor phase resistance expressed in Ohm. 
* '''Rs''' is the stator phase resistance expressed in Ohm. 
* '''Lls''' is the stator phase leakage inductance expressed in Henry. 
* '''Llr''' is the rotor phase leakage inductance expressed in Henry. 
* '''Lms''' is the rotor phase magnetizing inductance expressed in Henry. 
* '''In''' is the rated nominal phase motor current expressed in amperes RMS. 
* '''Im''' is the magnetizing phase current that corresponds to the no-load test phase current. In the case of FOC, it is the value fixed for Id current. It is expressed in amperes RMS. 
* '''Vn''' is the rated phase to neutral voltage expressed in volts RMS. 
* '''Fn''' is the rated motor frequency expressed in Hz. 
<br clear=all>

[[file:STM32_MC_image012.jpg|left]]

* '''PWM frequency''' is the frequency of gate signals and of the high-frequency task, which manages the electromagnetic field angle computation and the duty cycle computation.
* '''Validation Tick''' is the number of consecutive Speed Loop task ticks when the measured Id current is into the [Low BW limit, UP BW limit] bandwidth. It is used at any startup to magnetize the motor before generating torque.
* '''Low BW''' limit and UP BW limit are the bandwidth limits and they are expressed in %
<br clear=all>

[[file:STM32_MC_image013.jpg|left]]

* '''Execution frequency''' of speed regulator section is the frequency of Medium Frequency task that manages the motor control state machine and then the speed loop execution.
<br clear=all>

[[file:STM32_MC_image014.jpg|left]]

* '''LSO gain''' is the empiric value to set to guarantee the stability of the LSO (between 1-1.5) 
<br clear=all>

[[file:STM32_MC_image015.jpg|left]]

* '''Target Speed''' is the default value that the speed control will take into account at the first Start Motor command; in this case, the user has not previously executed the Exec ramp command. (For more details of STM32 MC WB monitor window commands, refer to the dedicated slides of this document).
* '''Max Speed''' is the maximum mechanical speed that FW will allow to set as target speed. It can be chosen considering the minimum value between the maximum motor speed and the maximum speed readable by the sensor; or simply considering the max application speed, if it is not higher than the motor and sensor max velocity.

* '''Inertia''' is the rotor + load inertia coefficient.
* '''Friction''' is the rotor + load friction coefficient.
<br clear=all>
<!--[[file:STM32_MC_image017.jpg|left]]

'''Encored PPR''' is the Pulses Per mechanical Revolution.
'''Encoder inv. dir.''' inverts the sign of the measured speed. The user has to choose the state of this checkbox to match the sign convention of the encoder with the firmware’s one, according to the motor phases connection.-->

<br clear=all>

[[file:STM32_MC_image018.jpg|left]]

'''Kf (Vrms/Hz)''' Flux constant is the value of the flux maintained constant during the V/f control. The user can calculate it by dividing the nominal phase peak voltage by nominal frequency. If necessary, he can adjust to find the best value that provides the maximum torque with the maximum speed range according to the user’s application. 
'''Voltage offset''' is the peak value of voltage used to compensate the voltage drop on the stator winding at a very low frequency. (Below the Min Frequency). 
'''Min Frequency''' is used to fix the Voltage offset if the applied frequency is below the threshold.
<br clear=all>

[[file:STM32_MC_image019.jpg|left]]

The '''Bandwidth''' field is the PI regulator bandwidth used for its tuning. High values increase the reactivity of the regulator but can introduce noise and fast oscillation on the controlled quantity.
<br clear=all>


=== Real time comunication ===

==== ST motor pilot ====

Starting from the MCSDK 5.Y.0 version, the serial communication between the motor control firmware and the PC is managed with the STM32 MC motor pilot program.

The ACIM firmware examples are configured to use the STM32 MC motor pilot to send the basic commands like start and stop, set target speed, visualization, and clearing of fault conditions.

== Appendix A - How to measure the motor electrical parameters with standard tests ==

=== Measurement setup ===

[[file:STM32_MC_image028.png|frame|center]]

=== Electrical model of the motor at steady state ===

[[file:STM32_MC_image029.jpg|left|Figure 2 - Single-phase equivalent circuit referred to the stator of a 3-Phase IM]]
[[file:STM32_MC_image030.png|125px|right]]
<br clear=all>
 Where:
{|
|-
! Parameter  !! Comment
|-
| R_s (Ω) || Stator phase winding resistance
|-
| L_ls (H) || Stator Leakage inductance 
|-
| R_Fe (Ω) || Equivalent iron loss resistance 
|-
| L_ms(H) || Magnetizing inductance
|-
| L_lr^'(H) || Rotor leakage inductance referred to stator 
|-
| R_r^'(Ω) || Equivalent rotor phase resistance
|-
| Φ_n(Wb) || Nominal magnetizing flux
|}

=== DC Test ===

During the DC test, a continuous electromagnetic field is generated. It means the equivalent impedance of the motor is resistive and only the stator has to be considered.

It consists of measuring the resistance between two stator windings with a multimeter.

[[file:STM32_MC_image029.jpg|left]]
[[file:STM32_MC_image030.png|125px|right]]
<br clear=all>

=== No-Load test – Rotating test ===

No-load: slip s = 0 (ωre ≅ ωe)

[[file:STM32_MC_image038.jpg|center]]

Since I0 is equal to the magnetizing current, it is lower than the nominal current. In, the voltage drop on the Rs and Ls parameters is negligible concerning the nominal phase voltage, Vn. It is so possible to consider the following equivalent circuit:

[[file:STM32_MC_image040.jpg|center]]

The term R_Fe represent the iron-losses and its value is higher than the magnetizing impedance module, Z_m= ω_e L_ms, so it is reasonable to consider, I_(m, RMS)≅ I_(0, RMS)
<gallery mode="traditional" widths=260px heights=200px>

File:STM32_MC_image044.png
File:STM32_MC_image045_bis.png
File:STM32_MC_image046.png</gallery>

<br clear=all>

=== Blocked-Rotor test ===

The rotor is mechanically blocked: slip s = 1 (ωre = 0)

Since I_br is equal to I_n and is higher than the magnetizing current (no-load current), I_br, (I_br >> I_m) the magnetizing branch is negligible in respect of the series one. It is so possible to consider the following equivalent circuit:

[[file:STM32_MC_image053.jpg|center]]
<gallery mode="traditional" widths=260px heights=200px>

File:STM32_MC_image055.png
File:STM32_MC_image054_bis.png
File:STM32_MC_image057_bis.png</gallery>

<br clear=all>

== Appendix B - Block diagrams and principles about the implemented ACIM control methods ==

=== Legend of symbols ===

* f<sub>e</sub>  = stator frequency, Hz
* ω<sub>e</sub> = stator pulsation, rad/s
* ω<sub>re</sub> = rotor electrical pulsation, rad/s
* ω<sub>slip</sub> = slip pulsation, rad/s
* n*<sub>r</sub> = mech. target speed, rpm
* n<sub>r,fbk</sub> = mech. target speed, rpm
* τ<sub>r</sub> = Lr/Rr = electrical rotor time constant, s
* I*<sub>qd</sub> = q-d reference frame reference current vector
* I<sub>qd,fbk</sub> = q-d reference frame measured current vector
* V<sub>qd</sub> = q-d reference frame voltage vector
* V<sub>αβ</sub> = α-β reference frame voltage vector
* θ<sub>λr</sub> = rotor flux position

=== Constant airgap flux operation - V/f ===

==== Open loop block diagram ====

[[file:STM32_MC_image058.png|frame|center|Figure 3 - Torque-speed curves at constant V/f ratio]]

[[file:STM32_MC_image059.png|thumb|left]]

'''Advantages'''
* Simple control.
* No speed sensors.
* Motor electrical model not required.
'''Drawback and Limitations'''
* Low efficiency.
* Low control dynamics.
* No speed control.
<br clear=all>

[[file:STM32_MC_image060.jpg|thumb|left]]
* Although the stable region curve slope remains constant, maintaining the V/f = const., an increase/decrease of the mechanical load causes a variation of the rotor speed (modifying the slip frequency to provide the required torque).
<br clear=all>
<!--==== Closed loop block diagram ====

[[file:STM32_MC_image061.jpg|frame|center|Figure 4 - Torque-speed curves at constant V/f ratio]]

[[file:STM32_MC_image062.png|thumb|left]]
'''Advantages'''
* Simple control.
* Motor electrical model not required.
* Speed control modifies the slip frequency to provide the required mech. Load and maintain the rotor speed target.
'''Drawback and Limitations'''
* Low efficiency.
* Low control dynamics.
<br clear=all>-->

=== Field Oriented control ===
<!--==== Indirect Field Oriented control (IFOC) – solution with speed sensor ====

[[File:STM32_MC_image063.jpg|left]]
[[File:STM32_MC_image064.png|right]]
<br clear=all>
'''Advantages'''
* High efficiency.
* High control dynamics.
* Simple estimation of rotor flux position.
'''Drawback and Limitations'''
* Some motor parameters are required (τ_r)
* Motor parameters variation dependency (i.e. variation of resistances with the temperature) badly affecting the efficiency.
* Speed sensor is required both for rotor flux position estimation and for speed loop execution.-->

==== Luenberger State Observer–FOC (LSO-FOC) – solution without speed sensor ====

[[File:STM32_MC_image066.jpg|center]]

'''Advantages'''
* High efficiency.
* High control dynamics.
* Speed sensor not required both for rotor flux position estimation and for speed loop execution.
'''Drawback and Limitations'''
* Motor electrical model is required.
* Motor parameters variation dependency (i.e. variation of resistances with the temperature) badly affecting the efficiency and/or the speed estimation accuracy.
* Complexity of estimator model.
* Empiric setting of the observer gain.
==References==<references />
<noinclude>

[[Category:Motor Control]]
{{PublicationRequestId|19718| 4/22/2021| JM LAGOUTTE}}<noinclude>

<!--
Internal source: "to be completed" VX.0
-->
Line 50: Line 50:
 
** IAR Embedded Workbench IDE – ARM
 
** IAR Embedded Workbench IDE – ARM
   
For more information, refer to the related documentation on [http://www.st.com STMicroelectronics website].
+
For more information, refer to the related documentation on STMicroelectronics website<ref>[http://www.st.com STMicroelectronics website]</ref>.
   
 
=== Field Oriented Control FW example for Induction Motors ===
 
=== Field Oriented Control FW example for Induction Motors ===
Line 246: Line 246:
   
 
<br clear=all>
 
<br clear=all>
Where:
+
Where:
 
{|
 
{|
 
|-
 
|-
Line 395: Line 395:
 
* Empiric setting of the observer gain.
 
* Empiric setting of the observer gain.
   
  +
==References==
  +
<references />
 
<noinclude>
 
<noinclude>
 
[[Category:Motor Control]]
 
[[Category:Motor Control]]