Changeset 352 for applications
- Timestamp:
- 06/02/09 10:04:12 (16 years ago)
- Location:
- applications/pmsm
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/Barcelona/Mz_mx.cfg
r349 r352 21 21 }; 22 22 OM = {type="pmsmOM";}; 23 /* dQ : 24 { 25 elements = [ 0.001738643873, 0.001738643873, 1.00000004, 1.562501e-08, 1 ]; 26 cols = 4; 27 };*/ 28 dQ=[0.017, 0.017, 0.00000004, 1e-14, 1e-1]; 29 dR=[0.025, 0.025]; 23 dQ=[0.002, 0.002, 5e-7, 3e-13, 1e-1]; 24 dR=[0.0025, 0.0025]; 30 25 dP0=[0., 0., 0., 0., 0.]; 31 26 //connect … … 43 38 }; 44 39 OM = {type="pmsmOM";}; 45 dQ=[0.0017, 0.0017, 0.00000004, 1e-14, 1e-1]; 46 // dQ=[0.017, 0.017, .1, 1e-6];//[0.017, 0.017, 100., 1e-4]; 47 dR=[0.025, 0.025]; 40 dQ=[0.002, 0.002, 5e-7, 3e-13, 1e-1]; 41 dR=[0.0025, 0.0025]; 48 42 dP0=[0., 0., 0., 0., 0.]; 49 43 //connect … … 60 54 }; 61 55 OM = {type="pmsmOM";}; 62 dQ=[0.0017, 0.0017, 1.00000004, 1e-8]; 63 // dQ=[0.017, 0.017, .1, 1e-6];//[0.017, 0.017, 100., 1e-4]; 56 dQ=[0.002, 0.002, 0.3, 5e-9]; 64 57 dR=[0.025, 0.025]; 65 dP0=[0., 0., 0., 0. , 0.];58 dP0=[0., 0., 0., 0.]; 66 59 //connect 67 60 drv = {type="rv"; names=["o_ia","o_ib","t_ua","t_ub"];}; // observed u -
applications/pmsm/Barcelona/Mz_mx.m
r349 r352 1 M=pmsm_estim_mex('Mz_mx.cfg'); 1 if 0 2 M=pmsm_estim_mex('Mz_mx.cfg'); 3 save Mz M 4 else 5 load Mz 6 end 7 8 time = 0.000125*[0:size(M.crbzth,1)-1]; 2 9 3 10 figure(1) 4 11 subplot(2,1,1); 5 plot(M.x(:,3)); 12 plot(time,M.xom); 13 grid on 14 title('Simulated rotor speed profile'); 6 15 7 16 subplot(2,1,2); 8 17 hold off 9 plot( M.crbz(:,4));18 plot(time,M.crbzth); 10 19 hold on 11 plot(M.crb(:,4),'r'); 20 plot(time,M.crbth,'r--'); 21 grid on 22 legend('EKF TL','EKF') 23 title('Cramer-Rao bounds on rotor position') 12 24 13 25 figure(2) 14 26 hold off 15 plot( M.crbz(:,3));27 plot(time,M.crbzom); 16 28 hold on 17 plot( M.crb(:,3),'r');29 plot(time,M.crbom,'r'); 18 30 19 ind=100:size(M.crb,1)-100; 20 [min(M.crb(ind,3)), max(M.crb(ind,3))] 21 [min(M.crbz(ind,3)), max(M.crbz(ind,3))] 31 ind=100:size(M.crbth,1)-100; 32 [min(M.crbom(ind)), max(M.crbom(ind))] 33 [min(M.crbzom(ind)), max(M.crbzom(ind))] 34 -
applications/pmsm/Barcelona/pwm.m
r349 r352 38 38 39 39 bnds = [max(abs(M.modelua-M.tua)), max(abs(M.modelub-M.tub)) 0 0]; 40 Qpwm = (dt/Ls)^2* (2*bnds).^2/1240 Qpwm = (dt/Ls)^2*[1 1 0 0]%(2*bnds).^2/12 41 41 42 42 %%%%%%%%%%%%%%% Integration -
applications/pmsm/pmsm_ui.h
r342 r352 113 113 mat P0; 114 114 if (S.exists("mu0")){mu0=getvec(S["mu0"]);}else{mu0=zeros(dim);}; 115 if (S.exists("P0")){mu0=getmat(S["P0"],dim);}else{P0=eye(dim);}; 115 if (S.exists("dP0")){P0=diag(getvec(S["dP0"]));}else{ 116 if (S.exists("P0")){mu0=getmat(S["P0"],dim);}else{P0=eye(dim);}; 117 } 116 118 E->set_statistics(mu0,P0); 117 119