Problems with multistepper control

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
pogcarrOld
 
Posts: 19
Joined: Tue Jan 25, 2011 10:21 pm

Problems with multistepper control

Post by pogcarrOld »

I am having some trouble doing a multistepper control of a pair of 400 step per revolution motors without using Accelstepper, just Stepper.
The gist of my control looks like this:

while (encoderEWV1<EndPos || encoderEWV2<EndPos){
motorEWV1.onestep(FORWARD,DOUBLE);
motorEWV2.onestep(BACKWARD,DOUBLE);
delayMicroseconds(125000/Spd/2);
}

If Spd is set fairly low, like 100 then it runs beautifully, but the critical control speed is around Spd=20 at which point the stepper runs very poorly and one of them will miss a lot of steps.

The setSpeed command does not seem to have any input into the onestep command. Any other way to do this sort of control and get better results?

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Problems with multistepper control

Post by Franklin97355 »

Steppers need more power the faster they go in order to get the step done before the next one starts. This may be your problem.

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Problems with multistepper control

Post by adafruit_support_bill »

The setSpeed command does not seem to have any input into the onestep command.
Setspeed just sets the interval between calls to onestep(). Since you are handling this part yourself, setspeed has no effect.
Any other way to do this sort of control and get better results?
Higher voltage may help. But be aware that the current will increase too. Check here for options for increased current from the shield.

User avatar
pogcarrOld
 
Posts: 19
Joined: Tue Jan 25, 2011 10:21 pm

Re: Problems with multistepper control

Post by pogcarrOld »

I think I have plenty of voltage and current. the motors are nominal 6V motors and I have 24VDC and up to 12A available (ok, the shield can't handle that current, but I am NOT experiencing any voltage sag when the motors pull current )

I am still curious as to why the problem only shows itself the slower I try to step the motors. If I step the motors quickly (up to a limit of course) they run beautifully. It is only when I try to run them slow that I have any issue. Odd!

I could try using the Accelstepper, which claims to be able to drive stepper motors even very slowly, but I don't see how that could help since it basically just calls onestep anyway, no?

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Problems with multistepper control

Post by adafruit_support_bill »

I am still curious as to why the problem only shows itself the slower I try to step the motors.
I guess I missed that in my first reading of the problem. I see now that the number you are decreasing is a divisor for the step time.

If my calculations are correct, a value of 20 gives you just over 3 milliseconds per step. I suspect you might be running into some harmonic frequency where your step rate is fighting against the natural oscillations of the rotor.

Increased voltage/current may help to control that. What current is the motor pulling at the voltage you have now? You might also have better luck with INTERLEAVE or MICROSTEP at those speeds.

User avatar
pogcarrOld
 
Posts: 19
Joined: Tue Jan 25, 2011 10:21 pm

Re: Problems with multistepper control

Post by pogcarrOld »

Yes, thank you!!!
It turns out that Interleave was the answer! I completely forgot about those other drive modes.

Interestingly, Microstep does not work at all for long movements. I think it is best suited to final positioning if real precision is needed.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”