|
|
|
@ -228,18 +228,26 @@ static const int32_t SliderSpeed = 50; |
|
|
|
const uint32_t up_limit = 6200; |
|
|
|
const uint8_t down_limit = 0; |
|
|
|
|
|
|
|
uint8_t Pin2 = -1; //上限位,为0表示限位触发
|
|
|
|
uint8_t Pin3 = -1; //下限位,为0表示限位触发
|
|
|
|
|
|
|
|
void Manual_Up_State_Do(void) |
|
|
|
{ |
|
|
|
int32_t SliderSpeed_PPS = SliderSpeed_mmps_2_pps(SliderSpeed); |
|
|
|
GV.LS_FrontEnd_Motor.Target_Position = -10000000; |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = SliderSpeed_PPS; |
|
|
|
|
|
|
|
if((GV.ZHR29_200_measure_results.laser_sensor_1_measure_distance >= up_limit) |
|
|
|
/*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) |
|
|
|
|| (GV.ZHR29_200_measure_results.laser_sensor_3_measure_distance >= up_limit)) |
|
|
|
{ |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
if (!Pin2) |
|
|
|
{ |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void Manual_Down_State_Do(void) |
|
|
|
@ -248,13 +256,17 @@ void Manual_Down_State_Do(void) |
|
|
|
GV.LS_FrontEnd_Motor.Target_Position = 10000000; |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = SliderSpeed_PPS; |
|
|
|
|
|
|
|
if((GV.ZHR29_200_measure_results.laser_sensor_1_measure_distance <= down_limit) |
|
|
|
/*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) |
|
|
|
|| (GV.ZHR29_200_measure_results.laser_sensor_3_measure_distance <= down_limit)) |
|
|
|
{ |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
if (!Pin3) |
|
|
|
{ |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 定义前端升降电机速度,单位0.1mm/s
|
|
|
|
@ -266,12 +278,17 @@ void Manual_Low_Speed_Up_State_Do(void) |
|
|
|
GV.LS_FrontEnd_Motor.Target_Position = -10000000; |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = SliderSpeed_PPS; |
|
|
|
|
|
|
|
if((GV.ZHR29_200_measure_results.laser_sensor_1_measure_distance >= up_limit) |
|
|
|
/*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) |
|
|
|
|| (GV.ZHR29_200_measure_results.laser_sensor_3_measure_distance >= up_limit)) |
|
|
|
{ |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
if (!Pin2) |
|
|
|
{ |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void Manual_low_speed_Down_State_Do(void) |
|
|
|
@ -280,13 +297,17 @@ void Manual_low_speed_Down_State_Do(void) |
|
|
|
GV.LS_FrontEnd_Motor.Target_Position = 10000000; |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = SliderSpeed_PPS; |
|
|
|
|
|
|
|
if((GV.ZHR29_200_measure_results.laser_sensor_1_measure_distance <= down_limit) |
|
|
|
/*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) |
|
|
|
|| (GV.ZHR29_200_measure_results.laser_sensor_3_measure_distance <= down_limit)) |
|
|
|
{ |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
if (!Pin3) |
|
|
|
{ |
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|