robot

Dependencies:   FastPWM3 mbed

Revision:
179:935f9d78d936
Parent:
154:0a22dcf91577
--- a/BREMS/BREMSStructs.h	Thu Feb 08 02:16:04 2018 +0000
+++ b/BREMS/BREMSStructs.h	Thu Feb 08 02:42:16 2018 +0000
@@ -6,6 +6,7 @@
 #include "FastPWM.h"
 #include "PwmIn.h"
 #include "PositionSensor.h"
+#include "PreferenceWriter.h"
 #include "Filter.h"
 
 typedef struct {
@@ -14,6 +15,7 @@
     PwmIn *throttle_in;
     PositionSensorEncoder *pos;
     Serial *pc;
+    PreferenceWriter *pref;
 } IOStruct;
 
 typedef struct {
@@ -21,6 +23,8 @@
     float vbus;
     float p_mech, last_p_mech, w;
     float ia_supp_offset, ib_supp_offset;
+    bool err_throttle_disabled, err_pos_invalid;
+    bool err_not_driving;
 } ReadDataStruct;
 
 typedef struct {
@@ -33,6 +37,7 @@
     float last_d, last_q;
     float d_ref, q_ref;
     float d_filtered, q_filtered;
+    float user_cmd;
     float torque_percent;
     MedianFilter *throttle_filter, *velocity_filter;
 } ControlStruct;