Changeset 352

Show
Ignore:
Timestamp:
06/02/09 10:04:12 (15 years ago)
Author:
smidl
Message:

Barcelona

Location:
applications/pmsm
Files:
4 modified

Legend:

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

    r349 r352  
    2121         }; 
    2222         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]; 
    3025         dP0=[0., 0., 0., 0., 0.]; 
    3126         //connect 
     
    4338         }; 
    4439         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]; 
    4842         dP0=[0., 0., 0., 0., 0.]; 
    4943         //connect 
     
    6054         }; 
    6155         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]; 
    6457         dR=[0.025, 0.025]; 
    65          dP0=[0., 0., 0., 0., 0.]; 
     58         dP0=[0., 0., 0., 0.]; 
    6659         //connect 
    6760         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'); 
     1if 0 
     2    M=pmsm_estim_mex('Mz_mx.cfg'); 
     3    save Mz M 
     4else 
     5    load Mz 
     6end 
     7 
     8time = 0.000125*[0:size(M.crbzth,1)-1]; 
    29 
    310figure(1) 
    411subplot(2,1,1); 
    5 plot(M.x(:,3)); 
     12plot(time,M.xom); 
     13grid on 
     14title('Simulated rotor speed profile'); 
    615 
    716subplot(2,1,2); 
    817hold off 
    9 plot(M.crbz(:,4)); 
     18plot(time,M.crbzth); 
    1019hold on 
    11 plot(M.crb(:,4),'r'); 
     20plot(time,M.crbth,'r--'); 
     21grid on 
     22legend('EKF TL','EKF') 
     23title('Cramer-Rao bounds on rotor position') 
    1224 
    1325figure(2) 
    1426hold off 
    15 plot(M.crbz(:,3)); 
     27plot(time,M.crbzom); 
    1628hold on 
    17 plot(M.crb(:,3),'r'); 
     29plot(time,M.crbom,'r'); 
    1830 
    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))] 
     31ind=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  
    3838 
    3939bnds = [max(abs(M.modelua-M.tua)), max(abs(M.modelub-M.tub)) 0 0]; 
    40 Qpwm = (dt/Ls)^2*(2*bnds).^2/12 
     40Qpwm = (dt/Ls)^2*[1 1 0 0]%(2*bnds).^2/12 
    4141 
    4242%%%%%%%%%%%%%%% Integration 
  • applications/pmsm/pmsm_ui.h

    r342 r352  
    113113                        mat P0; 
    114114                        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                        } 
    116118                        E->set_statistics(mu0,P0); 
    117119