zhaohe 1 year ago
parent
commit
9de9f8940b
  1. 5
      components/step_motor_ctrl_module/tmc51x0_motor.cpp

5
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;
}

Loading…
Cancel
Save