|
||||||||
|
||||||||
|
GAN143 Motor Controller Interfacing Basics By Michael Simpson The main objective of this article is to keep you from blowing your microcontroller chips. Power Source The single most important choice is going to be your power source. There are two approaches you can take to power your bot. Single Power Source
Dual Power Source
In my research and experimentation I have blown many microcontrollers. Be prepared, you are dealing with currents that will blow a chip in microseconds.
As I researched this article I noticed that most bots using motor controllers were using the dual battery method to power all but the smallest bots. I myself have successfully connected several motor drivers to various microcontrollers using dual power sources. 9v battery and 5v regulator for all the logic and 6 to 12volts for motor power. Some of the observations or rules when interfacing to motor controllers Rule 1 If the Motor Driver does not have clamp diodes you must provide them. These must be high speed Schottky type diodes. They must be rated at the motor current at the very least. You can also use a snubber network in place of the Schottky diodes. A snubber network is tuned capacitor/resistor circuit place across the motor terminals. It limits the rate of voltage change to the motor. This is can be tricky as it must be tuned. I burnt 3 chips trying to tune a bot. For this reason I don't recommend the snubber by its self. You can however use a snubber in addition to clamping diodes. Rule 2 All Motors must have noise suppression capacitors. I found that the three .1 capacitors worked the best. See my application note at: http://www.kronosrobotics.com/an142/GAN142.htm
Do not proceed until the above rules are taken care of. If not You will have your own bucket of blown chips. Because the rules are so important I'm going to be caring Schottky diodes and suppression capacitors on the web site. Rule 3 The microcontroller to motor driver should have some passive buffering. I used resistors placed between the motor driver inputs and micro controller ioports. In my case I used 10k resistors with good success. This is not as important if you use dual power source but it goes a long way if you accidentally short something out. !!! Please Note !!! Once I started using the above 3 rules I have yet to blow a single chip. Rule 4 Twist your motor power and motor leads to help reduce noise.
Rule 5 Avoid running power leads/motor leads parallel with signal leads. Crossing the wires perpendicular normally is ok. Also avoid running power leads next to metal. The metal becomes a EMF conductor. Rule 6 Watch out for ground loops. This happens when you have multiple grounds going to the same circuit at different points. This can set up an incorrect voltage reference. The rule of thumb is only one ground connection per circuit. Rule 7 In all but the smallest bots use only nicad batteries. Normal batteries can not deliver the power needed to the motors. Single Power System Rules Rule A Run the power from the battery directly to your micro controller with the proper gauge wire. If its too big that's ok. If its too small there just wont be enough current when the motors fire. This will cause the largest sags. Run the motor power from the same point. Power Sag cheat: One thing I have done with success is to run slightly smaller gauge wire than is called for to the motor power connector. This will act as a current limiter and keep the main power from sagging. Engineers hate this but I don't care it works. Yet another cheat. If you are running a motor that requires 6 volts. Use a larger power source of say 7.2-9.6 volts. Then run a large wattage 1 or 2 ohm resistor in series with the motor power input. This can totally eliminate the voltage drop out problem. Note that it can be difficult to locate a power resistor big enough for large amp motors. Rule B Use large capacitors on the logic side after the regulation. I have also placed them on the non regulated side close to the regulator. The funny thing is that reason I was using a single power source was for weight at space. By the time I was done adding large capacitors I had taken just as much space. Rule C When using 6v power source with single battery systems you will need to use a low drop out 5v regulator like the 2940T. If not the 6v battery will not be enough to power your logic. Even the slightest sag will cause your microcontroller to crash. To Sum it up... As the size of the motors go up so will all the problems that I have identified here. For instance I built a small micro powered bot where the motors only required about 20ma on start up. The only thing I did was to place a small .1uf cap across the motors. Parts list
|
Copyright © 2001 - 2007 Kronos Robotics