diff --git a/src/main/java/a8k/canbus/A8kModParamInitializer.java b/src/main/java/a8k/canbus/A8kModParamInitializer.java index 4948ea6..fb589a6 100644 --- a/src/main/java/a8k/canbus/A8kModParamInitializer.java +++ b/src/main/java/a8k/canbus/A8kModParamInitializer.java @@ -71,14 +71,12 @@ public class A8kModParamInitializer implements AppEventListener { // canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_run_to_zero_speed, 500); canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_default_velocity, 2200); - // canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_a1, 50); - // canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_amax, 100); canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_irun, 31); - canBus.moduleSetReg(MId.PlatesBoxPusherM, RegIndex.kreg_step_motor_default_velocity, 1500); + canBus.moduleSetReg(MId.PlatesBoxPusherM, RegIndex.kreg_step_motor_default_velocity, 1800); canBus.moduleSetReg(MId.PlatesBoxPusherM, RegIndex.kreg_step_motor_irun, 31); - canBus.moduleSetReg(MId.PlatesBoxYM, RegIndex.kreg_step_motor_default_velocity, 1500); + canBus.moduleSetReg(MId.PlatesBoxYM, RegIndex.kreg_step_motor_default_velocity, 1800); canBus.moduleSetReg(MId.PlatesBoxYM, RegIndex.kreg_step_motor_irun, 25); // canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_run_to_zero_speed, 500); diff --git a/src/main/java/a8k/canbus/protocol/CmdId.java b/src/main/java/a8k/canbus/protocol/CmdId.java index 1964d5c..258b209 100644 --- a/src/main/java/a8k/canbus/protocol/CmdId.java +++ b/src/main/java/a8k/canbus/protocol/CmdId.java @@ -9,7 +9,7 @@ public enum CmdId { event_bus_reg_change_report(0x0064, "event_bus_reg_change_report"),// // module_ping(0x0100, "module_ping"),// - module_get_status(0x0104, "module_get_status", false),// + module_get_status(0x0104, "module_get_status", true),// module_stop(0x0101, "module_stop"),// module_set_reg(0x0105, "module_set_reg"),// module_get_reg(0x0106, "module_get_reg"),// diff --git a/src/main/java/a8k/service/hardware/ReactionPlatesTransmitCtrlService.java b/src/main/java/a8k/service/hardware/ReactionPlatesTransmitCtrlService.java index 5cf14ac..96fb549 100644 --- a/src/main/java/a8k/service/hardware/ReactionPlatesTransmitCtrlService.java +++ b/src/main/java/a8k/service/hardware/ReactionPlatesTransmitCtrlService.java @@ -216,7 +216,22 @@ public class ReactionPlatesTransmitCtrlService implements HardwareCtrlModule { //限制pos在 0--> 36000之间 pos = pos % 36000; if (pos < 0) {pos += 36000;} - canBus.stepMotorEasyMoveToBlock(MId.IncubatorRotateCtrlM, pos, getActionOvertime()); + + //先移动半个间距,用来检测是否发生卡板 + Integer nowPos = canBus.stepMotorReadPos(MId.IncubatorRotateCtrlM); + if (nowPos < pos) { + canBus.stepMotorEasyMoveByBlock(MId.IncubatorRotateCtrlM, getTurntablePosSpacing(), getActionOvertime()); + } else if (nowPos > pos) { + canBus.stepMotorEasyMoveByBlock(MId.IncubatorRotateCtrlM, -getTurntablePosSpacing(), getActionOvertime()); + } + + //解决齿轮间隙的问题 + if (nowPos < pos) { + canBus.stepMotorEasyMoveToBlock(MId.IncubatorRotateCtrlM, pos, getActionOvertime()); + } else { + canBus.stepMotorEasyMoveToBlock(MId.IncubatorRotateCtrlM, pos - 300/**/, getActionOvertime()); + canBus.stepMotorEasyMoveToBlock(MId.IncubatorRotateCtrlM, pos, getActionOvertime()); + } } @@ -289,9 +304,7 @@ public class ReactionPlatesTransmitCtrlService implements HardwareCtrlModule { continue; } pushPlateQuick(PBCh, index); - if (pushAllPlateAndDropBreakFlag) {break;} pullPlate(index); - if (pushAllPlateAndDropBreakFlag) {break;} dropPlate(); if (pushAllPlateAndDropBreakFlag) {break;} }