eventually something bad
will happen.
In Listing 1, my
motor speed code clearly
shows this “coast rather
than suddenly change
motor directions”
philosophy. This saves
wear and tear on
everything.
*/
{
You will only want to
implement some of what
is on my controller board;
this design is a bit much
to just drive the motors
with an RC radio. The
basic design is here for
you to pick and choose
what you want.
Q. I am frustrated from being illiterate on the
subject of DC motors and
their controllers. This is
especially true when it
comes to ratings.
{
else
All DC motor
controller providers give
current capacity (10A,
15A, etc.). What about
voltage?
}
Do I need to worry
about the motor voltage rating? Do I need to
match between a motor and its controller, or will
any controller do the job as long as its current
rating is high enough to run the motor? Your help
is extremely appreciated.
LISTING 1. Motor control code.
void MotorA(int chanA)
/*
Deals with setting PWM for PWM1
signed int speed;
unsigned int pwm;
unsigned int chan;
chan = chanA;
if (chan > 154)
chan = 154;
else if (chan < 74)
chan = 74;
//Limit endpoints to be the same for
//both sticks
if (chan == lastChanA)
return;
speed = 114 - chan;
// positive for forward, negative for reverse
if (chan > 112 && chan < 116) // create our deadband
{
pwm=0;
}
else
{
if ((lastChanA > 114 && chan < 114) ||
(lastChanA < 114 && chan > 114))
setup_ccp1(CCP_OFF); //We coast rather than suddenly
delay_ms(50); //change motor directions to save
//wear and tear on the gear train!
}
if (speed < 0)
output_bit(DIR_1,1);
output_bit(DIR_1,0);
pwm = (abs(speed)*3);
}
setup_ccp1(CCP_PWM);
set_pwm1_duty(pwm);
lastChanA = chan;
//5% to 95%
— Amr
A. Those are good questions and ones that I hear fairly often. Matching DC motors to proper motor drivers can be tricky, but there
are some pretty simple “rules of thumb” that you
can use to simplify the job. I think that you’ll find
those specification sheets for the motor drivers do
indeed specify the maximum voltage that their
driver will tolerate, as well as their maximum
current. However, just because you will run your
motor at or below the maximum voltage and at or
below the maximum current doesn’t mean that
the motor driver chip will do the job that you
need. The reason that you aren’t in the clear just
by being under the specs is: heat — the chip killer.
Your L298 driver chip will indeed deliver your 24
volts at two amps for about a minute before it
goes into thermal shutdown!
The datasheet for the L298 says that it will
handle 50V max at 2A continuous current. Look
further into the charts near the bottom of the
page, however, and you’ll find a chart that graphs
“saturation voltage vs. output current.” At 2A, that
saturation voltage is 2V. Doing a quick power
calculation, we find that at 2A this part will be
dissipating 2V 2A = 4W. Ouch! That chip will
get hot REALLY fast. The 2A continuous current is
the rating as long as the transistor junctions are at
ambient temperature (which is 25 degrees C).
That junction will NOT be at 25° C for long while
the part is dissipating four watts!
To keep that temperature down, you’ll need
to put on a heatsink. The calculations required to
determine the size of that heatsink get very
complex and unless you’re an engineer designing
a printer, you’re not going to be interested in
them. My advice is to keep your voltage to 1/2 the
rating of the driver chip and your continuous
current at 1/2 to 1/4 of the rating of the chip; put
the biggest heatsink you can fit on it. Run your
motors with their typical speed and usage, and
test how hot the part gets. If you can hold your
SERVO 03.2010 15