Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: main.cpp
- Revision:
- 92:a9dac72d8cac
- Parent:
- 91:f58472ac3fae
- Child:
- 93:e7e45957f496
--- a/main.cpp Wed Apr 05 20:57:18 2017 +0000 +++ b/main.cpp Thu Apr 06 17:33:47 2017 +0000 @@ -118,9 +118,9 @@ } /*output to timers*/ - set_dtc(io.a, 0.5f + 0.5f * va); - set_dtc(io.b, 0.5f + 0.5f * vb); - set_dtc(io.c, 0.5f + 0.5f * vc); + set_dtc(io.a, 0.5f + 0.5f * va * 0.89f); + set_dtc(io.b, 0.5f + 0.5f * vb * 0.89f); + set_dtc(io.c, 0.5f + 0.5f * vc * 0.89f); } void slow_loop() { @@ -151,13 +151,12 @@ } void log() { - //io.pc->printf("%d,%d,%d,%d,%d,%d,%d,%d\n", (int) read.w, (int) control.d_ref, (int) control.d_filtered, (int) control.q_ref, (int) control.q_filtered, (int) (255 * control.torque_percent), - // (int) (255 * foc.vd), (int) (255 * foc.vq)); - io.pc->printf("%d\n", (int) (control.d_filtered));//io.throttle_in->get_usecs()); + io.pc->printf("%d,%d,%d,%d,%d,%d,%d,%d\n", (int) read.w, (int) control.d_ref, (int) control.d_filtered, (int) control.q_ref, (int) control.q_filtered, (int) (255 * control.torque_percent), + (int) (255 * foc.vd), (int) (255 * foc.vq)); + //io.pc->printf("%d\n", (int) (255 * control.torque_percent)); wait(1.0f / LOG_FREQUENCY); } - extern "C" void TIM1_UP_TIM10_IRQHandler(void) { int start_state = io.throttle_in->state();