Go to Post Don't worry so much about the wording of the rules but the intent of the rules. - Greg Needel [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-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 27-10-2009, 19:06
JonesSoda101's Avatar
JonesSoda101 JonesSoda101 is offline
LabView Master
AKA: Cody Jones
FRC #0240 (Tempest)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2008
Location: Monroe MI
Posts: 1
JonesSoda101 is an unknown quantity at this point
Using Switches in Autonomus

How do I, using labView, program switches attached to the drivers station to decide which autonomus mode is used?
Thanks in Advance.
Reply With Quote
  #2   Spotlight this post!  
Unread 27-10-2009, 20:28
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: 9,112
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
Re: Using Switches in Autonomus

As soon as the robot is enabled in autonomous mode, you won't be able to read anything from the Driver Station. So what you need to do is continuously read the switches while the robot is disabled, figure out which autonomous selection that means, and store it in a global variable. When autonomous begins, use the value from that global variable to select the proper actions.

Is that enough to start with, or do you want more detail?
Reply With Quote
  #3   Spotlight this post!  
Unread 28-10-2009, 06:46
rwood359 rwood359 is offline
Registered User
AKA: Randy
FRC #0359 (Hawaiian Kids)
Team Role: Mentor
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Waialua, HI
Posts: 212
rwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to all
Re: Using Switches in Autonomus

Just a reminder that the DS inputs do not have pull-up resistors. So, you need to connect a pull-up from +5 to signal and a switch from signal to ground.
Reply With Quote
  #4   Spotlight this post!  
Unread 28-10-2009, 08:47
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Using Switches in Autonomus

Quote:
Originally Posted by rwood359 View Post
Just a reminder that the DS'09 inputs do not have pull-up resistors. So, you need to connect a pull-up from +5 to signal and a switch from signal to ground.
Fixed that for ya
Reply With Quote
  #5   Spotlight this post!  
Unread 28-10-2009, 10:30
rsisk's Avatar
rsisk rsisk is offline
The GURU Channel
AKA: Richard Sisk
FRC #2493 (Robokong)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Riverside, CA
Posts: 2,748
rsisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond reputersisk has a reputation beyond repute
Send a message via MSN to rsisk
Re: Using Switches in Autonomus

Could you explain what a pull-up resistor is and why you need it in this situation?
Reply With Quote
  #6   Spotlight this post!  
Unread 28-10-2009, 13:23
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Using Switches in Autonomus

Quote:
Originally Posted by rsisk View Post
Could you explain what a pull-up resistor is and why you need it in this situation?
A pull-(up/down) resistor weakly pulls an input either high or low. This prevents the input from floating around randomly and gives it a "Unless you dictate otherwise, I am high (or low if it is a pull down)." If you've ever had a digital input "flutter" or be otherwise unreliable, you probably needed a pull-___ resistor.
Reply With Quote
  #7   Spotlight this post!  
Unread 02-11-2009, 14:46
Shivang1923 Shivang1923 is offline
I make robot go VROOM VROOM!
FRC #1923 (MidKnight Inventors)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: West Windsor, NJ
Posts: 38
Shivang1923 has a spectacular aura aboutShivang1923 has a spectacular aura about
Re: Using Switches in Autonomus

That being said vdubs you might want to let them know that a 10k resistor works perfectly (at least it did for us).

Dont want them to use a small resistor and end up shorting the DS
Reply With Quote
  #8   Spotlight this post!  
Unread 06-11-2009, 10:32
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: Using Switches in Autonomus

I like Alan's recommendation of using a global variable, but why not put the switches on the 'bot instead of the DS?

During the setup time between matches you place your 'bot and set your switches accordingly.

We never actually implemented the full code last year, but we had some switches on the 'bot that we could set based on which starting square we were starting in. This way, the Auto code can know its starting position as soon as it starts up. Regrettably, our autonomous code never got that mature and the switches were left unused ... go figure!
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
  #9   Spotlight this post!  
Unread 06-11-2009, 12:34
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
Re: Using Switches in Autonomus

Quote:
Originally Posted by Ziaholic
... why not put the switches on the 'bot instead of the DS?
Having done this both ways on the pre-2009 robots, it tends to be an easier location on the driver station, and it eliminates the awkward running back out to the robot to make sure the switches are set correctly. Also last second changes after seeing how other robots are placed.

I think our programmer for 2009 even had a one-line autonomous description on the DS box, which was better than a simple number. Not that his descriptions were, well, descriptive.
Reply With Quote
  #10   Spotlight this post!  
Unread 06-11-2009, 14:32
Jon Jack's Avatar
Jon Jack Jon Jack is offline
VEX Robotics
no team (No Team)
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Greenville, TX
Posts: 614
Jon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond reputeJon Jack has a reputation beyond repute
Send a message via AIM to Jon Jack
Re: Using Switches in Autonomus

Quote:
Originally Posted by Roger View Post
Having done this both ways on the pre-2009 robots, it tends to be an easier location on the driver station, and it eliminates the awkward running back out to the robot to make sure the switches are set correctly. Also last second changes after seeing how other robots are placed.

I think our programmer for 2009 even had a one-line autonomous description on the DS box, which was better than a simple number. Not that his descriptions were, well, descriptive.
Agreed. We had the DS display which autonomous mode we were running all season. Having the ability to switch your autonomous mode after seeing how your opponent is set up is very nice. It's even nicer in a game like Lunacy where a poor autonomous mode could be the difference between a win and a loss.
__________________
Team 1538 / The Holy Cows, 2005-2016
Reply With Quote
  #11   Spotlight this post!  
Unread 09-11-2009, 13:25
Shivang1923 Shivang1923 is offline
I make robot go VROOM VROOM!
FRC #1923 (MidKnight Inventors)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: West Windsor, NJ
Posts: 38
Shivang1923 has a spectacular aura aboutShivang1923 has a spectacular aura about
Re: Using Switches in Autonomus

Having the switched on the controls allows for last minute changes to the code in case of a strategy change - dont know how many times we've changed the auton after a brief stroke of inspiration 5 seconds before the match starts.

As for the DS display, I find that showing the position and the begining movement of the robot allows for the operator/driver/coach to identify the auton being used pretty well.

For example, one of my codes displays: far left to far right, or center away.
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 Limit Switches in LabVIEW VeedotJaydot NI LabVIEW 2 14-02-2009 16:01
Toggling boolean using 2 limit switches Quarkster NI LabVIEW 2 02-02-2009 22:43
Using Limit Switches with the Arm iwin2000 Programming 3 18-02-2008 03:52
Using Switches on the Operator Interface CronosPrime1 Programming 41 16-02-2006 11:43
using limit_switch_max/min in autonomus CmptrGk Programming 4 11-02-2005 11:32


All times are GMT -5. The time now is 11:50.

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


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