it works!
Dependencies: mbed-dev-f303 FastPWM3
Diff: FOC/foc.cpp
- Revision:
- 51:6cd89bd6fcaa
- Parent:
- 49:83d83040ea51
--- a/FOC/foc.cpp Thu Apr 04 13:53:58 2019 +0000 +++ b/FOC/foc.cpp Wed Jul 17 03:40:12 2019 +0000 @@ -165,7 +165,7 @@ /// Field Weakening /// controller->fw_int += .001f*(0.5f*OVERMODULATION*controller->v_bus - controller->v_ref); - controller->fw_int = fmaxf(fminf(controller->fw_int, 0.0f), -I_MAX_FW); + controller->fw_int = fmaxf(fminf(controller->fw_int, 0.0f), -I_FW_MAX); controller->i_d_ref = controller->fw_int; //float i_cmd_mag_sq = controller->i_d_ref*controller->i_d_ref + controller->i_q_ref*controller->i_q_ref; limit_norm(&controller->i_d_ref, &controller->i_q_ref, I_MAX);