top of page

Neural Network with Model Predictive Control of PMSM

Neural Network with Model Predictive Control of PMSM


Permanent Magnet Synchronous Motors (PMSMs) are widely used in various applications due to their high efficiency and performance. Controlling these motors precisely is crucial, and integrating neural networks with model predictive control offers a robust solution.

Simulink Model Components

Our Simulink model includes:

  1. DC Voltage Source

  2. Three-Phase Inverter

  3. Permanent Magnet Synchronous Motor (PMSM)

  4. Neural Network Controller

  5. Model Predictive Controller (MPC)

Key Measurements

We measure several parameters from the PMSM:

  • Rotor Angle (in radians)

  • Stator Currents (phase A, B, C)

  • Rotor Speed (in radians per second)

  • Electromagnetic Torque

These measurements are crucial for controlling and monitoring the motor's performance.

Neural Network Controller

The neural network controller receives two inputs:

  1. Error Input: The difference between the reference speed and the actual speed of the PMSM.

  2. Reference Speed Command

The neural network processes these inputs to generate the IqI_qIq​ reference for the field-oriented control. Here, IdI_dId​ reference is set to zero. The neural network is trained using collected input-output data to minimize the error between the reference and actual speeds.

Training the Neural Network

We use MATLAB's fitting app to train the neural network:

  1. Select Input and Output Data: Collected from the system.

  2. Train the Model: Ensure the training achieves a high RRR-value (close to 1) and a minimal mean squared error.

The trained model is then integrated into the Simulink environment for real-time control.

Model Predictive Controller (MPC)

The MPC optimizes the switching states of the inverter to control the PMSM:

  1. Calculate Inverter Voltages: For different switching patterns.

  2. Compute Direct and Quadrature Axis Currents (IdI_dId​ and IqI_qIq​): Using the predicted inverter voltages.

  3. Evaluate Cost Function: For each switching state to minimize the error.

  4. Select Optimal Switching State: Based on the minimum cost function to generate the control pulses for the inverter.

Simulation and Results

Reference Speed Profile

The reference speed command varies as follows:

  • From 0 to 0.05 seconds: Increase from 0 to 120 rad/s.

  • From 0.05 to 0.1 seconds: Maintain at 120 rad/s.

  • From 0.1 to 0.15 seconds: Decrease from 120 to 0 rad/s.


  1. Rotor Speed: The neural network and MPC effectively track the reference speed with minimal error.

  2. Inverter Output Voltage and Stator Current: Show smooth transitions with controlled stator currents, avoiding significant overshoots.

  3. Electromagnetic Torque: Demonstrates consistent performance under varying speed conditions.

Performance Analysis

The integration of the neural network with MPC ensures precise control of the PMSM:

  • Speed Tracking: The motor accurately follows the reference speed profile.

  • Stator Current: Remains stable, indicating smooth motor operation.

  • Electromagnetic Torque: Reflects the effective control of the motor's mechanical output.


Combining a neural network with model predictive control provides a powerful method for controlling Permanent Magnet Synchronous Motors. The approach ensures precise speed tracking, stable stator currents, and consistent electromagnetic torque, making it suitable for high-performance applications.

3 views0 comments


bottom of page