Alvee Ahmed
/
Hobbyking_Cheetah_Compact_DRV8323_14bit
customizing code for Aliexpress 14 bit version with MA702
Diff: FOC/foc.cpp
- Revision:
- 35:69b24894c11d
- Parent:
- 34:51647c6c500d
- Child:
- 37:c0f352d6e8e3
--- a/FOC/foc.cpp Wed Nov 08 15:18:18 2017 +0000 +++ b/FOC/foc.cpp Sat Nov 18 18:41:42 2017 +0000 @@ -97,7 +97,7 @@ /// PI Controller /// float i_d_error = controller->i_d_ref - controller->i_d; - float i_q_error = controller->i_q_ref - controller->i_q + cogging_current - 2.0f; + float i_q_error = controller->i_q_ref - controller->i_q + cogging_current; float v_d_ff = 2.0f*(2*controller->i_d_ref*R_PHASE); //feed-forward voltage float v_q_ff = controller->dtheta_elec*WB*1.73205081f; controller->d_int += i_d_error;