![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
asdgas
Dependencies: mbed Eigen FastPWM
Diff: function_utilities/function_utilities.cpp
- Revision:
- 63:376a20d2fbfd
- Parent:
- 62:456f87e3124e
- Child:
- 64:368bcd2a230a
--- a/function_utilities/function_utilities.cpp Tue Apr 28 09:19:26 2020 +0000 +++ b/function_utilities/function_utilities.cpp Thu May 07 03:52:28 2020 +0000 @@ -36,11 +36,11 @@ float I_GAIN_JOINT_POSITION = 0.0f; float D_GAIN_JOINT_POSITION = 0.0f; float P_GAIN_JOINT_TORQUE = 0.0f; -float I_GAIN_JOINT_TORQUE = 0.0; -float D_GAIN_JOINT_TORQUE = 0.0; +float I_GAIN_JOINT_TORQUE = 0.0f; +float D_GAIN_JOINT_TORQUE = 0.0f; -int16_t K_SPRING = 0.0; -int16_t D_DAMPER = 0.0; +float K_SPRING = 0.0f; +float D_DAMPER = 0.0f; int16_t flag_delay_test = 0; //float P_GAIN_VALVE_POSITION_OPP = 0.0f; @@ -322,6 +322,9 @@ int timer_while = 0; int while_index = 0; +float K_LPF = 0.0f; +float D_LPF = 0.0f; + //int h1, h2, h3, h4, h5, h6; /******************************************************************************* @@ -455,9 +458,10 @@ OPERATING_MODE = flashReadInt(Rom_Sector, RID_OPERATING_MODE); SENSING_MODE = flashReadInt(Rom_Sector, RID_SENSING_MODE); CURRENT_CONTROL_MODE = flashReadInt(Rom_Sector, RID_CURRENT_CONTROL_MODE); - CURRENT_CONTROL_MODE = 1; + CURRENT_CONTROL_MODE =1; FLAG_VALVE_DEADZONE = flashReadInt(Rom_Sector, RID_FLAG_VALVE_DEADZONE); CAN_FREQ = flashReadInt(Rom_Sector, RID_CAN_FREQ); + CAN_FREQ = 500; DIR_JOINT_ENC = flashReadInt(Rom_Sector, RID_JOINT_ENC_DIR); DIR_VALVE = flashReadInt(Rom_Sector, RID_VALVE_DIR); DIR_VALVE_ENC = flashReadInt(Rom_Sector, RID_VALVE_ENC_DIR); @@ -590,6 +594,7 @@ spi_enc_set_clear(); CUR_POSITION = 0; + pos.sen = 0.0f; ENC_pos_old = ENC_pos_cur = 0; } @@ -599,6 +604,7 @@ spi_enc_set_clear(); enc_offset = value_e; CUR_POSITION = value_e; + pos.sen = (float) value_e; ENC_pos_old = ENC_pos_cur = value_e; }