From 9de9f8940b0013d7a97db35e0acad9a4e072015a Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 8 Apr 2024 15:47:23 +0800 Subject: [PATCH] update --- components/step_motor_ctrl_module/tmc51x0_motor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/step_motor_ctrl_module/tmc51x0_motor.cpp b/components/step_motor_ctrl_module/tmc51x0_motor.cpp index d5f4fe3..6bcce96 100644 --- a/components/step_motor_ctrl_module/tmc51x0_motor.cpp +++ b/components/step_motor_ctrl_module/tmc51x0_motor.cpp @@ -194,7 +194,7 @@ int32_t TMC51X0Motor::move_to_zero_with_calibrate(int32_t nowx, action_cb_status m_param.motor_shift = calibrate_x; m_stepM1->setXACTUAL(0); - m_stepM1->setENCVAL(0); + m_stepM1->setENCVAL(0); call_exec_status_cb(erro, status_cb); return; @@ -713,6 +713,9 @@ int32_t TMC51X0Motor::motor_get_subdevice_reg(int32_t reg_addr, int32_t* reg_val } int32_t TMC51X0Motor::motor_read_enc_val(int32_t* enc_val) { + if (m_motor_enc_resolution == 0) { + return motor_read_pos(enc_val); + } inverse_kinematics(m_stepM1->getENCVAL(), *enc_val); return 0; }