Show
Ignore:
Timestamp:
03/16/12 16:46:40 (12 years ago)
Author:
smidl
Message:

Funkcni 1D Kalman

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/pmsm/simulator_zdenek/ekf_example/mpf_double.h

    r1438 r1439  
    22 
    33#include "parametry_motoru.h" 
     4#define Fpm 0.1989 
     5//#define pi 3.141596 
    46 
    5 #define N 20 
     7#define N 1 
    68 
    79#define Lsd Ls*0.9 
    810#define Lsq Ls 
    911#define _dt 0.000125 
    10 #define _ad (1.-Rs*_dt/Lsd) 
    11 #define _aq (1.-Rs*_dt/Lsq) 
    12 #define _b  Fmag/Lsq*_dt 
    13 #define _cd  _dt/Lsd 
    14 #define _cq  _dt/Lsq 
     12#define _ad (1.-Rs*_dt/(Lsd)) 
     13#define _aq (1.-Rs*_dt/(Lsq)) 
     14#define _b  Fpm/Lsq*_dt 
     15#define _cd  _dt/(Lsd) 
     16#define _cq  _dt/(Lsq) 
    1517 
    16 double randn(); 
    17 double randu(); 
    1818 
    19 void mpf_bayes ( const double &isa, const double &isb , const double &usa, const double &usb ); 
    20 void mpf_init(double qom0, double qth0, double r0); 
    21 void mpf_mean(double *Ecosth, double *Esinth, double *Eome); 
    22 void mpf_th(double th1[N]); 
     19# define floatx float 
    2320 
    24 double kalman_om ( const double &isa, const double &isb , const double &usa, const double &usb, const double &th ); 
     21floatx qrandn(); 
     22floatx qrandu(); 
     23 
     24void mpf_bayes ( const floatx isa, const floatx isb , const floatx usa, const floatx usb ); 
     25void mpf_init(floatx qom0, floatx qth0, floatx r0); 
     26void mpf_mean(floatx *Ecosth, floatx *Esinth, floatx *Eome); 
     27void mpf_th(floatx th1[N]); 
     28 
     29floatx kalman_om ( const floatx isa, const floatx isb , const floatx usa, const floatx usb, const floatx th );