teemuatlut / TMC2130Stepper

Arduino library for Trinamic TMC2130 Stepper driver
MIT License
159 stars 50 forks source link

Inconsistencies in stepper motor response when using stallGuard #11

Open beccathermo opened 6 years ago

beccathermo commented 6 years ago

I am working on a project in which a stepper motor moves a heavy load along the z-axis. There are bearings on each end that I use stallGuard to "detect" and have the code change the direction of the stepper motor. While I have used this library successfully for a simpler application (using stealthChop on a stepper with minimum load), I continue to experience inconsistencies in the motor's response when using stallGuard.

Setup:

For example, without coding any of the settings for dcStep, it will inconsistently "turn on" when moving in the negative z-direction. It will also slip-causing the load to slide down the shaft for one second-when changing direction from positive z to the negative z, but it only does this occasionally. (There is a clear difference in the slip and dcStep.) One other example is that each time I compile code or hit the reset button on the Teensy, the motor stalls briefly after one second before doing what I told it do. Is it possible it's calculating something during that time?

I can compile and upload the same code two times and it will behave differently. Do I need to reset the parameters each time I upload the code? Any thoughts?

teemuatlut commented 6 years ago

I'd recommend a full power cycle between compiles if you see it acting weird. The registers may not get a proper reset on start up and I remember having some trouble with resets at some point.

It's hard for me to point anything clear but

beccathermo commented 6 years ago

The full power cycle didn't improve the consistency unfortunately.

I also upped the current to 1A and still face the same issues. I've reached out to Watterott (supplier of the SilentStepStick motor driver I am using) and will provide an update if I reach any major breakthroughs.

Thank you for the work you've done with this library!