4-State Relay H-Bridge
I'm a·huge proponent·of the KISS priciple (keep it simple, stupid) and I'm not ashamed to admit that I often use simple on/off relays in my small robots instead of speed controls. They're easy to use, bullet proof, and have no internal voltage drop like most transistors do, so I get full battery power going to·my motors. For position control (AKA odometry), I like to·count my wheel encoder pulses and stop on a dime. Properly wired, two SPDT relays allow me to go full speed forward and reverse, and also to get dynamic braking out of·a DC motor. That is, to stop the motor in a hurry, short the motor leads together immediately after disconnecting power. This is·quite dramatic and useful, although you can get some arcing damage to the motor and relay contacts if·the robot and drivetrain have a lot of momentum. Recall Newton's fourth law: robots in motion tend to stay in motion...
To remedy this, I·sometimes add another·relay to enable a lower speed by dropping the motor voltage through a voltage regulator or several silicon·diodes in series. This way, I can accelerate and decelerate using this intermediate speed, which works quite well, but it does require another relay, several parts·and another precious Stamp I/O pin to drive the speed relay.
I recently came up with another·way to add a "softer stop"·which works very well. By modifying·my favorite relay h-bridge circuit, I can enable power off motor coasting (gradual deceleration) in addition to dynamic braking (sudden stop). It requires neither·a relay nor a Stamp I/O pin, only two silicon diodes. The penalty is that it will drop your motor battery supply voltage by one diode voltage drop (0.7 volt for a regular silicon diode, or 0.3 volt if you use a Schottky diode).
To recap,·this is an improvement for·simple position control, specifically to stop a motor more accurately and carefully than switching from full motor on to full braking as the desired stop position is approached. By anticipating the upcoming stop, it is possible to switch the motor off to allow the mechanical system to coast and decelerate to a lower RPM before dynamic braking is engaged for the final accurate stop.
The attached·schematic shows two different SPDT relay H-bridges. The leftmost one is what I have used in the past, a 3-state design. When only one SPDT relay is energized, the motor turns on fully in one of two directions. When the relays are both off or both on, the motor is dynamically braked since its leads are shorted together. (The diodes shown here across the relay coil are typical flyback diodes to minimize switching spikes fed back into the Stamp.)
The schematic on the right shows the improved 4-state design, and the addition of two diodes in red. Their function is to eliminate the motor short-circuit condition when both relays are energized, allowing the motor to coast.
When both relays are on, the motor is switched off, but free to coast to a stop. When both relays are off, the motor is short-circuited and dynamic braking is enabled. When just one relay is energized, the motor spins in the appropriate direction, driven by motor voltage minus one diode drop.· Experimentation·is required for each application to·determine how long to let the motor coast before dynamic braking should be enabled.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Post Edited (erco) : 9/8/2008 8:11:36 AM GMT
To remedy this, I·sometimes add another·relay to enable a lower speed by dropping the motor voltage through a voltage regulator or several silicon·diodes in series. This way, I can accelerate and decelerate using this intermediate speed, which works quite well, but it does require another relay, several parts·and another precious Stamp I/O pin to drive the speed relay.
I recently came up with another·way to add a "softer stop"·which works very well. By modifying·my favorite relay h-bridge circuit, I can enable power off motor coasting (gradual deceleration) in addition to dynamic braking (sudden stop). It requires neither·a relay nor a Stamp I/O pin, only two silicon diodes. The penalty is that it will drop your motor battery supply voltage by one diode voltage drop (0.7 volt for a regular silicon diode, or 0.3 volt if you use a Schottky diode).
To recap,·this is an improvement for·simple position control, specifically to stop a motor more accurately and carefully than switching from full motor on to full braking as the desired stop position is approached. By anticipating the upcoming stop, it is possible to switch the motor off to allow the mechanical system to coast and decelerate to a lower RPM before dynamic braking is engaged for the final accurate stop.
The attached·schematic shows two different SPDT relay H-bridges. The leftmost one is what I have used in the past, a 3-state design. When only one SPDT relay is energized, the motor turns on fully in one of two directions. When the relays are both off or both on, the motor is dynamically braked since its leads are shorted together. (The diodes shown here across the relay coil are typical flyback diodes to minimize switching spikes fed back into the Stamp.)
The schematic on the right shows the improved 4-state design, and the addition of two diodes in red. Their function is to eliminate the motor short-circuit condition when both relays are energized, allowing the motor to coast.
When both relays are on, the motor is switched off, but free to coast to a stop. When both relays are off, the motor is short-circuited and dynamic braking is enabled. When just one relay is energized, the motor spins in the appropriate direction, driven by motor voltage minus one diode drop.· Experimentation·is required for each application to·determine how long to let the motor coast before dynamic braking should be enabled.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Post Edited (erco) : 9/8/2008 8:11:36 AM GMT
Comments
http://www.radioshack.com/product/index.jsp?productId=2062480
And you can switch them easily enough with cheap little 2N2222-type transistors from the Shack's bulk pack:
http://www.radioshack.com/product/index.jsp?productId=2062586
Or, use these ultra-sensitive polarized Aromat relays directly, without any driver transistor at all. Coil resistance is 380 ohms, coil current >15 mA, perfect for a Stamp as long as you turn on·3 or less·at the same time.
http://cgi.ebay.com/NAIS-RELAY-TQ2-5V-Aromat-Relays-20-pcs_W0QQitemZ200248369366QQihZ010QQcategoryZ36328QQrdZ1QQssPageNameZWD1VQQcmdZViewItemQQ_trksidZp1638Q2em118Q2el1247
I really like those Aromat relays. They mount in a DIP socket and are easy to replace, and since they are DPDT, you can parallel the contacts for more current, or switch additional circuits.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Post Edited (erco) : 9/9/2008 12:20:59 AM GMT