Revision 1468, 0.8 kB
(checked in by smidl, 11 years ago)
|
uprava generatoru
|
Rev | Line | |
---|
[1380] | 1 | // Bayesian Filtering for PMSM using Marginalized Particle Filter |
---|
| 2 | |
---|
| 3 | #include "parametry_motoru.h" |
---|
[1439] | 4 | #define Fpm 0.1989 |
---|
| 5 | //#define pi 3.141596 |
---|
[1380] | 6 | |
---|
[1440] | 7 | #define N 4 |
---|
[1380] | 8 | |
---|
[1438] | 9 | #define Lsd Ls*0.9 |
---|
[1380] | 10 | #define Lsq Ls |
---|
| 11 | #define _dt 0.000125 |
---|
[1439] | 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) |
---|
[1380] | 17 | |
---|
| 18 | |
---|
[1439] | 19 | # define floatx float |
---|
[1438] | 20 | |
---|
[1439] | 21 | floatx qrandn(); |
---|
| 22 | floatx qrandu(); |
---|
[1468] | 23 | void rng_init(); |
---|
[1439] | 24 | |
---|
| 25 | void mpf_bayes ( const floatx isa, const floatx isb , const floatx usa, const floatx usb ); |
---|
| 26 | void mpf_init(floatx qom0, floatx qth0, floatx r0); |
---|
| 27 | void mpf_mean(floatx *Ecosth, floatx *Esinth, floatx *Eome); |
---|
| 28 | void mpf_th(floatx th1[N]); |
---|
[1468] | 29 | void mpf_om(floatx om1[N]); |
---|
[1439] | 30 | |
---|
| 31 | floatx kalman_om ( const floatx isa, const floatx isb , const floatx usa, const floatx usb, const floatx th ); |
---|