|
@ -673,10 +673,17 @@ int32_t StepMotorCtrlModule::step_motor_easy_move_to_zero_point_quick() { |
|
|
do { |
|
|
do { |
|
|
// 期望偏差
|
|
|
// 期望偏差
|
|
|
int32_t expectation_dpos = -m_cfg.io_trigger_append_distance + 0 + m_cfg.motor_dzero - getnowpos(); |
|
|
int32_t expectation_dpos = -m_cfg.io_trigger_append_distance + 0 + m_cfg.motor_dzero - getnowpos(); |
|
|
// 快速移动到零点
|
|
|
|
|
|
moveTo(0 + m_cfg.motor_dzero, m_cfg.motor_default_velocity); |
|
|
|
|
|
// 等待移动到目标点
|
|
|
|
|
|
if (!waitforstop([this]() { return m_iotable[0].getState(); })) break; |
|
|
|
|
|
|
|
|
if (!m_iotable[0].getState()) { |
|
|
|
|
|
// 快速移动到零点
|
|
|
|
|
|
moveTo(0 + m_cfg.motor_dzero, m_cfg.motor_default_velocity); |
|
|
|
|
|
// 等待移动到目标点
|
|
|
|
|
|
if (!waitforstop([this]() { return m_iotable[0].getState(); })) break; |
|
|
|
|
|
} else { |
|
|
|
|
|
// 快速移动到零点
|
|
|
|
|
|
moveTo(0 + m_cfg.motor_dzero, m_cfg.motor_default_velocity); |
|
|
|
|
|
// 等待移动到目标点
|
|
|
|
|
|
if (!waitforstop([this]() { return !m_iotable[0].getState(); })) break; |
|
|
|
|
|
} |
|
|
// 移动到零点
|
|
|
// 移动到零点
|
|
|
if (!exec_move_to_io_task(0, -1)) break; |
|
|
if (!exec_move_to_io_task(0, -1)) break; |
|
|
moveToZero = true; |
|
|
moveToZero = true; |
|
|