Gu Jasper / Motor_DRV8323RH_for_20190

Dependencies:   mbed-dev-f303 FastPWM3

Files at this revision

API Documentation at this revision

Comitter:
Jasper_gu
Date:
Sat Dec 05 06:55:55 2020 +0000
Parent:
48:f083ea9d1d03
Commit message:
DRV8323RS

Changed in this revision

Calibration/calibration.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f083ea9d1d03 -r 10638a45c3ac Calibration/calibration.cpp
--- a/Calibration/calibration.cpp	Thu Jan 09 01:42:00 2020 +0000
+++ b/Calibration/calibration.cpp	Sat Dec 05 06:55:55 2020 +0000
@@ -16,7 +16,7 @@
     printf("\n\r Checking phase ordering\n\r");
     float theta_ref = 0;
     float theta_actual = 0;
-    float v_d = .15f;                                                             //Put all volts on the D-Axis
+    float v_d = .3f;                                                             //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;
@@ -88,7 +88,7 @@
     int raw_b[n] = {0};
     float theta_ref = 0;
     float theta_actual = 0;
-    float v_d = .15f;                                                             // Put volts on the D-Axis
+    float v_d = .3f;                                                             // 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;
diff -r f083ea9d1d03 -r 10638a45c3ac main.cpp
--- a/main.cpp	Thu Jan 09 01:42:00 2020 +0000
+++ b/main.cpp	Sat Dec 05 06:55:55 2020 +0000
@@ -395,6 +395,14 @@
 
     
     while(1) {
-
+    if(state == MOTOR_MODE)
+        {
+           //printf(" %.3f  %.3f  %.3f \n\r", controller.p_des,controller.p_des-controller.theta_mech,controller.v_des-controller.dtheta_mech);  //spi.GetMechPosition
+           //printf(" %.3f  %d  %d \n\r", controller.v_bus,controller.adc1_raw,controller.adc2_raw);  //spi.GetMechPosition
+           // printf("%.3f  %.3f  %.3f\n\r", (float)observer.temperature, (float)observer.temperature2, observer.resistance);
+            //printf("%.3f  %.3f  %.3f %.3f %.3f\n\r", controller.v_d, controller.v_q, controller.i_d_filt, controller.i_q_filt, controller.dtheta_elec);
+           // printf("%.3f\n\r", controller.dtheta_mech);
+           wait(.002);
+        }
     }
 }