|
|
@ -238,6 +238,19 @@ int StrongSingleShotFlag = 0; |
|
|
|
|
|
|
|
|
extern uint8_t Mode_Init;// 初始化时第一次升刀的流程
|
|
|
extern uint8_t Mode_Init;// 初始化时第一次升刀的流程
|
|
|
|
|
|
|
|
|
|
|
|
static void LimitDownPosition(void) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!Pin3) |
|
|
|
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT) |
|
|
|
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void Manual_Up_State_Do(void) |
|
|
void Manual_Up_State_Do(void) |
|
|
{ |
|
|
{ |
|
|
int32_t SliderSpeed_PPS = SliderSpeed_mmps_2_pps(SliderSpeed); |
|
|
int32_t SliderSpeed_PPS = SliderSpeed_mmps_2_pps(SliderSpeed); |
|
|
@ -257,11 +270,6 @@ void Manual_Up_State_Do(void) |
|
|
KinfePosition = GV.LS_FrontEnd_Motor.Real_Position; |
|
|
KinfePosition = GV.LS_FrontEnd_Motor.Real_Position; |
|
|
Mode_Init = 1;// 表示自动初始化完成
|
|
|
Mode_Init = 1;// 表示自动初始化完成
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT) |
|
|
|
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Manual_Down_State_Do(void) |
|
|
void Manual_Down_State_Do(void) |
|
|
@ -277,15 +285,7 @@ void Manual_Down_State_Do(void) |
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
}*/ |
|
|
}*/ |
|
|
|
|
|
|
|
|
if (!Pin3) |
|
|
LimitDownPosition(); |
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT) |
|
|
|
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 定义前端升降电机速度,单位0.1mm/s
|
|
|
// 定义前端升降电机速度,单位0.1mm/s
|
|
|
@ -310,11 +310,6 @@ void Manual_Low_Speed_Up_State_Do(void) |
|
|
KinfePosition = GV.LS_FrontEnd_Motor.Real_Position; |
|
|
KinfePosition = GV.LS_FrontEnd_Motor.Real_Position; |
|
|
Mode_Init = 1;// 表示自动初始化完成
|
|
|
Mode_Init = 1;// 表示自动初始化完成
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT) |
|
|
|
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Manual_low_speed_Down_State_Do(void) |
|
|
void Manual_low_speed_Down_State_Do(void) |
|
|
@ -330,15 +325,7 @@ void Manual_low_speed_Down_State_Do(void) |
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
}*/ |
|
|
}*/ |
|
|
|
|
|
|
|
|
if (!Pin3) |
|
|
LimitDownPosition(); |
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT) |
|
|
|
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#define STEP_LEN_COUNT 20000 // 位置环每20000个count对应1mm
|
|
|
#define STEP_LEN_COUNT 20000 // 位置环每20000个count对应1mm
|
|
|
@ -366,11 +353,6 @@ void Manual_step_Up_State_Do(void) |
|
|
KinfePosition = GV.LS_FrontEnd_Motor.Real_Position; |
|
|
KinfePosition = GV.LS_FrontEnd_Motor.Real_Position; |
|
|
Mode_Init = 1;// 表示自动初始化完成
|
|
|
Mode_Init = 1;// 表示自动初始化完成
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT) |
|
|
|
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Manual_step_Down_State_Do(void) |
|
|
void Manual_step_Down_State_Do(void) |
|
|
@ -390,15 +372,7 @@ void Manual_step_Down_State_Do(void) |
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
}*/ |
|
|
}*/ |
|
|
|
|
|
|
|
|
if (!Pin3) |
|
|
LimitDownPosition(); |
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT) |
|
|
|
|
|
{ |
|
|
|
|
|
GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void FrontEnd_Halt_State_Do(void) |
|
|
void FrontEnd_Halt_State_Do(void) |
|
|
|