asdgas

Dependencies:   mbed Eigen FastPWM

Revision:
49:e7bcfc244d40
Parent:
48:889798ff9329
Child:
50:3c630b5eba9f
diff -r 889798ff9329 -r e7bcfc244d40 function_utilities/function_utilities.cpp
--- a/function_utilities/function_utilities.cpp	Wed Jan 29 13:50:24 2020 +0000
+++ b/function_utilities/function_utilities.cpp	Wed Feb 05 08:35:58 2020 +0000
@@ -24,8 +24,8 @@
 int16_t DIR_VALVE = 0;
 int16_t DIR_VALVE_ENC = 0;
 
-float SUPPLY_VOLTAGE = 12000.0f;
-float VALVE_VOLTAGE_LIMIT = 12000.0f;  //mv
+float SUPPLY_VOLTAGE = 12.0f;
+float VALVE_VOLTAGE_LIMIT = 12.0f;  //v
 
 float P_GAIN_VALVE_POSITION = 0.0f;
 float I_GAIN_VALVE_POSITION= 0.0f;
@@ -55,6 +55,7 @@
 
 int16_t VELOCITY_COMP_GAIN;
 int16_t COMPLIANCE_GAIN;
+int16_t FLOWFORCE_GAIN;
 
 int16_t VALVE_CENTER;
 
@@ -379,6 +380,7 @@
     writer.write(RID_VALVE_DEADZONE_MINUS,(int) (VALVE_DEADZONE_MINUS * 10.0f));
     writer.write(RID_VELOCITY_COMP_GAIN,(int) VELOCITY_COMP_GAIN);
     writer.write(RID_COMPLIANCE_GAIN,(int) COMPLIANCE_GAIN);
+    writer.write(RID_FLOWFORCE_GAIN, (int) FLOWFORCE_GAIN);
     writer.write(RID_VALVE_CNETER,(int) VALVE_CENTER);
     writer.write(RID_VALVE_FF,(int) VALVE_FF);
     writer.write(RID_BULK_MODULUS,(int) BNO);
@@ -441,9 +443,7 @@
     DIR_VALVE = flashReadInt(Rom_Sector, RID_VALVE_DIR);
     DIR_VALVE_ENC = flashReadInt(Rom_Sector, RID_VALVE_ENC_DIR);
     SUPPLY_VOLTAGE = (float) (flashReadInt(Rom_Sector, RID_VOLATGE_SUPPLY)) *0.1f;
-//    SUPPLY_VOLTAGE = 12000.0f;
     VALVE_VOLTAGE_LIMIT = (float) (flashReadInt(Rom_Sector, RID_VOLTAGE_VALVE)) * 0.1f;
-//    VALVE_VOLTAGE_LIMIT = 12000.0f;
     P_GAIN_VALVE_POSITION = flashReadInt(Rom_Sector, RID_P_GAIN_VALVE_POSITION);
     I_GAIN_VALVE_POSITION = flashReadInt(Rom_Sector, RID_I_GAIN_VALVE_POSITION);
     D_GAIN_VALVE_POSITION = flashReadInt(Rom_Sector, RID_D_GAIN_VALVE_POSITION);
@@ -457,6 +457,7 @@
     VALVE_DEADZONE_MINUS = (float) (flashReadInt(Rom_Sector, RID_VALVE_DEADZONE_MINUS)) * 0.1f;
     VELOCITY_COMP_GAIN = flashReadInt(Rom_Sector, RID_VELOCITY_COMP_GAIN);
     COMPLIANCE_GAIN = flashReadInt(Rom_Sector, RID_COMPLIANCE_GAIN);
+    FLOWFORCE_GAIN = flashReadInt(Rom_Sector, RID_FLOWFORCE_GAIN);
     VALVE_CENTER = flashReadInt(Rom_Sector, RID_VALVE_CNETER);
     VALVE_FF = flashReadInt(Rom_Sector, RID_VALVE_FF);
     BULK_MODULUS = flashReadInt(Rom_Sector, RID_BULK_MODULUS);