Mini Cheetah Actuator Branch Superseded by: https://github.com/bgkatz/motorcontrol

Dependencies:   mbed-dev-f303 FastPWM3

Superseded by: https://github.com/bgkatz/motorcontrol

Revision:
51:6cd89bd6fcaa
Parent:
49:83d83040ea51
Child:
52:8e74c22ed89f
Child:
53:e85efce8c1eb
--- 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);