Changeset 349

Show
Ignore:
Timestamp:
05/27/09 21:40:30 (15 years ago)
Author:
smidl
Message:

Barcelona + mex for pmsm + results of pwm experiment for off-line use with pwm.m (>> pwm(0))

Location:
applications/pmsm
Files:
5 added
8 modified

Legend:

Unmodified
Added
Removed
  • applications/pmsm/Barcelona/Mz_mx.cfg

    r346 r349  
    99        params = {type = "external";filename = "../cfg/zcu.cfg";path = "pmsm107";}; 
    1010        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"; 
    1414}; 
    1515 
     
    2626        cols = 4; 
    2727        };*/ 
    28         dQ=[0.0017, 0.0017, 0.00000004, 1e-14, 1e-1]; 
     28        dQ=[0.017, 0.017, 0.00000004, 1e-14, 1e-1]; 
    2929         dR=[0.025, 0.025]; 
    3030         dP0=[0., 0., 0., 0., 0.]; 
  • applications/pmsm/Barcelona/Mz_mx.m

    r346 r349  
    1010hold on 
    1111plot(M.crb(:,4),'r'); 
     12 
     13figure(2) 
     14hold off 
     15plot(M.crbz(:,3)); 
     16hold on 
     17plot(M.crb(:,3),'r'); 
     18 
     19ind=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  
    2323    1e-7]; 
    2424 
    25 Q= StdQ.^2 
     25Qu = (dt/Ls)^2*(2*3)^2/12; 
    2626 
    2727%R 
  • applications/pmsm/Barcelona/real.cfg

    r346 r349  
    22 
    33experiment={ 
    4         ndat = 32000; 
     4        ndat = 8000; 
    55}; 
    66 
    77system= { 
    88        type = "ITppFileDS"; 
    9         filename = "tec0013ALL.it"; 
     9        filename = "tec0009ALL.it"; 
    1010        varname="D"; 
    1111        rv = {type="rv"; names=["o_ia","o_ib","o_ua","o_ub"];};  // observed u 
     
    2323         dR=[0.025, 0.025]; 
    2424         dP0=[1., 1., 1., 10., 1e-10]; 
     25         mu0=[1., 1., 1., 2.4, 1e-10]; 
    2526         //connect 
    2627         drv = {type="rv"; names=["o_ia","o_ib","o_ua","o_ub"];};  // observed u 
     
    3334logger= { 
    3435        type="itpplog"; 
    35         maxlen = 32000; 
     36        maxlen = 8000; 
    3637        filename = "real.it"; 
    3738}; 
  • applications/pmsm/Barcelona/real_mx.cfg

    r346 r349  
    22 
    33experiment={ 
    4         ndat = 32000; 
     4        ndat = 8000;//32000; 
    55}; 
    66 
    77system= { 
    88        type = "ITppFileDS"; 
    9         filename = "tec0013ALL.it"; 
     9        filename = "tec0009ALL.it"; 
    1010        varname="D"; 
    1111        rv = {type="rv"; names=["o_ia","o_ib","o_ua","o_ub"];};  // observed u 
     
    1919         }; 
    2020         OM = {type="pmsmOM";}; 
    21 //       dQ=[0.017, 0.017, 0.00000004, 1e-14, 1e-30]; 
    22          dQ=[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]; 
    2424         dP0=[1., 1., 1., 10., 1e-10]; 
    2525         //connect 
     
    3131         IM = {type="pmsmIM"; 
    3232                params = {type = "external";filename = "../cfg/zcu.cfg";path = "pmsm107";}; 
    33                 variant = "Stat"; 
     33                variant = "2o"; 
    3434         }; 
    3535         OM = {type="pmsmOM";}; 
    36 //       dQ=[0.017, 0.017, 0.00000004, 1e-14, 1e-30]; 
    37          dQ=[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]; 
    3939         dP0=[1., 1., 1., 10.]; 
    4040         //connect 
     
    4747logger= { 
    4848        type="mexlog"; 
    49         maxlen = 31999; 
     49        maxlen = 7999; 
    5050}; 
  • applications/pmsm/Barcelona/real_pmsm.m

    r346 r349  
    11M=pmsm_estim_mex('real_mx.cfg'); 
    22 
    3 ids = [1:size(M.EKFMz_mean,1)]; 
     3ids = [1:size(M.mean_EKFMz,1)]; 
    44kftime=[ids-ids(1)]*0.000125; 
    55 
     
    77subplot(2,1,1); 
    88hold off 
    9 plot(kftime,M.EKFMz_mean(ids,3)/2/pi); 
     9plot(kftime,M.mean_EKFMz(ids,3)/2/pi,'-.'); 
    1010hold on 
    11 plot(kftime,M.EKF_mean(ids,3)/2/pi,'r'); 
     11plot(kftime,M.mean_EKF(ids,3)/2/pi,'r'); 
     12 
     13title('Measured and estimated \omega_{me}'); 
     14xlabel('time [s]') 
    1215 
    1316subplot(2,1,2); 
    14 plot(kftime, M.EKFMz_mean(ids,5)); 
     17plot(kftime, M.mean_EKFMz(ids,5)); 
     18title('Estimated load T_L'); 
     19 
    1520 
    1621% -----  
    1722 
    18 load ~/work/vs/Pohony/DATA_MERENI/DATA_MCU/data1.dat -ascii 
     23load ~/work/vs/Pohony/DATA_MERENI/DATA_MCU/data9.dat -ascii 
     24 
     25data=data9; 
    1926 
    2027subplot(2,1,1); 
    2128setime=[0:799]*0.004666; % fitted on currents 
    22 plot(setime,data13([0:799]+711,6),'--k','LineWidth',3); 
    23 plot(setime,data13([0:799]+711,11),'--g','LineWidth',3); 
     29plot(setime,data([0:799]+711,6),'--k','LineWidth',3); 
     30%plot(setime,data([0:799]+711,11),'--g','LineWidth',3); 
    2431%plot(setime,2*pi*data1([0:799]+620,6),'--k','LineWidth',3); 
    2532 
     33legend('EKF T_L estimate','EKF estimate','Sensor readings') 
    2634 
     35set(gca,'XLim',[0,kftime(end)]) 
  • applications/pmsm/pmsm.h

    r332 r349  
    3030 
    3131        void modelpwm(const vec &x0, const vec u0, double &ua, double &ub){ 
     32/*              ua=u0[0]; 
     33                ub=u0[1]; 
     34                return;*/ 
    3235                double sq3=sqrt ( 3.0 ); 
    3336                double i1=x0(0); 
  • applications/pmsm/pmsmDS.h

    r342 r349  
    1313#include <stat/loggers.h> 
    1414#include <estim/libKF.h> 
    15 #include "simulator.h" 
     15#include "simulator_zdenek/simulator.h" 
    1616#include "pmsm.h" 
    1717 
     
    149149                vec true_state=vec(x,4); // read from pmsm 
    150150                E.set_mu(true_state); 
    151                  
     151                mu=true_state; 
     152                         
    152153                //integration error 
    153154                old_true(4)=KalmanObs[4]; 
     
    199200         
    200201                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"); 
    202203                } 
    203204                void logit(logger &L){