20210203

Dependencies:   mbed FastPWM

Revision:
133:22ab22818e01
Parent:
130:26b416050376
Child:
139:15621998925b
--- a/CAN/function_CAN.cpp	Sun Sep 27 07:42:10 2020 +0000
+++ b/CAN/function_CAN.cpp	Mon Oct 05 13:33:46 2020 +0000
@@ -739,7 +739,8 @@
         }
         
         torq.ref = (double)temp_torq * 0.1f / TORQUE_SENSOR_PULSE_PER_TORQUE;   //N
-        
+        torq.ref_diff = torq.ref - torq.ref_old;
+        torq.ref_old = torq.ref;
         
         ///////////////Make Data///////////////////
         for(int i=0; i<num_array_u_past-1;i++){