PDA

View Full Version : Limit Switch return value


Team1710
01-24-2009, 01:20 PM
In the process of programming our shooter turret, I realized we needed some limit switches in there. I looked up at the library, and it seems that the DigitalInput class is what we need.

I'm using the digitalInput get method, so after declaration my code looks like this:

limitSwitchLeft->Get()

Will this return a Boolean? I would assume its default would be false...when the limit switch is hit it would turn to true. I'm looking to impliment this into an if-else condition to use in limiting my turret.

Am I looking at this from the right direction?

Thanks!

nathanww
01-24-2009, 11:28 PM
Yes, this should give you a boolean--but depending on the kind of limit switch it is, having the bar pressed down may cause it to be either closed or open. Your best bet is to check it with a multimeter first.

wt200999
01-25-2009, 02:07 PM
Are you using jaguar speed controllers for it? Maybe the built in limit switches work for that? It just makes life easier if you are.

Albo
01-25-2009, 02:40 PM
Hmmm. Built in limit switches on the Jaguar, you say? Sounds interesting. Could you please elaborate?

wt200999
01-25-2009, 02:52 PM
http://www.easternfront.org/uploads/William/jaguar.jpg

There are two jumpers there when you first get it, those are the limit switches. When the connection between the two pins is broken the motor stops turning in that direction. Under each of those sets of 2 pins a letter either F or R for forward and reverse. Just hook a two pin cable into one of those and hook that to a limit switch in the normally closed position and instant limit switch, no programming required :D

Also if you have jaguars that you don't want to use this feature for (I.E. drive motors) make sure you tape the jumpers in so they cant fall out during competition.

For next year keep an eye out for allowed features with the other connectors :P

Albo
01-25-2009, 02:55 PM
That, my friend, is a beautiful thing! Thanks!!

WatersongX
01-25-2009, 04:57 PM
The output of a limit switch depends on the switch itself. If the switch is labeled SPDT, it will typically have three pins, one ground and two signals. One signal will be closed only while the switch is depressed, and the other will be closed only while the switch is released. A SPST switch however will only have two pins, in which case the most common configuration is that the circuit between the pins is closed when the switch is depressed (Though the alternate case does exist, so be sure to read any print on the switch). If all else fails, use a multimeter or circuit tester of some sort. (You can make one with a resistor, a spare LED, and a watch battery, or just use the dashboard and a DI ^^)

P.S. In the case the switch has three pins, usually the center pin will be ground.

Team1710
01-26-2009, 07:09 PM
Hmm, I wasn't aware the Jaguar had built-in speed controllers. The team was planning on hooking the turret up to a spike, but boy if we had a Jaguar on it that would make my life a lot easier.

I was planning on using the IEC Limit Switch provided with this years kit of parts. (Part number AAP2T51Z11) I'm not a hundred percent sure on how this would work, I'm more familiar with an actual switch that is hit when and returns a value when hit. This new one looks a little different, I could be wrong...

nathanww
01-26-2009, 11:58 PM
A switch returns a value however fast you set your code to sample--since the only thing it's measuring is whether or not there is a complete circuit.

Alan Anderson
01-27-2009, 07:47 AM
Hmm, I wasn't aware the Jaguar had built-in speed controllers.

The Jaguar is a speed controller. Do you mean built-in limit switch detectors?

sircedric4
01-27-2009, 02:22 PM
There are two jumpers there when you first get it, those are the limit switches. When the connection between the two pins is broken the motor stops turning in that direction. Under each of those sets of 2 pins a letter either F or R for forward and reverse. Just hook a two pin cable into one of those and hook that to a limit switch in the normally closed position and instant limit switch, no programming required :D

Also if you have jaguars that you don't want to use this feature for (I.E. drive motors) make sure you tape the jumpers in so they cant fall out during competition.

For next year keep an eye out for allowed features with the other connectors :P

Can someone clarify if we can use the built in limit switch ports on the Jaguars. i was originally gonna use that capability myself, but since Update 4 when they posted this rule update:

