Field-Weakening Control (with MTPA) of PMSM - MATLAB & Simulink Example - MathWorks Korea (2024)

This example uses:

  • C2000 Microcontroller BlocksetC2000 Microcontroller Blockset
  • Embedded CoderEmbedded Coder
  • Motor Control BlocksetMotor Control Blockset
  • Simulink CoderSimulink Coder
  • SimulinkSimulink

Open Model

This example implements the field-oriented control (FOC) technique to control the torque and speed of a three-phase permanent magnet synchronous motor (PMSM). The FOC algorithm requires rotor position feedback, which is obtained by a quadrature encoder sensor. For details about FOC, see Field-Oriented Control (FOC).

Field-Weakening Control

When you use the FOC algorithm to run a motor with rated flux, the maximum speed is limited by the stator voltages, rated current, and back emf. This speed is called the base speed. Beyond this speed, the operation of the machine is complex because the back emf is more than the supply voltage. However, if you set the d-axis stator current (Id) to a negative value, the rotor flux linkage reduces, which allows the motor to run above the base speed. This operation is known as field-weakening control of the motor.

Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (1)

Depending upon the connected load and rated current of the machine, the reference d-axis current (Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (2)) in the field-weakening control also limits the reference q-axis current (Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (3)), and therefore, limits the torque output. Therefore, the motor operates in the constant torque region until the base speed. It operates in the constant power region with a limited torque above the base speed, as illustrated in the preceding figure.

The computations for the reference current Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (4) depend on the motor and inverter parameters.

Note:

  • For some surface PMSMs, (depending upon the parameters) it may not be possible to achieve higher speeds at the rated current. To achieve higher speeds, you need to overload the motor with maximum currents that are higher than the rated current (if the thermal conditions of the machine are within the permissible limits).

  • When you operate the motor above the base speed, we recommend that you monitor the temperature of the motor. During motor operation, if the motor temperature rises beyond the temperature recommended by the manufacturer, turn-off the motor for safety reasons.

  • When you operate the motor above the base speed, we recommend that you increment the speed reference in small steps, to avoid the dynamics of field weakening that can make some systems unstable.

Maximum Torque Per Ampere (MTPA)

For the interior PMSMs, the saliency in the magnetic circuit of rotor results in higher Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (5) ratio (greater than 1). This produces reluctance torque in the rotor (in addition to the existing electromagnetic torque). For more information, see MTPA Control Reference.

Therefore, you can operate the machine at an optimum combination of Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (6) and Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (7), and obtain a higher torque for the same stator current, Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (8).

This increases the efficiency of the machine, because the stator current losses are minimized. The algorithm that you use to generate the reference Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (9) and Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (10) currents for producing maximum torque in the machine, is called Maximum Torque Per Ampere (MTPA).

Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (11)

For an Interior PMSM (IPMSM), this example computes the reference Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (12) and Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (13) currents using the MTPA method until the base speed. For a Surface PMSM (SPMSM), the example achieves MTPA operation by using a zero d-axis reference current, until the base speed.

To operate the motor above the base speed, this example computes the reference Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (14) and Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (15) for MTPA and field-weakening control, depending upon the motor type. For a Surface PMSM, Constant Voltage Constant Power (CVCP) control method is used. For an Interior PMSM, Voltage and Current Limited Maximum Torque (VCLMT) control method is used.

For information related to MTPA Control Reference block, see MTPA Control Reference.

Target Communication

For hardware implementation, this example uses a host and a target model. The host model, running on the host computer, communicates with the target model deployed to the hardware connected to the motor. The host model uses serial communication to command the target model and run the motor in a closed-loop control.

Both field-weakening control and MTPA require generation of reference currents that follow the limitations related to:

  • Current limited circle

  • Voltage limited ellipse

  • Motor temperature

To determine the operating point that follows these limits, see the plot generated by the function Obtain Motor Characteristics.

In the field-weakening region, some PMSMs may need a stator current that is higher than the rated current of the motor. For details, see the plot generated by the function Obtain Motor Characteristics.

