N K
/
GaNtroller
a fork of priustroller
Fork of priustroller_current by
meta/meta.h@14:1cc975207995, 2015-03-09 (annotated)
- Committer:
- bwang
- Date:
- Mon Mar 09 02:06:06 2015 +0000
- Revision:
- 14:1cc975207995
- Parent:
- 11:dccbaa9274c5
added stubs for SVM, modulation scheme is still the same as last time
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bwang | 11:dccbaa9274c5 | 1 | #ifndef __META_H |
bwang | 11:dccbaa9274c5 | 2 | #define __META_H |
bwang | 11:dccbaa9274c5 | 3 | |
bwang | 11:dccbaa9274c5 | 4 | #include "includes.h" |
bwang | 11:dccbaa9274c5 | 5 | #include "core.h" |
bwang | 11:dccbaa9274c5 | 6 | #include "sensors.h" |
bwang | 11:dccbaa9274c5 | 7 | #include "filters.h" |
bwang | 11:dccbaa9274c5 | 8 | |
bwang | 11:dccbaa9274c5 | 9 | class Modulator { |
bwang | 11:dccbaa9274c5 | 10 | public: |
bwang | 11:dccbaa9274c5 | 11 | Modulator(Inverter *inverter) {_inverter = inverter;} |
bwang | 14:1cc975207995 | 12 | virtual void Update(float valpha, float vbeta) = 0; |
bwang | 11:dccbaa9274c5 | 13 | protected: |
bwang | 11:dccbaa9274c5 | 14 | Inverter* _inverter; |
bwang | 11:dccbaa9274c5 | 15 | }; |
bwang | 11:dccbaa9274c5 | 16 | |
bwang | 11:dccbaa9274c5 | 17 | class SinusoidalModulator: public Modulator { |
bwang | 11:dccbaa9274c5 | 18 | public: |
bwang | 11:dccbaa9274c5 | 19 | SinusoidalModulator(Inverter *inverter):Modulator(inverter) {} |
bwang | 14:1cc975207995 | 20 | virtual void Update(float valpha, float vbeta); |
bwang | 14:1cc975207995 | 21 | }; |
bwang | 14:1cc975207995 | 22 | |
bwang | 14:1cc975207995 | 23 | class SvmModulator: public Modulator { |
bwang | 14:1cc975207995 | 24 | public: |
bwang | 14:1cc975207995 | 25 | SvmModulator(Inverter *inverter):Modulator(inverter) {} |
bwang | 14:1cc975207995 | 26 | virtual void Update(float valpha, float vbeta); |
bwang | 11:dccbaa9274c5 | 27 | }; |
bwang | 11:dccbaa9274c5 | 28 | |
bwang | 11:dccbaa9274c5 | 29 | class ReferenceSynthesizer { |
bwang | 11:dccbaa9274c5 | 30 | public: |
bwang | 11:dccbaa9274c5 | 31 | ReferenceSynthesizer(float max_phase_current) {_max_phase_current = max_phase_current;} |
bwang | 11:dccbaa9274c5 | 32 | virtual void GetReference(float angle, float throttle, float *ref_d, float *ref_q) {*ref_d = 0; *ref_q = 0;} |
bwang | 11:dccbaa9274c5 | 33 | protected: |
bwang | 11:dccbaa9274c5 | 34 | static float LutSin(float theta); |
bwang | 11:dccbaa9274c5 | 35 | static float LutCos(float theta); |
bwang | 11:dccbaa9274c5 | 36 | protected: |
bwang | 11:dccbaa9274c5 | 37 | float _max_phase_current; |
bwang | 11:dccbaa9274c5 | 38 | }; |
bwang | 11:dccbaa9274c5 | 39 | |
bwang | 11:dccbaa9274c5 | 40 | class SynchronousReferenceSynthesizer : public ReferenceSynthesizer { |
bwang | 11:dccbaa9274c5 | 41 | public: |
bwang | 11:dccbaa9274c5 | 42 | SynchronousReferenceSynthesizer(float max_phase_current):ReferenceSynthesizer(max_phase_current) {} |
bwang | 11:dccbaa9274c5 | 43 | virtual void GetReference(float angle, float throttle, float *ref_d, float *ref_q); |
bwang | 11:dccbaa9274c5 | 44 | }; |
bwang | 11:dccbaa9274c5 | 45 | |
bwang | 11:dccbaa9274c5 | 46 | #endif |
bwang | 11:dccbaa9274c5 | 47 |