![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
For LIGHT
Diff: setting.h
- Revision:
- 62:851cf7b7aa7a
- Parent:
- 59:0ad14153b58f
- Child:
- 63:a3c7f31742c9
--- a/setting.h Fri Apr 10 02:00:46 2020 +0000 +++ b/setting.h Tue May 12 06:23:22 2020 +0000 @@ -110,13 +110,11 @@ extern uint8_t CONTROL_MODE; extern uint8_t OPERATING_MODE; extern uint8_t SENSING_MODE; +extern uint8_t CONTROL_UTILITY_MODE; extern uint8_t CURRENT_CONTROL_MODE; extern uint8_t FLAG_VALVE_DEADZONE; -extern uint8_t SETTING_SWITCH; -extern uint8_t SETTING_SWITCH_OLD; extern uint8_t REFERENCE_MODE; extern int16_t CAN_FREQ; -extern int CAN_FREQUENCY; extern int16_t DIR_JOINT_ENC; extern int16_t DIR_VALVE; extern int16_t DIR_VALVE_ENC; @@ -134,8 +132,8 @@ extern float I_GAIN_JOINT_TORQUE; extern float D_GAIN_JOINT_TORQUE; -extern int16_t K_SPRING; -extern int16_t D_DAMPER; +extern float K_SPRING; +extern float D_DAMPER; extern int16_t flag_delay_test; @@ -167,6 +165,7 @@ extern int16_t PISTON_AREA_A; extern int16_t PISTON_AREA_B; extern float PISTON_AREA_alpha; +extern float alpha3; extern int16_t PRES_SUPPLY; @@ -178,8 +177,8 @@ extern int16_t STROKE; -extern int16_t VALVE_LIMIT_PLUS; -extern int16_t VALVE_LIMIT_MINUS; +//extern int16_t VALVE_LIMIT_PLUS; +//extern int16_t VALVE_LIMIT_MINUS; extern float ENC_PULSE_PER_POSITION; extern float TORQUE_SENSOR_PULSE_PER_TORQUE; @@ -221,7 +220,6 @@ extern float CUR_TORQUE; extern float CUR_PRES_A; extern float CUR_PRES_B; -extern int CUR_PWM; extern int CUR_VALVE_POSITION; extern unsigned int TMR2_COUNT_LED1; @@ -240,25 +238,20 @@ extern int MODE_POS_FT_TRANS; -//////////////////////////////////////////////////////////////////////////////// -////////////////////////////// SEUNGHOON ADD /////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - +extern float CUR_CURRENT_mA; extern float CUR_PRES_A_BAR; extern float CUR_PRES_B_BAR; extern float CUR_TORQUE_NM; extern float CUR_TORQUE_NM_PRESS; extern float PRES_A_VREF; -extern float PRES_A_VREF_TEST; extern float PRES_B_VREF; -extern float PRES_B_VREF_TEST; extern float TORQUE_VREF; extern float VALVE_PWM_RAW_FB; extern float VALVE_PWM_RAW_FF; +extern float VALVE_PWM_RAW; extern int VALVE_PWM_VALVE_DZ; -extern int VALVE_INPUT_PWM; extern float VALVE_GAIN_LPM_PER_V[10]; extern float VALVE_POS_VS_PWM[25]; @@ -266,9 +259,7 @@ extern int VALVE_MAX_POS; extern int VALVE_MIN_POS; -extern float DDV_CENTER; extern int VALVE_POS_NUM; -extern int VALVE_CENTER_OFFSET_times10; extern float VALVE_CENTER_OFFSET; extern float VALVE_DZ_MINUS_OFFSET; extern float VALVE_DZ_PLUS_OFFSET; @@ -285,13 +276,6 @@ extern int TMR3_COUNT_JOINT; extern int TMR3_COUNT_ROTARY_FRIC_TUNE; -extern bool FLAG_REFERENCE_VALVE_PWM; -extern bool FLAG_REFERENCE_VALVE_POSITION; -extern bool FLAG_REFERENCE_JOINT_POSITION; -extern bool FLAG_REFERENCE_JOINT_TORQUE; -extern bool FLAG_REFERENCE_PRES_DIFF; -extern bool FLAG_REFERENCE_CURRENT; - extern float TUNING_TIME; extern float REFERENCE_FREQ; @@ -329,7 +313,6 @@ extern int ID_index_array[50]; extern int first_check; extern float init_time; -extern int VEL_POINT; extern int DZ_case; extern int START_POS; extern int FINAL_POS; @@ -371,6 +354,8 @@ extern int fl_temp_cnt2; extern int cur_vel_sum; +extern float Cur_Valve_Open_pulse; + // find home extern int CUR_VELOCITY_OLD; extern int cnt_findhome; @@ -389,11 +374,20 @@ extern float freq_fric_tune; -extern bool FLAG_VALVE_OUTPUT_CALIB; - extern uint32_t TMR3_COUNT_CAN_TX; -extern float I_REF; +// Current Control Variables +extern double I_REF; +extern double I_REF_fil; +extern double I_ERR; +extern double I_ERR_INT; +extern double I_REF_fil_old; +extern double I_REF_fil_diff; + +// system id +extern int cnt_sysid; +extern double freq_sysid_Iref; + extern int TMR3_COUNT_IREF; extern float CUR_CURRENT; extern float u_CUR[3]; @@ -405,7 +399,23 @@ extern float alpha_trans; -//extern int h1, h2, h3, h4, h5, h6; + +extern float V_out; +extern float V_rem; +extern float V_MAX; + +extern float PWM_out; + +extern double K_v; +extern double mV_PER_mA; +extern double mV_PER_pulse; +extern double mA_PER_pulse; + +extern int timer_while; +extern int while_index; + +extern float K_LPF; +extern float D_LPF; @@ -423,3 +433,5 @@ + +