A4983 ramps problems

Dear all,

I am using A4983 stepper motor driver carrier with voltage regulators to drive a Nema 23 stepper motor 400 steps for 360 degrees (phidgets.com/documentation/P … asheet.pdf) that moves a 72/1 worm drive. In other words I need 80 steps to do 1 degree ((400*72)/360=80) at the end of my worm drive.
The pause command I use between the high to low transition for the step rate is 1.25ms (for max speed).
Using the above works fine and keeps the desired number of steps at full speed.
As soon as I try to use ramps (ups and downs) to smooth the motion I loose steps (the motor stops before the 360 degrees although the steps counter in my program reports a value of 28800 i.e. a full 360 degrees rotation). I am wondering if it’s a matter of software or hardware?
What I do for the ramps:
I start with a pause value of 3.75 ms between the high-low step command and I run the motor for 10 steps, I decrease the pause value to 3.5ms I do another 10 steps and I continue decreasing by 0.25 ms for every 10 steps the motor does until I reach pause 1.25ms (my fastest speed). I do the opposite by increasing 0.25ms every 10 steps until I reach 3.75ms (slowest speed) and then I stop.

I need to know if there might be a problem or limitation with the hardware (motor driver or stepper motor) related to the ramps. Is there a proper practice to do for ramps ? How come the motor at full speed keeps the steps and while using ramps looses them.

Regards
Antonis

Hello.

I suspect it’s a software issue as the driver and stepper motor should generally have no problem going slower. The typical concern regards missing steps as the speed gets higher, but since you say it works when the speed is held constant at your fastest speed, it seems like your chosen top speed is not too fast. Can you post your code? Also, what is your pause between the low-to-high transition?

Another possibility is that your motor driver was starting to overheat (you’re using a rather beefy stepper motor), and it was just a coincidence that it affected your ramping test. What have you set the current limit to?

- Ben

Hi Ben,

At the fastest speed I am using pause 6 (between high to low transitions, I assume that high 1, pause 6, low 1 pause 6 is one step, right?) which at normal microcontroller clock (8MHz) is 6ms. My microcontroller is overclocked at 32MHz which affects pause and other time related commands. Pause 6 at 32MHz is 6/4 = 1.25ms

I did set the current limit by measuring Vref. For I = 1.6A a bit lower than its max limit and 4XRs=0.4, Vref was set to 0.64 Volts. I don’t use a heatsink but I did use long legs to mount the carrier board (to give it some space for the bottom to breath ) and added a 40mm x 40mm 12V fan on top of the carrier board. As the motor is used with a worm gear unit I always disable it while it’s not moving and the way it is used is on and off (i.e. moves to a position waits for 2 secs moves to another position waits for 2 secs etc.) Please comment if the fan is adequate to cool it to a safe temp.

While my tests continue, I have observed that the system behaves differently for different ramp profiles (i.e. when my final full speed is at pause 10 if I start my ramp at pause 15 moving -1 every 10 steps I loose it, If I do the same but starting my ramp at pause 14 moving -1 every 10 steps I don’t loose any steps ). The difference is also audible. From pause 14 to pause 10 the sound is smooth but from pause 15 to pause 10 the sound is rough ?!?!
I am doing both ramp ups and downs as the system has to move for 2 degrees (160 steps) wait for 2 secs and then do another 2 degrees and then wait for 2 secs and so on until 360 degrees are complete.

Thanks
Antonis

I don’t know what you mean by “high 1”/“low 1”, but a low-to-high transition on the STEP pin advances the motor one increment.

I suspect a fan alone is not going to be sufficient for adequate heat dissipation at your set current, though the ultimate performance really depends on the implementation details. I still think there’s a chance you have a bug in your software, but another explanation is that adding in the ramping is causing the motor to be on longer, and during that time it is overheating and missing steps due to thermal protections. You should also note that your stepper motor will tend to draw less current as your step rate increases because the inductance of the stepper coils limits how quickly the current can ramp up, which is another reason why your driver might be behaving better at faster speeds. What is your motor supply voltage?

One thing you could try is seeing if things start working as you expect with a lower current limit. If it gets better, that’s a very good indication that your problems are related to an overheating driver. Does your application require the full motor torque?

- Ben

Ben,

The Motor and the driver run at 15V DC. The driver during the tests (no load on the motor) is cool to touch by bare fingers.

I have observed that the motors axle is not moving smooth at all. You can easily see the point that it moves from ramp up to full speed and from full speed to ramp down (sometimes it even kicks back especially at ramp down).
I 'll send you the code snippet.
The first example didn’t loose any steps.

for b5 = 14 to 10 step -1	'ramps up for the first 5*10 steps
	for b6 = 1 to 10
high motorStep	‘motorstep is the pin that sends the pulse to the driver STEP
		pause b5
		low motorStep	
		pause b5
	next b6
next b5


for w6 = 1 to 60		‘Full speed
	high motorStep
	pause 9
	low motorStep
	pause 9
next w6

for b5 = 10 to 14	'ramps down for the last 5*10 steps
	for b6 = 1 to 10
		high motorStep
		pause b5
		low motorStep	
		pause b5
	next b6
next b5

The second example lost 21 steps

for b5 = 13 to 9 step -1	'ramps up for the first 5*10 steps
	for b6 = 1 to 10
		high motorStep
		pause b5
		low motorStep	
		pause b5
	next b6
next b5


for w6 = 1 to 60
	high motorStep
	pause 8
	low motorStep
	pause 8
next w6

for b5 = 9 to 13	'ramps down for the last 5*10 steps
	for b6 = 1 to 10
		high motorStep
		pause b5
		low motorStep	
		pause b5
	next b6
next b5

I am reminding you that the micro is overclocked and all pause values shown should be divided by 4 to get the proper delay in ms.

Thanks Antonis

Hi,

I noticed your program isn’t doing anything with direction. Do you have anything connected to the DIR pin? Can you describe all of the connections you’ve made to your driver, or post a picture of your setup?

- Ryan