Sungwoo Kim
/
HydraulicControlBoard_PostLIGHT_210420
LIGHT2
Diff: function_utilities/function_utilities.cpp
- Revision:
- 12:6f2531038ea4
- Parent:
- 11:82d8768d7351
- Child:
- 13:747daba9cf59
diff -r 82d8768d7351 -r 6f2531038ea4 function_utilities/function_utilities.cpp --- a/function_utilities/function_utilities.cpp Fri Aug 23 12:28:08 2019 +0000 +++ b/function_utilities/function_utilities.cpp Tue Aug 27 05:32:44 2019 +0000 @@ -377,7 +377,7 @@ } for(i=0; i<100; i++) { - JOINT_VEL[i] = (long) ( (spi_eeprom_read(RID_VALVE_POS_VS_FLOWRATE_0 + i) & 0xFFFF) | ((spi_eeprom_read(RID_VALVE_POS_VS_FLOWRATE_0_1 + i) & 0xFFFF) << 16)); + JOINT_VEL[i] = (int32_t) ( (spi_eeprom_read(RID_VALVE_POS_VS_FLOWRATE_0 + i) & 0xFFFF) | ((spi_eeprom_read(RID_VALVE_POS_VS_FLOWRATE_0_1 + i) & 0xFFFF) << 16)); } VALVE_MAX_POS = (int) spi_eeprom_read(RID_VALVE_MAX_POS); @@ -420,13 +420,13 @@ //MOT_E_STOP(0); } - ENC_VEL_RAW = (long) (ENC_pos_diff * TMR_FREQ_5k); + ENC_VEL_RAW = (int32_t) (ENC_pos_diff * TMR_FREQ_5k); KF_Y_11 = ENC_pos_cur; KF_Y_21 = ENC_VEL_RAW; KF_X_11 = KF_G1_11 * KF_X_11 + KF_G1_12 * KF_X_21 + KF_G2_11 * KF_Y_11 + KF_G2_12*KF_Y_21; KF_X_21 = KF_G1_21 * KF_X_11 + KF_G1_22 * KF_X_21 + KF_G2_21 * KF_Y_11 + KF_G2_22*KF_Y_21; - ENC_VEL_KF = (long) KF_X_21; + ENC_VEL_KF = (int32_t) KF_X_21; CUR_POSITION = (DIR_JOINT_ENC) * ENC_pos_cur + enc_offset; // CUR_POSITION = (DIR_JOINT_ENC) * ENC_pos_cur; @@ -446,7 +446,7 @@ } -void ENC_SET(long value) { +void ENC_SET(int32_t value) { spi_enc_set_clear(); enc_offset = value;