Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: FOC/foc.cpp
- Revision:
- 32:ccac5da77844
- Parent:
- 31:61eb6ae28215
- Child:
- 34:51647c6c500d
--- a/FOC/foc.cpp Wed Aug 30 15:28:40 2017 +0000
+++ b/FOC/foc.cpp Wed Aug 30 18:05:37 2017 +0000
@@ -130,9 +130,9 @@
TIM1->CCR1 = (PWM_ARR)*(1.0f-controller->dtc_w);
}
else{
- TIM1->CCR3 = (PWM_ARR>>1)*(1.0f-controller->dtc_u);
- TIM1->CCR1 = (PWM_ARR>>1)*(1.0f-controller->dtc_v);
- TIM1->CCR2 = (PWM_ARR>>1)*(1.0f-controller->dtc_w);
+ TIM1->CCR3 = (PWM_ARR)*(1.0f-controller->dtc_u);
+ TIM1->CCR1 = (PWM_ARR)*(1.0f-controller->dtc_v);
+ TIM1->CCR2 = (PWM_ARR)*(1.0f-controller->dtc_w);
}
controller->theta_elec = theta; //For some reason putting this at the front breaks thins