Changeset 1380 for applications/pmsm/simulator_zdenek/simulator.cpp
- Timestamp:
- 08/01/11 22:11:09 (13 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/simulator_zdenek/simulator.cpp
r1306 r1380 42 42 43 43 // system state 44 double x[9]; // (isx,isy,wme,theta_e,M,Fsd,Isd,Isq,Mz)44 static double x[9]; // (isx,isy,wme,theta_e,M,Fsd,Isd,Isq,Mz) 45 45 46 46 // internal variables of PWM module … … 70 70 71 71 // output for EKF (voltages and measured currents, which are fed to KalmanObs) 72 double KalmanObs[10]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; // usx, usy, Isx, Isy, usx_av, usy_av72 static double KalmanObs[10]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; // usx, usy, Isx, Isy, usx_av, usy_av 73 73 74 74 // real-time 75 double t=0.; //VS removed static due to clash with export in .h75 static double t=0.; //VS removed static due to clash with export in .h 76 76 77 77 // stator voltage components in alfa beta (inluding impact of the real dc-link voltage) … … 510 510 ////////////////////////////////////////////////////////////////////////////////////////////////////// 511 511 ////////////////////////////////////////////////////////////////////////////////////////////////////// 512 513 // for mexfile 514 void pmsmsim_fill_parameters(double x_out[10]){ 515 x_out[0]= Rs; 516 x_out[1]= Ls; 517 x_out[2]= Fmag; 518 x_out[3]= Bf; 519 x_out[4]= p; 520 x_out[5]= kp; 521 x_out[6]= J; 522 x_out[7]= Uc; 523 x_out[8]= DT; 524 x_out[9]= h; 525 } 526 void pmsmsim_fill_xy(double xout[9], double yout[6]){ 527 for (int i=0;i<9;i++){ 528 xout[i]=x[i]; 529 } 530 for (int i=0;i<6;i++){ 531 yout[i]=KalmanObs[i]; 532 } 533 } 534 double pmsmsim_get_t() 535 { 536 return t; 537 } 538