Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: main.cpp
- Revision:
- 114:095a77fcf53b
- Parent:
- 102:1cd38f88393c
- Child:
- 115:6c1bce07768d
--- a/main.cpp Sat Apr 22 05:18:51 2017 +0000 +++ b/main.cpp Sun Apr 23 02:15:36 2017 +0000 @@ -87,8 +87,8 @@ constrain_norm(&control.d_integral, &control.q_integral, 0.5f, 1.0f, 1.0f); - foc.vd = KP_D * d_err + control.d_integral;// - Lq * POLE_PAIRS * read.w * foc.q / BUS_VOLTAGE / 2.0f; - foc.vq = KP_Q * q_err + control.q_integral;// + Ld * POLE_PAIRS * read.w * foc.d / BUS_VOLTAGE / 2.0f; + foc.vd = KP_D * d_err + control.d_integral + Lq * POLE_PAIRS * read.w * foc.q / BUS_VOLTAGE / 2.0f; + foc.vq = KP_Q * q_err + control.q_integral - Ld * POLE_PAIRS * read.w * foc.d / BUS_VOLTAGE / 2.0f; constrain_norm(&foc.vd, &foc.vq, 1.0f, 1.0f, 1.0f);