1

Dependencies:   mbed-dev-f303 FastPWM3

Revision:
51:29e1686e8b3e
Parent:
49:7eac11914980
Child:
52:d4d5e3414865
--- a/Calibration/calibration.cpp	Tue May 26 09:24:13 2020 +0000
+++ b/Calibration/calibration.cpp	Thu Aug 06 07:25:51 2020 +0000
@@ -74,7 +74,7 @@
  
 void calibrate(PositionSensor *ps, GPIOStruct *gpio, ControllerStruct *controller, PreferenceWriter *prefs){
     /// Measures the electrical angle offset of the position sensor
-    /// and (in the future) corrects nonlinearity due to position sensor eccentricity
+    /// and (in the future) corrects nonlinearity due to position sensor eccentricity 
     printf("Starting calibration procedure\n\r");
     
     const int n = 128*NPP;                                                      // number of positions to be sampled per mechanical rotation.  Multiple of NPP for filtering reasons (see later)
@@ -139,7 +139,7 @@
        theta_actual = ps->GetMechPositionFixed();
        error_f[i] = theta_ref/NPP - theta_actual;
        raw_f[i] = ps->GetRawPosition();
-       printf("%.4f   %.4f    %d\n\r", theta_ref/(NPP), theta_actual, raw_f[i]);
+       printf("%.4f   %.4f    %d\n\r", theta_ref/(NPP), theta_actual, raw_f[i]);// theta_ref/(NPP)=2pi/(128*21)=0.0023374944940476
 
        // printf("ref %.4f\n\r  actual %.4f\n\r   raw %d\n\r", theta_ref/(NPP), theta_actual, raw_f[i]);
        //theta_ref += delta;