|
||||||||
|
||||||||
|
AAN101 Interfacing the Athena to the SN754410 for DC Motor Control By Michael Simpson
Schematic 1
In the configuration shown in Schematic 1 you can use the same power supply to power the motors and Athena. The catch is the the battery source must not exceed 5.5 volts or so. With many other microprocessors they may have problems with this configuration because of the drop out voltage. Since the Athena will run with a voltage all the way down to 2.7 volts the voltage drop when the motors are engaged are not a problem. Just tie the Vcc2 lead to Vcc and connect a second Vss lead from the driver chip to the negative side of the battery. The 39 ohm resistor will keep any ground loops from getting out of hand. For single power sources this configuration works quit well. Now a word about the 5 resistors. These keep any connection or motor problems from blowing your Athena. Since I have been doing this on my motor controllers I have yet to blow a microcontroller. Please check out my motor controller interfacing application note. Each motor must have noise suppression capacitors. If you fail to do this again you could blow the controller or Athena. Check out my motor noise application note. The concept behind the motor drivers is
quite simple. There are 4 drivers built into the chip. Each driver
can be set to source or sink based on its input pin. You could drive 4
motors with just on or off and no direction control, but by connecting the two
leads of the motor to the two output leads we can control which lead gets
sourced or sunk. For instance, by setting the M1 input A
High the M1 output A goes to +Motor Power. If the M1 input B is Low then
the M1 output B is at ground. This will cause the motor to spin in one
direction. Setting the M1 input A Low causes the
M1 output A to ground. And with the M1 input B High the M1 output B goes
to +Motor Power. This will cause the motor to spin in the opposite
direction. If both the input pins are set the same
then both the output pins will be set to ground or +Motor Power. This in
effect causes the motor to short causing dynamic breaking. All this only works if the Motor Enable
pin is high. If it is low both output pins go into a tri-state
condition. We are going to take
the enable pins and tie them to an signal generator.
The amount of time the signal is high will determine how much actual on
time each motor gets. If we do it fast enough – for example at 1000 times a
second - there will be no herky-jerky motion and everything will run smoothly. We now know it takes three leads to
gain total control of each motor. Lets look at the truth table to recap
what kind of control we have on each motor.
Any time the A and B inputs are set the same dynamic breaking is enabled on the motor. Lets do some simple things first.
In this program we ties tthe two motor enable ports to the hardware pwm generator on the Athena. Its set to 1000Hz and we set the duty cycle to control the speed. A value between 170 and 255 works well. 255 is full speed. Program 1 (download it here)
Now let me talk a bit about the SN754410 a bit more. I said earlier that the chip can handle 1Amp per channel. In order to get the full 1Amp you will need to add a dip heat sink. Now say you want to handle a bigger motor. One final note. The SN754410 can also be used to control stepper motors and solenoids. I will be creating more papers on these topics in the future. Parts
|
Copyright © 2001 - 2007 Kronos Robotics