Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Stepper loses distance after direction change

I’m using a MP6500 with a 400-step motor and 8 microsteps, and am having a slight accuracy issue. The first movement after a direction reversal doesn’t quite stay in registration - it appears that the move is about 3 microsteps short. Looking at it in slow motion (e.g. 1 microstep/sec), it seems that the driver is providing the impulses OK, as I can hear the clicks from the motor. But the first 6 or so microsteps are smaller than the normal size, resulting of course in a slightly smaller overall movement. And this movement loss is quite consistent (both ways), and only occurs immediately following a reversal - same direction moves are OK.

So it doesn’t seem to be a driver issue. I have also tried to eliminate the possibility of friction or slack in the drive setup, by manually tweaking the load prior to the reverse move. Might it be a characteristic of the motor?

I wondered whether this phenomenon had been noticed by anyone else, and if there are any ideas on how to identify and resolve it.

I can make a correction by adding (e.g.) 3 microsteps whenever the motor is reversed but that is sub-optimal for a couple of reasons, and this is addressing the symptom and I would like to know the cause.

Any thoughts would be welcome.


Hi, Paul.

Stepper motors generally do not have backlash unless they are geared. How are you controlling the driver? Could you post a link to more information on your motor like a datasheet? Pictures, code (preferably simplified to just demonstrate the problem), and more information about your system might also be helpful.


Hi Claire.

Thanks for getting back to me. Here is most of what you asked for, which should give you an idea of what’s going on. I hope responding like this gets directly to you OK.

I have added some notes to the arduino code, but was a bit wary about stripping out too much in case I removed something that was tripping me up. I think it’s fairly straightforward, but if you would prefer that I do some surgery, I will.

Background on the application. It’s a model railway turntable with the 12” rotating platform horizontally mounted, so it’s well balanced and there doesn’t seem to be undue friction. The stepper motor is vertically mounted directly underneath, and is directly coupled without any gearing or reduction drive - so I wasn’t expecting backlash - and in fact that’s why I opted for this configuration. Typical moves are only a fraction of a turn, and it moves at about 1 rpm. I’m using the 400-step motor in eighth-step microsteps for smoothness, and all moves are multiples of 32 microsteps (4 full steps). Positional accuracy is everything, since 4 microsteps at the periphery translates into almost 1/16”, which is too much (derailments likely), so I’ve got to get well below this.

I hope this helps. If anything isn’t clear, let me know.

Thanks again.

P.S. I love the digital control of motor current, and it’s working well.

Here is the motor spec page:

42BYGHM809.pdf (41.2 KB)

Turntable controls schematic (MP6500).pdf (58 KB)

Turntable_with_Pololu_MP6500_driver_annotated.ino (13.9 KB)



Hi Claire.

I realised after sending you this package that I could have simplified the code quite a bit more, to just demonstrate the stepper motor movements. So I am working on that now, and will test to be sure the problem is still there. So don’t spend time with the sketch I sent yesterday, and I will try and get the simpler one to you today.

Sorry for the confusion.

Thanks for the additional information. I think it is worth checking that your coupler is not introducing the backlash. Is it possible to test the system without it? If so, it might be better to use a lighter load like a long strip of paper instead of the whole turntable.


Hmmm, yes. I wondered about the coupler, which I am using to deal with any slight misalignment between the motor shaft and the turntable shaft. It does have that spiral in it, but it is made of fairly solid aluminum, and doesn’t seem to have any torsional flex. The advantage of looking at the turntable is that it represents a rigid pointer, and the rim of the TT well is a good fixed reference. Since I am looking at discrepancies of the order of 1/16” at a radius of 6", anything flexible may not give me any useful indication. What I have been doing is to give the TT a nudge or a flick just before issuing the reverse command, to try and clear any accumulated backlash or strain in the drive, and to overcome any static friction that might be present; while not especially scientific, these nudges don’t seem to result in any pre-move repositioning, and nor do they change the problem. Anyway, eliminating the TT motion from the equation sounds a good idea, so let me think about what I might be able to pull together, but it might need some fabrication.

I was a little concerned about a the possibility of some start-up friction in the movement, which may be needing a few pulses to get started on the move, and that might still be at the root of it. But I only have a problem on reversals so that doesn’t seem very likely, and I did select a fairly heavy-duty motor and am driving it quite hard (1.5A). It did occur to me that the MP6500 driver starts at step 5 (on ⅛ microsteps) with all my moves - i.e. at the 45º position, and I wondered whether there was a different starting position which provides more initial torque. - and how can I get there?

I worked today on a simplified arduino sketch, and I attach it. I have removed as much of the control code as I can, and just left the motion commands with a few simple moves controlled by digital inputs. The motor control routines in this simpler version are the same as in my full version, so should be applicable. The problem is still apparent.


Test_turntable_microsteps.ino (3.55 KB)

Hi Claire.

Following your suggestion, I took the coupler and bearing system out of play, and tested again. What I did was to raise the turntable rotating platform so that it was using only the motor bearing: since the TT is well balanced there should be no twisting or friction effects. The result was that the problem went away, and there were no short movements on reversal. So the software, driver, and motor are working correctly.

I now have to find a way of dealing with this. I have tried hard to eliminate friction, but that might still be the culprit. Short of totally revising the TT design, that might be hard to do, but I will have to look further to see if anything might be possible. I don’t think I can rely totally on the motor bearing, since vertical registration is as important as the horizontal and the TT platform has guide wheels to ensure this, but again I will look at it.

I don’t know whether my thought about finding a higher torque starting position for the driver might be possible, and perhaps you might have some thoughts on that. Otherwise it’s up to me to work out the best way forward.

Thanks for your suggestions.


I’m not sure if this would work for you, but I adapted the Servo City “ServoBlocks” idea for use with a stepper so that my turntable would be both low friction and not bearing down on the stepper shaft. The idea is that the hub sits in it’s own bearing. It might be tricky aligning your turntable with its surround though since you’d have to make all your adjustments at the bearing.

Hi jlo. I appreciate the reference and haven’t come across these before, but will look closer. But right now I can’t even easily get the TT to run on the stepper bearings without significant redesign - and as you say that would be tricky to align properly. Right now the TT, which is only a mid-range product, relies on the various nylon moving parts to stay in both vertical and horizontal alignment - and its good, but that’s where the friction probably originates. I don’t want to throw all that away or even buy a better TT unless I really have to.

Oh I see…well maybe a hub mount gear on the TT with a pinion on the stepper? Anyway, good luck!

Hi, Paul.

Glad you were able to identify the source of the backlash even though it doesn’t look easy to fix! Stepper motors generally have the most holding torque in their full-step positions, like the 45 degree position, so a different starting position wouldn’t help. Also, we are not aware of a way to change the default starting position.

Good luck!


Thanks. I’ll go back to the drawing board.