Powering Nema 17 Stepper motor with a NiMH battery.

I am very new to Arduino's and electronics in general. I have learned a lot from the interwebs, but I can't figure this out from anything I've found so far. So, please be gentle.

I have built a camera slider for time-lapse photography that is driven by a Nema 17 Stepper Motor, an A4988 Driver, and controlled through my Arduino Uno. I normally power it with a 12v 2.0A wall-wart. It works flawlessly for many hours at a time. An example of use would be the slow transport of the camera gantry a distance of just 600mm over the course of 6 hours.

I was hoping to make this slider portable. I can run the Arduino for many hours with a USB phone-charger battery. But I was hoping to run the stepper motor off a battery as well. I have several large Anton Bauer Hytron 140 NiMH batteries for my video work. They were rated at 140WH @ 14.4V when new. They are older now and probably more like 100WH (pure guess).

What would I need to do to, or can I, power the stepper off one of these batteries for hours at a time? Would I need to run a voltage regulator inline so I can properly set the over-current limit on the driver? I ask because the battery fully charged has closer to 17V and then gets lower as used. I'm unsure about how the voltage drop affects the over-current limit setting on the driver board.

Here's the necessary specs:

Pololu A4988 Stepper Motor Driver Carrier, Black Edition ( Pololu - A4988 Stepper Motor Driver Carrier, Black Edition )
Min./Max. Operating Voltage: 8 - 35V
Continuous Current per Phase: 1.2A (heat sink added for higher amperage...closer to 2.0A)
Max. Current per Phase: 2.0A

