Controlling 2 12VDC 4 Amp Motors with the Arduino

Hi,

I'm rather new to the Arduino platform and am working on a project where I need to control 2 12VDC 4 Amp motors bi-directionally, I looked over motor shields but it appears these motors are too high amperage for use with a motor shield. Any suggestions on how to control both of these motors would be much appreciated.

You can:

  1. Not run the motors at 4A. The 4A rating is a limit, not a requirement. Using PWM you can modulate the current to whatever the limit of your motor driver is.

  2. Use multiple motor drivers in parallel. For example you can stack our Rugged Motor Driver shields to multiply the maximum current by the number of shields.

  3. Use a motor driver that is not a shield. This product might be a bit of overkill at 9A per motor but it'll get the job done.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

Thanks for the reply. As I'm rather new to the Arduino platform could you further explain my options in regards to PWM?

PWM uses the analogWrite() function to control the amount of effective power (hence current) delivered to a motor by rapidly turning the motor current on and off. The motor's inertia smooths out this on/off waveform to a constant speed.

This is the canonical Wikipedia article:

This article is more directly related to motors:

http://engineeronadisk.com/V2/book_implementation/engineeronadisk-54.html

--
The Arduino Drum Machine: MIDI development system with 14-track MIDI drum machine sequencer / groove-box software

It occured to me that I have an old Adafruit Motor Shield (Motor Shield - Arduino motor/stepper/servo control) lying around, I was wondering if using this PWM technique I might be able to control my motors with this. In addition I'd like to thank you veyr much for your help so far.

That is probably one of the lowest-current shields available. It uses the L293 which has a datasheet rating of 0.6A per output, so realistically maybe half that in steady state without heatsinking. Your motors may turn but you're not going to get a lot of torque. You will also have to limit your PWM to 10%-15% range maximum. Or you can use a voltage lower than 12V and then slightly higher PWM.

It might make a nice starting point just to make sure you understand how things work. But the L293 has no internal thermal shutdown protection so if you goof up you will destroy the chip.

Work carefully!

--
The Aussie Shield: breakout all 28 pins to quick-connect terminals

Hi,
IF you don't need to control the speed of the motors, you can use one of these relay boards:
=relay&s[title]=Y&s[short_desc]=Y&s[full_desc]=Y&s[sku]=Y&s[match]=all&s[cid]=0] http://arduino-direct.com/sunshop/index.php?l=search_list&s[search]=relay&s[title]=Y&s[short_desc]=Y&s[full_desc]=Y&s[sku]=Y&s[match]=all&s[cid]=0

You would use 2 of these Single-Pole Double-Throw relays for each motor. Turning 1 relay on will run in one direction, the other in the other direction, both off (Or both on) will stop the motor. If you are constantly switching on and off, you may want "snubber" (Series R and C) across motor to decrease contact sparking. The relays are rated at 10A at 30VDC.

The 8-relay board is optically-isolated and you could locate it near the motors, away from the Arduino.

Also: make SURE you have a delay between rotation directions!!! Or the motors will draw VERY large surge currents as you try to instantly reverse them.

Let us know what you do and how it works out...

DISCLAIMER: I mentioned stuff from my own Shop...

You might also look into this motor controller http://www.parallax.com/tabid/768/ProductID/64/Default.aspx from Parallax. It can be controlled via several different methods including using the same PWM signals used to control a standard RC servo motor. It is rated at 25A continuous so can handler your motor easily.

PWM uses the analogWrite() function to control the amount of effective power (hence current) delivered to a motor by rapidly turning the motor current on and off. The motor's inertia smooths out this on/off waveform to a constant speed.

Not quite - the PWM turns the voltage on and off to the motor winding, the winding's inductance smoothes the current out if the PWM frequency is high enough. If the frequency is too high there will be overly high magnetic losses, if too slow the current won't be smoothed and the motor will vibrate at the PWM frequency (both noisy and inefficient) and the power supply will try to provide motor short-circuit current.

MarkT:
If the frequency is too high there will be overly high magnetic losses.

How does that happen? I'm not doubting you. I just don't see why a high-frequency PWM signal would be a problem.

Well motors typically use 1% silicon steel for the magnetic circuit - this performs very well at low frequencies (tens to thousands of Hz) but at higher frequencies eddy-current losses increase (using very thin laminations helps at high frequencies, but are expensive). Thus high-frequency components of current in the windings tend to just heat up the steel. In other words the inductance starts to look more resistive at higher frequencies and lead to more losses. Also higher frequencies cause more losses in the switching circuit too.

In contrast a switch mode power supply will use inductors with a ferrite core which are able to work efficiently at upto megahertz frequencies - and higher frequencies mean smaller inductor and smaller capacitors. A motor though is a free inductor of considerable size so lower switching frequencies are a clever way to use this fact.

I think people naturally assume that because a lot of electronic devices are very well behaved and linear (resistors, capacitors) that inductors must be too - however magnetic materials are all very imperfect and have many limitations, making inductors more of an art than a science I think. Air-cored superconducting coils are the exception perhaps :wink:

Excellent explanation. Thanks.

You could make your own using the attached file.

Just use two SPDT relays rated at 12v instead of 5. Buy everything else as required.

You won't be able to use PWM but it'll cost you about $5-10.

MotorReverseTransistorRelay.PNG