Arduino PWM

Ok, Firstly I just need to clarify PWM. As I understand it, Pulse Width Modulation is turning things on and off at very high speeds in order to see an average effect.

I'd like to control a high-current DC electric motor and am wondering how I should do it.

Basically, I have a "Golf Trike" which I got at an auction. It is a 3-wheeled contraption and the back wheel drives it. It has 3 12v batteries in series to provide 36v.

At its peak, the electric motor can suck 750w - that's 20.8 amps! (At 36v).

Here are the problems

  1. I still dont know much about the arduino.
  2. How do I control the speed of an electric motor from the arduino?

Do I need a solid state relay that can switch it on and off very fast? This sounds like a bad idea.

Help! :s

(P.S The reason it doesn't work already is because the cheap chinese design (The entire circuit was covered in glue overheated when a "large" friend of mine was on it for a couple of hours). So I would need something which exceeds the requirements so that it doesn't burn out.)

It has an accelerator but I dont know how that works. I'm sure it would be compatible with the arduino. But is the arduino what I want for this project?

It sounds like you need a speed controller. These devices take a pwm input and switch MOSFETS on and off to change the voltage. take a look at these sites

http://www.robotmarketplace.com/marketplace_speedcontrollers.html

http://www.ifirobotics.com/speed-controller-selection-guide.shtml

What you probably want to do is build an H-Bridge circuit.

Here is a fairly simple circuit.

You will need to check if the FETs (IRF*) are rated for this high amperage. They probably are not, make sure you buy some that are rated at least 20% over your peak. You will need to provide PWM from the Arduino on pin 9 to 11 (see the tutorials for this) on the two drive lines. What's great is this will allow you to drive the motor in both direction as well as control speed (with PWM) and break! There is a ton of information on H Bridge on the net, you should easily be able to gather the intel you need. :slight_smile:

Thanks for the information everyone, and sorry to be posting a month later - haven't had time for this lately.

Ok, I haven't yet got an arduino (Still!), but am trying to look at my options here. I could get an arduino for $31.95 USD ~$40 AUD
from here: http://www.sparkfun.com/commerce/product_info.php?products_id=666
Plus postage. Next I need something to interpret the PWM signal - that circuit above looks good, but I am hardly any good at complicated looking circuits!


Here's a simple HBridge which I just drew in MSPaint. Why couldn't I just use that? Its perfect! By default, the brake is on. When you turn on Relay2, it goes backwards, when you turn on relay 1, it goes forwards.

The question is, what part do I need to interpret an analogue signal (from a potentiometer) and put that into PWM, and then according to the PWM, switch these relays on and off very fast!

Ok I suppose the problem with my design is that little or no transistors have NC/NO? Which is why I need 4 of them?

I suppose all of these transistors in the first diagram are capable of being driven directly from the arduino PWM outputs?

In case anyone was wondering, I managed to make it a two-speed trike using the following:
(I only had 2 30 amp relays, a couple of switches, and a bit of wiring handy, so I came up with this design)

Well... I'm reminded of Wolfgang Pauli and his observations about ideas that are "not even wrong"... :wink:

Relays are just switches that are used to control high current/voltage with low current/voltage signals. They should only be used as on/off switches. Using relays in the way you're thinking is problematic for a variety of reasons, two of the more significant are time delays in switching (relays are not instantaneous) and noise, both sound and electrical.

The circuits you need (i.e. H-bridge) are well documented, and explained, in a variety of robotics hobbyist books and web pages. Purpose built motor control modules with the voltage and current capacity inplied by your diagrams are available from a variety of sources, but are expensive.

Yeah, what you need is an H-bridge or some sort of speed controller. For example, the "victor" from IFI Robotics...

http://www.ifirobotics.com/victor-884-speed-controller-robots.shtml

it can take a 40 amp continuous load. You can drive it with simple PWM from your arduino, as I am trying to do now (i am still looking for some example PWM driving code).

For a (much) cheaper option, just buy an h-bridge and use the code in the motor control tutorial @ arduino.cc

I know this is an old topic but i was wondering if anyone ever got an arduino to work with a victor 884, and if so how they did it?

I'm pretty sure this is how you would wire up a Victor 884:

It would be wise to put some overcurrent protection in there also (fuse, circuit breaker).

i had a question about the motor controllers from ifirobotics, is it possible to drive more than one motor with them or do you have to split the pwm signal to multiple motor controllers?

thx for any answers