Mini Cheetah Actuator Branch Superseded by: https://github.com/bgkatz/motorcontrol
Dependencies: mbed-dev-f303 FastPWM3
Superseded by: https://github.com/bgkatz/motorcontrol
Diff: FOC/foc.cpp
- Revision:
- 53:e85efce8c1eb
- Parent:
- 51:6cd89bd6fcaa
- Child:
- 55:c4c9fec8539c
--- a/FOC/foc.cpp Wed Jul 17 03:40:12 2019 +0000 +++ b/FOC/foc.cpp Thu Aug 08 17:19:39 2019 +0000 @@ -194,12 +194,12 @@ controller->v_ref = sqrt(controller->v_d*controller->v_d + controller->v_q*controller->v_q); limit_norm(&controller->v_d, &controller->v_q, OVERMODULATION*controller->v_bus); // Normalize voltage vector to lie within curcle of radius v_bus - float dtc_d = controller->v_d/controller->v_bus; - float dtc_q = controller->v_q/controller->v_bus; - linearize_dtc(&dtc_d); - linearize_dtc(&dtc_q); - controller->v_d = dtc_d*controller->v_bus; - controller->v_q = dtc_q*controller->v_bus; + //float dtc_d = controller->v_d/controller->v_bus; + //float dtc_q = controller->v_q/controller->v_bus; + //linearize_dtc(&dtc_d); + //linearize_dtc(&dtc_q); + //controller->v_d = dtc_d*controller->v_bus; + //controller->v_q = dtc_q*controller->v_bus; abc(controller->theta_elec + 0.0f*DT*controller->dtheta_elec, controller->v_d, controller->v_q, &controller->v_u, &controller->v_v, &controller->v_w); //inverse dq0 transform on voltages svm(controller->v_bus, controller->v_u, controller->v_v, controller->v_w, &controller->dtc_u, &controller->dtc_v, &controller->dtc_w); //space vector modulation