diff --git a/sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp b/sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp index d9600be..506ac63 100644 --- a/sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp +++ b/sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp @@ -673,10 +673,17 @@ int32_t StepMotorCtrlModule::step_motor_easy_move_to_zero_point_quick() { do { // 期望偏差 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; moveToZero = true; diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 1db2dc5..af00fc5 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -1,5 +1,5 @@ #pragma once -#define PC_VERSION 513 +#define PC_VERSION 520 #define PC_MANUFACTURER "http://www.iflytop.com/" #define PC_PROJECT_NAME "a8000_subboard" #define PC_IFLYTOP_ENABLE_OS 1