![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
distribution-201229
Diff: function_utilities/function_utilities.cpp
- Revision:
- 33:91b17819ec30
- Parent:
- 32:4b8c0fedaf2c
- Child:
- 34:bb2ca2fc2a8e
--- a/function_utilities/function_utilities.cpp Mon Nov 11 09:48:00 2019 +0000 +++ b/function_utilities/function_utilities.cpp Tue Nov 12 11:29:36 2019 +0000 @@ -53,8 +53,8 @@ float I_GAIN_JOINT_TORQUE = 0.0; float D_GAIN_JOINT_TORQUE = 0.0; -int16_t VALVE_DEADZONE_PLUS; -int16_t VALVE_DEADZONE_MINUS; +float VALVE_DEADZONE_PLUS; +float VALVE_DEADZONE_MINUS; int16_t VELOCITY_COMP_GAIN; int16_t COMPLIANCE_GAIN; @@ -166,9 +166,11 @@ int VALVE_MAX_POS; int VALVE_MIN_POS; -int DDV_CENTER; +float DDV_CENTER; int VALVE_POS_NUM; float VALVE_CENTER_OFFSET; +float VALVE_DZ_MINUS_OFFSET; +float VALVE_DZ_PLUS_OFFSET; int VALVE_CENTER_OFFSET_times10; int TMR3_COUNT_FINDHOME; @@ -367,8 +369,8 @@ writer.write(RID_P_GAIN_JOINT_TORQUE,(int) P_GAIN_JOINT_TORQUE); writer.write(RID_I_GAIN_JOINT_TORQUE,(int) I_GAIN_JOINT_TORQUE); writer.write(RID_D_GAIN_JOINT_TORQUE,(int) D_GAIN_JOINT_TORQUE); - writer.write(RID_VALVE_DEADZONE_PLUS,(int) VALVE_DEADZONE_PLUS); - writer.write(RID_VALVE_DEADZONE_MINUS,(int) VALVE_DEADZONE_MINUS); + writer.write(RID_VALVE_DEADZONE_PLUS,(int) (VALVE_DEADZONE_PLUS * 10.0f)); + 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_VALVE_CNETER,(int) VALVE_CENTER); @@ -416,9 +418,8 @@ } writer.write(RID_VALVE_MAX_POS, (int) VALVE_MAX_POS); writer.write(RID_VALVE_MIN_POS, (int) VALVE_MIN_POS); - writer.write(RID_DDV_CENTER, (int) DDV_CENTER); + writer.write(RID_DDV_CENTER, (int) (DDV_CENTER * 10.0f)); writer.write(RID_VALVE_POS_NUM, (int) VALVE_POS_NUM); - writer.write(RID_VALVE_CENTER_OFFSET, (int) (VALVE_CENTER_OFFSET * 10.0f)); writer.close(); @@ -426,7 +427,7 @@ void ROM_CALL_DATA(void) { BNO = flashReadInt(Rom_Sector, RID_BNO); - BNO = 11; + BNO = 5; OPERATING_MODE = flashReadInt(Rom_Sector, RID_OPERATING_MODE); CAN_FREQ = flashReadInt(Rom_Sector, RID_CAN_FREQ); DIR_JOINT_ENC = flashReadInt(Rom_Sector, RID_JOINT_ENC_DIR); @@ -445,8 +446,8 @@ P_GAIN_JOINT_TORQUE = flashReadInt(Rom_Sector, RID_P_GAIN_JOINT_TORQUE); I_GAIN_JOINT_TORQUE = flashReadInt(Rom_Sector, RID_I_GAIN_JOINT_TORQUE); D_GAIN_JOINT_TORQUE = flashReadInt(Rom_Sector, RID_D_GAIN_JOINT_TORQUE); - VALVE_DEADZONE_PLUS = flashReadInt(Rom_Sector, RID_VALVE_DEADZONE_PLUS); - VALVE_DEADZONE_MINUS = flashReadInt(Rom_Sector, RID_VALVE_DEADZONE_MINUS); + VALVE_DEADZONE_PLUS = (float) (flashReadInt(Rom_Sector, RID_VALVE_DEADZONE_PLUS)) * 0.1f; + 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); VALVE_CENTER = flashReadInt(Rom_Sector, RID_VALVE_CNETER); @@ -496,9 +497,8 @@ } VALVE_MAX_POS = flashReadInt(Rom_Sector, RID_VALVE_MAX_POS); VALVE_MIN_POS = flashReadInt(Rom_Sector, RID_VALVE_MIN_POS); - DDV_CENTER = flashReadInt(Rom_Sector, RID_DDV_CENTER); + DDV_CENTER = (float) (flashReadInt(Rom_Sector, RID_DDV_CENTER)) * 0.1f; VALVE_POS_NUM = flashReadInt(Rom_Sector, RID_VALVE_POS_NUM); - VAVLE_CENTER_OFFSET = (float) (flashReadInt(Rom_Sector, RID_VALVE_CENTER_OFFSET)) * 0.1f; }