diff --git a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c index 3a682c9..6cab3f4 100644 --- a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c +++ b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c @@ -145,28 +145,34 @@ void Mode_Control() } extern uint8_t Pin2; -extern uint8_t Pin3; - +extern uint8_t Test1; void IO_Control() { - GF_BSP_GPIO_SetIO(4, 1); + //GF_BSP_GPIO_SetIO(4, 1); if(StrongGrindingMachineCurrentState == STRONG_GRINDING_MACHINE_MOTION_STATE) { - GF_BSP_GPIO_SetIO(5, 0); + //GF_BSP_GPIO_SetIO(5, 0); } else if(StrongGrindingMachineCurrentState == STRONG_GRINDING_MACHINE_HALT_STATE) { - GF_BSP_GPIO_SetIO(5, 1); + //GF_BSP_GPIO_SetIO(5, 1); } else{ } Pin2 = GF_BSP_GPIO_ReadIO(2); - Pin3 = GF_BSP_GPIO_ReadIO(3); - + Test1 = GF_BSP_GPIO_ReadIO(3); + if (!Test1) + { + GF_BSP_GPIO_SetIO(5, 0); + } + else + { + GF_BSP_GPIO_SetIO(5, 1); + } } void Automatic_Init() diff --git a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/main.c b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/main.c index c1c4338..1d4d39b 100644 --- a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/main.c +++ b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/main.c @@ -154,7 +154,7 @@ int main(void) MX_LPUART1_UART_Init(); MX_ADC2_Init(); /* USER CODE BEGIN 2 */ - GF_BSP_GPIO_SetIO(5,1); + //GF_BSP_GPIO_SetIO(5,1); DLT_LOG_ENABLE_LEVEL=0;//7 send all information 0 send nothing Error_Detect_Intialzie(3000);//every 1 seconds HAL_Delay(5000); @@ -276,9 +276,9 @@ void CV_GV_Init() strong_grinding_machine_cmd = 0; // 电磁?默认关闭 GF_BSP_GPIO_SetIO(3, 1); - GF_BSP_GPIO_SetIO(4, 1); + //GF_BSP_GPIO_SetIO(4, 1); // 冷却通气?默认关闭,动作与主轴同步 - GF_BSP_GPIO_SetIO(5, 1); + //GF_BSP_GPIO_SetIO(5, 1); //Error Config SystemErrorData= &GV.SystemErrorData;//send to upper computer diff --git a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c index 732b328..6ccb4ea 100644 --- a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c +++ b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c @@ -360,7 +360,7 @@ const uint32_t up_limit = 6200; const uint8_t down_limit = 0; uint8_t Pin2 = -1; //上限位,为0表示限位触发 -uint8_t Pin3 = -1; //下限位,为0表示限位触发 +uint8_t Test1 = 0; int32_t KinfePosition = 1000; // 初始化为一个不合理的大值,等于1000时显示为未标定 int StrongSingleShotFlag = 0; @@ -371,11 +371,6 @@ 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; // 电机脉冲数急停