Models

This example uses multiple models for these hardware configurations:

Speed control of PMSM with field-weakening and MTPA:

  • mcb_pmsm_fwc_qep_f28069LaunchPad

  • mcb_pmsm_fwc_qep_f28379d

Speed control of Interior PMSM (IPMSM) with field-weakening and MTPA:

  • mcb_ipmsm_fwc_qep_f28379d

Note: This model uses the ADLEE-BM-180E IPMSM parameters that are defined in the model initialization script. ADLEE-BM-180E IPMSM has a saliency of approximately 10% (Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (16) is approximately 10% higher than Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (17)). Because of low saliency, this motor demands higher Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (18) currents to enter the field-weakening region and run at speeds higher than the rated speed. However, the motor has a rated current of only 9A. Therefore, when you run this motor in the field-weakening region, the low saliency makes the motor draw high Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (19) currents quickly (and quickly reach the rated curent limit) while gaining only a limited speed increase above the base speed. You can use this model to achieve higher speeds above the base speed by using an IPMSM that has a higher saliency.

Torque control of PMSM with MTPA:

  • mcb_pmsm_mtpa_qep_f28069LaunchPad

  • mcb_pmsm_mtpa_qep_f28379d

You can use these models for both simulation and code generation.

Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (20)

Required MathWorks Products

To simulate model:

1. For the models: mcb_pmsm_fwc_qep_f28069LaunchPad and mcb_pmsm_mtpa_qep_f28069LaunchPad

  • Motor Control Blockset™

  • Fixed-Point Designer™

2. For the models: mcb_pmsm_fwc_qep_f28379d, mcb_ipmsm_fwc_qep_f28379d, and mcb_pmsm_mtpa_qep_f28379d

  • Motor Control Blockset™

To generate code and deploy model:

1. For the models: mcb_pmsm_fwc_qep_f28069LaunchPad and mcb_pmsm_mtpa_qep_f28069LaunchPad

  • Motor Control Blockset™

  • Embedded Coder®

  • C2000™ Microcontroller Blockset

  • Fixed-Point Designer™

2. For the models: mcb_pmsm_fwc_qep_f28379d, mcb_ipmsm_fwc_qep_f28379d, and mcb_pmsm_mtpa_qep_f28379d

  • Motor Control Blockset™

  • Embedded Coder®

  • C2000™ Microcontroller Blockset

  • Fixed-Point Designer™ (only needed for optimized code generation)

Prerequisites

1. Obtain the motor parameters. We provide default motor parameters with the Simulink® model that you can replace with the values from either the motor datasheet or other sources.

However, if you have the motor control hardware, you can estimate the parameters for the motor that you want to use, by using the Motor Control Blockset parameter estimation tool. For instructions, see Estimate PMSM Parameters Using Recommended Hardware.

The parameter estimation tool updates the motorParam variable (in the MATLAB® workspace) with the estimated motor parameters.

2. If you obtain the motor parameters from the datasheet or other sources, update the motor, inverter, and position sensor calibration parameters in the model initialization script associated with the Simulink® models. For instructions, see Estimate Control Gains and Use Utility Functions.

If you use the parameter estimation tool, you can update the inverter and position sensor calibration parameters, but do not update the motor parameters in the model initialization script. The script automatically extracts motor parameters from the updated motorParam workspace variable.

Simulate (Speed Control and Torque Control) Models

This example supports simulation. Follow these steps to simulate the model.

1. Open a model included with this example.

2. Click Run on the Simulation tab to simulate the model.

3. Click Data Inspector on the Simulation tab to view and analyze the simulation results.

Analyze simulation results for Speed Control Model

The model uses the per-unit system to represent speed, currents, voltages, torque, and power. Type PU_System at the workspace to see the conversion of one per-unit value into SI units for these quantities.

Observe the dynamics of the system for the speed and current controllers. In addition, notice the negative Id currents for motor operation above the base speed.

Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (21)