---------------------------------------------------------------
<R67> All outputs from sensors, custom circuits and additional electronics shall connect to only the following:
A. Other custom circuits, or
B. PWM Out, I2C, Relay or Digital I/O ports on the Digital Sidecar, or
C. ANALOG IN ports on the Analog Breakout.
D. Ethernet Port 2 on the cRIO Mobile Device Controller (to which the Kit Of Parts-provided camera, and only that camera, may be connected).

-------------------------------------------------------------
I moved my limit switches back to the digital sidecar and am programming them instead. I didn't want to have to fight with inspectors on game day and have to rush some code to reinstitute my limit switches so I am doing it through the sidecar from the beginning. I looked on Q&A and didn't see a specific allowance for using the jaguar limit switch capability.

Does anyone know whether I am being too careful or could I use the much easier built in limit switches on the jaguars?

Team1710
01-27-2009, 07:32 PM
It would seem odd that they would give us built in limit switch capability and then not allow us to use it.

Given the case that they will be able to let us use the built in feature, I'm still not quite sure how their jumper system will impliment say...a turret? Can anyone clarify?

wt200999
01-27-2009, 08:45 PM
Well put your limit switches wherever you need to put them to stop your turret. Then lets say when you drive the speed controller forward to far it presses switch one, and if you drive it in reverse then it hits switch 2. Take out the jumper and put a 2 pin wire from where the jumper was to the switch. Wire the 2 pin slot labeled F to switch 1 and the one labeled R to switch 2. Make sure the switches are wired for normally closed, and test it at slower speeds to ensure that it works 100%

It would seem odd that they would give us built in limit switch capability and then not allow us to use it.


There are other features of the Jaguars that we are not allowed to use this year (if you look at the diagram you are not allowed to use the encoder, analog, or net ports this year). I am pretty sure you can use the limit switches, but definitely double check in the rules.

Joe Ross
01-28-2009, 05:23 PM
Can someone clarify if we can use the built in limit switch ports on the Jaguars. i was originally gonna use that capability myself, but since Update 4 when they posted this rule update:

---------------------------------------------------------------
<R67> All outputs from sensors, custom circuits and additional electronics shall connect to only the following:
A. Other custom circuits, or
B. PWM Out, I2C, Relay or Digital I/O ports on the Digital Sidecar, or
C. ANALOG IN ports on the Analog Breakout.
D. Ethernet Port 2 on the cRIO Mobile Device Controller (to which the Kit Of Parts-provided camera, and only that camera, may be connected).

-------------------------------------------------------------
I moved my limit switches back to the digital sidecar and am programming them instead. I didn't want to have to fight with inspectors on game day and have to rush some code to reinstitute my limit switches so I am doing it through the sidecar from the beginning. I looked on Q&A and didn't see a specific allowance for using the jaguar limit switch capability.

Does anyone know whether I am being too careful or could I use the much easier built in limit switches on the jaguars?

I have submitted a question to the Q/A about this. I agree that <R67> as written doesn't allow it, so I'm hoping it will be amended.

sircedric4
02-02-2009, 08:06 AM
I have submitted a question to the Q/A about this. I agree that <R67> as written doesn't allow it, so I'm hoping it will be amended.

And it looks like the GDC has ruled that we can't use theJaguar limit switch capability. I personally see no reason to even use Jaguars over Victors since we can't use any of the "smart" capabilities of these devices. Victors take up much less room on my electronics board. Am I missing some other advantage to Jaguars?

http://forums.usfirst.org/showthread.php?t=11658

************************************************** ****************
GDC
Game Design Committee Join Date: Jan 2006
Posts: 1,754

Re: Limit switch inputs - Jaguar controller ruling?

--------------------------------------------------------------------------------

No, the limit switch inputs on the Jaguar speed controllers are not legal for use this year. This would be a violation of Rule <R62>. The rules in the Manual supersede all other documentation.
************************************************** *****************

Alan Anderson
02-02-2009, 02:32 PM
Am I missing some other advantage to Jaguars?

They cost less than Victors. That's all I can come up with. Maybe the different response curve.

Just about every other feature of a Jaguar is either unusable by fiat this year (built-in limit switch connections, CAN interface to current measurement and encoder connections), or is undesireable (40 amp governor, relatively large size and weight).