1
Dependencies: mbed-dev-f303 FastPWM3
Diff: Joint_Calibration/joint_calibration.cpp
- Revision:
- 54:4c9415402628
- Parent:
- 49:7eac11914980
--- a/Joint_Calibration/joint_calibration.cpp Tue Sep 15 08:59:03 2020 +0000 +++ b/Joint_Calibration/joint_calibration.cpp Thu Sep 17 07:49:27 2020 +0000 @@ -37,7 +37,7 @@ ///Set voltage angle to zero, wait for rotor position to settle abc(theta_ref, v_d, v_q, &v_u, &v_v, &v_w); // inverse dq0 transform on voltages - svm(1.0, v_u, v_v, v_w, &dtc_u, &dtc_v, &dtc_w); // space vector modulation + svm(1.0, v_u, v_v, v_w, 0, &dtc_u, &dtc_v, &dtc_w); //space vector modulation for(int i = 0; i<40000; i++){ TIM1->CCR3 = (PWM_ARR>>1)*(1.0f-dtc_u); // Set duty cycles if(PHASE_ORDER){ @@ -81,7 +81,7 @@ for(int j = 0; j<n2; j++){ theta_ref += delta; abc(theta_ref, v_d, v_q, &v_u, &v_v, &v_w); // inverse dq0 transform on voltages - svm(1.0, v_u, v_v, v_w, &dtc_u, &dtc_v, &dtc_w); // space vector modulation + svm(1.0, v_u, v_v, v_w, 0, &dtc_u, &dtc_v, &dtc_w); //space vector modulation TIM1->CCR3 = (PWM_ARR>>1)*(1.0f-dtc_u); if(PHASE_ORDER){ // Check phase ordering TIM1->CCR2 = (PWM_ARR>>1)*(1.0f-dtc_v); // Set duty cycles @@ -109,7 +109,7 @@ for(int j = 0; j<n2; j++){ theta_ref -= delta; abc(theta_ref, v_d, v_q, &v_u, &v_v, &v_w); // inverse dq0 transform on voltages - svm(1.0, v_u, v_v, v_w, &dtc_u, &dtc_v, &dtc_w); // space vector modulation + svm(1.0, v_u, v_v, v_w, 0, &dtc_u, &dtc_v, &dtc_w); //space vector modulation TIM1->CCR3 = (PWM_ARR>>1)*(1.0f-dtc_u); if(PHASE_ORDER){ TIM1->CCR2 = (PWM_ARR>>1)*(1.0f-dtc_v);