Browse Source

【吊耳切割临时测试】破烂无线手轮

master
Lizongdi 1 week ago
parent
commit
eddfa045ba
  1. 20
      diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c
  2. 6
      diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/main.c
  3. 7
      diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c

20
diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c

@ -145,28 +145,34 @@ void Mode_Control()
} }
extern uint8_t Pin2; extern uint8_t Pin2;
extern uint8_t Pin3; extern uint8_t Test1;
void IO_Control() void IO_Control()
{ {
GF_BSP_GPIO_SetIO(4, 1); //GF_BSP_GPIO_SetIO(4, 1);
if(StrongGrindingMachineCurrentState == STRONG_GRINDING_MACHINE_MOTION_STATE) 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) else if(StrongGrindingMachineCurrentState == STRONG_GRINDING_MACHINE_HALT_STATE)
{ {
GF_BSP_GPIO_SetIO(5, 1); //GF_BSP_GPIO_SetIO(5, 1);
} }
else{ else{
} }
Pin2 = GF_BSP_GPIO_ReadIO(2); 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() void Automatic_Init()

6
diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/main.c

@ -154,7 +154,7 @@ int main(void)
MX_LPUART1_UART_Init(); MX_LPUART1_UART_Init();
MX_ADC2_Init(); MX_ADC2_Init();
/* USER CODE BEGIN 2 */ /* 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 DLT_LOG_ENABLE_LEVEL=0;//7 send all information 0 send nothing
Error_Detect_Intialzie(3000);//every 1 seconds Error_Detect_Intialzie(3000);//every 1 seconds
HAL_Delay(5000); HAL_Delay(5000);
@ -276,9 +276,9 @@ void CV_GV_Init()
strong_grinding_machine_cmd = 0; strong_grinding_machine_cmd = 0;
// 电��默认关闭 // 电��默认关闭
GF_BSP_GPIO_SetIO(3, 1); 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 //Error Config
SystemErrorData= &GV.SystemErrorData;//send to upper computer SystemErrorData= &GV.SystemErrorData;//send to upper computer

7
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; const uint8_t down_limit = 0;
uint8_t Pin2 = -1; //上限位,为0表示限位触发 uint8_t Pin2 = -1; //上限位,为0表示限位触发
uint8_t Pin3 = -1; //下限位,为0表示限位触发 uint8_t Test1 = 0;
int32_t KinfePosition = 1000; // 初始化为一个不合理的大值,等于1000时显示为未标定 int32_t KinfePosition = 1000; // 初始化为一个不合理的大值,等于1000时显示为未标定
int StrongSingleShotFlag = 0; int StrongSingleShotFlag = 0;
@ -371,11 +371,6 @@ extern uint8_t Mode_Init;// 初始化时第一次升刀的流程
static void LimitDownPosition(void) static void LimitDownPosition(void)
{ {
if (!Pin3)
{
GV.LS_FrontEnd_Motor.Target_Velcity = 0;
}
if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT) if (GV.LS_FrontEnd_Motor.Real_Position - KinfePosition >= SAFE_MOTOR_COUNT)
{ {
GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停 GV.LS_FrontEnd_Motor.Target_Velcity = 0; // 电机脉冲数急停

Loading…
Cancel
Save