robot

Dependencies:   FastPWM3 mbed

Revision:
118:2b6dab10b69d
Parent:
117:97da9eb4300e
Child:
119:ad7a6af6fba3
--- a/Calibration/Calibration.cpp	Sun Apr 23 07:17:48 2017 +0000
+++ b/Calibration/Calibration.cpp	Mon Apr 24 01:51:16 2017 +0000
@@ -27,7 +27,7 @@
     *c = vc;
 }
 
-void calibrate_position(IOStruct *io, ControlStruct *control) {
+void calibrate_position(IOStruct *io) {
     io->pc->printf("%s\n", "Starting calibration procedure");
     
     const int n = (int) (128 * POLE_PAIRS);
@@ -41,7 +41,7 @@
     float theta_ref = 0.0f;
     float theta_actual = 0.0f;
     
-    float vd = 0.1f;
+    float vd = 0.5f;
     float vq = 0.0f;
     float va, vb, vc = 0.0f;
     
@@ -62,7 +62,7 @@
             set_dtc(io->a, 0.5f + 0.5f * va * MODULATION_MAX);
             set_dtc(io->b, 0.5f + 0.5f * vb * MODULATION_MAX);
             set_dtc(io->c, 0.5f + 0.5f * vc * MODULATION_MAX);
-            wait_us(100);
+            wait_us(3000);
         }
         theta_actual = io->pos->GetMechPosition();
         error_f[i] = theta_ref / POLE_PAIRS - theta_actual;
@@ -76,7 +76,7 @@
             set_dtc(io->a, 0.5f + 0.5f * va * MODULATION_MAX);
             set_dtc(io->b, 0.5f + 0.5f * vb * MODULATION_MAX);
             set_dtc(io->c, 0.5f + 0.5f * vc * MODULATION_MAX);
-            wait_us(100);
+            wait_us(3000);
         }
         theta_actual = io->pos->GetMechPosition();
         error_b[i] = theta_ref / POLE_PAIRS - theta_actual;