|
|
@ -388,7 +388,9 @@ bool StepMotorCtrlModule::exec_move_to_io_task(int32_t ioindex, int32_t directio |
|
|
|
if (direction < 0) { |
|
|
|
targetpos = getnowpos() - m_cfg.io_trigger_append_distance; |
|
|
|
} |
|
|
|
ZLOGI(TAG, "step4: move to zero point %d", targetpos); |
|
|
|
moveTo(targetpos, m_cfg.motor_default_velocity); |
|
|
|
|
|
|
|
waitforstop(nullptr); |
|
|
|
|
|
|
|
if (m_thread.getExitFlag()) { |
|
|
@ -670,7 +672,7 @@ int32_t StepMotorCtrlModule::step_motor_easy_move_to_zero_point_quick() { |
|
|
|
bool moveToZero = false; |
|
|
|
do { |
|
|
|
// 期望偏差
|
|
|
|
int32_t expectation_dpos = 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); |
|
|
|
// 等待移动到目标点
|
|
|
@ -683,7 +685,7 @@ int32_t StepMotorCtrlModule::step_motor_easy_move_to_zero_point_quick() { |
|
|
|
} while (false); |
|
|
|
|
|
|
|
after_motor_move(); |
|
|
|
if (moveToZero) setnowpos(0 + m_cfg.motor_dzero); |
|
|
|
if (moveToZero) setnowpos(0 + m_cfg.motor_dzero - m_cfg.io_trigger_append_distance); |
|
|
|
}, |
|
|
|
[this]() { m_stepM1->stop(); }); |
|
|
|
|
|
|
|