Original Version of STM Board

Dependencies:   FastPWM mbed

Revision:
226:82a3ca333004
Parent:
225:9c0becc196ba
Child:
227:699c3e572283
diff -r 9c0becc196ba -r 82a3ca333004 function_utilities/function_utilities.cpp
--- a/function_utilities/function_utilities.cpp	Thu Feb 04 05:43:47 2021 +0000
+++ b/function_utilities/function_utilities.cpp	Wed Mar 03 10:56:25 2021 +0000
@@ -54,8 +54,8 @@
 //float I_GAIN_JOINT_TORQUE_OPP = 0.0;
 //float D_GAIN_JOINT_TORQUE_OPP = 0.0;
 
-float VALVE_DEADZONE_PLUS;
-float VALVE_DEADZONE_MINUS;
+int16_t VALVE_DEADZONE_PLUS;
+int16_t VALVE_DEADZONE_MINUS;
 
 int16_t VELOCITY_COMP_GAIN;
 int16_t COMPLIANCE_GAIN;
@@ -101,7 +101,7 @@
 float PRES_SENSOR_A_PULSE_PER_BAR = 4096.0f / 200.0f;
 float PRES_SENSOR_B_PULSE_PER_BAR = 4096.0f / 200.0f;
 
-int HOMEPOS_OFFSET;
+int16_t HOMEPOS_OFFSET;
 int HOMEPOS_VALVE_OPENING;
 
 float FRICTION;
@@ -124,7 +124,7 @@
 int REF_MOVE_TIME_5k;
 int INIT_REF_PWM;
 int INIT_REF_VALVE_POS;
-int INIT_REF_POS;
+int32_t INIT_REF_POS;
 int INIT_REF_VEL;
 int INIT_REF_TORQUE;
 int INIT_REF_PRES_DIFF;
@@ -301,6 +301,7 @@
 // Current Control Variables
 double I_REF = 0.0f;
 double I_REF_fil = 0.0f;
+double I_REF_fil_DZ = 0.0f;
 double I_ERR = 0.0f;
 double I_ERR_INT = 0.0f;
 double I_REF_fil_old = 0.0f;
@@ -399,7 +400,7 @@
 void ROM_CALL_DATA(void)
 {
     BNO = spi_eeprom_read(RID_BNO);
-    BNO = 2;
+    BNO = 11;
     OPERATING_MODE = spi_eeprom_read(RID_OPERATING_MODE);
     SENSING_MODE = spi_eeprom_read(RID_SENSING_MODE);
     CURRENT_CONTROL_MODE = spi_eeprom_read(RID_CURRENT_CONTROL_MODE);
@@ -419,8 +420,8 @@
     P_GAIN_JOINT_TORQUE = spi_eeprom_read(RID_P_GAIN_JOINT_TORQUE);
     I_GAIN_JOINT_TORQUE = spi_eeprom_read( RID_I_GAIN_JOINT_TORQUE);
     D_GAIN_JOINT_TORQUE = spi_eeprom_read(RID_D_GAIN_JOINT_TORQUE);
-    VALVE_DEADZONE_PLUS = (float) (spi_eeprom_read( RID_VALVE_DEADZONE_PLUS)) * 0.1f;
-    VALVE_DEADZONE_MINUS = (float) (spi_eeprom_read(RID_VALVE_DEADZONE_MINUS)) * 0.1f;
+    VALVE_DEADZONE_PLUS = (spi_eeprom_read(RID_VALVE_DEADZONE_PLUS));
+    VALVE_DEADZONE_MINUS = (spi_eeprom_read(RID_VALVE_DEADZONE_MINUS));
     VELOCITY_COMP_GAIN = spi_eeprom_read(RID_VELOCITY_COMP_GAIN);
     COMPLIANCE_GAIN = spi_eeprom_read(RID_COMPLIANCE_GAIN);
     VALVE_CENTER = spi_eeprom_read(RID_VALVE_CNETER);