NEMA 17 Stepper Motor ( http://cdn1.bigcommerce.com/server2300/itwgldve/products/105/images/1518/NEMA17__77109.1430428278.1280.1280.JPG?c=2 )
Rated 2.8VDC
Current per phase: 1.68A

Anton Bauer Hytron 140 NiMH Battery ( http://www.antonbauer.com/en- US/Shop/products/on-camera-batteries-logic-series-HyTRON-140-8675-0079 )
140WH @ 14.4V

Thanks in advance for any help,
Doug

The A4988 sets the motor current, whatever the supply voltage (within its range of 8 to 35V, that is).

You won't get 2A from an A4988 without a fan, it will cutout, but you probably don't need to run your
stepper at full current anyway - try turning it down a bit and you'll get better battery life too? Anyway
its probably worth finding out the smallest current you can get away with, then add 20% for a safety
margin and use that, everything runs cooler then.

MarkT:
The A4988 sets the motor current, whatever the supply voltage (within its range of 8 to 35V, that is).

You won't get 2A from an A4988 without a fan, it will cutout, but you probably don't need to run your
stepper at full current anyway - try turning it down a bit and you'll get better battery life too? Anyway
its probably worth finding out the smallest current you can get away with, then add 20% for a safety
margin and use that, everything runs cooler then.

I'm not trying to get 2A from the A4988. Using my 12v 2A wall-wart, I set the current limit of the A4988 to about 1.5A since I'm only using a heat sink and I believed the stepper motor to have a limit of 1.68A. What I need to find out is how unregulated voltage from a battery that may run from 16.5V to 12V, affects the current limit and the speed of the stepper.

I imagine the current drops as the voltage drops and the stepper motor may slow as well. But I'm having a hard time wrapping my head around this. I thought maybe it's better to use a voltage regulator to keep things consistent (at least until the battery drains to the point where voltage regulator stops working). Is this the case?

sisson_d:
What I need to find out is how unregulated voltage from a battery that may run from 16.5V to 12V, affects the current limit and the speed of the stepper.

It should not affect the current limit.

The purpose of using a hgher voltage is to allow the motor to reach the current limit more quickly and to operate at the current limit for a greater proportion of each step. As the voltage falls the proportion of time at the current limit should decline with a resultant loss of torque.

If the motor is moving slowly this should not matter.

...R

The stepper speed depends on how fast you send step pulses.... Do you mean the achievable
maximum speed? That goes up with voltage.

Thank you Robin2 and MarkT! That clears up some stuff for me. Although I still have a lot to learn before I really grasp why this is the case. I've had no problem with the fabrication, wiring, photography, and video, but the intricacies of the electrical engineering has been the most challenging part. So far, I have figured out just enough to do what I need to do.

A few more questions: Running very slowly as it would doing time-lapse photography, what happens as the voltage of the battery drops well below the 12 volts my AC supply usually provides? Will the steps happen slower or in smaller increments? Or will it pretty much work as usual until voltage/current gets low enough to stop working completely?

MarkT:
The stepper speed depends on how fast you send step pulses.... Do you mean the achievable
maximum speed? That goes up with voltage.

Okay, based on what you say here, it sounds like the motor would slow down as battery voltage drops if I was using the motor close to top speed as a video slider (distances of 1200-1400mm in about 20 seconds).

The rate at which step pulses are produced is determined by the Arduino and has nothing to do with the motor voltage.

If the Arduino produces a step pulse and the motor has sufficient voltage to generate the required torque it will move one step. If the voltage has fallen to the point where the torque is not enough to overcome the load the motor just won't move. In other words, it will move at the correct speed, or not at all. (OK, maybe there would be some intermittent behaviour at the margin).

If there is a long time between step pulses the decline in voltage will have much less effect. What is the fastest step-rate that you require (steps per second)?

Sorry I forgot to include this link earlier Stepper Motor Basics

...R

Robin2:
The rate at which step pulses are produced is determined by the Arduino and has nothing to do with the motor voltage.

If the Arduino produces a step pulse and the motor has sufficient voltage to generate the required torque it will move one step. If the voltage has fallen to the point where the torque is not enough to overcome the load the motor just won't move. In other words, it will move at the correct speed, or not at all. (OK, maybe there would be some intermittent behaviour at the margin).

If there is a long time between step pulses the decline in voltage will have much less effect. What is the fastest step-rate that you require (steps per second)?

Sorry I forgot to include this link earlier Stepper Motor Basics

...R

Thanks for the link. It helped clear up more things for me. From what you say, I equate what happens when the battery voltage drops too much, to what happens with an over-the-air HDTV signal. The signal provides a perfect picture as it reduces in strength right up until it gets too low. Then the picture starts to pixelate and freeze before the image is lost completely.

As I type this, I am running my first test using the battery to power the motor with a 2.5 hour time-lapse with 1200mm of travel. So far, it looks like the large NiMH battery for the motor will not be the weak link. 1.5 hours in and the built-in LCD battery indicator hasn't moved at all. And I ran some full speed video "slides" before starting the timelapse. Another longer duration test will show if the camera battery or Arduino battery fail first. But I think this motor battery would practically last for days.

FYI, this is not my design. It is the design of Rob Taylor (http://computers.tutsplus.com/tutorials/motion-control-with-arduino-motorising-a-camera-slider--cms-21539). And, again, I'm a newbie. Looking through his sketch, here is his comment about steps per second: "0.2mm = 20-tooth gear on 2mm pitch belt; 40mm per rev, 200 steps per rev, ergo 1/5th mm per step"

So, the fastest I run this slider for full speed video is about 858 steps per second ((1200mm x 5) / 7 seconds). Does that sound right?

For time-lapse, it varies greatly. I might do 1,200mm of travel over the course of 9,000 seconds (2.5 hours). So that would be more like 0.67 steps per second. That sounds about right to me as you can clearly hear the pulses when running very slowly for timelapse and each pulse comes roughly about 1.5 seconds apart.

Of course, the timelapse mode, unlike a non-stop video slide, does include 2 second pauses in motion for each camera shutter firing. So, that number is really not accurate but close enough for the very slow speed.

Thank you for all your help. I'll post again with links to the video I make from today's test.

-Doug

Here's a link to the video showing the slider running completely off batteries. The time lapse is over the course of 2.5 hours and didn't use much battery at all for all three batteries (1 for motor, 1 for camera, 1 for Arduino).

Thanks again for the help.

-Doug

BTW, in case a battery like the one I'm using might be helpful for others, here's what you need. Search eBay for "Hytron 140" and look for used batteries. Only buy from a seller that displays pics of the actual battery for sale. And look for a pic of the LCD Battery Capacity Display. You want one that shows the number "3" with a full pie-chart looking circle next to it. The battery has it's own built in capacity monitor. And when fully charged, the display will show a reduced capacity if the battery (ie. a "2" with 1 of 4 pie slices lit up).
Expect to pay between $65-100 with shipping (they were about $600 new). Then you'll need to try and find a cheap used "gold mount", charger, and a D-Tap cable that terminates with a plug suitable to power your motor driver. It may be harder to find the charger and mount cheap, but it can be done. I was able to separately get a great deal on an "intelligent" dual charger, 3 batteries, and a gold mount meant just for my Sony video camera, for less than $500. It's not cheap, but these batteries are beasts. Sony makes batteries for my cine video camera that cost about $120 each and last about 1.5 hours. Just one of these used Anton Bauer batteries powers my camera for 6-8 hours.

7-Hour time lapse running only on batteries is complete:

All of the batteries used (for motor, arduino, and camera) only lost about 1/3 of capacity over the 7 hours.

sisson_d,

Any chance of you posting your sketch? I too have almost completed my camera slider.
If you search this forum back a little ways, you will find it under camera slider.

Does your system incorporate limit switches at each end of the track, separate switches for forwards, stop and backwards plus distance control and speed control. I have these features built into mine.

Ken

If the battery voltage drops that much, you have just thrashed your expensive rechargable battery pack...

Never let rechargable batteries drop below the minimum voltage rating without immediately
recharging, it total knackers the cells.

Monitor the voltage and shutdown if its too low. No problem with the stepper then.

neksmerj:
sisson_d,

Any chance of you posting your sketch? I too have almost completed my camera slider.
If you search this forum back a little ways, you will find it under camera slider.

Does your system incorporate limit switches at each end of the track, separate switches for forwards, stop and backwards plus distance control and speed control. I have these features built into mine.

Ken

I have used Rob Taylor's sketch completely unchanged. You can find the sketch in his tutorial here:

I'm very new to all this and haven't written code in about 18 years. I understand enough to understand what Rob wrote, but not enough to have come up with it myself. his sketch only prompts you for which direction you want the motor to go in. You also input the distance traveled in mm, the time you want it to take in seconds, and how many stops to make (at each stop it triggers the camera shutter while stopped). You can do dolly video shots by inputting only 1 stop.

I have just received the limit switches I plan on using but I haven't installed them yet. Rob's tutorial includes nothing about limit switches and his sketch allows the motor to go in either direction. So this is critical in my opinion as I already once started the gimbal going in the wrong direction. Thankfully, it was a slow moving time lapse and I had plenty of time to reset it. Had I been doing a full-speed dolly shot, it may have been a different result.

MarkT:
If the battery voltage drops that much, you have just thrashed your expensive rechargable battery pack...

Never let rechargable batteries drop below the minimum voltage rating without immediately
recharging, it total knackers the cells.

Monitor the voltage and shutdown if its too low. No problem with the stepper then.

No worries here. These large Anton Bauer batteries have lots of built-in monitors and features that, among other things, protect them from most of the problems that plague other batteries. They're designed primarily for field use with pro-level broadcast cameras. That's why they are so expensive when new.