Installed limit switches

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.

4 Responses to “Installed limit switches”

  1. Harry Says:

    Hello, I am writing here because I have not seen an e-mail in the blog.
    I am an Italian student and I am working with an Inverted Pendulum for my Diploma.
    I think I will control it with an op amp circuit, but I have few problems to find mechanical pieces, such as yours. Do you know an online shop for mechanical pieces?
    Thank You.

  2. Bruce Ammons Says:

    I ordered almost everything for my pendulum online. I am pretty sure I listed the source for all my parts, usually when I talked about ordering the parts. If there is a specific part that I didn’t name the source, let me know and I will provide details.


  3. Harry Says:

    Thank you for the answer, I will look for the websites in every post.
    I need a place to buy gears and the rack (i think “rack” is the good translation, is the piece of metal shaped like the gears, on the bottom, right?)

  4. Bruce Ammons Says:

    I don’t think I included the web sites, just the names of the companies. You have to search the web to find their sites. I bought the rack from McMaster and the aluminum gears from Nordex.