top of page

Model Predictive Control (MPC) of PMSM using MATLAB/Simulink

3 hours ago
6 min read

Model Predictive Control (MPC) of PMSM using MATLAB/Simulink


𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧

Model Predictive Control (MPC) is an advanced control technique that can provide fast dynamic response and accurate control of a Permanent Magnet Synchronous Motor (PMSM).


Model Predictive Control (MPC) of PMSM


Model Predictive Control (MPC) of PMSM


Model Predictive Control of PMSM
₹10,000.00₹5,000.00
Buy Now


This MATLAB/Simulink model demonstrates the complete operation of MPC-based PMSM speed and torque control, including:

  • DC-to-AC power conversion

  • PMSM speed control

  • Rotor position measurement

  • abc-to-dq0 current transformation

  • PI-based speed control

  • MPC switching-state prediction

  • Cost-function evaluation

  • Optimal inverter switching selection

  • Speed and torque response analysis

The system uses a 500 V DC source, a three-phase inverter, and a PMSM rated at 0.8 Nm, 300 V, and 3000 rpm.

𝐒𝐲𝐬𝐭𝐞𝐦 𝐎𝐯𝐞𝐫𝐯𝐢𝐞𝐰

The model consists of the following major sections:

  • 500 V DC source

  • Three-phase inverter

  • Permanent Magnet Synchronous Motor

  • Rotor angle measurement

  • Stator current measurement

  • abc-to-dq0 transformation

  • Speed measurement

  • PI speed controller

  • Model Predictive Controller

  • Switching pulse generation

  • Speed, torque, current, and voltage scopes

The DC source supplies the inverter, which converts DC power into three-phase AC power required by the PMSM.

Main System Parameters

Parameter

Value

DC source voltage

500 V

PMSM rated voltage

300 V

PMSM rated torque

0.8 Nm

PMSM rated speed

3000 rpm

Number of poles

4

Number of pole pairs

2

Initial speed reference

100 rad/s

Updated speed reference

125 rad/s

Speed reference change time

0.05 s

d-axis current reference

0

Number of inverter switching states

8

The PMSM model also uses machine parameters such as:

  • Stator resistance

  • Motor inductance

  • Permanent-magnet flux linkage

  • Number of pole pairs

These parameters are used by the predictive controller to estimate the future motor-current behavior.

𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬

The complete control process can be understood in the following sequence.

1. DC Power Supply

A 500 V DC source is connected to the inverter.

The inverter converts the available DC voltage into controlled three-phase AC voltage for the PMSM.

2. PMSM Operation

The inverter supplies the PMSM based on the switching pulses produced by the Model Predictive Controller.

Important motor quantities are continuously measured:

  • Rotor angle

  • Three-phase stator current

  • Rotor speed

  • Electromagnetic torque

3. Rotor Angle Processing

The rotor angle obtained from the PMSM is a mechanical rotor position.

The measured angle is converted into the corresponding electrical angle using the motor pole information.

For the selected PMSM:

Parameter

Value

Number of poles

4

Pole pairs

2

The processed electrical angle is then used in the motor-control calculations.

𝐂𝐮𝐫𝐫𝐞𝐧𝐭 𝐓𝐫𝐚𝐧𝐬𝐟𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧

The PMSM provides three-phase stator currents:

  • Phase-a current

  • Phase-b current

  • Phase-c current

These currents are transformed into the rotating reference frame using the abc-to-dq0 Park transformation.

The controller therefore obtains:

  • id – d-axis current

  • iq – q-axis current

This conversion simplifies the control of motor flux and torque.

𝐒𝐩𝐞𝐞𝐝 𝐂𝐨𝐧𝐭𝐫𝐨𝐥

The PMSM rotor speed is continuously measured and compared with the required reference speed.

The reference speed follows two operating conditions.

Simulation Time

Reference Speed

0 to 0.05 s

100 rad/s

After 0.05 s

125 rad/s

The resulting speed error is supplied to a PI controller.

The PI controller generates the required iq reference, which is used to regulate PMSM torque and consequently control motor speed.

For field-oriented operation:

  • id reference = 0

  • iq reference = generated by the PI speed controller

𝐌𝐨𝐝𝐞𝐥 𝐏𝐫𝐞𝐝𝐢𝐜𝐭𝐢𝐯𝐞 𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲

The MPC controller is the main control element of the system.

It evaluates the possible inverter switching conditions and determines which switching state provides the best motor response.

