1 | function [x,y]=pmsm_sim(input) |
---|
2 | % Realistic simulator of PMSM with power electronics. |
---|
3 | % For implementation reasons, functionality of the simulator is split |
---|
4 | % according to the number of arguments as follows: |
---|
5 | % |
---|
6 | % Usage: |
---|
7 | % DefaultParameters = pmsm_sim; % Initialize (compulsory) |
---|
8 | % NewParam = pmsm_sim(NewParameters); % Change parameters |
---|
9 | % [x,y] = pmsm_sim(omega_ref,Mz); % Internally controlled sim. step |
---|
10 | % [x,y] = pmsm_sim(usa,usb,Mz); % Externally controlled sim. step |
---|
11 | % |
---|
12 | % Parameters = [Rs, Ls, Fmag, Bf, p, kp, J, Uc, DT, dt] |
---|
13 | % Rs..J -- PSMSM parameters |
---|
14 | % Uc -- DC link voltage |
---|
15 | % DT -- Dead Time |
---|
16 | % dt -- internal simulation step |
---|
17 | % |
---|
18 | % x = [isa,isb,omega,theta,Torque,Fsd,isd,isq,Mz]; |
---|
19 | % y = [usa_req, usb_req, isa, isb, usa_av, usb_av]; |
---|
20 | % us[a,b]_req -- requested voltage (before PWM) |
---|
21 | % us[a,b]_av -- avereged true voltage (after PWM) |
---|
22 | % |
---|
23 | |
---|