diff --git a/components/tmc/ic/ztmc5130.cpp b/components/tmc/ic/ztmc5130.cpp index ad72830..b279d5e 100644 --- a/components/tmc/ic/ztmc5130.cpp +++ b/components/tmc/ic/ztmc5130.cpp @@ -201,11 +201,11 @@ void TMC51X0::moveTo(int32_t position, uint32_t velocityMax) { void TMC51X0::moveToEnd(int32_t direction, uint32_t velocityMax) { if (direction > 0) { writeInt(TMC5130_RAMPMODE, TMC5130_MODE_POSITION); - writeInt(TMC5130_VMAX, velocityMax); + writeInt(TMC5130_VMAX, to_motor_vel(velocityMax)); writeInt(TMC5130_XTARGET, INT32_MAX); } else { writeInt(TMC5130_RAMPMODE, TMC5130_MODE_POSITION); - writeInt(TMC5130_VMAX, velocityMax); + writeInt(TMC5130_VMAX, to_motor_vel(velocityMax)); writeInt(TMC5130_XTARGET, INT32_MIN); } }