Inputs Used by the MPC

The predictive controller receives information such as:

  • Speed-related input

  • Actual id

  • Actual iq

  • Reference iq

  • Reference id

  • Clock input

  • Electrical rotor angle

The predictive model also uses important PMSM and converter parameters such as:

  • PMSM inductance

  • Stator resistance

  • Permanent-magnet flux linkage

  • DC-link voltage of 500 V

𝐏𝐫𝐞𝐝𝐢𝐜𝐭𝐢𝐨𝐧 𝐨𝐟 𝐌𝐨𝐭𝐨𝐫 𝐂𝐮𝐫𝐫𝐞𝐧𝐭𝐬

The inverter has eight possible switching states.

For every switching state, the MPC algorithm predicts the future values of:

  • d-axis current

  • q-axis current

Therefore, eight different predicted operating conditions are obtained during each controller evaluation.

MPC Operation

Number

Inverter switching states evaluated

8

Predicted current sets

8

Cost values evaluated

8

Optimal switching state selected

1

𝐂𝐨𝐬𝐭-𝐅𝐮𝐧𝐜𝐭𝐢𝐨𝐧 𝐁𝐚𝐬𝐞𝐝 𝐒𝐰𝐢𝐭𝐜𝐡𝐢𝐧𝐠

For each switching state, the controller compares the predicted current response with the corresponding reference values.

A cost value is calculated for every possible switching condition.

The controller then:

  1. Predicts id and iq for all switching states.

  2. Determines eight corresponding cost values.

  3. Compares the cost values.

  4. Identifies the minimum cost.

  5. Selects the inverter state associated with the minimum cost.

  6. Generates the corresponding switching pulses.

  7. Applies those pulses to the inverter.

This process is repeated continuously to regulate PMSM speed and torque.

𝐖𝐡𝐲 𝐌𝐏𝐂 𝐢𝐬 𝐔𝐬𝐞𝐝 𝐇𝐞𝐫𝐞

Instead of using a separate modulation stage to determine inverter switching, the MPC evaluates the inverter states directly and chooses the most suitable switching condition.

The implemented control approach provides:

  • Fast response to reference changes

  • Direct inverter switching selection

  • Accurate current tracking

  • Effective PMSM speed regulation

  • Good torque control

  • Dynamic response to load variations

𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬

The MATLAB/Simulink scopes are used to observe:

  • Inverter output voltage

  • PMSM stator current

  • Reference motor speed

  • Actual motor speed

  • Electromagnetic torque

  • Inverter switching pulses

Speed Response

Initially, the reference speed is fixed at 100 rad/s.

The actual PMSM speed rises and closely follows the reference within approximately 0.02 s.

At 0.05 s, the reference speed changes from:

100 rad/s → 125 rad/s

The actual speed responds to this change and increases to approximately 125 rad/s.

Speed Performance Summary

Condition

Reference Speed

Motor Response

Initial operating condition

100 rad/s

Tracks approximately 100 rad/s

Reference change at 0.05 s

125 rad/s

Rises to approximately 125 rad/s

Initial tracking period

Approximately 0.02 s

The result demonstrates effective reference-speed tracking using the MPC controller.

𝐄𝐥𝐞𝐜𝐭𝐫𝐨𝐦𝐚𝐠𝐧𝐞𝐭𝐢𝐜 𝐓𝐨𝐫𝐪𝐮𝐞 𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞

During motor starting, a higher electromagnetic torque is produced to accelerate the motor.

The starting torque reaches approximately:

3.2 Nm

After the starting transient, the electromagnetic torque settles to approximately:

0.3 Nm

This operating condition continues up to 0.05 s.

After 0.05 s, the motor load is increased toward the rated operating condition. Consequently, the electromagnetic torque rises to approximately:

0.6 Nm

Torque Results

Operating Condition

Electromagnetic Torque

Starting condition

Approximately 3.2 Nm

Steady condition before 0.05 s

Approximately 0.3 Nm

After load increase

Approximately 0.6 Nm

The torque response shows that the controller can respond effectively to changes in the motor operating condition.

𝐏𝐌𝐒𝐌 𝐒𝐭𝐚𝐭𝐨𝐫 𝐂𝐮𝐫𝐫𝐞𝐧𝐭

The stator current also changes according to motor loading.

Initially, the current is approximately:

0.5 A peak

After the load increases at approximately 0.05 s, the stator current increases to about:

1.2 A peak

Current Response

