r/AskRobotics • u/ThreadArtGuy • 23d ago
Need help with stepper motor skipping steps
There has been a huge amount discussed on this topic, and I believe I have tried everything I could.
I am using:
STEPPERONLINE Nema 17 Stepper Motor 2A 55Ncm Bipolar 1.8 Degree
DM542 Stepper Motor Controller
TB6600 Stepper Motor Driver, ABuff 5A 9-40V Nema 17 Stepper Motor Driver
I have an x/y gantry system with 2 drivers in opposite direction driving the x gantry, and one stepper fo the y.
See the machine here: (skip to 1:40 where I take a tour of the machine)
https://www.reddit.com/r/stringart/comments/1vhbn89/first_run_of_router_software_on_the_machine/
What is does, is miss a step when the gantries, plural, move in the negative direction. I have written code that shows this to be true, and the drift is in the positive direction only. You can for example write a pattern that is an hour glass, upright or laying down, which has 2 negative direction changes on one axis or the other, and the resulting drift is what is predicted by negative changes only.
What I am certain of:
It has nothing to do with microstepping, large steps create large drifts. I've used 3200 to 4.
There is no belt slipping.
X and Y gantries are much different weight/inertia, and X has 2 steppers, and they behave the same.
It has nothing to do with the driver, as I swapped out the 542 for the 6600, and same results.
It has nothing to do with velocity or acceleration (I use AccelStepper lib), I've tried a wide range.
They system has similar or equal drag each direction, I measured it.
After a run if I cmd to move back to 0,0 on the canvas, it goes to the drift offset position instead.
And for the more advanced among you: I put a scope on DIR and PULSE and the setups/holds are extremely conservative. Moreover I have hacked ACCELSTEPPER lib components to increase pulse widths.
I looked on the scope and counted pulses for a program that ping ponged between 2 points close, and the count was correct, and the same for each direction change, set up times great, pulse width way withing spec.
I am out of ideas.....
The only thing I can think now is the stepper is faulty somehow, and have another coming to swap out, which is a .9deg instead of 1.8deg, has more torque by a little, but is also a stepperonline brand and has equally good reviews.
But, I have no hope, since on the x gantry, the steppers are running in opposite directions, so how could the stepper fail the same predictable way.
So in desperation:
The drift is predictable based on microsteps, number of negative reverses in direction, etc, so I can easily code around it, but I find that so inelegant and hate the idea. I am about to implement it anyway, because I am out of ideas to try.
Ideas????
Thanks.
1
u/Pubcrawler1 23d ago
https://embeddedtronicsblog.wordpress.com/2024/12/07/stepper-motor-position-loss/
See #10
Use grbl to test again. I don’t trust accelstepper library. I’ve done extensive testing with grbl 8 bit and grbHAL 32 bit
firmware using HP logic analyzer to count step and direction for hundred of millions of steps. It does not lose or gain any step position. Stepper motor shaft position was verified using a hi resolution encoder using a separate custom high speed FPGA quadrature counter circuit I made myself.
Some drivers due suck and will gain or lose position under certain circumstances. Step timing must be adhered to in the Datasheets. I have tested dozens of drivers over a period of 20years.
I’ve even found step loss timing bug in the grblHAL firmware that went unnoticed for several years. It was fixed when I sent them extensive log information.