A method for permanent magnet synchronous motor parameter identification based on least squares method is introduced

Publisher:BlissfulWhisperLatest update time:2024-08-21 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Permanent magnet synchronous motors have the advantages of small size, low moment of inertia, and simple structure, and are widely used in control systems. However, in actual applications, the control system will be affected by external factors such as high temperature and load, and the parameters of the permanent magnet synchronous motor such as inductance and rotor flux will change, causing system oscillation and affecting the actual control effect.


Therefore, accurate parameter identification is a necessary condition for achieving better control effect. At present, the commonly used motor parameter identification methods are: Kalman filter algorithm, least squares method, genetic algorithm, particle swarm algorithm, etc. Considering the advantages of the least squares method, which is simple in structure and easy to implement, this paper adopts the permanent magnet synchronous motor parameter identification method based on the least squares method. Based on the derivation of permanent magnet synchronous motor, the stator voltage and other measurable variables are used as input and output to identify the stator resistance and d and q axis armature inductance of the motor.


1. Least Squares Method

The least squares parameter identification method can solve the problems of linear time-varying systems, linear steady-state systems, linear systems with noise, etc. Common least squares methods include: recursive least squares method, forgetting factor recursive least squares method, corrected compensation least squares method, etc. These methods can all be used in system parameter identification.

2. Establishment of identification model

The permanent magnet synchronous motor is a nonlinear multivariable system. The voltage equation in d, q rotating coordinates is:

picture

Where iq and id are the currents of q and d respectively; uq and ud are the voltages of q and d respectively; Rs, Lq, Ld are the resistance of the stator winding and the inductance of the q and d axes respectively; Ψq and Ψd are the components of the q and d magnetic flux respectively; ω is the electrical angular velocity of the rotor.

Modify the above formula into the expression of least squares method:

picture

3. Simulation experiment

The parameter identification module written by S function is added to the permanent magnet synchronous motor control system model for simulation experiments.

function [sys,x0,str,ts]=mdlInitializeSizes %System initialization

sizes = simsizes;

sizes.NumContStates = 0; %Set the variables of the system continuous state

sizes.NumDiscStates = 0; %Set the variables of the system discrete state

sizes.NumOutputs = 1; %Set the system output variables

sizes.NumInputs = 3; %Set system input variables

sizes.DirFeedthrough = 1; % If the input variable u is explicitly included in the output equation, this parameter should be set to 1, and the input is not directly passed to the output port

sizes.NumSampleTimes = 1; % Number of module sampling cycles

% Required sample time, usually 1.

% guess that if it is n, then the state at the next moment needs to know the system state of the previous n states

sys = simsizes(sizes);

x0 = []; % System initial state variables

str = []; % Reserve the variable and keep it empty

ts = [-1 0]; % Sampling time [t1 t2] t1 is the sampling period. If t1=-1, the sampling period of the input signal will be inherited; parameter t2 is the offset, which is generally taken as 0



global P_past2 theta_past2

P_past2 = 1e4 * eye(2,2); %Usually 1e4 - 1e10

theta_past2 = [0.0001; 0.0001]; % Generally take a very small positive real vector



function sys=mdlOutputs(t,x,u) %Generate (transmit) system output

%Determination of initial value

lambda = 0.99; %Forgetting factor 0-1

global P_past2 theta_past2

xt = [u(1) u(2)]; %1*2 fait

y = u(3);

I = [1 0;0 1];



K = P_past2*xt'/(lambda + xt * P_past2*xt'); %2*1

P_new = 1/lambda*(I - K*xt) * P_past2; %2*2

theta_new = theta_past2 + K*(y-xt*theta_past2); %2*1



P_past2 = P_new ;

theta_past2 = theta_new;



sys(1) = theta_new(1);

function [sys,x0,str,ts] = Synchronous_demarcate(t,x,u,flag)

%This program is to identify the motor parameters stator resistance Rs, permanent magnet flux faif, dq axis inductance L

switch flag

case 0 % Initialization

[sys,x0,str,ts]=mdlInitializeSizes;

case 2 % Discrete state calculation, next simulation time, termination simulation setting

sys=[];%mdlUpdates(t,x,u);

Case 3 % Output signal calculation

sys = mdlOutputs(t,x,u);

case {1,4,9} % output signal calculation

sys=[];

otherwise

DAStudio.error('Simulink:blocks:unhandledFlag', num2str(flag));

end



function [sys,x0,str,ts]=mdlInitializeSizes %System initialization

sizes = simsizes;

sizes.NumContStates = 0; %Set the variables of the system continuous state

sizes.NumDiscStates = 0; %Set the variables of the system discrete state

sizes.NumOutputs = 3; %Set the system output variables

sizes.NumInputs = 5; %Set system input variables

sizes.DirFeedthrough = 1; % If the input variable u is explicitly included in the output equation, this parameter should be set to 1, and the input is not directly passed to the output port

sizes.NumSampleTimes = 1; % Number of module sampling cycles

% Required sample time, usually 1.

% guess that if it is n, then the state at the next moment needs to know the system state of the previous n states

sys = simsizes(sizes);

x0 = []; % System initial state variables

str = []; % Reserve the variable and keep it empty

ts = [0 0]; % Sampling time [t1 t2] t1 is the sampling period. If t1=-1, the sampling period of the input signal will be inherited; parameter t2 is the offset, which is generally taken as 0



global P_past theta_past

P_past = 1e4 * eye(3,3);

theta_past = [0;0;10000];



function sys=mdlOutputs(t,x,u) %Generate (transmit) system output

%Determination of initial value

lambda = 1; % forgetting factor, choose not to forget 0.8~1

global P_past theta_past


Moment of inertia parameter identification results:

picture

Electromagnetic inductance parameter identification results:

picture

Electrical angular velocity observations:

picture

Load observation results:

picture

Three-phase current observation results:

picture

The simulation results show that the parameter identification algorithm using the recursive least squares method can accurately identify the electromagnetic parameters of the motor, can well follow the changes in the motor parameters, and has fast convergence and good identification results.


Reference address:A method for permanent magnet synchronous motor parameter identification based on least squares method is introduced

Previous article:Overview of the advantages and disadvantages of the PID algorithm and the three PID control components
Next article:Control method of two-phase induction servo motor

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号