root/applications/pmsm/simulator_zdenek/ekf_example/mpf_double.h @ 1440

Revision 1440, 0.7 kB (checked in by smidl, 12 years ago)

rychly exp + vice clenu randn

Line 
1// Bayesian Filtering for PMSM using Marginalized Particle Filter
2
3#include "parametry_motoru.h"
4#define Fpm 0.1989
5//#define pi 3.141596
6
7#define N 4
8
9#define Lsd Ls*0.9
10#define Lsq Ls
11#define _dt 0.000125
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)
17
18
19# define floatx float
20
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 );
Note: See TracBrowser for help on using the browser.