OCCRA
Go to Post Don't start celebrating yet. I haven't a clue if we can get this working. - Kevin Watson [more]
Home
Go Back   Chief Delphi > Technical > Programming > WindRiver C++
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-24-2009, 02:20 PM
Team1710's Avatar
Team1710 Team1710 is offline
Registered User
FRC #1710
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Kansas City
Posts: 95
Team1710 is an unknown quantity at this point
Limit Switch return value

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:

Code:
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!
Reply With Quote
  #2   Spotlight this post!  
Unread 01-25-2009, 12:28 AM
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Limit Switch return value

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.
__________________
Get yer robot source code here!
Reply With Quote
  #3   Spotlight this post!  
Unread 01-25-2009, 03:07 PM
wt200999's Avatar
wt200999 wt200999 is offline
Registered User
AKA: Will
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Dallas, Texas
Posts: 215
wt200999 will become famous soon enoughwt200999 will become famous soon enough
Send a message via MSN to wt200999
Re: Limit Switch return value

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.
__________________
FIRST LEGO League 2005
FRC Team 870 Student 2006 - 2009
FRC Team 870 College Student 2009 - 2013
FRC Team 3005 Mentor 2014

Reply With Quote
  #4   Spotlight this post!  
Unread 01-25-2009, 03:40 PM
Albo Albo is offline
Registered User
AKA: Al Vigland
FRC #2408 (Shrapnel Sergeants)
Team Role: Mentor
 
Join Date: Sep 2008
Rookie Year: 2007
Location: St. Louis
Posts: 7
Albo is an unknown quantity at this point
Re: Limit Switch return value

Hmmm. Built in limit switches on the Jaguar, you say? Sounds interesting. Could you please elaborate?
Reply With Quote
  #5   Spotlight this post!  
Unread 01-25-2009, 03:52 PM
wt200999's Avatar
wt200999 wt200999 is offline
Registered User
AKA: Will
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Dallas, Texas
Posts: 215
wt200999 will become famous soon enoughwt200999 will become famous soon enough
Send a message via MSN to wt200999
Re: Limit Switch return value



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

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
__________________
FIRST LEGO League 2005
FRC Team 870 Student 2006 - 2009
FRC Team 870 College Student 2009 - 2013
FRC Team 3005 Mentor 2014


Last edited by wt200999 : 01-25-2009 at 04:02 PM.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-25-2009, 03:55 PM
Albo Albo is offline
Registered User
AKA: Al Vigland
FRC #2408 (Shrapnel Sergeants)
Team Role: Mentor
 
Join Date: Sep 2008
Rookie Year: 2007
Location: St. Louis
Posts: 7
Albo is an unknown quantity at this point
Re: Limit Switch return value

That, my friend, is a beautiful thing! Thanks!!
Reply With Quote
  #7   Spotlight this post!  
Unread 01-25-2009, 05:57 PM
WatersongX WatersongX is offline
Registered User
AKA: Matthew Keen
FRC #1111 (Powerhawks)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Edgewater, MD
Posts: 7
WatersongX is an unknown quantity at this point
Send a message via AIM to WatersongX
Re: Limit Switch return value

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.
Reply With Quote
  #8   Spotlight this post!  
Unread 01-26-2009, 08:09 PM
Team1710's Avatar
Team1710 Team1710 is offline
Registered User
FRC #1710
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Kansas City
Posts: 95
Team1710 is an unknown quantity at this point
Re: Limit Switch return value

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...
Reply With Quote
  #9   Spotlight this post!  
Unread 01-27-2009, 12:58 AM
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Limit Switch return value

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.
__________________
Get yer robot source code here!
Reply With Quote
  #10   Spotlight this post!  
Unread 01-27-2009, 08:47 AM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 7,894
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Send a message via AIM to Alan Anderson
Re: Limit Switch return value

Quote:
Originally Posted by Team1710 View Post
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?
Reply With Quote
  #11   Spotlight this post!  
Unread 01-27-2009, 03:22 PM
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
FRC #2992 (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 242
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Re: Limit Switch return value

Quote:
Originally Posted by wt200999 View Post

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

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
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?
Reply With Quote
  #12   Spotlight this post!  
Unread 01-27-2009, 08:32 PM
Team1710's Avatar
Team1710 Team1710 is offline
Registered User
FRC #1710
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Kansas City
Posts: 95
Team1710 is an unknown quantity at this point
Re: Limit Switch return value

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?
Reply With Quote
  #13   Spotlight this post!  
Unread 01-27-2009, 09:45 PM
wt200999's Avatar
wt200999 wt200999 is offline
Registered User
AKA: Will
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Dallas, Texas
Posts: 215
wt200999 will become famous soon enoughwt200999 will become famous soon enough
Send a message via MSN to wt200999
Re: Limit Switch return value

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%

Quote:
Originally Posted by Team1710 View Post
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.
__________________
FIRST LEGO League 2005
FRC Team 870 Student 2006 - 2009
FRC Team 870 College Student 2009 - 2013
FRC Team 3005 Mentor 2014

Reply With Quote
  #14   Spotlight this post!  
Unread 01-28-2009, 06:23 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 7,918
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Limit Switch return value

Quote:
Originally Posted by sircedric4 View Post
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.
Reply With Quote
  #15   Spotlight this post!  
Unread 02-02-2009, 09:06 AM
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
FRC #2992 (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 242
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Re: Limit Switch return value

Quote:
Originally Posted by Joe Ross View Post
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.
************************************************** *****************
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a limit switch to limit motion ManicMechanic Programming 16 12-20-2007 12:54 AM
limit switch wedellm Electrical 4 02-16-2007 01:01 PM
No value in digital ins using NASON pressure switch. Ari Allyn-Feuer Programming 1 02-18-2006 01:18 AM
Limit switch in easy c? chadbarbe Programming 6 02-02-2006 09:51 AM


All times are GMT -5. The time now is 02:31 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi