Browse Source

吊耳切割【调通打标】前端打磨电机调通

master
Lizongdi 2 weeks ago
parent
commit
f78d27fe35
  1. 6
      diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/msp_Strong_grinding_machine.c
  2. 14
      diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c
  3. 16
      diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c

6
diaoerqiege/BHBF_Robot_Lifting_Lug/Core/BASE/Src/MSP/msp_Strong_grinding_machine.c

@ -31,8 +31,8 @@ void strong_grinding_machine_intialize(struct UARTHandler *Handler)
// 测试,转速20rpm // 测试,转速20rpm
const uint8_t strong_grinding_machine_set_speed_cmd[8] = {0x01, 0x06, 0x00, 0x02, 0x00, 0x14, 0x28, 0x05}; const uint8_t strong_grinding_machine_set_speed_cmd[8] = {0x01, 0x06, 0x00, 0x02, 0x00, 0x14, 0x28, 0x05};
const uint8_t strong_grinding_machine_start_cmd[8] = {0x01, 0x06, 0x00, 0x01, 0x08, 0x82, 0x5F, 0xAB}; const uint8_t strong_grinding_machine_start_cmd[8] = {0x01, 0x06, 0x20, 0x00, 0x00, 0x01, 0x43, 0xCA};
const uint8_t strong_grinding_machine_stop_cmd[8] = {0x01, 0x06, 0x00, 0x01, 0x08, 0x81, 0x1F, 0xAA}; const uint8_t strong_grinding_machine_stop_cmd[8] = {0x01, 0x06, 0x20, 0x00, 0x00, 0x00, 0x82, 0x0A};
static uint8_t strong_grinding_machine_cmd_flag = 0; static uint8_t strong_grinding_machine_cmd_flag = 0;
uint8_t strong_grinding_machine_cmd = 0; uint8_t strong_grinding_machine_cmd = 0;
@ -48,7 +48,7 @@ void Strong_grinding_machine_cmd(void)
case 0: case 0:
MB_WriteHoldingReg(&Strong_grinding_machine_handler->Tx_Buf, Strong_grinding_machine_handler->TxCount, MB_WriteHoldingReg(&Strong_grinding_machine_handler->Tx_Buf, Strong_grinding_machine_handler->TxCount,
0x01, 0x0002, strong_grinding_machine_speed); 0x01, 0x4000, strong_grinding_machine_speed);
// Strong_grinding_machine_handler->TxCount = 8; // Strong_grinding_machine_handler->TxCount = 8;
// memcpy(&Strong_grinding_machine_handler->Tx_Buf, &strong_grinding_machine_set_speed_cmd, Strong_grinding_machine_handler->TxCount); // memcpy(&Strong_grinding_machine_handler->Tx_Buf, &strong_grinding_machine_set_speed_cmd, Strong_grinding_machine_handler->TxCount);
Strong_grinding_machine_handler->AddSendList(Strong_grinding_machine_handler, Strong_grinding_machine_handler->Tx_Buf, Strong_grinding_machine_handler->TxCount, Strong_grinding_machine_handler->AddSendList(Strong_grinding_machine_handler, Strong_grinding_machine_handler->Tx_Buf, Strong_grinding_machine_handler->TxCount,

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

@ -399,9 +399,9 @@ void Automatic_Operation()
uint8_t IsAllowRotation = 1; uint8_t IsAllowRotation = 1;
void Strong_Grinding_Machine_Control() void Strong_Grinding_Machine_Control()
{ {
IsAllowRotation = Knife_Detection(); // IsAllowRotation = Knife_Detection();
if(IsAllowRotation == 1) // if(IsAllowRotation == 1)
{ // {
if(GV.MK32_Key.CH6_SC == -1000) if(GV.MK32_Key.CH6_SC == -1000)
{ {
StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_MOTION_STATE; StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_MOTION_STATE;
@ -410,10 +410,10 @@ void Strong_Grinding_Machine_Control()
StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE; StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE;
} }
} // }
else{ // else{
StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE; // StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE;
} // }
} }

16
diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/robot_state.c

@ -516,15 +516,15 @@ extern int Knife_Detection(void);
void Strong_Grinding_Machine_Motion_State_Do(void) void Strong_Grinding_Machine_Motion_State_Do(void)
{ {
IsAllowRotation = Knife_Detection(); // IsAllowRotation = Knife_Detection();
if(IsAllowRotation == 1) // if(IsAllowRotation == 1)
{ // {
strong_grinding_machine_cmd = 1; strong_grinding_machine_cmd = 1;
} // }
else // else
{ // {
strong_grinding_machine_cmd = 0; // strong_grinding_machine_cmd = 0;
} // }
} }
void auto_forward_state_do(void) void auto_forward_state_do(void)

Loading…
Cancel
Save