Changeset 349 for applications
- Timestamp:
- 05/27/09 21:40:30 (16 years ago)
- Location:
- applications/pmsm
- Files:
-
- 5 added
- 8 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/Barcelona/Mz_mx.cfg
r346 r349 9 9 params = {type = "external";filename = "../cfg/zcu.cfg";path = "pmsm107";}; 10 10 tstep = 1.0; // steps for profile in [s] 11 profileW = [0, 1, 5, 10, 10, 3, 0, 0, -3, -3, -10, -10, -4, 0, 0];12 profileM = [0, 10, 0, 0, 10, 0, 0, 0, 0, 0, 10, 0, 0];13 options = "modelu";11 profileW = [0, 3, 10, 10, 3, 0, 0, -3, -3, -3, -10, -10, -4, 0, 0]; 12 profileM = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; 13 // options = "modelu"; 14 14 }; 15 15 … … 26 26 cols = 4; 27 27 };*/ 28 dQ=[0.0 017, 0.0017, 0.00000004, 1e-14, 1e-1];28 dQ=[0.017, 0.017, 0.00000004, 1e-14, 1e-1]; 29 29 dR=[0.025, 0.025]; 30 30 dP0=[0., 0., 0., 0., 0.]; -
applications/pmsm/Barcelona/Mz_mx.m
r346 r349 10 10 hold on 11 11 plot(M.crb(:,4),'r'); 12 13 figure(2) 14 hold off 15 plot(M.crbz(:,3)); 16 hold on 17 plot(M.crb(:,3),'r'); 18 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))] -
applications/pmsm/Barcelona/QandR.m
r342 r349 23 23 1e-7]; 24 24 25 Q = StdQ.^225 Qu = (dt/Ls)^2*(2*3)^2/12; 26 26 27 27 %R -
applications/pmsm/Barcelona/real.cfg
r346 r349 2 2 3 3 experiment={ 4 ndat = 32000;4 ndat = 8000; 5 5 }; 6 6 7 7 system= { 8 8 type = "ITppFileDS"; 9 filename = "tec00 13ALL.it";9 filename = "tec0009ALL.it"; 10 10 varname="D"; 11 11 rv = {type="rv"; names=["o_ia","o_ib","o_ua","o_ub"];}; // observed u … … 23 23 dR=[0.025, 0.025]; 24 24 dP0=[1., 1., 1., 10., 1e-10]; 25 mu0=[1., 1., 1., 2.4, 1e-10]; 25 26 //connect 26 27 drv = {type="rv"; names=["o_ia","o_ib","o_ua","o_ub"];}; // observed u … … 33 34 logger= { 34 35 type="itpplog"; 35 maxlen = 32000;36 maxlen = 8000; 36 37 filename = "real.it"; 37 38 }; -
applications/pmsm/Barcelona/real_mx.cfg
r346 r349 2 2 3 3 experiment={ 4 ndat = 32000;4 ndat = 8000;//32000; 5 5 }; 6 6 7 7 system= { 8 8 type = "ITppFileDS"; 9 filename = "tec00 13ALL.it";9 filename = "tec0009ALL.it"; 10 10 varname="D"; 11 11 rv = {type="rv"; names=["o_ia","o_ib","o_ua","o_ub"];}; // observed u … … 19 19 }; 20 20 OM = {type="pmsmOM";}; 21 // dQ=[0.017, 0.017, 0.00000004, 1e-14, 1e-30];22 d Q=[0.017, 0.017, 0.00000007, 1e-14, 1e-3];23 dR=[0.025, 0.025];21 dQ=[6e-3, 6e-3, 5e-7, 3e-13, 1e-2]; 22 dR=[0.0025, 0.0025]; 23 mu0=[0., 0., 0.,3.4, 1e-10]; 24 24 dP0=[1., 1., 1., 10., 1e-10]; 25 25 //connect … … 31 31 IM = {type="pmsmIM"; 32 32 params = {type = "external";filename = "../cfg/zcu.cfg";path = "pmsm107";}; 33 variant = " Stat";33 variant = "2o"; 34 34 }; 35 35 OM = {type="pmsmOM";}; 36 // dQ=[0.017, 0.017, 0.00000004, 1e-14, 1e-30];37 d Q=[0.017, 0.017, 1.0, 1e-8];38 dR=[0.025, 0.025];36 dQ=[6e-3, 6e-3, 0.3, 5e-9]; 37 dR=[0.0025, 0.0025]; 38 mu0=[0., 0., 0.,3.4]; 39 39 dP0=[1., 1., 1., 10.]; 40 40 //connect … … 47 47 logger= { 48 48 type="mexlog"; 49 maxlen = 31999;49 maxlen = 7999; 50 50 }; -
applications/pmsm/Barcelona/real_pmsm.m
r346 r349 1 1 M=pmsm_estim_mex('real_mx.cfg'); 2 2 3 ids = [1:size(M. EKFMz_mean,1)];3 ids = [1:size(M.mean_EKFMz,1)]; 4 4 kftime=[ids-ids(1)]*0.000125; 5 5 … … 7 7 subplot(2,1,1); 8 8 hold off 9 plot(kftime,M. EKFMz_mean(ids,3)/2/pi);9 plot(kftime,M.mean_EKFMz(ids,3)/2/pi,'-.'); 10 10 hold on 11 plot(kftime,M.EKF_mean(ids,3)/2/pi,'r'); 11 plot(kftime,M.mean_EKF(ids,3)/2/pi,'r'); 12 13 title('Measured and estimated \omega_{me}'); 14 xlabel('time [s]') 12 15 13 16 subplot(2,1,2); 14 plot(kftime, M.EKFMz_mean(ids,5)); 17 plot(kftime, M.mean_EKFMz(ids,5)); 18 title('Estimated load T_L'); 19 15 20 16 21 % ----- 17 22 18 load ~/work/vs/Pohony/DATA_MERENI/DATA_MCU/data1.dat -ascii 23 load ~/work/vs/Pohony/DATA_MERENI/DATA_MCU/data9.dat -ascii 24 25 data=data9; 19 26 20 27 subplot(2,1,1); 21 28 setime=[0:799]*0.004666; % fitted on currents 22 plot(setime,data 13([0:799]+711,6),'--k','LineWidth',3);23 plot(setime,data13([0:799]+711,11),'--g','LineWidth',3);29 plot(setime,data([0:799]+711,6),'--k','LineWidth',3); 30 %plot(setime,data([0:799]+711,11),'--g','LineWidth',3); 24 31 %plot(setime,2*pi*data1([0:799]+620,6),'--k','LineWidth',3); 25 32 33 legend('EKF T_L estimate','EKF estimate','Sensor readings') 26 34 35 set(gca,'XLim',[0,kftime(end)]) -
applications/pmsm/pmsm.h
r332 r349 30 30 31 31 void modelpwm(const vec &x0, const vec u0, double &ua, double &ub){ 32 /* ua=u0[0]; 33 ub=u0[1]; 34 return;*/ 32 35 double sq3=sqrt ( 3.0 ); 33 36 double i1=x0(0); -
applications/pmsm/pmsmDS.h
r342 r349 13 13 #include <stat/loggers.h> 14 14 #include <estim/libKF.h> 15 #include "simulator .h"15 #include "simulator_zdenek/simulator.h" 16 16 #include "pmsm.h" 17 17 … … 149 149 vec true_state=vec(x,4); // read from pmsm 150 150 E.set_mu(true_state); 151 151 mu=true_state; 152 152 153 //integration error 153 154 old_true(4)=KalmanObs[4]; … … 199 200 200 201 void log_add(logger &L, const string &name="" ){ 201 L_CRB=L.add(concat(rx,RV("Mz",1,0)),"crb ");202 L_CRB=L.add(concat(rx,RV("Mz",1,0)),"crbz"); 202 203 } 203 204 void logit(logger &L){