![]() |
Wiring a limit switch.
Question - how to wire a limit switch to the robot.
Question - Is it wired with a spike relay, or a jaguar. Were thinking about adding an arm to get across the bridge. But the only problem is were trying to figure out how to wire a limit switch to the robot. So some programming can be done to interact with it. Is it wired with a spike relay, or a jaguar. Any help is greatly appreciated, and thank you for your time. |
Re: Wiring a limit switch.
You have two options with limit switches:
1. Wire it into a Digital Input on the Digital Sidecar. This allows your software to read it and take appropriate action (such as turning off the motor). Doing this, you only need to wire it to signal and ground (there's an internal pull-up resistor on the digital inputs). 2. Wire it into a Jaguar that is using CAN (per R61, nothing else can be attached to a Jaguar using PWM except for the coast/break port). For these, there are 4 pins - two control forward direction, two reverse. There are jumpers in there when its shipped. If you go this route, make sure you wire the limit switch so it's "Normally Closed" - in other words, you should be able to measure 0 (or near 0) resistance when the switch is NOT being pressed, and infinite resistance when it is. That way, the Jaguar will automatically stop when the switch is pressed. Regardless of which way to wire it up, make sure you add some sort of mechanical stop to ensure the arm won't go past the limit switch. Even with it turning off as soon as the switch is pressed, often an arm will continue moving a bit before it fully stops - a mechanical stop will prevent this. |
Re: Wiring a limit switch.
Just one more option to consider:
If you're out of Digital I/O ports (like I was this year), you can also wire to the analog breakout. Connect +5v and Signal when the limit switch is engaged, and then check in code whether the analog channel reads above or below 2.5V. Something you have to remember about programming Jon's first option: the channel will read 1 unless signal and ground are connected, in which case it would read zero. That confused me for a while when our limit switches did not work as programmed. |
Re: Wiring a limit switch.
Quote:
|
Re: Wiring a limit switch.
Quote:
As mentioned by others, the limit switch may work opposite of what you expect! Switches can be wired up as "Normally Closed" or "Normally Open". Depending on which way you wire it, you may read TRUE and FALSE either way. Looking at the case of the limit switch that came in the KoP, you'll see the three ports are labeled "Com", "NC", and "NO": Hook up one wire to Com - it doesn't matter which one. If you hook the other one up to NC (Normally Closed), then you'll read FALSE when the switch is not pressed, and TRUE when it is. If you hook it up to NO (Normally Open), you'll read TRUE when the switch is not pressed, and FALSE when it is. Our programming team always writes a small test program for sensors - essentially, they just read the value and print it to the consol output. This lets them see which way its wired up, and adjust their code as needed. |
Re: Wiring a limit switch.
Quote:
|
Re: Wiring a limit switch.
Hmm, all I can say is that it worked fine for us. Our normally open switch reported 0 volts when open and 5 volts when closed, with a bit of noise. The 2.5V threshold accurately detects the two states.
Why would an unconnected pin report random values? Or do you just mean it would be a noisy zero? |
Re: Wiring a limit switch.
Quote:
|
Re: Wiring a limit switch.
if the limit switch is a double throw (has common, NO and NC) then you could connect 5V to NO, Gnd to NC, and the signal to common. The switch would then either switch the signal to 5v or ground. Be careful not to put 5v or gnd on the common terminal, or one state will give you a short.
Reversing 5V and ground would change polarity or just change in software. Get the analog port for greatere or less than 2.5 volts. |
Re: Wiring a limit switch.
Quote:
I think I'll be wiring any analog limit switches this way in the future; thanks! |
Re: Wiring a limit switch.
Quote:
|
Re: Wiring a limit switch.
Quote:
|
Re: Wiring a limit switch.
Normal open, red wire (end)
Middle leg, white wire (middle) Normal Closed, black wire (end) This will read false when not trigged in the code, true when pressed. If you don't know which end leg is which, just look on the side of the limit switch. The diagram will show the middle leg connected to a side leg (normal closed) Plug into a digital I/O, pay attention to the orientation on the digital side car. |
Re: Wiring a limit switch.
Quote:
|
| All times are GMT -5. The time now is 11:08. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi