Show
Ignore:
Timestamp:
08/02/12 22:43:00 (12 years ago)
Author:
smidl
Message:

opraven test Ch

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/pmsm/simulator_zdenek/ekf_example/ekf_mm.cpp

    r1464 r1466  
    11#include "ekf_mm.h" 
    22#include "qmath.h" 
     3#include "stdio.h" 
    34 
    45 
     
    1213        //               q15              + q15*q13 
    1314        (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]; 
    1417         
    1518        mmultACh(E->PSI,E->Chf,E->PSICh,2,2); 
     
    3639        E->y_est[1]=((int32)(E->cA)*(E->y_old[1])-(int32)tmp*t_cos+(int32)(E->cC)*(uy))>>15; // q13 
    3740         
    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; 
    4243         
    4344        E->y_old[0] = isx; 
     
    4546         
    4647        *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); 
    4849} 
    4950