Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Drive a 4-wire bipolar stepper motor or a pair of DC motors from your Arduino. [Product page]
Post Reply
monkeyiq
Posts: 7
Joined: Sat Mar 17, 2012 12:07 pm

Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Post by monkeyiq » Tue Feb 11, 2014 8:26 am

Hi,
I have one of these bipolar stepper motors from Sparkfun:
https://www.sparkfun.com/products/10846
400 steps/rev, 3v, 1.7a per phase.

I attached the Freetronics HBRIDGE to a uno and powered the uno using a 12v/2a supply. The hbridge is set to Bridge VIN To Motor Power. I have the 4 wires connected such that each coil is on a single channel. (from the datasheet from sfe product page, Black+Green on one and Red and Blue on the other).

If I run the stepper at about 110-130rpm and spin for 1 revolution one way, wait 0.5 sec and return then wait 0.5s and go again then it almost works. Every now and then there is a minor skip allowing the end position of the rotation to drift a little from time to time. Not every time, but maybe one in 10 iterations of loop(). Trying to use only 9 steps and a 20ms delay to do a rotation doesn't go as well. It's more like random movement.

I've tried limiting the current 0.6, 1.2 and 2a on the hbridge. The quickstart guide mentions that the current limit is per channel, so I'm it seems to me that a 2A limit would thus need a 12v/4A power supply to give a 2A limit to each of the two channels? Any suggestions on getting just a hand full of steps working reliably very welcome, even if they are that I shouldn't be trying to drive that stepper with this configuration ;)

One idea is to switch out to a less current hungry stepper like, 12v / 0.33A:
https://www.sparkfun.com/products/9238

cef
Freetronics Staff
Freetronics Staff
Posts: 106
Joined: Wed Nov 09, 2011 12:53 am

Re: Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Post by cef » Tue Feb 11, 2014 9:38 pm

I would first look at your 12V 2A supply.

I'd see if you could use a slightly larger supply (eg: 12V 3-5A) just to avoid current spikes taking the usage over the 2A mark. The more the voltage varies, the less reliable your steps will be. As the Arduino regulates that voltage down to 5V, it won't see any of these drops in voltage (unless they're huge - ie: takes the supply below about 7.5V), so you only have a problem that affects the stepper driver.

Another option may be to place a large capacitance across your supply (eg: 2200uF). This will charge and be able to provide short bursts of current during high current drain to avoid a voltage drop.

Note: Yes the stepper itself is only rated for 4V, but with steppers current is the key value here. A higher voltage simply allows the coil to create a magnetic field faster, which allows the "steps" to happen faster. If you switch to steppers with coils rated for 12V, they will step slower, so you may need to allow longer time between each step to ensure the motor actually moves completely. If you attempt to step "before" an existing step (mechanically) is finished, then the results are unreliable.

PS: A general "rule of thumb" I follow is that you want the motor to be rated no more than 1/2 the supply voltage to the stepper driver, and preferably under 1/3rd. You want to avoid the rating being less than 1/8th. This isn't hard and fast though: As your supply goes up, the difference goes down, but I find the above works reasonably well for supplies in the 10-15V range. This ensures reasonable speed without the motor getting too hot.

monkeyiq
Posts: 7
Joined: Sat Mar 17, 2012 12:07 pm

Re: Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Post by monkeyiq » Thu Feb 13, 2014 1:23 am

Thanks for the info!

I moved to a 13.8V 12A supply. So hopefully now I'm not giving the supply unit so much grief.

Unfortunately it still skips (or reverse steps) at times. I've tried doing 2 steps per move, and 20 steps per move. Altering the setSpeed from 1 up to 200 (later doesn't move at all). At 1.2A and 60 rpm doing 20 steps per move I have found that it doesn't step backwards, but sometimes the call to move 20 steps doesn't produce any movement. I also tried toggling the enable lines between movements to see if not holding the place would change the result. Didn't seem to help. I also want to hold the place, and likely step 2-3 degress per hit in the project.

Trying to spin 1 revolution with the new supply produced more erratic results than before.

The new supply is cat num MP3079
http://www.jaycar.com.au/productView.as ... TID=999#12
given that the full rotation test is not as accurate with this supply I'm beginning to think it might not be what this task needs.

