How to calibrate stepps

Hi, i’m having trouble with the steppers for all axis. How do i calibrate the axis to move the right amount of stepps? Can’t seem to find it in the code.
When i move my X 10mm it moves 12.6 mm. The Y moves 11.4 mm. The Z moves about 25% but i figured its because i have used different pitched lead screw than the recomenden one.

I running my CNC with the following:
Board: Archim v1, from this site

Firmware: MPCNC_archim1_T8_16T_LCD_DualEndstop

Steppers: nema 17 59Ncm 2A 1.8 4-lead 48mm stepper motors.

You should not need to “calibrate” per se. The movement should be deterministic and predictable based on the pulley and stepper driver you are using. If you used a 20 tooth pulley instead of 16 tooth, you would expect 25% greater movement, or 12.5 mm of movement when 10 mm is requested.

This is in configuration.h at DEFAULT_AXIS_STEPS_PER_UNIT. Change from 200 to 160 on the first and second value, which represent X and Y. If the lead of your lead screw is 2mm per revolution instead of 8mm, then your third value for DEFAULT_AXIS_STEPS_PER_UNIT should be 4 times higher, or 3200. Make sure your Z movements are slow, or your Z axis could miss steps.

As for your Y axis moving shorter than X, the most likely causes are

  1. Physical problem like pulley loose on motor shaft
  2. Electrical wiring problem causing intermittent motor movement
  3. Not enough motor current, causing missed steps
  4. Too much motor current, causing driver overheat and thermal shutdown
1 Like


I’ve heard several of you say this but I’m afraid I don’t understand. I do understand that things are, in theory, “deterministic and predictable” with discrete numbers of teeth on belts and pulleys and motor steps/revolution but – in practice – I routinely see that there will be be slight adjustments necessary to truly get “calibrated” axis movement.

I love your Test Pattern generator, Jamie. And I’ve always been fond of printing/lasering rulers with the machines I build… those are equally as important to me as the “MPCNC crown” to give me confidence that my machine is operating properly.

Only a couple of days ago, I was messing with the laser on my FoamRipper machine… and using the X and X/Y rulers from your generator to calibrate the X and Y axes. Note all the rulers, printed on this piece of cereal box cardboard. Obviously, 160 is the “determined” and “predictable” number for steps/mm… but 160.00, 160.80, 160.50, and 160.60 all give “measurable” differences when compared with an accurate metal ruler.

[attachment file=105278]

Over the 100mm I used here, I watched the rulers adjust to “dead on” with 160.60. If I really want/need to refine that value further, I do this over a larger range, say 900mm… or as much as the axis will physically allow.

Anyway, I use the following calculation to zero in on the steps/mm value for my particular machine’s axis

steps/mm = (commanded / actual) * current step/mm setting

I’m all ears if someone can tell my why this isn’t the right way to calibrate an axis. I’ve seen it on virtually every machine I’ve built over the last several years… and there have been a number of them. Why do they all seem to be more accurate with, say 160.57, than 160? To me, this is the difference between “close” and “calibrated”.

– David

1 Like

You’re right, and I should qualify that to be that the deterministic, predictable should get you within 1% or less. The final small errors come from who knows where… belt pitch very slightly off? Different thermal expansion of the workpiece compared to the belts? Coriolis force? Correcting this, if it’s repeatable, is to measure and compensate, which is calibration, nevermind the origin of the error. And this is a valid thing to do.

The larger errors of 10% or 1mm are too big to lump into the mysterious small effects, and I’m recommending that the ‘proper’ solution is to reconcile the theoretical, predicted movement with the actual movement. But as you said, only to get “close”, not “calibrated”.

1 Like

Not sure how much (if at all) it affects the calculated vs. actual accuracy, but the steppers themselves aren’t perfect. Mine have a spec’d “Positional Accuracy” of +/- 5%.[attachment file=“Step Accuracy.jpg”]

I think we’ve determined that getting “close” is “deterministic and predictable”… and “calibration” is not.

Getting initial “steps/mm” values is indeed “deterministic and predictable” in that we select our components “by spec” - motors, pulleys, belts, etc. - and put them together… and calculate a “steps/mm” number, based on those component specs, that should get us “close” to proper movement right out of the gate. But that’s not “calibration”.

“Calibration” is a process of actually moving, measuring, correcting… and repeating that process, until any error we see approaches zero. So we command a specific movement, measure what we actually moved, and compute a new value based on the difference between commanded and actual motion.

It’s a priority, as Jamie said, that you see repeatable movement before doing any calibration, to rule out inaccuracies due to loose components, mechanical slop, etc. Interestingly, however, we don’t really have to know any of the specs – or actual sources of error – on any of our components, once we can command movement and measure how far it actually moves; i.e. if a 20-tooth (vs 16-tooth) pulley is mistakenly installed, or my steppers have poor poor positional accuracy, no big deal… it can still be compensated for, as long as it is repeatable. And it “converges” quickly… regardless of the magnitude of the initial error (as long as it’s within the physical limits of the machine).

– David

1 Like

Well said - agree completely.

Yes, this is right. One thing I will add is that while calibration can correct anything that is repeatable, this does not come completely for free: it requires some degree of judgement. Tool runout for example can make cuts that are larger than the commanded length plus the cutter diameter, and adjusting steps per mm will create more headaches. In 3d printing, it used to be common for people to print calibration cubes and adjust steps per mm, not realizing that the dimensional error was from over- or under-extrusion.

But yes, I agree with everything you’ve said, and none of this changes that.