Broken Limit Switches

We have been having a problem with our limit switches. They have been consistently breaking when we hit the goal post. We have been replacing them with the same result every time. Here is a pic. Also, here is the code that our robot runs on.

while(true) // Sensor setup when not pressed
{sleep(3000);
if(SensorValue[frontSwitch]==0)
{
motor(FrontS)=127; // start of autonomous code
motor(ESystem)=0;
motor(RDrive)=100; // speed test
motor(LDrive)=127; // speed test
motor(Tray)=0;
}
else
{// if switch is pressed
motor(RDrive)=0;
motor(LDrive)=0;
motor(FrontS)=127;
motor(Tray)=100; // Tray speed for testing
motor(ESystem)=127; //end of autonomous code
}

}
}

Hello Bulldogs,

We’re sorry to hear you’re having trouble with your limit switches. How are these limit switches being used? Depending on your application, there may be a better sensor to use.

Limit switches work best when trying to limit range of motion and when they are not exposed to direct impacts. For instance, a rotating arm that is capable of swinging 180° that you want limited to 160° could have a standoff on one side that swings into a limit switch to trigger a stop.

A Bumper Switch is more useful for running into objects. The bumper switch is better suited to surviving impacts and is useful for orienting the robot during autonomous modes.

Hope this helps!