N K
/
GaNtroller
a fork of priustroller
Fork of priustroller_current by
meta/modulators.cpp@13:79e247e54d78, 2015-03-09 (annotated)
- Committer:
- bwang
- Date:
- Mon Mar 09 01:40:43 2015 +0000
- Revision:
- 13:79e247e54d78
- Parent:
- 11:dccbaa9274c5
- Child:
- 14:1cc975207995
fixed a bug in position sensor initialization + hack in modulators.cpp to make motor turn, 2.19A@20V
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bwang | 11:dccbaa9274c5 | 1 | #include "includes.h" |
bwang | 11:dccbaa9274c5 | 2 | #include "core.h" |
bwang | 11:dccbaa9274c5 | 3 | #include "meta.h" |
bwang | 11:dccbaa9274c5 | 4 | #include "sensors.h" |
bwang | 11:dccbaa9274c5 | 5 | #include "lut.h" |
bwang | 11:dccbaa9274c5 | 6 | |
bwang | 13:79e247e54d78 | 7 | void SinusoidalModulator::Update(float va, float vb) { |
bwang | 13:79e247e54d78 | 8 | //--hack to make duty cycles positive |
bwang | 13:79e247e54d78 | 9 | float dtcA = va; |
bwang | 13:79e247e54d78 | 10 | float dtcB = ((-va + sqrt(3.0f) * vb) / 2.0f); |
bwang | 13:79e247e54d78 | 11 | float dtcC = ((-va - sqrt(3.0f) * vb) / 2.0f); |
bwang | 13:79e247e54d78 | 12 | _inverter->SetDtcA(dtcA * 0.5f + 0.5f); |
bwang | 13:79e247e54d78 | 13 | _inverter->SetDtcB(dtcB * 0.5f + 0.5f); |
bwang | 13:79e247e54d78 | 14 | _inverter->SetDtcC(dtcC * 0.5f + 0.5f); |
bwang | 11:dccbaa9274c5 | 15 | } |