Ramps - external driver - Nema23

I had to replace my Z stepper with a Nema23.
Ramps 1.4
MKS CD Current Expansion Board (https://www.robotics.org.za/MKS-BREAK)
External stepper driver (https://www.robotics.org.za/MKS-TMC2160-OC)

Works well except the steps are way wrong. 1mm movement results in 20mm real movement. So I read I need to change the stepper driver in configuration.h to :


Do I use the standalone option or the one that say “TMC2160” ? I assumed standalone as the other is controlled by SPI. What else needs modification to get the Z steps right ?

Thanks Martin

Can you make the TB driver use miceosteps?

The Ramps code from MarlinBuilder releases assumes drv8825s with 1/32nd microstepping. That gets folded into the Z steps per unit (or steps per mm). Our firmware assumes 800. If you had 1/2 microsteps on your TB driver, then it should be 16x smaller or 50 steps per mm. But honestly, 1/2 will be noticeably chunky. I would try to set it to at least 1/8.

There are several copies of the steps per unit parameter. The default is set in configuration.h. When Marlin boots, it reads it from EEPROM. And when it’s running, you can change it with M92.

So you can adjust it by sending M92 Z50. If that works, you can write it to eeprom with M500.

Or you can edit configuration.h, flash the mega, and use M502 to reset to the defaults, and then use M500 to save to eeprom.

Is this assumption wrong ?:

1.8 Deg/Step

The basic formula to calculate motion on a rotating rod is:

(motor_steps_per_rev * driver_microstep) / thread_pitch = steps_per_mm
200 * 32 = 6400 / 2 = 3200

#define DEFAULT_AXIS_STEPS_PER_UNIT { 200, 200, 3200 }

I assume seeing that the ramps is set to 1/32nd microstepping the external driver needs to be set the same ?


Are you using a 2mm single start leadscrews? The standard build is 4 start. So it moves 8mm in one turn, not 2mm.

That is why the default is 800 steps/mm for 1/32nd microstepping.

I would use at least 1/8. 1/16th is good. 1/32 works too (but you won’t notice the difference between 1/16 and 1/32). Your steps/mm are dependent on your microstepping setting. So you should adjust accordingly.

I usually persuade people to avoid calibrating their steps/mm. The equation will get you closer than your calipers.

Ahh and there the lights came on !!! Never thought about the 4 start Now it makes sense.

Thanks Martin

1 Like