├── FOC_w_STO_v1.slx ├── Docs └── Project_PMSM_w_STO.pdf ├── README.md ├── controllers.m └── model_parameters.m /FOC_w_STO_v1.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnatemesi/Sensorless_PMSM_w_STO/HEAD/FOC_w_STO_v1.slx -------------------------------------------------------------------------------- /Docs/Project_PMSM_w_STO.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnatemesi/Sensorless_PMSM_w_STO/HEAD/Docs/Project_PMSM_w_STO.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sensorless_PMSM_w_STO 2 | Sensorless control of an SPMSM using a second-order Sliding Mode Observer (also called Super-twister) to acquire the rotor position and speed. 3 | 4 | It was implemented in MATLAB/Simulink 2018b. 5 | 6 | A short design documentation is also attached (work in progress). 7 | 8 | Initialization is done in: Model Properties / Callbacks / InitFcn* 9 | -------------------------------------------------------------------------------- /controllers.m: -------------------------------------------------------------------------------- 1 | %Controllers 2 | %PI parameters 3 | 4 | switch 5 5 | case 1 6 | 7 | Ki_speed = 2; 8 | Kp_speed = 0.06; 9 | Ka_speed = 0; 10 | 11 | Ki_id = 463; 12 | Kp_id = 3.8; 13 | 14 | Ki_iq = 463; 15 | Kp_iq = 3.8; 16 | 17 | case 2 18 | % 19 | Ki_speed = 3; 20 | Kp_speed = 0.4; 21 | Ka_speed = 5; 22 | 23 | Ki_id = 463; 24 | Kp_id = 3.8; 25 | 26 | Ki_iq = 463; 27 | Kp_iq = 3.8; 28 | 29 | case 3 30 | % 31 | Ki_speed = 3; 32 | Kp_speed = 0.3; 33 | Ka_speed = 5; 34 | 35 | Ki_id = 463; 36 | Kp_id = 3.8; 37 | 38 | Ki_iq = 463; 39 | Kp_iq = 3.8; 40 | 41 | case 4 42 | %Lab values 43 | Ki_speed = 3; 44 | Kp_speed = 0.4; 45 | Ka_speed = 5; 46 | 47 | Ki_id = 463; 48 | Kp_id = 3.8; 49 | 50 | Ki_iq = 463; 51 | Kp_iq = 3.8; 52 | 53 | case 5 54 | %Lab values 55 | Ki_speed = 1; 56 | Kp_speed = 0.1; 57 | Ka_speed = 5; 58 | 59 | Ki_id = 463; 60 | Kp_id = 3.8; 61 | 62 | Ki_iq = 463; 63 | Kp_iq = 3.8; 64 | end 65 | 66 | model_parameters -------------------------------------------------------------------------------- /model_parameters.m: -------------------------------------------------------------------------------- 1 | % Siemens PMSM ROTEC 1FT6084-8SH7 2 | nrat = 4500; % Rated speed [rpm] 3 | Npp = 4; % Number of pole pairs = 1/2 number of poles 4 | Omegae_rat = 2*pi*nrat/60*Npp; % Rated electrical angular frequency 5 | Lndmpm = 0.12258; % Rotor peak PM flux linkage [Web.turns], 6 | Rs = 0.268*1; % [Ohm] Rs = system resistance = machine resistance, cable resistance, and inverter resistance. 7 | Ld = 2.2e-3; % [H] d-axis inductance 8 | Lq = 2.2e-3; % [H] q-axis inductance 9 | % The motor is a surface mounted PMSM 10 | L_pm = Lq; 11 | L_q = L_pm; 12 | L_s = L_pm; 13 | f =-Rs/L_pm; 14 | g =1/L_pm; 15 | Vs = 360; % Max. RMS phase voltage 16 | Vph = Vs*sqrt(2); % Peak value of phase voltage [V] 17 | 18 | % Limiting the max. transient current in the output of speed loop PI 19 | I_rated = 18; % Peak rated power 20 | Iphmax = I_rated*sqrt(2)*3; 21 | 22 | % Mechanical system 23 | Kt = 1.01; % Torque constant [Nm/A] 24 | J = 0.0146; % Total inertia: J_induction motor+J_PMSM+J_coupling [J.m^2] 25 | B_m = 0.0016655; % Viscous friction [Ns/m] 26 | C_m = 0.2295; % Columb friction [Nm] 27 | gamma = 0.001; % constant for tanh function for columb friction 28 | Trat = 14; % Rated torque [Nm] 29 | Tl_const = Trat/nrat^2; % Fan load torque constants 30 | 31 | % Danfoss FC302 VSI 15 kW 32 | fs = 1*5e3; % switching frequency of inverter [kHz] 33 | ts = 1/fs; 34 | d_mode = 'tustin'; 35 | t_dead = 2.5*10^(-6); % Dead Time [sec] 36 | 37 | % Initilizing the Simulink model 38 | Omegae_ini = 0; % Initial motor shaft speed, electrical value, [rad] 39 | Lndd_ini = Lndmpm; % This means at t=0, theta=0 and N-pole aligned with d-axis 40 | 41 | % Limits from lab model 42 | i_maxim_PM = 35; % maximum current of PMSM [A] 43 | Vdq_limit = 300; 44 | T_PM_limit = 14; % load torque limit --------------------------------------------------------------------------------