Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of priustroller_2 by
Diff: callbacks.cpp
- Revision:
- 54:e8d9bc885723
- Parent:
- 53:ef62d7a958f2
- Child:
- 55:f102d271e808
diff -r ef62d7a958f2 -r e8d9bc885723 callbacks.cpp --- a/callbacks.cpp Sat May 02 00:21:00 2015 +0000 +++ b/callbacks.cpp Tue May 19 08:50:42 2015 +0000 @@ -13,10 +13,13 @@ dbg_ib = I_b = c->motor->GetCurrentB(); dbg_ic = I_c = c->motor->GetCurrentC(); dbg_angle = angle = c->motor->GetPosition(); + float speed_raw = c->motor->GetSpeed(); + dbg_speed = c->filter_sp->Update(speed_raw); Clarke(-(I_b + I_c), I_b, &alpha, &beta); Parke(alpha, beta, angle, &d, &q); dbg_q_raw = q; + dbg_d_raw = d; 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. @@ -70,8 +73,8 @@ } void log(Context *c) { - //c->debugger->Write(0, dbg_ref_q); - //c->debugger->Write(1, dbg_throttle); - //c->debugger->Write(2, dbg_q_filtered); + //c->debugger->Write(0, dbg_speed); + //c->debugger->Write(1, dbg_q_filtered); + //c->debugger->Write(2, dbg_ref_q); //c->debugger->Write(3, dbg_loop_q); } \ No newline at end of file