this motor config,npp=21,GR= 151

Dependencies:   mbed FastPWM3

Revision:
56:b050b80bab42
Parent:
55:489f01927025
--- a/Calibration/calibration.cpp	Wed May 12 12:41:39 2021 +0000
+++ b/Calibration/calibration.cpp	Sun May 16 06:53:56 2021 +0000
@@ -18,7 +18,7 @@
     float theta_actual = 0;
     //float v_d = .15f;
     //float v_d = .20f;
-     float v_d = .40f;                                                               //Put all volts on the D-Axis
+     float v_d = .10f;                                                               //Put all volts on the D-Axis
     float v_q = 0.0f;
     float v_u, v_v, v_w = 0;
     float dtc_u, dtc_v, dtc_w = .5f;
@@ -92,7 +92,7 @@
     float theta_actual = 0;
     //float v_d = .15f;
    // float v_d = .20f;
-    float v_d = .40f;                                                               // Put volts on the D-Axis
+    float v_d = .10f;                                                               // Put volts on the D-Axis
     float v_q = 0.0f;
     float v_u, v_v, v_w = 0;
     float dtc_u, dtc_v, dtc_w = .5f;
@@ -497,7 +497,7 @@
     
     //float v_d = .15f;
     //float v_d = .18f;   
-     float v_d = .60f;                                                            // Put volts on the D-Axis
+     float v_d = .10f;                                                            // Put volts on the D-Axis
     float v_q = 0.0f;
     float v_u, v_v, v_w = 0;
     float dtc_u, dtc_v, dtc_w = .5f;
@@ -582,12 +582,14 @@
      
        theta_joint_actual = jps->GetMechPositionFixed();
        //error_joint_b[i] =  theta_joint_ref*(1+1/GR)/NPP - theta_joint_actual;
-       error_joint_b[i] =  (theta_joint_ref-(1/GR)*theta_ref)/NPP -theta_joint_actual;
+      // error_joint_b[i] =  (theta_joint_ref-(1/GR)*theta_ref)/NPP -theta_joint_actual;
+       error_joint_b[i] =  (theta_joint_ref+(1/GR)*theta_ref)/NPP -theta_joint_actual;  //hjb 202105
        joint_raw_b[i] = jps->GetRawPosition();//-raw_b[i]/GR;
        
        
       //printf("%.4f   %.4f    %d-\n\r", theta_ref*(1+1/GR)/(NPP),  theta_joint_actual, joint_raw_b[i]);
-        printf("%.4f   %.4f   %d\n\r", (theta_joint_ref-(1/GR)*theta_ref)/NPP, theta_joint_actual, joint_raw_b[i]);
+       // printf("%.4f   %.4f   %d\n\r", (theta_joint_ref-(1/GR)*theta_ref)/NPP, theta_joint_actual, joint_raw_b[i]);
+        printf("%.4f   %.4f   %d\n\r", (theta_joint_ref+(1/GR)*theta_ref)/NPP, theta_joint_actual, joint_raw_b[i]);//Hjb 202105
        //theta_ref -= delta;
         }