Operating Condition

Approximate Peak Current

Before load increase

0.5 A

After load increase

1.2 A

The increase in current corresponds to the increased electromagnetic torque demand.

𝐈𝐧𝐯𝐞𝐫𝐭𝐞𝐫 𝐎𝐮𝐭𝐩𝐮𝐭

The inverter switching pulses generated by the MPC continuously control the switching devices.

The simulation allows observation of:

  • Three-phase inverter voltage

  • PMSM phase currents

  • Individual switching pulses

  • Changes in current following speed and load variations

The inverter switching pattern changes according to the optimal switching state selected by the predictive controller.

𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬 𝐚𝐭 𝐚 𝐆𝐥𝐚𝐧𝐜𝐞

Quantity

Initial/First Condition

Changed Condition

Reference speed

100 rad/s

125 rad/s

Change time

0.05 s

Approx. speed tracking period

0.02 s

Tracks new reference

Torque

0.3 Nm after starting

0.6 Nm

Starting torque

3.2 Nm

Stator current

0.5 A peak

1.2 A peak

DC source

500 V

500 V

MPC switching states

8

8

𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬

  • Model Predictive Control of PMSM implemented in MATLAB/Simulink

  • 500 V DC-link supply

  • Three-phase inverter-fed PMSM

  • 0.8 Nm, 300 V, 3000 rpm PMSM

  • Rotor-position feedback

  • Stator-current feedback

  • abc-to-dq0 current transformation

  • Field-oriented current references

  • PI-based speed-control loop

  • Eight inverter switching states evaluated by MPC

  • Prediction of future id and iq

  • Minimum-cost switching-state selection

  • Direct inverter pulse generation

  • Variable speed-reference testing

  • Load-change response analysis

  • Speed, current, torque, voltage, and switching-pulse observation

𝐌𝐚𝐢𝐧 𝐁𝐞𝐧𝐞𝐟𝐢𝐭𝐬

The developed MPC-controlled PMSM model is useful for understanding:

  • How predictive motor control operates

  • How inverter switching states affect PMSM currents

  • How PMSM current prediction is performed

  • How optimal inverter switching is selected

  • How speed error determines torque-producing current demand

  • How the PMSM responds to speed-reference changes

  • How current and torque vary when motor loading changes

  • How predictive control can provide fast dynamic performance

𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬

MPC-controlled PMSM drives are relevant to many high-performance motor-drive applications, including:

  • Electric drive systems

  • Industrial motor drives

  • Servo-drive applications

  • Robotics and automation

  • High-performance motion control

  • Variable-speed motor-drive systems

  • Electrified transportation drive systems

  • Advanced power-electronic motor-control research

𝐖𝐡𝐚𝐭 𝐘𝐨𝐮 𝐂𝐚𝐧 𝐋𝐞𝐚𝐫𝐧 𝐟𝐫𝐨𝐦 𝐭𝐡𝐞 𝐌𝐨𝐝𝐞𝐥

By studying this MATLAB/Simulink implementation, students, researchers, and engineers can understand:

  • PMSM modeling in Simulink

  • Inverter-fed PMSM operation

  • Rotor-angle processing

  • abc-to-dq0 transformation

  • PMSM speed feedback

  • PI speed-controller operation

  • d-axis and q-axis current control

  • Model Predictive Control implementation

  • Inverter switching-state prediction

  • Cost-function based switching selection

  • PMSM torque response

  • Speed-reference tracking

  • Motor-current behavior during load changes

𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧

The Model Predictive Control (MPC) of PMSM using MATLAB/Simulink demonstrates an effective approach for controlling the speed and torque of a Permanent Magnet Synchronous Motor.

The controller evaluates eight inverter switching states, predicts the corresponding motor currents, determines the cost associated with each condition, and selects the switching state having the minimum cost.

The simulation demonstrates that:

  • The PMSM successfully tracks the initial 100 rad/s speed reference.

  • The actual speed responds effectively when the reference changes to 125 rad/s at 0.05 s.

  • Starting torque reaches approximately 3.2 Nm.

  • Torque settles near 0.3 Nm before the load change.

  • Torque increases to approximately 0.6 Nm after the load is increased.

  • Stator current increases from approximately 0.5 A peak to 1.2 A peak according to the increased torque requirement.

Overall, the results demonstrate effective PMSM speed tracking, torque regulation, current control, and optimal inverter switching using Model Predictive Control.


Comments


bottom of page