Robotics: Unmanned Ground Vehicle Project - How to Build a Steering Mechanism...Or Not (Part 5 - Limit Switches)
Posted on 2011-02-03 @ 21:56:00 by r00t - Read the parent: Unmanned Ground Vehicle Project - How to Build a Steering Mechanism...Or Not (Part 4 - Adding Feedback)

I'd already ruined one good motor (which ultimately turned into three), through the misadventure of driving the motor to the end of travel in the steering mechanism, causing binding and ultimately destruction of the gears. The only way to prevent this moving forward was to install limit switches.

These are mechanical switches, augmented by diodes, which will allow current to flow easily in both directions when the switches are in one state (namely, normally-closed), but when one or the other switch is opened, the current is forced to flow against the diode (reversed bias). At the voltages being worked with (12 VDC), and with the blocking voltage of the diodes (1N400x) - which at minimum is 50 VDC, effectively little to no current passes. But since only one or the other diode is switched in by the action of the switches, essentially a "one-way" path is set up. At the end of travel, that direction is switched off, and you can only move in the other direction.

At this point I must give a shout-out to a friend on the Arduino Forums who pointed me down this path: Thank you, zoomkat - you saved me a ton of time! This old thread details the discussion, and here you can see the circuit zoomkat recommended. My version of the circuit is essentially the same:

Questions or Comments?

The parts for this project are a couple of "Cherry" leaf micro-switches, a couple of (1N400x) diodes, some wire, and a few quick-connectors (with the plastic removed for soldering them to the wire):

Questions or Comments?

I first mounted the limit switches on the steering arm, then tested the schematic and layout using several alligator jumper cables to connect the parts together:

Questions or Comments?

Questions or Comments?

Questions or Comments?

This testing proved the circuit worked as intended, so I then soldered the diodes and wires in place on the switches (each switch is configured identically), then installed the wiring harness and re-tested:

Questions or Comments?

Questions or Comments?

Questions or Comments?

It worked perfectly. I could steer the wheels to the left and to the right, and when the limit switch was triggered, the motor stopped dead, and would only respond to a change in voltage to cause movement in the opposite direction. This will prevent any over-travel condition from breaking my gear-motor again (especially in future code testing with the Arduino). It won't prevent an issue due to over-current (perhaps if the motor can move the wheels due to them being stuck, but not against the limits), but I intend to tackle that issue later.

Share This Article


Questions or Comments?

If you have any questions or comments about this article, please contact me...

Referencing Articles:
0 comment(s) posted
Post New Thread