1

Dependencies:   mbed-dev-f303 FastPWM3

Files at this revision

API Documentation at this revision

Comitter:
shaorui
Date:
Fri Oct 23 09:37:45 2020 +0000
Parent:
53:32218a36df05
Commit message:
Joint_control_2AS5147_DRV8323RH_GR49_HJB_2020_8_10

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 32218a36df05 -r e201ae25e467 main.cpp
--- a/main.cpp	Tue Sep 15 08:59:03 2020 +0000
+++ b/main.cpp	Fri Oct 23 09:37:45 2020 +0000
@@ -668,7 +668,7 @@
                 controller.p_des=0;
                 controller.v_des = 1.0f;
                 controller.kp = 0;
-                controller.kd = 2.0f;
+                controller.kd = 4.0f;
                 controller.t_ff = 0;
                 wait(.5); 
                // }
@@ -689,7 +689,7 @@
                 controller.p_des=0;
                 controller.v_des = -1.0f;
                 controller.kp = 0;
-                controller.kd = 2.0f;
+                controller.kd = 4.0f;
                 controller.t_ff = 0;
                 wait(.5);
                 printf("test position:%.3f\n\r",(1.0f/GR)* spi.GetMechPosition());
@@ -714,7 +714,7 @@
           // float j_position=-(controller.theta_mech1+controller.theta_mech)*2807.49319614;
           // float j_position=-controller.theta_mech1*57.2957795;
             //printf("m:%.3f\n\r,j:%.3f\n\r",m_position,j_position);
-           if(count >= 4000){
+           if(count >= 400){
 //            printf("J: %.3f  Mec: %.3f   Jerr: %.3f   JVerr: %.3f   Kp: %.3f   Kd: %.3f  \n\r",controller.theta_joint*57.2957795, controller.theta_mech*57.2957795, (controller.p_des - controller.theta_mech)*57.2957795,(controller.v_des - controller.dtheta_mech)*57.2957795, controller.kp,controller.kd);
             printf("Jraw:%.3f   J: %.3f  Mec: %.3f   N: %.3d   Nmod: %.3f   Mmod: %.3f \n\r",controller.theta_joint_raw*57.2957795,controller.theta_joint*57.2957795, controller.theta_mech*57.2957795, controller.Ncycle,controller.Ncycle_mod*57.2957795,controller.Mech_mod*57.2957795);