Sungwoo Kim
/
HydraulicControlBoard_LIGHT
For LIGHT
Diff: function_utilities/function_utilities.cpp
- Revision:
- 18:b8adf1582ea3
- Parent:
- 17:1865016ca2e7
- Child:
- 19:23b7c1ad8683
diff -r 1865016ca2e7 -r b8adf1582ea3 function_utilities/function_utilities.cpp --- a/function_utilities/function_utilities.cpp Tue Sep 03 11:59:55 2019 +0000 +++ b/function_utilities/function_utilities.cpp Wed Sep 04 11:02:57 2019 +0000 @@ -25,8 +25,8 @@ int16_t DIR_VALVE = 0; int16_t DIR_VALVE_ENC = 0; -double SUPPLY_VOLTAGE = 12.0; -double VALVE_VOLTAGE_LIMIT = 12.0; +double SUPPLY_VOLTAGE = 12000.0; +double VALVE_VOLTAGE_LIMIT = 12000.0; //mv double P_GAIN_VALVE_POSITION = 0.0; double I_GAIN_VALVE_POSITION= 0.0; @@ -86,7 +86,6 @@ double DAC_REF; double DAC_RESOL; -double PWM_RESOL; int REF_POSITION; int REF_VELOCITY; @@ -141,7 +140,6 @@ double PRES_B_VREF_TEST; double TORQUE_VREF; -double VALVE_PWM_RAW; double VALVE_PWM_RAW_FB; double VALVE_PWM_RAW_FF; int VALVE_PWM_VALVE_DZ; @@ -390,7 +388,20 @@ writer.write(RID_VALVE_GAIN_MINUS_2,(int) (VALVE_GAIN_LPM_PER_V[3] * 100.0)); writer.write(RID_VALVE_GAIN_MINUS_3,(int) (VALVE_GAIN_LPM_PER_V[5] * 100.0)); writer.write(RID_VALVE_GAIN_MINUS_4,(int) (VALVE_GAIN_LPM_PER_V[7] * 100.0)); - writer.write(RID_VALVE_GAIN_MINUS_5,(int) (VALVE_GAIN_LPM_PER_V[9] * 100.0)); + writer.write(RID_VALVE_GAIN_MINUS_5,(int) (VALVE_GAIN_LPM_PER_V[9] * 100.0)); + for(int i=0; i<25; i++) + { + writer.write(RID_VALVE_POS_VS_PWM_0 + i, (int) VALVE_POS_VS_PWM[i]); + } + for(int i=0; i<100; i++) + { + writer.write(RID_VALVE_POS_VS_FLOWRATE_0 + i, (int) (JOINT_VEL[ID_index] & 0xFFFF)); + writer.write(RID_VALVE_POS_VS_FLOWRATE_0_1 + i, (int) ((JOINT_VEL[ID_index] >> 16) & 0xFFFF)); + } + 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_VALVE_POS_NUM, (int) VALVE_POS_NUM); writer.close(); @@ -405,7 +416,9 @@ DIR_VALVE = flashReadInt(Rom_Sector, RID_VALVE_DIR); DIR_VALVE_ENC = flashReadInt(Rom_Sector, RID_VALVE_ENC_DIR); SUPPLY_VOLTAGE = (double) (flashReadInt(Rom_Sector, RID_VOLATGE_SUPPLY)) *0.1; + SUPPLY_VOLTAGE = 12000.0; VALVE_VOLTAGE_LIMIT = (double) (flashReadInt(Rom_Sector, RID_VOLTAGE_VALVE)) * 0.1; + VALVE_VOLTAGE_LIMIT = 12000.0; 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); @@ -466,7 +479,7 @@ } 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_CNETER); + DDV_CENTER = flashReadInt(Rom_Sector, RID_DDV_CENTER); VALVE_POS_NUM = flashReadInt(Rom_Sector, RID_VALVE_POS_NUM); } @@ -536,3 +549,4 @@ ENC_pos_old = ENC_pos_cur = value_e; } +