Sungwoo Kim
/
HydraulicControlBoard_PostLIGHT_210420
LIGHT2
Diff: function_utilities/function_utilities.cpp
- Revision:
- 53:4d66fb1c5dd9
- Parent:
- 52:8ea76864368a
diff -r 8ea76864368a -r 4d66fb1c5dd9 function_utilities/function_utilities.cpp --- a/function_utilities/function_utilities.cpp Wed Feb 19 05:48:57 2020 +0000 +++ b/function_utilities/function_utilities.cpp Tue Feb 25 07:39:17 2020 +0000 @@ -22,7 +22,8 @@ uint8_t SETTING_SWITCH = 0; uint8_t SETTING_SWITCH_OLD = 0; uint8_t REFERENCE_MODE = 0; -uint16_t CAN_FREQ = 500; +int16_t CAN_FREQ = 500; +int CAN_FREQUENCY = 500; int16_t DIR_JOINT_ENC = 0; int16_t DIR_VALVE = 0; int16_t DIR_VALVE_ENC = 0; @@ -42,6 +43,7 @@ int16_t K_SPRING = 0.0; int16_t D_DAMPER = 0.0; +int16_t flag_delay_test = 0; //float P_GAIN_VALVE_POSITION_OPP = 0.0f; //float I_GAIN_VALVE_POSITION_OPP= 0.0f; @@ -129,7 +131,8 @@ unsigned int TMR2_COUNT_LED1; unsigned int TMR2_COUNT_LED2; -unsigned int TMR2_COUNT_CAN_TX; +unsigned int TMR2_COUNT_CAN_TX = 0; +unsigned int TMR3_COUNT_TEST = 0; int num_err; int flag_err[8]; @@ -549,9 +552,9 @@ ENC_pos_cur = spi_enc_read(); ENC_pos_diff = ENC_pos_cur - ENC_pos_old; - if (ENC_pos_diff > 1300 || ENC_pos_diff<-1300) { - //MOT_E_STOP(0); - } +// if (ENC_pos_diff > 1300 || ENC_pos_diff<-1300) { +// //MOT_E_STOP(0); +// } ENC_VEL_RAW = (int32_t) (ENC_pos_diff * TMR_FREQ_5k);