- Timestamp:
- 08/02/12 22:43:00 (12 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/simulator_zdenek/ekf_example/ekf_mm.cpp
r1464 r1466 1 1 #include "ekf_mm.h" 2 2 #include "qmath.h" 3 #include "stdio.h" 3 4 4 5 … … 12 13 // q15 + q15*q13 13 14 (E->x_est)[1]=(((int32)(E->x_est[1])<<15)+(int32)(E->cG)*(E->x_est[0]))>>15; 15 E->x_pred[1]=E->x_est[1]; 16 E->x_pred[0]=E->x_est[0]; 14 17 15 18 mmultACh(E->PSI,E->Chf,E->PSICh,2,2); … … 36 39 E->y_est[1]=((int32)(E->cA)*(E->y_old[1])-(int32)tmp*t_cos+(int32)(E->cC)*(uy))>>15; // q13 37 40 38 39 int16 difz[2]; 40 difz[0]=(isx-(E->y_est[0])); // shift to q15!! 41 difz[1]=(isy-(E->y_est[1]));//<<2; 41 E->difz[0]=(isx-(E->y_est[0])); // shift to q15!! 42 E->difz[1]=(isy-(E->y_est[1]));//<<2; 42 43 43 44 E->y_old[0] = isx; … … 45 46 46 47 *detS = 32767; *rem=0; 47 carlson_fastC( difz,E->x_est,E->Chf,E->C,E->dR,2,2, detS, rem);48 carlson_fastC(E->difz,E->x_est,E->Chf,E->C,E->dR,2,2, detS, rem); 48 49 } 49 50