Note: In the beginning, the example runs the motor in open-loop control. After it detects the index pulse of the quadrature encoder sensor, the motor starts running using a closed-loop control. A start-up algorithm takes approximately 0.5 seconds to perform this transition. Ignore any transients observed in the speed and position feedback signals during this initial period.

Analyze simulation results for Torque Control Model

Run simulation with the Id and Iq reference currents generated by these three methods:

1. Generate reference currents by using the MTPA Control Reference Block.

2. Generate the MTPA reference currents manually by using the Vector Control Reference Block.

3. Generate the Control Reference without MTPA.

The first method uses mathematical computations to determine the reference currents Id and Iq, after assuming linear inductances.

Use the second method to manually generate the MTPA look-up tables for motors with non-linear inductances. You can illustrate this with the Id and Iq references generated by sweeping the torque angle between +(π/2) to -(π/2).

Use the last method to obtain the reference currents without the MTPA algorithm.

You can compare the torque and power generated by these three methods in the data inspector.

Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (22)

In the preceding example, you can notice that the electrical torque generated using MTPA is 0.34PU whereas electrical torque generated without MTPA is 0.27PU. You can also notice that with a varying torque angle, the maximum generated torque matches the torque produced by MTPA. The negative d-axis current indicates that the MTPA utilizes the reluctance torque for interior PMSM.

Note: If you are working with Surface PMSM, change the Type of motor parameter from Interior PMSM to Surface PMSM, in the MTPA Control Reference block located at these locations:

  • mcb_pmsm_fwc_qep_f28069LaunchPad/Speed Control

  • mcb_pmsm_fwc_qep_f28379d/Speed Control

  • mcb_pmsm_mtpa_qep_f28069LaunchPad/Torque Control/MTPA_Reference

  • mcb_pmsm_mtpa_qep_f28379d/Torque Control/MTPA_Reference

Generate Code and Deploy Model to Target Hardware

This section instructs you to generate code and run the FOC algorithm on the target hardware.

This example uses a host and a target model. The host model is a user interface to the controller hardware board. You can run the host model on the host computer. The prerequisite to use the host model is to deploy the target model to the controller hardware board. The host model uses serial communication to command the target Simulink® model and run the motor in a closed-loop control.

Required Hardware

This example supports these hardware configurations. You can also use the target model name to open the model for the corresponding hardware configuration, from the MATLAB® command prompt.

  • LAUNCHXL-F28069M controller + BOOSTXL-DRV8305 inverter: mcb_pmsm_fwc_qep_f28069LaunchPad and mcb_pmsm_mtpa_qep_f28069LaunchPad

  • LAUNCHXL-F28379D controller + BOOSTXL-DRV8305 inverter: mcb_pmsm_fwc_qep_f28379d, mcb_ipmsm_fwc_qep_f28379d, and mcb_pmsm_mtpa_qep_f28379d

For connections related to the preceding hardware configurations, see LAUNCHXL-F28069M and LAUNCHXL-F28379D Configurations.

Run Models to implement speed and torque control with field-weakening and MTPA

1. Simulate the model and analyze the simulation results by using the preceding section.

2. Complete the hardware connections.

3. The torque control model requires an Interior PMSM with QEP Sensor, driven by an external dynamometer with speed control (that uses the speed control model).

4. The model automatically computes the ADC (or current) offset values. To disable this functionality (enabled by default), update the value zero to the variable inverter.ADCOffsetCalibEnable in the model initialization script.

Alternatively, you can compute the ADC offset values and update it manually in the model initialization scripts. For instructions, see Run 3-Phase AC Motors in Open-Loop Control and Calibrate ADC Offset.

5. Compute the quadrature encoder index offset value and update it in the model initialization scripts associated with the target model. For instructions, see Quadrature Encoder Offset Calibration for PMSM.

6. Open the target model for the hardware configuration that you want to use. If you want to change the default hardware configuration settings for the target model, see Model Configuration Parameters.

