Sim Youngwoo / Mbed 2 deprecated V3PowerCycle

Dependencies:   mbed Motor_Feedforward

Revision:
7:e4fc29c6f014
Parent:
6:95dc3761f64a
Child:
9:3e15c7d42813
--- a/main.cpp	Wed Feb 19 04:52:01 2020 +0000
+++ b/main.cpp	Sat Sep 19 01:51:56 2020 +0000
@@ -3,20 +3,11 @@
 #include "math_ops.h"
 #include "MotorModule.h"
 
-typedef union _data {
-  float f;
-  char  s[4];
-} myData;
 
 
 Serial       pc(PA_2, PA_3);                // Serial port to the computer
 CAN          can(PB_8, PB_9, 1000000);      // CAN Rx pin name, CAN Tx pin name
 
-myData  dat1;
-myData  dat2;
-myData  dat3;
-myData  dat4;
-
 Ticker loop_ctrl;                                // Control loop interrupt handler
 Ticker loop_msg;
 
@@ -38,7 +29,7 @@
 float t = 0.0;
 float A=  0.5;
 float f = 1.0;
-double mycur = 0.2;
+double mycur = 0.35;
 bool flagCtrl = true;
 
 void printnew(){
@@ -57,6 +48,7 @@
         }
         if (1<=t<20){
             motors[0].control.i_ff = mycur;
+            motors[0].control.p_des = 0;
             motors[0].control.kd = 0;
             motors[0].control.kp = 0;
         }