|
|
|
@ -232,6 +232,7 @@ uint8_t Pin2 = -1; //上限位,为0表示限位触发 |
|
|
|
uint8_t Pin3 = -1; //下限位,为0表示限位触发
|
|
|
|
|
|
|
|
int32_t KinfePosition = 1000; // 初始化为一个不合理的大值,等于1000时显示为未标定
|
|
|
|
int StrongSingleShotFlag = 0; |
|
|
|
|
|
|
|
void Manual_Up_State_Do(void) |
|
|
|
{ |
|
|
|
@ -333,10 +334,15 @@ void Manual_low_speed_Down_State_Do(void) |
|
|
|
#define STEP_LEN_COUNT 18000 // 位置环每18000个count对应1mm
|
|
|
|
|
|
|
|
void Manual_step_Up_State_Do(void) |
|
|
|
{ |
|
|
|
if (StrongSingleShotFlag == 0) |
|
|
|
{ |
|
|
|
int32_t SliderSpeed_PPS = SliderSpeed_mmps_2_pps(leisai_low_speed); |
|
|
|
GV.LS_FrontEnd_Motor.Target_Position = GV.LS_FrontEnd_Motor.Real_Position - (GV.PV.step_len * STEP_LEN_COUNT); |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = SliderSpeed_PPS; |
|
|
|
KinfePosition -= GV.PV.step_len; |
|
|
|
StrongSingleShotFlag = 1; |
|
|
|
} |
|
|
|
|
|
|
|
/*if((GV.ZHR29_200_measure_results.laser_sensor_1_measure_distance >= up_limit)
|
|
|
|
|| (GV.ZHR29_200_measure_results.laser_sensor_2_measure_distance >= up_limit) |
|
|
|
@ -353,10 +359,15 @@ void Manual_step_Up_State_Do(void) |
|
|
|
} |
|
|
|
|
|
|
|
void Manual_step_Down_State_Do(void) |
|
|
|
{ |
|
|
|
if (StrongSingleShotFlag == 0) |
|
|
|
{ |
|
|
|
int32_t SliderSpeed_PPS = SliderSpeed_mmps_2_pps(leisai_low_speed); |
|
|
|
GV.LS_FrontEnd_Motor.Target_Position = GV.LS_FrontEnd_Motor.Real_Position + (GV.PV.step_len * STEP_LEN_COUNT); |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = SliderSpeed_PPS; |
|
|
|
KinfePosition += GV.PV.step_len; |
|
|
|
StrongSingleShotFlag = 1; |
|
|
|
} |
|
|
|
|
|
|
|
/*if((GV.ZHR29_200_measure_results.laser_sensor_1_measure_distance <= down_limit)
|
|
|
|
|| (GV.ZHR29_200_measure_results.laser_sensor_2_measure_distance <= down_limit) |
|
|
|
|