From 96ccad10ecd607f1a335d16ea990dee9497dfa33 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Tue, 12 May 2026 15:50:39 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=B0=83=E9=80=9A=E6=89=93=E6=A0=87?= =?UTF-8?q?=E3=80=91=E6=80=A5=E5=81=9C=E5=92=8C=E6=A8=A1=E5=BC=8F=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=B1=82=E7=BA=A7=E5=85=B3=E7=B3=BB=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BHBF_Robot_Lifting_Lug/Core/Src/FSM.c | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c index e4ef2f8..ba52fad 100644 --- a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c +++ b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c @@ -70,10 +70,6 @@ void GF_Dispatch() IV_Control(); IO_Control(); - Mode_Control(); - - // 限位安全检测 - Limit_Detection(); // 急停 EmergencyStopControl(); @@ -92,21 +88,12 @@ void EmergencyStopControl() CurrentFrontEndState = HALT_STATE; StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE; } - else{ - + else + { + Mode_Control(); } } -uint8_t upper_limit_position = 0; -uint8_t lower_limit_position = 0; - -void Limit_Detection() -{ -// upper_limit_position = GF_BSP_GPIO_ReadIO(2); -// lower_limit_position = GF_BSP_GPIO_ReadIO(3); -} - - uint8_t Mode_Select_State = MANUAL_OPERATION; uint8_t Mode_Init = 0;// 初始化时第一次升刀的流程 @@ -285,7 +272,8 @@ int32_t knife_current_altitude = 0; // 激光1读数 void Automatic_Operation() { - MaxLaserSensor = 2000; +#if 0 + MaxLaserSensor = 2000;//临时加的保护 static int knife_flag = 1; uint8_t IsAllowRotation_AutoMode = 0; // 是否允许转刀 @@ -379,6 +367,23 @@ void Automatic_Operation() CurrentFrontEndState = HALT_STATE; StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE; } +#else + CurrentFrontEndState = HALT_STATE; + StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE; + + if(GV.MK32_Key.CH7_SD == -1000) + { + CurrentMoveState = AUTO_FORWARD; + } + else if(GV.MK32_Key.CH7_SD == 1000) + { + CurrentMoveState = AUTO_BACKWARD; + } + else + { + CurrentMoveState = Move_HALT; + } +#endif }