Go to Post A coin flip is a wonderful thing. Not because it makes the decision for you, but because when the coin is in the air, you realize what you really want. - rtfgnow [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-03-2010, 09:03
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
DIP switches for autonomous modes

Hi, Were wanting to use DIP switches to select between different autonomous behavior prior to our matches without needing to reprogram. We would connect them to the GPIO pins.

Since the signal pins are pulled to 5V with a 10k resistor, we are thinking of simply pulling the pin to GND to select the autonomous behavior.

I didn't see any rules against this. Do you guys agree?

Thanks,
windell
  #2   Spotlight this post!  
Unread 23-03-2010, 09:17
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: DIP switches for autonomous modes

Pulling a pin to ground is the common way of connecting to the digital inputs.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #3   Spotlight this post!  
Unread 23-03-2010, 09:18
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: DIP switches for autonomous modes

A switch connecting a signal pin to ground when pressed is the intended method of operation for Digital Inputs, so you are correct. Have you considered using Digital Inputs on the driver station (many teams prefer this approach) instead of the robot? You can use the virtual digital inputs on the I/O panel or your DIP switch on the PSoC.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #4   Spotlight this post!  
Unread 23-03-2010, 09:28
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
Re: DIP switches for autonomous modes

Thanks Lucas and apalrd! Unfortunately, I'm not the programmer of the team so I don't know about the PSoC or the driver station DIO. I know we're using the classmate, but other than that I'm clueless. Our programmer seems spacey sometimes and doesn't think of these things. So we'll probably put the switches on the bot. I'll pass on the info!

Thanks again,
windell
  #5   Spotlight this post!  
Unread 23-03-2010, 09:31
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: DIP switches for autonomous modes

Quote:
Originally Posted by The Lucas View Post
A switch connecting a signal pin to ground when pressed is the intended method of operation for Digital Inputs, so you are correct. Have you considered using Digital Inputs on the driver station (many teams prefer this approach) instead of the robot? You can use the virtual digital inputs on the I/O panel or your DIP switch on the PSoC.
While there are good reasons for putting the selection on the Operator Interface (you can change it without having to be next to your robot) for me there is nothing as certain as flipping a switch on your robot to be sure that your robot will know what to do.

So... ...if #2849 ever gets its autonomous program(s) running, we'll be flipping switches on the robot to select (or disable) them.

For what it's worth.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
  #6   Spotlight this post!  
Unread 23-03-2010, 09:47
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: DIP switches for autonomous modes

Quote:
Originally Posted by Joe Johnson View Post
While there are good reasons for putting the selection on the Operator Interface (you can change it without having to be next to your robot) for me there is nothing as certain as flipping a switch on your robot to be sure that your robot will know what to do.

So... ...if #2849 ever gets its autonomous program(s) running, we'll be flipping switches on the robot to select (or disable) them.

For what it's worth.

Joe J.
I understand those reasons. We use rotary switches (2 X six pos) on the PSoC and print out the auto routine on the Driver Station LCD so we can confirm that the cRIO sees those switches. In case the PSoC (as it did when the Classmate battery goes low, we will not let that happen again) fails the drivers are trained to use the virtual analog in as a backup. It is important to be sure you run the correct auto.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #7   Spotlight this post!  
Unread 23-03-2010, 09:47
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,364
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: DIP switches for autonomous modes

Another possibility is using a potentiometer and one analog input on the robot.
Theoretically you could have close to 5000 different autonomous options as I believe the analog inputs are 12 bit. (2^12=4096). Practically speaking, you would easily be able to have a couple per zone.
We have a pot on our robot this year that has 10 detented positions, but we are only using 4 modes. This allows us greater room for error in positioning the pot.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #8   Spotlight this post!  
Unread 23-03-2010, 09:57
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,792
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: DIP switches for autonomous modes

For many years we have used a modified Radio Shack rotary switch. This is stock 6 position double pole switch. With a small modification it can be turned into a 12 position single pole switch. Wired with 9.1k resistors in a series string, this switch can function on an analog input either at the robot or on the driver's console. It effectively steps from 0 volts to five volts.
The modification involves removing the phenolic switch deck, and cutting the inside of one of the follower contacts on one side of the switch. Then remove one of the mechanical stops on the metal detent plate and reassemble the switch. Then wire the two center contacts together and tie to the analog input. Wire the 9.1k resistors from contact to contact around the outside terminals of the switch. Tie one end of the string to 5 volts and the other to negative power supply. The load on the 5 volts supply is in the order of 100 k ohms so there is little current.

http://www.radioshack.com/product/in...AID=107598141#
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.

Last edited by Al Skierkiewicz : 23-03-2010 at 10:03.
  #9   Spotlight this post!  
Unread 23-03-2010, 09:59
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: DIP switches for autonomous modes

Quote:
Originally Posted by billbo911 View Post
Another possibility is using a potentiometer and one analog input on the robot.
Theoretically you could have close to 5000 different autonomous options as I believe the analog inputs are 12 bit. (2^12=4096). Practically speaking, you would easily be able to have a couple per zone.
We have a pot on our robot this year that has 10 detented positions, but we are only using 4 modes. This allows us greater room for error in positioning the pot.
Another option is a multiplexed switch. You solder a resistor from each position to the position next to it, with GND on one end and +5 (or +3.3) on the other. The selector goes to SIG. If all of the resistors are the same value, each position is an even increment from the next and the switch clicks from position to position, more accurately than the potentiometer method.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #10   Spotlight this post!  
Unread 23-03-2010, 10:20
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: DIP switches for autonomous modes

I am going for 3 switches providing 8 choices for autonomous programs (000, 001, 010, 011, 100, 101, 110, 111) It requires a secret decoder ring but it is simple enough to manage and as a practical matter we will probably only use 3 of them.

Works for me.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
  #11   Spotlight this post!  
Unread 23-03-2010, 11:13
samir13k samir13k is offline
Registered User
AKA: Samir Shaikh
FRC #4329
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2008
Location: St. Louis, MO
Posts: 281
samir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant futuresamir13k has a brilliant future
Send a message via AIM to samir13k Send a message via MSN to samir13k
Re: DIP switches for autonomous modes

1501 uses a thumbwheel on our robot. It uses 4 Digital I/0 slots in the Digital Sidecar. it can also be used on the Cyprus Board i believe, but we decided to not use any custom circuits on our Drivers Station. It offers 0-9, and A-F i believe. Overall there is about 15-16 options, and we have never had a problem with it. I can try to get you the supplier if you PM me. We have never had a problem with it. I believe you wire it into a case selector in labview to change between the different modes. If you dont have that many modes, than you can have your code default to a certain auto mode, or default back to no code if the thumbwheel is set incorrectly. (Which we have never had happen, but we code it in as a safety anyways. Also helps prevents watchdog errors)
  #12   Spotlight this post!  
Unread 23-03-2010, 13:18
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 669
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: DIP switches for autonomous modes

We built our own DIP switches last year and are able to reuse it this year. We mounted it on the robot and connect it to some of the digital input pins (however many pins we want up to 8). The board was designed to interface with both the digital inputs on the robot (internally pulled up) and the digital inputs on the DS last year (no internal pull-ups). We didn't have time to play with the PSoC this year but I would imagine it should not be hard to interface it to the PSoC as well.
Attached Thumbnails
Click image for larger version

Name:	5820_118646037217_605902217_2471498_6933123_n.jpg
Views:	44
Size:	79.8 KB
ID:	8917  
__________________
  #13   Spotlight this post!  
Unread 23-03-2010, 21:02
McVey's Avatar
McVey McVey is offline
Kilroy is here!
FRC #0339 (Kilroy)
 
Join Date: Mar 2010
Rookie Year: 2005
Location: Northern Virginia
Posts: 21
McVey has a spectacular aura aboutMcVey has a spectacular aura aboutMcVey has a spectacular aura about
Re: DIP switches for autonomous modes

For control over autonomous as our team takes the field, we have one SPST switch (enable / disable) and one SPDT switch (offense, defense, midfield). Digital inputs with switches work fine when wired to the digital board to the cRIO, the only issue is that each individual switch requires its own PWM and slot on the digital board. All in all, our setup only requires three inputs, but still, we could be using those for other things and I fear that your DIP Switch may take up too much space on your digital board.

Of course, you've probably already accounted for that! I've had great success with physical switches though and swear by them - have at it.
__________________
FRC Member 2006-10 | Volunteer 2009-10 \\ FTC Member 2008-10 \\ FLL Member 2005 | Volunteer 2007-11
Thank you FIRST for six years of joy, heartbreak, and an all out great time - I look forward to even more in years to come
  #14   Spotlight this post!  
Unread 23-03-2010, 21:37
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: DIP switches for autonomous modes

Quote:
Originally Posted by McVey View Post
All in all, our setup only requires three inputs, but still, we could be using those for other things and I fear that your DIP Switch may take up too much space on your digital board.
Are you seriously close to running out of your 28 DIO's? I have 2 encoders in the drivetrain (4 inputs), pressure switch, claw sensor, ball-in sensor, and that's it. 7 inputs, not including analog. Not close to 28. Same with the Cypress board. 16 inputs. We have three buttons plus a 4-pos switch, and we still haven't filled half of the IO. Plus, you can always use analog triggers as DIO, adding another 16 di's to the 28 dio's (total: 44 dio). If you seem to be using lots of DO's, you can use Relay channels as 2 DO's each, another 32 DO's todal.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #15   Spotlight this post!  
Unread 24-03-2010, 02:09
Jeremy Germita's Avatar
Jeremy Germita Jeremy Germita is offline
Co-Advisor/Lead Engineering Mentor
AKA: wood is good. plastic is fantastic.
FRC #5012 (Gryffingear) / (Antelope Valley FIRST Teams)
Team Role: Coach
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Lancaster, CA
Posts: 284
Jeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond repute
Re: DIP switches for autonomous modes

Team 399 has a little panel on the driver station. There are 4 SPDT Toggle Switches and a Rotary Switch.
There are 15 options with the Toggles times 4 with the rotary switch.
Like Al and apalrd, we wired the rotary the same way giving us the option to use just 1 analog input instead of 4 digitals.
We have also printed the options on the DS LCD.

So we can have a maximum of 60 autonomous modes.
__________________
Drive Coach Team 5012 Gryffingear / Antelope Valley FIRST teams / EWCP - (2013 - Current)
Student / Driver / Programmer / CAD - FRC Team 399: Eagle Robotics / FTC Team 72: GarageBots - (2009 - 2013)
Los Angeles Region FTC FTA/CSA/Head Ref
[FF] FIRST Pick
2014 FTC Los Angeles Regional Compass Award Winner.

2017 - San Diego Regional / Sacramento Regional / Las Vegas Regional
2016 - Los Angeles Regional Creativity + Winners (1197, 987, 5012) / Las Vegas Regional Team Spirit + SF (5012, 5851, 5049) / Galileo Subdivision
2015 - Inland Empire QF (597, 5012, 4413) / Las Vegas Imagery + Winners (148, 987, 5012) / Newton Subdivision and World Champions (118, 1678, 1671, 5012)
2014 - Inland Empire Rookie All Star + Highest Rookie Seed + SF (2339, 1967, 5012) / Las Vegas Rookie All Star / Galileo Division Imagery
Closed Thread


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
problems with using switches for autonomous ssica_jj NI LabVIEW 21 13-03-2010 21:39
Programming toggle switches to DS for different autonomous routines? grosh NI LabVIEW 9 30-03-2009 20:42
Question: Dip Switches on Robot Controller RedHeadRobotics Electrical 5 11-02-2009 21:29
White Paper Discuss: C Programming and Autonomous Modes for Newbies cbolin Extra Discussion 3 09-01-2008 19:32
Autonomous modes? Buster Robotics Education and Curriculum 4 17-03-2004 15:56


All times are GMT -5. The time now is 15:29.

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