Changeset 1387
- Timestamp:
- 09/09/11 12:50:56 (13 years ago)
- Location:
- applications/pmsm
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/experiments/ctrl.cfg
r1294 r1387 40 40 controllers=({ 41 41 class = "PMSM_PICtrl"; 42 estim = "UD";42 // estim = "UD"; 43 43 } 44 44 ); -
applications/pmsm/experiments/ctrl_lq_dq2.cfg
r1385 r1387 14 14 // profileW = [0, 500, 1000, 1500, 2000, 2500, 3000 ]; 15 15 // 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]; 16 17 // 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]; 18 19 // profileW = [250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000, 3000]; 19 20 // profileM = [0, 30, 0, 0, 30, 0, 0, 0, 0, 0, 10, 0, 0]; … … 21 22 }; 22 23 23 UD = {class="EKF full";24 UD = {class="EKF_UD"; 24 25 IM = {class="IMpmsmStat"; 25 26 params = "pmsm107@./cfg/zcu.cfg"; … … 28 29 // dQ=[0.1, 0.1, 0.1, 0.001]; ///??????????????? 29 30 // 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]; 31 32 dR=[0.05, 0.05]; 32 33 //connect 33 log_level="logmean ";34 log_level="logmean,logU,logD,logC"; 34 35 name = "Est0"; 35 36 }; … … 100 101 // rpd = 0.1; 101 102 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; 106 107 injome = 500.0; 107 108 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"; 108 118 } 109 119 ); -
applications/pmsm/pmsmDS.h
r1380 r1387 38 38 int Dt; 39 39 public: 40 double x[ 8];41 double KalmanObs[ 8];40 double x[9]; 41 double KalmanObs[6]; 42 42 //! Constructor with fixed sampling period 43 43 pmsmDS () : DS() … … 216 216 void step() 217 217 { 218 double t=pmsmsim_get_t(); 218 pmsmsim_fill_xy(x,KalmanObs); 219 double t; 219 220 220 221 static int ind=0; 221 222 static double dW; // increase of W 222 223 static double Mz; // W 223 t +=125e-6;224 t=pmsmsim_get_t(); 224 225 if ( t>=dt_prof*ind ) 225 226 { -
applications/pmsm/pmsm_ctrl.h
r1386 r1387 129 129 return vec_1(tmp); 130 130 } 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 } 131 139 }; 132 140 … … 160 168 PMSMCtrl():Controller() { 161 169 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 }"); 163 171 } 164 172 … … 1360 1368 1361 1369 class PMSM_LQCtrl_bic3: public PMSMCtrl{ 1370 LOG_LEVEL(PMSM_LQCtrl_bic3, logModel); 1362 1371 public: 1372 1363 1373 /* 1364 1374 PMSMCtrl: … … 1431 1441 // inj 1432 1442 double injkon, injome, injphi; 1433 1443 int minindex; 1434 1444 1435 1445 PMSM_LQCtrl_bic3():PMSMCtrl(), a(0.9898), b(0.0072), c(0.0361), d(1.0), e(0.0149), … … 1574 1584 varPth(2) = Pt5(1,1); 1575 1585 1576 intminindex = 0;1586 minindex = 0; 1577 1587 for(int i = 1; i < 3; i++){ 1578 1588 if(varPth(i) < varPth(minindex)){ … … 1673 1683 varPth(4) = Pt5(1,1); 1674 1684 1675 intminindex = 0;1685 minindex = 0; 1676 1686 for(int i = 1; i < 5; i++){ 1677 1687 if(varPth(i) < varPth(minindex)){ … … 1751 1761 UI::get(injome,set, "injome", UI::optional); 1752 1762 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 1753 1776 } 1754 1777 … … 1804 1827 lq.redesign(); 1805 1828 } 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 1806 1840 }; 1807 1841 UIREGISTER(PMSM_LQCtrl_bic3); -
applications/pmsm/simulator_zdenek/simulator.cpp
r1380 r1387 506 506 KalmanObs[6]=usxf; 507 507 KalmanObs[7]=usyf; 508 508 509 t+=h; 509 510 } 510 511 //////////////////////////////////////////////////////////////////////////////////////////////////////