[Permanent Magnet Synchronous Motor] Simulation research on nonlinear terminal sliding mode control of permanent magnet synchronous motor based on model predictive control MPC (Simulink & Matlab code implementation)

Welcome to this blog

Advantages of bloggers:Blog content should be as thoughtful and logical as possible for the convenience of readers.

Motto:He who travels a hundred miles is half as good as ninety.

The directory of this article is as follows:

Table of Contents

1 Overview

2 Operation results

3 References

4 Simulink simulation, Matlab code implementation


1 Overview

Permanent Magnet Synchronous Motor (PMSM) is a high-performance, high-efficiency motor commonly used in industry and transportation. When controlling permanent magnet synchronous motors, Model Predictive Control (MPC) and Nonlinear Terminal Sliding Mode Control (NTSMC) are two common control strategies.

MPC is a control method based on a system model, which predicts the future state of the system and optimizes control inputs to enable the system to achieve desired performance indicators. The application of MPC in permanent magnet synchronous motor control can improve the dynamic response and robustness of the system.

NTSMC is a method based on sliding mode control, which achieves fast tracking and robust control of the system by introducing terminal sliding mode surfaces. The application of NTSMC in permanent magnet synchronous motor control can improve the stability and anti-interference ability of the system.

Combining MPC and NTSMC can give full play to their respective advantages and improve the control performance of permanent magnet synchronous motors. In the simulation study, the mathematical model of the permanent magnet synchronous motor can be established, and the MPC and NTSMC controllers can be designed based on this model. By comparing the simulation results of different control strategies, their performance in permanent magnet synchronous motor control can be evaluated.

Nonlinear terminal sliding mode control of permanent magnet synchronous motor based on model predictive control MPC is a control strategy worth studying, which can improve the control performance and robustness of permanent magnet synchronous motor. In practical applications, factors such as the real-time nature and computational complexity of the system also need to be considered.

2 Running results

Part of the code:

function [sys,x0,str,ts] = get_sita_u(t,x,u,flag)
switch flag,
  case 0,
    [sys,x0,str,ts]=mdlInitializeSizes;
  case 1,
    sys=[];
  case 2,
    sys=[];
  case 3,
    sys=mdlOutputs(t,x,u);
  case 4,
    sys=[];
  case 9,
    sys=[];
   otherwise
    error(['Unhandled flag = ',num2str(flag)]);
end
% mdlInitializeSizes
function [sys,x0,str,ts]=mdlInitializeSizes

sizes = simsizes;

sizes.NumContStates = 0;
sizes.NumDiscStates = 0;
sizes.NumOutputs = 1;
sizes.NumInputs = 3;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1; % at least one sample time is needed

sys = simsizes(sizes);
x0 = [];
str = [];
ts = [0.00001 0]; % sampling time 0.002s, 500 Hz

%mdlOutputs

function sys=mdlOutputs(t,x,u)
global Id_g Iq_g sita_e_g
global sita_u_g
global faid_g faiq_g Ld Lq L flux

Id_g=u(2);Iq_g=u(1); sita_e_g=u(3);
Ld=L;Lq=L; L=0.000395;flux=0.1827;
faid_g=flux + Ld*Id_g;
faiq_g=Lq*Iq_g;

sita_u_g=sita_e_g + atan(faiq_g/faid_g) + pi/2;
sys(1)=sita_u_g;

function [sys,x0,str,ts] = get_sita_u(t,x,u,flag)
switch flag,
case 0,
[sys,x0,str,ts]=mdlInitializeSizes;
case 1,
sys=[];
case 2,
sys=[];
case 3,
sys=mdlOutputs(t,x,u);
case 4,
sys=[];
case 9,
sys=[];
otherwise
error([‘Unhandled flag = ‘,num2str(flag)]);
end
% mdlInitializeSizes
function [sys,x0,str,ts]=mdlInitializeSizes

sizes = simsizes;

sizes.NumContStates = 0;
sizes.NumDiscStates = 0;
sizes.NumOutputs = 1;
sizes.NumInputs = 3;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1; % at least one sample time is needed

sys = simsizes(sizes);
x0 = [];
str = [];
ts = [0.00001 0]; % sampling time 0.002s, 500 Hz

%mdlOutputs

function sys=mdlOutputs(t,x,u)
global Id_g Iq_g sita_e_g
global sita_u_g
global faid_g faiq_g Ld Lq L flux

Id_g=u(2);Iq_g=u(1); sita_e_g=u(3);
Ld=L;Lq=L; L=0.000395;flux=0.1827;
faid_g=flux + Ld*Id_g;
faiq_g=Lq*Iq_g;

sita_u_g=sita_e_g + atan(faiq_g/faid_g) + pi/2;
sys(1)=sita_u_g;

3 References

Some content in the article is quoted from the Internet, and the source will be indicated or cited as a reference. It is inevitable that there will be some unfinished information. If there is anything inappropriate, please feel free to contact us to delete it.

[1] Tian Yannan, Xia Kun. Research on model predictive current control of permanent magnet synchronous motor based on sliding mode observer [J]. Mechanical and Electrical Engineering, 2017, 34(10):6.DOI:10.3969/j.issn.1001-4551.2017 .10.015.

[2] Xu Bo. Research on position sensorless and control of bearingless permanent magnet synchronous motor [D]. Jiangsu University, 2013. DOI: 10.7666/d.Y2445008.

[3] Zheng Jiangping, Li Chao. Optimal sliding mode control of permanent magnet synchronous motor based on MPC [J]. Computer Applications and Software, 2018, 35(7):6.DOI:10.3969/j.issn.1000-386x .2018.07.007.

[4] Jin Yuxing. Research on model predictive control system of permanent magnet synchronous motor based on fractional-order speed regulator [D]. Lanzhou Jiaotong University [2023-10-27]. DOI: CNKI: CDMD: 2.1017.233451.