Submitted by Webbot on July 3, 2008 - 2:22pm.
Why do I need a controller?
Micro-controllers have a number of I/O (input/output) pins which can
be set to 'high' (+5v) or cleared to 'low' (0v) under software control.
So you may assume that you can connect a dc motor directly to two such
pins. Seting pin1 high and pin 2 low would make the motor go one way;
setting pin 1 low and pin 2 high would make the motor go the other way.
Theoretically this is okay. In practice it will fry your
microcontroller. Why? Well the pins on your microcontroller are only
capable of supplying a few milli-amps of current (they are designed for
driving other logic chips) - but your motor (being a big physical
'thing') requires a lot of power to make it move. The purpose of a
motor controller is to convert the small powered signals from your
micro-controller into more powerful signals that can drive motors.
Given that 'Power = Amps * Volts' and 'Volts' is a fixed number then
the power required is proportional to the current required. The more
current then the more power. But power generates heat. And this is why
you will 'fry' your controller. It will try to generate lots of current
in order to drive the motor but this current will create heat, and
since your controller has no heatsink, then it will melt !!
Stall current
Motors will require more current when they are under stress. So if
you hold your robot in the air and allow the motors to turn then,
because there is no resistance, they will need the smallest amount of
current,. Now put your robot on the floor: and the weight of the robot
will create friction and so the motors require more power to overcome
this. Now if your robot is going up a steep hill or, worse, has hit a
solid wall and is therefore trying to turn the motors but the wall
prevents it from doing so then the motors are under the maximum amount
of stress. This latter scenario is known as the 'stall current' and you
need to make sure that your circuit doesn't get fried by this peak
requirement. You can measure this 'stall current' with your multimeter
by connecting the motor to your battery so that it turns and then hold
the axle to stop it from turning. This 'stall current' is a very
important value to measure for DC motors as it dictates the maximum
current that your motor driver needs to provide. Without it your robot
may work fine until it hits a wall and then 'hey presto', the current
goes up and your circuitry melts!
Alien
If the above is too technical then think about the Alien movie where
Sigourney Weaver gets into that robot suit that makes her 'extra
strong'. That suit is a 'motor controller' - it converts her puny (but
lovely!) movements into a much more powerful movement.
Stages
Think of your electronics in this way:-
1. The micro-controller works at 5 volts and small current. It is
enough to drive other 'chips' but not motors. I call this the logic
stage - as all of the electronics will work in this world. The logical
world.
2. Motors work in another world of high current, higher voltages, heat, current spikes etc. The real/physical world.
3. You need something that sits in-between these worlds that
converts micro-controller signals into something more powerfull that
can control a motor. This is a motor controller.