20210203

Dependencies:   mbed FastPWM

Revision:
101:50159049a518
Parent:
99:7bbcb3c0fb06
Child:
117:7141c0517b82
--- a/CAN/function_CAN.cpp	Tue Sep 08 01:14:04 2020 +0000
+++ b/CAN/function_CAN.cpp	Tue Sep 08 06:50:02 2020 +0000
@@ -760,8 +760,8 @@
         for(int i=0; i<num_array_f_past-1;i++){
             f_past[i] = f_past[i+1];
         }
-        //f_past[num_array_f_past-1] = torq.sen;  //N
-        f_past[num_array_f_past-1] = torq.ref;  //N              //For add PI control
+        f_past[num_array_f_past-1] = torq.sen;  //N
+        //f_past[num_array_f_past-1] = torq.ref;  //N              //For add PI control
         
         f_future[0] = torq.sen;  //N
         for(int i=1;i<num_array_f_future-1;i++){
@@ -769,7 +769,13 @@
         }
         f_future[num_array_f_future-1] = torq.ref;  //N
 
+
         int ind = 0;
+        for(int i=0;i<numpast_u;i++){
+            input_NN[ind] = u_past[2*i];
+            ind = ind + 1;
+        }
+        
         for(int i=0;i<numpast_x;i++){
             input_NN[ind] = x_past[2*i] / 60.0f;
             ind = ind + 1;