7. Load a sample program to CPU2 of LAUNCHXL-F28379D, for example, program that operates the CPU2 blue LED by using GPIO31 (c28379D_cpu2_blink.slx), to ensure that CPU2 is not mistakenly configured to use the board peripherals intended for CPU1. For more information about the sample program or model, see the Task 2 - Create, Configure and Run the Model for TI Delfino F28379D LaunchPad (Dual Core) section in Getting Started with Texas Instruments C2000 Microcontroller Blockset (C2000 Microcontroller Blockset).

8. Click Build, Deploy & Start on the Hardware tab to deploy the target model to the hardware.

9. Click the host model hyperlink in the target model to open the associated host model.

Field-Weakening Control (with MTPA) of PMSM- MATLAB & Simulink Example- MathWorks Korea (23)

For details about the serial communication between the host and target models, see Host-Target Communication.

10. In the model initialization script associated with the target model, specify the communication port using the variable target.comport. The example uses this variable to update the Port parameter of the Host Serial Setup, Host Serial Receive, and Host Serial Transmit blocks available in the host model.

11. In the Speed control model, update the Reference Speed (RPM) block value. In the Torque control model, update the current request using Imag Reference block.

12. Click Run on the Simulation tab to run the host model.

13. Change the position of the Start / Stop Motor switch to On, to start running the motor.

14. Enter different reference speeds (or currents) and observe the debug signals from the RX subsystem, in the Time Scope of host model.

Note:

  • If the position offset is incorrect, this example can lead to excessive currents in the motor. To avoid this, ensure that the position offset is correctly computed and updated in the workspace variable: pmsm.PositionOffset.

  • When you operate the motor above the base speed, we recommend that you monitor the temperature of motor. During motor operation, if the motor temperature rises beyond the temperature recommended by the manufacturer, turn-off the motor for safety reasons.

  • When you operate the motor above the base speed, we recommend that you increment the speed reference in small steps, to avoid the dynamics of field weakening that can make some systems unstable.

References

[1] B. Bose, Modern Power Electronics and AC Drives. Prentice Hall, 2001. ISBN-0-13-016743-6.

[2] Lorenz, Robert D., Thomas Lipo, and Donald W. Novotny. "Motion control with induction motors." Proceedings of the IEEE, Vol. 82, Issue 8, August 1994, pp. 1215-1240.

[3] Morimoto, Shigeo, Masayuka Sanada, and Yoji Takeda. "Wide-speed operation of interior permanent magnet synchronous motors with high-performance current regulator." IEEE Transactions on Industry Applications, Vol. 30, Issue 4, July/August 1994, pp. 920-926.

[4] Li, Muyang. "Flux-Weakening Control for Permanent-Magnet Synchronous Motors Based on Z-Source Inverters." Master's Thesis, Marquette University, e-Publications@Marquette, Fall 2014.

[5] Briz, Fernando, Michael W. Degner, and Robert D. Lorenz. "Analysis and design of current regulators using complex vectors." IEEE Transactions on Industry Applications, Vol. 36, Issue 3, May/June 2000, pp. 817-825.

[6] Briz, Fernando, et al. "Current and flux regulation in field-weakening operation [of induction motors]." IEEE Transactions on Industry Applications, Vol. 37, Issue 1, Jan/Feb 2001, pp. 42-50.

[7] TI Application Note, "Sensorless-FOC With Flux-Weakening and MTPA for IPMSM Motor Drives."

See Also

  • Field-Weakening Control (with MTPA) of Nonlinear PMSM Using Lookup Table

  • PMSM Drive Characteristics and Constraint Curves

Field-Weakening Control (with MTPA) of PMSM
- MATLAB & Simulink Example
- MathWorks Korea (2024)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Geoffrey Lueilwitz

Last Updated:

Views: 5505

Rating: 5 / 5 (60 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Geoffrey Lueilwitz

Birthday: 1997-03-23

Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

Phone: +13408645881558

Job: Global Representative

Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.