Changeset 1387 for applications

Show
Ignore:
Timestamp:
09/09/11 12:50:56 (13 years ago)
Author:
smidl
Message:

oprava simulator + log do bic3

Location:
applications/pmsm
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • applications/pmsm/experiments/ctrl.cfg

    r1294 r1387  
    4040controllers=({ 
    4141                class = "PMSM_PICtrl"; 
    42                 estim = "UD"; 
     42//              estim = "UD"; 
    4343        } 
    4444); 
  • applications/pmsm/experiments/ctrl_lq_dq2.cfg

    r1385 r1387  
    1414//      profileW = [0, 500, 1000, 1500, 2000, 2500, 3000 ];      
    1515//      profileW = [0, -10, 30, 60, 90, 60, 30, 0, -30, -60, -30]; 
     16        profileW = [0, -1, 3, 6, 9, 6, 3, 0, 0, 0, 0, 0,0,-3, -6, -3]; 
    1617//      profileW = [1, 10, 50, 200, 200, 30, 0, 0, -30, -30, -100, -100, -40, 0, 0]; 
    17         profileW = [1, 10, 50, 200, 200, 30, 1, 1, -1, -10, -50, -200, -200, -30, 0]; 
     18//      profileW = [1, 10, 50, 200, 200, 30, 1, 1, -1, -10, -50, -200, -200, -30, 0]; 
    1819//      profileW = [250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000, 3000]; 
    1920//      profileM = [0, 30, 0, 0, 30, 0, 0, 0, 0, 0, 10, 0, 0]; 
     
    2122}; 
    2223 
    23 UD = {class="EKFfull"; 
     24UD = {class="EKF_UD"; 
    2425         IM = {class="IMpmsmStat"; 
    2526                params = "pmsm107@./cfg/zcu.cfg"; 
     
    2829//      dQ=[0.1, 0.1, 0.1, 0.001]; ///??????????????? 
    2930//      dQ=[0.1, 0.1, 10.01, 10.01]; 
    30         dQ=[0.1, 0.1, 0.1, 0.1]; 
     31        dQ=[0.1, 0.1, 0.1, 0.01]; 
    3132        dR=[0.05, 0.05]; 
    3233         //connect 
    33          log_level="logmean"; 
     34         log_level="logmean,logU,logD,logC"; 
    3435         name = "Est0"; 
    3536         }; 
     
    100101//              rpd = 0.1; 
    101102                rpd = 0.00417; 
    102                 bcbv = 5.0; 
    103 //              bcbv = 0.0; 
    104                 biver = 6; 
    105                 injkon = 10.0; 
     103                bcbv = 6.0; 
     104                //bcbv = 0.0; 
     105                biver = 3; 
     106                injkon = 3.0; 
    106107                injome = 500.0; 
    107108                injphi = 0.0; 
     109                 
     110                // PI parametry 
     111                PIw_Pd = 3.0; 
     112                PIw_Pi = 0.0037; 
     113                 
     114                PIu_Pd = 20.0; 
     115                PIu_Pi = 0.5; 
     116 
     117                log_level = "logModel"; 
    108118        } 
    109119); 
  • applications/pmsm/pmsmDS.h

    r1380 r1387  
    3838    int Dt;     
    3939public: 
    40         double x[8]; 
    41         double KalmanObs[8]; 
     40        double x[9]; 
     41        double KalmanObs[6]; 
    4242    //! Constructor with fixed sampling period 
    4343    pmsmDS () : DS() 
     
    216216                void step() 
    217217                { 
    218                         double t=pmsmsim_get_t(); 
     218                        pmsmsim_fill_xy(x,KalmanObs); 
     219                        double t; 
    219220                         
    220221                        static int ind=0; 
    221222                        static double dW; // increase of W 
    222223                        static double Mz; // W 
    223                         t+=125e-6; 
     224                        t=pmsmsim_get_t(); 
    224225                        if ( t>=dt_prof*ind ) 
    225226                        { 
  • applications/pmsm/pmsm_ctrl.h

    r1386 r1387  
    129129                        return vec_1(tmp); 
    130130        } 
     131        void set_params(double Pd0, double Pi0){ 
     132                Pd=Pd0; 
     133                Pi=Pi0; 
     134        } 
     135        void get_params(double &Pd0, double &Pi0){ 
     136                Pd0=Pd; 
     137                Pi0=Pi; 
     138        } 
    131139}; 
    132140 
     
    160168        PMSMCtrl():Controller() { 
    161169                rv = RV("{ua ub }"); 
    162                 rvc = RV("{o_ia o_ib t_ua t_ub o_om o_th Ww }"); 
     170                rvc = RV("{o_ia o_ib o_ua o_ub o_om o_th Ww }"); 
    163171        } 
    164172         
     
    13601368 
    13611369class PMSM_LQCtrl_bic3: public PMSMCtrl{ 
     1370        LOG_LEVEL(PMSM_LQCtrl_bic3, logModel); 
    13621371public: 
     1372         
    13631373/* 
    13641374PMSMCtrl: 
     
    14311441// inj 
    14321442        double injkon, injome, injphi; 
    1433          
     1443        int minindex; 
    14341444                 
    14351445        PMSM_LQCtrl_bic3():PMSMCtrl(), a(0.9898), b(0.0072), c(0.0361), d(1.0), e(0.0149), 
     
    15741584                        varPth(2) = Pt5(1,1); 
    15751585                                 
    1576                         int minindex = 0; 
     1586                        minindex = 0; 
    15771587                        for(int i = 1; i < 3; i++){ 
    15781588                                if(varPth(i) < varPth(minindex)){                                
     
    16731683                        varPth(4) = Pt5(1,1); 
    16741684                                 
    1675                         int minindex = 0; 
     1685                        minindex = 0; 
    16761686                        for(int i = 1; i < 5; i++){ 
    16771687                                if(varPth(i) < varPth(minindex)){                                
     
    17511761                UI::get(injome,set, "injome", UI::optional); 
    17521762                UI::get(injphi,set, "injphi", UI::optional); 
     1763                 
     1764                double Pi,Pd; 
     1765                Cwq.get_params(Pd,Pi); 
     1766                UI::get(Pi,set,"PIw_Pi",UI::optional); 
     1767                UI::get(Pd,set,"PIw_Pd",UI::optional); 
     1768                Cwq.set_params(Pd,Pi); 
     1769                 
     1770                Cud.get_params(Pd,Pi); 
     1771                UI::get(Pi,set,"PIu_Pi",UI::optional); 
     1772                UI::get(Pd,set,"PIu_Pd",UI::optional); 
     1773                Cud.set_params(Pd,Pi); 
     1774                Cuq.set_params(Pd,Pi); 
     1775 
    17531776        } 
    17541777 
     
    18041827                lq.redesign(); 
    18051828        } 
     1829         
     1830        void log_register ( logger &L, const string &prefix ) { 
     1831                PMSMCtrl::log_register(L,prefix); 
     1832                L.add_vector ( log_level, logModel, RV ( 1), prefix ); 
     1833        } 
     1834        void log_write() const{ 
     1835                PMSMCtrl::log_write(); 
     1836                log_level.store( logModel , double(minindex));  
     1837                 
     1838        } 
     1839 
    18061840}; 
    18071841UIREGISTER(PMSM_LQCtrl_bic3); 
  • applications/pmsm/simulator_zdenek/simulator.cpp

    r1380 r1387  
    506506  KalmanObs[6]=usxf; 
    507507  KalmanObs[7]=usyf; 
    508    
     508  
     509  t+=h; 
    509510} 
    510511//////////////////////////////////////////////////////////////////////////////////////////////////////