A4983's strange behaviour when using acceleration


I’m trying to use the A4983 driver to drive 3 stepper drivers for use in a contraptor mini-cnc ( contraptor.org/mini-cnc )
The stepper motors are Lin Engineering 5718X-01 ( linengineering.com/line/cont … /5718.aspx ) wired in parallel.
The microcontroller is a Sanguino ( arduino-like board ), the PSU in a standard PC one ( 12V, lots of amps ), the firmware I’m running is an evolved version of the RepRap firmware you can find here : contraptor.svn.sourceforge.net/v … /firmware/
I’m ready to give any more info you may need.

Now the problem :
When having a fixed speed, everything is fine.
But when I enable the firmware’s acceleration option, it causes problems.
I made a video ( very short ) :

What the code is trying to do : accelerating to a speed, then staying at that speed, then decelerating at the end of the movement.
What actually happens is that at first it accelerates fine, then it suddenly stops working ( noise, vibration, no torque ) , then at the end of the movement when the code decelerates, it starts working again.
That is what you can see in the first part of the video.
First thought is : I’m going too fast, over the speed limit for this board.
The problem with that idea is : when not using acceleration ( going instantly from speed 0 to speed max ), it works fine, you can see that in the second part of the video.

So the problem only happens when progressively increasing speed.
Note : I’m not yet 100% sure this is not a problem with the sanguino code not sending the step impulses correctly, I’ll verify that tomorrow by wiring a speaker to it, but I’m nearly sure that’s not the problem as this firmware is used by lots of people, and the led indicator I have seems to indicate ok activity. So for now my first suspect is the A4983 board.
Any idea where this problem is coming from ?

Thanks reading this and thanks for any idea/help you may have !


I would suspect the code first, but stepper motors can have resonant points where they lose torque, so it’s possible your particular acceleration rate is not well matched to your motor. Is it easy to tweak the acceleration rate, and if so, can you make it higher to quickly get through the low-torque points? You could also use your fixed-frequency code to look for some of those low-torque speeds. The speaker sounds like it could be a good trick, but if possible, you should try to look at the signals with an oscilloscope (for instance, there could be a high-frequency component causing the problem that you wouldn’t hear).

- Jan