Changeset 666 for applications/pmsm
- Timestamp:
- 10/19/09 22:24:47 (15 years ago)
- Location:
- applications/pmsm
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/pmsm.h
r654 r666 13 13 //TODO hardcoded RVs!!! 14 14 RV rx ( "{ia ib om th }"); 15 RV ru ( "{ uaub }");15 RV ru ( "{o_ua o_ub }"); 16 16 RV ry ( "{oia oib }"); 17 17 … … 25 25 double Rs, Ls, dt, Ypm, kp, p, J, Mz; 26 26 27 bool compensate; 27 28 public: 28 IMpmsm() :diffbifn ( ) {dimy=4; dimx = 4; dimu=2; };29 IMpmsm() :diffbifn ( ) {dimy=4; dimx = 4; dimu=2; dimc=6;compensate=true;}; 29 30 //! Set mechanical and electrical variables 30 31 virtual void set_parameters ( double Rs0, double Ls0, double dt0, double Ypm0, double kp0, double p0, double J0, double Mz0 ) {Rs=Rs0; Ls=Ls0; dt=dt0; Ypm=Ypm0; kp=kp0; p=p0; J=J0; Mz=Mz0;} … … 58 59 double ubm; 59 60 60 modelpwm(x0,u0,uam,ubm); 61 if (compensate){ 62 modelpwm(x0,u0,uam,ubm); 63 } else { 64 uam = u0(0); 65 ubm = u0(1); 66 } 67 61 68 62 69 vec xk( 4 ); … … 104 111 set_parameters ( params["Rs"], params["Ls"], 125e-6, params["Fmag"], \ 105 112 params["kp"], params["p"], params["J"], 0.0); 113 int comp; 114 if (UI::get(comp,root,"compensate",UI::optional)){compensate=(comp==1);} 106 115 }; 107 116 … … 306 315 class OMpmsm: public diffbifn { 307 316 public: 308 OMpmsm() :diffbifn () {dimy=2;dimx=4;dimu= 2;};317 OMpmsm() :diffbifn () {dimy=2;dimx=4;dimu=0;}; 309 318 310 319 vec eval ( const vec &x0, const vec &u0 ) { -
applications/pmsm/pmsm_estim.cpp
r654 r666 12 12 #include "pmsmDS.h" 13 13 #include "filters.h" 14 #include "base/datasources.h" 14 15 15 16