N K
/
GaNtroller
a fork of priustroller
Fork of priustroller_current by
Diff: callbacks.cpp
- Revision:
- 40:b2bd9a097e3f
- Parent:
- 39:6f3d08745cd9
- Child:
- 41:0a573cf3e9b9
diff -r 6f3d08745cd9 -r b2bd9a097e3f callbacks.cpp --- a/callbacks.cpp Thu Apr 16 22:24:37 2015 +0000 +++ b/callbacks.cpp Thu Apr 16 22:45:38 2015 +0000 @@ -62,9 +62,13 @@ angle240 = angle -120.0f; if (angle120 >= 360.0f) angle240 -= 360.0f; if (angle120 < 0.0f) angle240 += 360.0f; - c->inverter->SetDtcA(0.5f + 0.5f * FastSin(angle) * c->user->throttle); - c->inverter->SetDtcB(0.5f + 0.5f * FastSin(angle120) * c->user->throttle); - c->inverter->SetDtcC(0.5f + 0.5f * FastSin(angle240) * c->user->throttle); + + dbg_dtcB = 0.5f + 0.5f * FastSin(angle) * c->user->throttle; + dbg_dtcA = 0.5f + 0.5f * FastSin(angle120) * c->user->throttle; + dbg_dtcC = 0.5f + 0.5f * FastSin(angle240) * c->user->throttle; + c->inverter->SetDtcA(dbg_dtcA); + c->inverter->SetDtcB(dbg_dtcB); + c->inverter->SetDtcC(dbg_dtcC); } void slow(Context *c) { @@ -75,7 +79,7 @@ void debug(Context *c) { //c->serial->printf("%f %f %f %f %f %f\n\r", dbg_d_filtered, dbg_q_filtered, dbg_ref_d, dbg_ref_q, dbg_loop_d, dbg_loop_q); //c->serial->printf("%f\n\r", dbg_angle); - //c->serial->printf("%f\n\r", c->user->throttle); + //c->serial->printf("%f %f %f %f\n\r", c->user->throttle, dbg_dtcA, dbg_dtcB, dbg_dtcC); } void log(Context *c) {