Chetan Sharma
/
HKCC_Controller_MBed_OS
Modifying the HKCC for no readily apparent reason
Diff: FOC/foc.cpp
- Revision:
- 51:6cd89bd6fcaa
- Parent:
- 49:83d83040ea51
- Child:
- 55:5afc2865ef7f
--- 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);