![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
derp
Diff: main.cpp
- Revision:
- 20:b22bf7e14871
- Parent:
- 9:4812c9e932ea
--- a/main.cpp Tue Apr 05 04:05:21 2016 +0000 +++ b/main.cpp Tue Apr 19 08:54:06 2016 +0000 @@ -13,7 +13,7 @@ #define PI 3.141593f #define CPR 4096 -#define POS_OFFSET 4.5f +#define POS_OFFSET 5.5f #define I_SCALE_RAW 25.0f //mv/A #define R_UP 12000.0f //ohms @@ -43,7 +43,7 @@ int adval1, adval2; float ia, ib, ic, alpha, beta, q; -double vq = 0.0, q_integral = 0.0, last_q = 0.0, q_ref = 0.0, q_filtered = 0.0; +double vq = 0.0, q_integral = 0.0, last_q = 0.0, q_ref = 20.0, q_filtered = 0.0; extern "C" void TIM1_UP_TIM10_IRQHandler(void) { if (TIM1->SR & TIM_SR_UIF) { @@ -163,9 +163,5 @@ en = 1; for (;;) { - q_ref = 0.0f; - wait_ms(2000); - q_ref = 20.0f; - wait_ms(2000); } }