|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
Limit switches
Our team has never used a limit switch, but this year we want to include one. The purpose is for our lifting mechanism. We would like to place a limit switch at the top and bottom to cut the power at a certain point. Any good place to start to learn how to wire it correctly?
|
|
#2
|
||||
|
||||
|
Re: Limit switches
The limit switch wires go to the DIO on the RoboRio. Use the ground (black) and signal (white) wires. Most of the switches have NO(normally open) and NC(Normally closed) options. Wire the signal wire to one of these pins, and the ground to the ground or common pin on the limit switch.
The detailed specifics depend on which limit switch you use. |
|
#3
|
|||||
|
|||||
|
Re: Limit switches
For switches with both normally open (NO) and normally closed (NC) options, the surest way is to use BOTH. Assuming you have your 3-pin cable color-coded as a standard PWM cable, connect the white pin to common, the red to normally open, and the black to normally closed. This way, you will get a definite 0V (OFF) when the switch is in the normal position, and a definite 5V (ON) when the switch is in the activated position. I don't know if this is critical for a 'RIO based system, but when I've done other microcontrollers (e.g. arduino), having a "floating" signal line gave indeterminate answers. Wire it this way, and you can use it on nearly any system.
Just as important as wiring the limit switch correctly is mounting it correctly. You must ensure that the switch is not part of the "hard" force that brings your load to a crunching stop. This can be accomplished by mounting the limit switch inside the stop, but back far enough so that it will not be crushed (like a push-button refregerator light switch), or on the side of the load so that the switch is activated by being pushed out of the way (like a lever-style refregerator light switch). |
|
#4
|
||||
|
||||
|
Re: Limit switches
The roborio has pullups on the digital inputs, so you can get away with just having the switch pull the signal pin to ground. That way you don't have 5V off the roborio out where it could possibly get shorted, for example, if the switch is connected wrong.
|
|
#5
|
|||
|
|||
|
Re: Limit switches
Thank you for the help! Now, to try to program it.
![]() |
|
#6
|
||||
|
||||
|
Re: Limit switches
We have used the limit switch function of the Jaguar Motor controllers in the past which allows you to avoid any programming. Not sure how others feel about this but it worked OK for our ball intake arm last year.
|
|
#7
|
|||
|
|||
|
Re: Limit switches
We had trouble with noise on long runs to limit switches on our 2013 robot. There were two fixes that worked for us -- increasing the pullup current using an external resistor, or a shielded run to the switch (22ga security system cable).
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|