cef
Freetronics Staff
Freetronics Staff
Posts: 106
Joined: Wed Nov 09, 2011 12:53 am

Re: Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Post by cef » Thu Feb 13, 2014 5:59 am

Q: Which code are you using to control this?

If you're using your own code, how long are you holding the signal at the appropriate logic level before returning it to the default? If the pulse is too short, the driver may not be recognising the pulse as valid.

monkeyiq
Posts: 7
Joined: Sat Mar 17, 2012 12:07 pm

Re: Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Post by monkeyiq » Thu Feb 13, 2014 6:20 am

I started with the example 'Example Stepper Sketch' from the tutorial:
http://www.freetronics.com/pages/hbridg ... tart-guide

I have also then experimented with the following. Changing incr in the range 2 to 20 and the delay between movements from 20ms to 3s. steploose was added to release the motor between steps. It is based on integrating the second example on the tutorial page into the code. The whole file is up at http://fuuko.libferris.com/stepper_oneR ... eetron.ino

snippits here:

void steptight( int v )
{
myStepper.step(v);
}

void steploose( int v )
{
digitalWrite(enableA, HIGH);
digitalWrite(enableB, HIGH);
myStepper.step(v);
digitalWrite(enableA, LOW);
digitalWrite(enableB, LOW);
}

void loop()
{
int incr = 2;

for( int i=0; i<stepsPerRevolution; i += incr )
{
steptight(1 * incr);
Serial << "going +ve to:" << i << endl;
ledstate = !ledstate;
digitalWrite( ledpin, ledstate );
delay(3000);
}
delay(1000);

for( int i=0; i<stepsPerRevolution; i += incr )
{
steptight(-1 * incr);
Serial << "going -ve to:" << i << endl;
ledstate = !ledstate;
digitalWrite( ledpin, ledstate );
delay(3000);
}
delay(1000);

}

monkeyiq
Posts: 7
Joined: Sat Mar 17, 2012 12:07 pm

Re: Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Post by monkeyiq » Thu Feb 13, 2014 1:22 pm

I've also tried the below code. Digging into Stepper and AccelStepper it seems to boil down to similar signals being sent to the driver. I'd probably look to use the AccelStepper library longer term anyway. Using the below also does some skips. Setting the pulse width higher doesn't seem to settle it down :| I'm thinking perhaps the new power supply might not be up to it. I'll try taking the motor and ardu combo to a hackerspace to use their bench power supply on it.

#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepper( AccelStepper::FULL4WIRE, 4, 7, 3, 2);

void setup()
{
stepper.setMaxSpeed(400.0);
stepper.setAcceleration(20.0);
// stepper.setMinPulseWidth(30);
}

void loop()
{
stepper.runToNewPosition(0);
delay(1000);
stepper.runToNewPosition(400);
delay(1000);
}

monkeyiq
Posts: 7
Joined: Sat Mar 17, 2012 12:07 pm

Re: Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Post by monkeyiq » Fri Feb 14, 2014 6:16 am

ok, so that motor runs without jitter using a EasyDriver and the same 13.8V/12A supply. Obviously that setup is current limited to up to 750mA. So not exactly apples to oranges, but good to see the motor moving well with the power supply to somewhat rule out pussible wire issues etc.

Moving back to the Freetronics H-Bridge sheild, my next line of investigation would probably be the accelstepper setMinPulseWidth() method. And perhaps then sniffing the 4 wires (4, 7, 3, 2) to see what signals are being sent down to the Freetronics H-Bridge sheild. Timing of pulses being the next target on the hit list.

Doc
Posts: 1
Joined: Fri Mar 18, 2016 9:56 am

Re: Controlling a1.7A/Phase 3v stepper (sparkfun ROB-10846)

Post by Doc » Fri Mar 18, 2016 10:42 am

Sorry for adding to an old post but I am having the same trouble but the odd steps are more frequent once in every 4th or 5 cycle as well as 1 or 2 steps occurring while the motor is braked during the 1 sec delay I am using the code on the freetronics motor shield page if i run it over 12vdc the motor the motor locks up if increase the amp toggles the steps become more violent so i am stumped

Post Reply