Archive for June, 2010

Installed limit switches

Tuesday, June 8th, 2010

For a while, I thought I could get away with not installing the limit switches.  As long as I start the pendulum in the center, it does a very good job avoiding the ends.  The problem is when I keep the pendulum inverted and it gets “bumped” repeatedly.  While it is correcting for the bumps, it tends to get close to the end of the rack.  Sometimes it will hit the end pretty hard while trying to correct for a bump.  Once it hits the end, it loses the center reference and continues to get worse.  I decided it was time to install the limit switches.

Soldering the wires for the limit switches was a minor hassle.  It wouldn’t have been too bad to solder three wires for each switch (GND, 5V, signal), but I needed a 1k ohm pull-up resistor between the 5V and the signal.  It starts to be a large number of wires in each hole for the connector, and it is kind of difficult to work around the resistors.  After the first try, I assembled the connector case and realized one wire was loose, so I had to take the connector case apart and resolder it.  After the second try, I managed to get everything connected securely.  Each signal turns off when the limit switch is obstructed, so I change the PWM limit in that direction to zero.  It takes about the width of the limit switch for the cart to decelerate from full speed.  If I position the limit switches just a short distance from the end, it will work well.  Right now the switches are just taped in place, but I am working on permanently mounting them.  My original plan was to drill holes and screw them down tight, but to do that I would probably have to move hardware out of the way to get the drill in place.  It looks like it would be much easier to mount them with thick double sided tape.  Not as pretty, but a heck of a lot easier.