Slow Stepper Motor

Hello

I have wired my arduino, stepstick and nema17 as per this (frizzing) diagram: [http://www.instructables.com/id/Drive-a-Stepper-Motor-with-an-Arduino-and-a-A4988-/step2/Wiring-Up-the-StepStick-and-Arduino/](http://Intructables link)

But instead of having an extra power plug I'm connecting a 12v to the arduino's power plug. The motor is running, but slowly. Is this due to the fact that it can only deliver 5 volts to the motors, even when I plug in a 12v power supply?

thanks!

the a4988 has two voltage inputs 5volts from arduino and gnd drive the logic portion of the driver i.e. steps,direction and limited to arduino current output. the vmot and its ground connected to separate power source lets say 12 volt to drive the stepper and adjust output current via the pot. an easy way is to use the usb from laptop to arduino to power it and use the 12 volt just for vmot and should be at least 2 amps.also examine the sketch as the delayMicroseconds change the speed as well step jumpers

Thanks for your reply, I get it now!

Two more questions you might be able to help me with...

If I put a 12v power source and split it to go to the arduino and to the vmot, would that solve my problem? The arduino will accept 12v but I could also use a L7806 to regulate the input to 6v and the 12V for the motors? I\ll be using two so a 4A power supply is what I've ordered.

And...

There wil a short distance (about 1 meter) between the arduino and the motor. Is there a preferred position for the stepstick? Should it be as close to the arduino as possible or the motor?

Thank you!

You can certainly split the 12v and supply both the Arduino and the stepper driver board.

However stepper motors work better (faster) with higher voltage supplies. The A4988 can take up to 30v IIRC.

You need to post a link to the datasheet for your stepper motor. Nema 17 just defines the size of the front face (1.7 inches).

These links may be useful
Stepper Motor Basics
Simple Stepper Code

The Pololu A4988 web page has a good connection diagram and lots of useful info.

...R

thank you Robin.

I'm using this stepper: link to motor specs.

I will be needing the stepper to run of a (12v car) battery so I'm kinda limited to the 12v then outdoors. I can have more voltage when indoors and using a power supply.

Do you also know something about the best position to mount the stepstick? I'm going to 3D print everything so if I need to put it near the motor I can adjust that now :slight_smile:

Thanks!

ps. I did read your links before.

There seem to be data for 6 motors on that link - which one have you got?

I don't think there is any need for the stepper driver to be close to the motor. I would put it somwhere that the electronics will be safe and where the waste heat can dissipate. My drivers are at the end of a 1metre (approx) cable that came with my motors.

Stepper motors are very inefficient so you will need a large battery if you want a long run time. I would be cautious about 3D printing from a battery as printing often takes a very long time and you don't want it to fail 10 minutes from the end.

...R

Thanks!

The stepper I have now is the one that is marked on that page (black with white letters in the table), 42HS4013A4.

I'm not going to use it for a printer but for a 2-axis slider for time lapse photography. The parts for the slider is what I'll be printing. And reading your last comment, I will put the driver on the sled. I won't be using it in rainy weather anyway.

About the driver power consumption, I planned on using the sleep pin to put the driver to rest if there's no need for movement. In between shots there will be only a small amount of movement and then it can rest for the remaining time until the next shot. Does it consume much if it is not in sleep but also not running? This sounds like a silly question but the datasheet was mentioning something about it still being 'active' even when nothing needs to move. I don't understand much of the numbers on the polulu driver datasheet, sorry.

snewpers:
I'm not going to use it for a printer but for a 2-axis slider for time lapse photography.

Sorry. I misread your Post.

About the driver power consumption, I planned on using the sleep pin to put the driver to rest if there's no need for movement. ..... Does it consume much if it is not in sleep but also not running?

I think it is only necessary to use the enable pin to switch off power to the motor. Sleep mode also shuts down other circuitry in the A4988. The motor won't hold position when the driver is disabled. Even if the motor is not disturbed there is a possibility that it will "click" to the next or previous step when it is re-enabled. But maybe a single step error won't matter. I think this would be a much bigger risk if you use microstepping. It may jump to the nearest full step. You probably need to do some experiments.

I think when the motor is powered but stationary it draws much the same current as if it was moving. That is necessary if it is to resist movement caused by the load.

...R

Thank you Robin,

If the track is level there is no need for the stepper to hold something in place, but the skipping in steps could be a problem, not sure. When it's on a slope I really need it to hold the sled in position. That's something I just have to test I reckon.

little update:

I have the uno powered by the USB (and also the driver) and the vmot is connected to a 12v 1.2A power supply. When I run a basic accelstepper code it's still very very slow, even is I set the speed to a ridiculous 4000... So i think I can rule out that I can set the speed, since there seems to be not enough correct or something.

When I run this example code:

// Run a A4998 Stepstick from an Arduino UNO.
// Paul Hurley Aug 2015
int x;
#define BAUD (9600)


void setup()
{
  Serial.begin(BAUD);
  pinMode(6, OUTPUT); // Enable
  pinMode(5, OUTPUT); // Step
  pinMode(4, OUTPUT); // Dir
  digitalWrite(6, LOW); // Set Enable low
}

void loop()
{
  digitalWrite(6, LOW); // Set Enable low
  digitalWrite(4, HIGH); // Set Dir high
  Serial.println("Loop 600 steps (1 rev)");
  for (x = 0; x < 600; x++) // Loop 200 times
  {
    digitalWrite(5, HIGH); // Output high
    delay(1); // Wait
    digitalWrite(5, LOW); // Output low
    delay(1); // Wait
  }
  Serial.println("Pause");
  delay(1000); // pause one second
}

... I need to set the delay to 1ms to get some fluid motion, but not very fast... but way faster than the accelstepper.

And uhm... I added a 220 uf cap between the v & gnd but that blew after a second ...? Running it without anything now.

Any ideas as to why I can;t speed it up more?

thanks!

Have you tried my Simple Stepper Code. The variable names are more informative and should help with understanding. If you change the values it can achieve high step rates - but start slow and then try shorter (faster) values.

You can set an A4988 to move in microsteps. If that has been done it would obviously make the motor move much more slowly.

Post a link to the datasheet for the actual stepper driver you are using - just in case there are variants.

...R

snewpers:
And uhm... I added a 220 uf cap between the v & gnd but that blew after a second ...? Running it without anything now.

Why did it blow? Was it not rated for the voltage or did you connect it backwards? Thats normally why they
blow. It could be inadequate ripple-current rating too, but that would take more than a second I think.

Robin2:
Have you tried my Simple Stepper Code. The variable names are more informative and should help with understanding. If you change the values it can achieve high step rates - but start slow and then try shorter (faster) values.

You can set an A4988 to move in microsteps. If that has been done it would obviously make the motor move much more slowly.

Post a link to the datasheet for the actual stepper driver you are using - just in case there are variants.

...R

Thanks!

I'm not micro stepping yet but I did figure out why the accelstepper example was so slow. The value for the acceleration is set so it takes a darn long time to get up to speed and in combination with the number of steps to travel in the same example is never got enough steps to get to full speed. It was constantly accelerating and decelerating. Changing those two values solved it all.

MarkT:
Why did it blow? Was it not rated for the voltage or did you connect it backwards? Thats normally why they
blow. It could be inadequate ripple-current rating too, but that would take more than a second I think.

hello

the 220uf is rated 16v. and the shorthand had a '-' marking. I put the short one on gnd and the positive leg on the + at the 12v vmot input. Did I do that wrong?

I did it just like this drawing: drawing link

So on the vmot the long leg, on the and the sort (-) leg. I see now that it's rated 100uf, is that what I did wrong? Oh my power source is 12v/4a.

The polulu site says:

Warning: This carrier board uses low-ESR ceramic capacitors, which makes it susceptible to destructive LC voltage spikes, especially when using power leads longer than a few inches. Under the right conditions, these spikes can exceed the 35 V maximum voltage rating for the A4988 and permanently damage the board, even when the motor supply voltage is as low as 12 V. One way to protect the driver from such spikes is to put a large (at least 47 µF) electrolytic capacitor across motor power (VMOT) and ground somewhere close to the board.

So I figured a 220uf/16v would also do the trick...

Try a 25V cap next time, I think there's a lot of spikeness on that rail which could have taken it above 16V - although if that gets hot rapidly you'll need to rethink.

Thanks Mark,

I had ordered a bunch of different values, also 50volt ones, but much lower uf values. I reckon those will not work?

They can't harm. [ uF is micro-farad, uf is micro-femto (ie 10^-21 !!) ]

Hello Mark, this is the set I have... probably not the right ones then :slight_smile:

Can you please tell me what I should get instead?

Voltage Capacitance Size(L*Dia) Quantity(PCS)
50V 0.22UF 84mm/0.310.15'' 10
50V 0.47UF 84mm/0.310.15'' 10
50V 1UF 84mm/0.310.15'' 10
50V 2.2UF 84mm/0.310.15'' 10
50V 4.7UF 84mm/0.310.15'' 10
50V 10UF 84mm/0.310.15'' 10
16V 22UF 85mm/0.310.19''
10
50V 33UF 84mm/0.310.15'' 10
16V 47UF 84mm/0.310.15'' 10
16V 100UF 75mm/0.270.19''
10
16V 220UF 76mm/0.270.23'' 10
16V 470UF 88mm/0.310.31'
10

Try the 33uF 50V - several of them perhaps, at least they should survive the voltage.

Ripple current is still perhaps an issue, cheap electrolytic caps often are rather limited for this
as ultra-thin Al foil is used to keep the caps compact.

Thanks Mark

I buy this stuff from eBay. What should I pay attention to when ordering caps? I'll get some from my own country, but chances are that they are the same chinese caps.

As always, the manufacturers' datasheets are the prime source of information about their products.
eBay isn't a great place to find that information, an electronics supplier is a better bet. eBay also
has a risk of counterfeit/substandard goods to worry about.