N K
/
GaNtroller
a fork of priustroller
Fork of priustroller_current by
Diff: callbacks.cpp
- Revision:
- 53:ef62d7a958f2
- Parent:
- 50:16b43e8fe04f
- Child:
- 54:e8d9bc885723
diff -r 14112834b067 -r ef62d7a958f2 callbacks.cpp --- a/callbacks.cpp Sun Apr 26 10:52:08 2015 +0000 +++ b/callbacks.cpp Sat May 02 00:21:00 2015 +0000 @@ -16,6 +16,7 @@ Clarke(-(I_b + I_c), I_b, &alpha, &beta); Parke(alpha, beta, angle, &d, &q); + dbg_q_raw = q; dbg_d_filtered = d_filtered = c->filter_q->Update(q); //swapped dbg_q_filtered = q_filtered = -c->filter_d->Update(d); //these and added a negative on this line. @@ -24,14 +25,16 @@ //and that a positive vq command produced a reading of positive d axis torque. //This may be the final step in aligning the handedness of the reference and the output. + c->user->UpdateThrottle(); + c->user->throttle = c->filter_th->Update(c->user->throttle); c->reference->GetReference(angle, c->user->throttle, &ref_d, &ref_q); dbg_ref_d = ref_d; dbg_ref_q = ref_q; dbg_loop_d = vd = c->pid_d->Update(ref_d, d_filtered); dbg_loop_q = vq = c->pid_q->Update(ref_q, q_filtered); - - + + dbg_throttle = c->user->throttle; if(c->user->throttle <= 0.05f){ //disable inverter - prevent whining, allow for safe precharge. c->inverter->Disable(); @@ -55,7 +58,7 @@ } void slow(Context *c) { - c->user->UpdateThrottle(); + //c->user->UpdateThrottle(); //c->user->throttle = c->filter_th->Update(c->user->throttle); } @@ -67,6 +70,8 @@ } void log(Context *c) { - //c->debugger->Write(0, dbg_angle); - //c->debugger->Write(1, dbg_q_filtered); + //c->debugger->Write(0, dbg_ref_q); + //c->debugger->Write(1, dbg_throttle); + //c->debugger->Write(2, dbg_q_filtered); + //c->debugger->Write(3, dbg_loop_q); } \ No newline at end of file