Go to Post I don't think FIRST is the reason for following rules, being respectful, etc. We should do that anyway. - Dan Zollman [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 22-01-2006, 14:06
CronosPrime1 CronosPrime1 is offline
Registered User
FRC #0321
 
Join Date: Jan 2006
Location: Hyperspace
Posts: 53
CronosPrime1 is an unknown quantity at this point
Question Using Switches on the Operator Interface

I know it has been done many times. I know it's often very handy. But how do you install switches and buttons on the OI? I want my robot to dump balls into the corner goals when I push a button or flip a switch. The OI, unlike the RC, does not seem to have convenient digital input connections, only serial ports. How, then, would I connect something like a three-way switch (to control a spike, for instance) to the OI? Please don't tell me to use the buttons on the joysticks. I know how to do that. I'm interested in wiring an actual switch or button to the OI. I know lots of people have done it, but how do you do it?
  #2   Spotlight this post!  
Unread 22-01-2006, 14:15
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Using Switches on the Operator Interface

Use the pinout of the serial port to make your own connector (put a switch between ground and one of the buttons).

See pages 7-10 of http://www.ifirobotics.com/docs/oi-r...e-11-21-05.pdf.
  #3   Spotlight this post!  
Unread 22-01-2006, 14:17
MacFlightSierra MacFlightSierra is offline
Registered User
FRC #0912 (Iron Lyons)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Toronto
Posts: 19
MacFlightSierra is an unknown quantity at this point
Re: Using Switches on the Operator Interface

Using a custom control box in addition to the drive joysticks is a great idea, we are also building one at the moment.

The pinout diagrams for the OI ports are available from IFI in the OI reference guide (they have not changed since 2005/05 I beleive) - http://www.ifirobotics.com/oi.shtml

The pinout chart gives the pin number for the OI digital and analog inputs, as well as the LED feedback drivers, and the IFI aliases for those inputs/outputs.

You will need 15 pin solder cups [male and female] and some basic wiring skills, but its quite simple to do. For switches - wire them between the input pin and any ground pin of that port.

good luck, have fun.
  #4   Spotlight this post!  
Unread 22-01-2006, 14:23
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,772
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: Using Switches on the Operator Interface

So as not to confuse the reader, the 15 pin connectors on the OI are gameports not serial ports. They are compatible with the oldstyle game port joysticks found on PC's from long ago. (In computer years, that is.)
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
  #5   Spotlight this post!  
Unread 22-01-2006, 14:29
CronosPrime1 CronosPrime1 is offline
Registered User
FRC #0321
 
Join Date: Jan 2006
Location: Hyperspace
Posts: 53
CronosPrime1 is an unknown quantity at this point
Re: Using Switches on the Operator Interface

Quote:
Originally Posted by Al Skierkiewicz
So as not to confuse the reader, the 15 pin connectors on the OI are gameports not serial ports. They are compatible with the oldstyle game port joysticks found on PC's from long ago. (In computer years, that is.)
Yea, I still have one of those joysticks. I think I might use it for the robot actually. Will joysticks that did not come in the kit work for controlling the robot? It's not joystick-dependent, is it?
  #6   Spotlight this post!  
Unread 22-01-2006, 14:32
CronosPrime1 CronosPrime1 is offline
Registered User
FRC #0321
 
Join Date: Jan 2006
Location: Hyperspace
Posts: 53
CronosPrime1 is an unknown quantity at this point
Re: Using Switches on the Operator Interface

Can someone please give me a less technical explanation of what everyone said about the pinouts and so on? I may be an experienced computer programmer, but I am fairly close to a newbie at robot programming. I'm not sure I know anything about the pins in the gameports.
  #7   Spotlight this post!  
Unread 22-01-2006, 14:32
Tristan Lall's Avatar
Tristan Lall Tristan Lall is offline
Registered User
FRC #0188 (Woburn Robotics)
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Toronto, ON
Posts: 2,484
Tristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond repute
Re: Using Switches on the Operator Interface

Quote:
Originally Posted by CronosPrime1
Yea, I still have one of those joysticks. I think I might use it for the robot actually. Will joysticks that did not come in the kit work for controlling the robot? It's not joystick-dependent, is it?
A gameport joystick will usually work, however there exist some non-standard implementations that may not function quite as expected. In general, any simple 2-axis, 2-button gameport joystick will work.
  #8   Spotlight this post!  
Unread 22-01-2006, 14:45
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Using Switches on the Operator Interface

The 15 pin connector that goes to a joystick - each pin corresponds to a particular function in the program. The document linked to earlier has the pinout description of what each does. To use a digital switch, for example, connect one terminal of the switch to ground and the other to one of the pins that corresponds to, say, p1_sw_trig (assuming your switchbox is plugged into port 1).

Then, in the program, whenever you access p1_sw_trig, you are actually getting the value of your switch.
  #9   Spotlight this post!  
Unread 22-01-2006, 14:51
CronosPrime1 CronosPrime1 is offline
Registered User
FRC #0321
 
Join Date: Jan 2006
Location: Hyperspace
Posts: 53
CronosPrime1 is an unknown quantity at this point
Post Re: Using Switches on the Operator Interface

Okay, that works. Now what if I have a multi-way switch? Can I plug it into the pin corresponding to p4_x, let's say, under port 4, and get a value from 0 to 255, where 0 will be one position, 1 will be another, and 2 will be another? And how will the switch know which position should be 0 and which should be 2? Or is it going to return 1,0, and -1, thus throwing my unsigned char data type off balance?
  #10   Spotlight this post!  
Unread 22-01-2006, 14:55
Billfred's Avatar
Billfred Billfred is offline
...and you can't! teach! that!
FRC #5402 (Iron Kings); no team (AndyMark)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: The Land of the Kokomese, IN
Posts: 8,522
Billfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond repute
Re: Using Switches on the Operator Interface

Well, p4_x is an analog variable, so you'd have to rig up some resistors in varying amounts to get different values for the switch positions. (I'm not entirely sure on the values of the resistors, so I won't guess.) Alternatively, you could wire it to two different digital inputs.
__________________
William "Billfred" Leverette - Gamecock/Jessica Boucher victim/Marketing & Sales Specialist at AndyMark

2004-2006: FRC 1293 (D5 Robotics) - Student, Mentor, Coach
2007-2009: FRC 1618 (Capital Robotics) - Mentor, Coach
2009-2013: FRC 2815 (Los Pollos Locos) - Mentor, Coach - Palmetto '09, Peachtree '11, Palmetto '11, Palmetto '12
2010: FRC 1398 (Keenan Robo-Raiders) - Mentor - Palmetto '10
2014-2016: FRC 4901 (Garnet Squadron) - Co-Founder and Head Bot Coach - Orlando '14, SCRIW '16
2017-: FRC 5402 (Iron Kings) - Mentor

94 events (more than will fit in a ChiefDelphi signature), 14 seasons, over 61,000 miles, and still on a mission from Bob.

Rule #1: Do not die. Rule #2: Be respectful. Rule #3: Be safe. Rule #4: Follow the handbook.
  #11   Spotlight this post!  
Unread 22-01-2006, 15:36
CronosPrime1 CronosPrime1 is offline
Registered User
FRC #0321
 
Join Date: Jan 2006
Location: Hyperspace
Posts: 53
CronosPrime1 is an unknown quantity at this point
Re: Using Switches on the Operator Interface

So, in a word, to get a binary switch working, I can simply wire it to the right pins, but to get a 0-255 thing working (analog), I'm actually going to have to build resistors or get potentiometers?
  #12   Spotlight this post!  
Unread 22-01-2006, 16:25
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Using Switches on the Operator Interface

Correct.
__________________

  #13   Spotlight this post!  
Unread 22-01-2006, 17:13
CronosPrime1 CronosPrime1 is offline
Registered User
FRC #0321
 
Join Date: Jan 2006
Location: Hyperspace
Posts: 53
CronosPrime1 is an unknown quantity at this point
Lightbulb Re: Using Switches on the Operator Interface

Well, I think I'll just wire several binary switches and ask the computer to compute values using binary. Like if I want to select between 4 things, I'll convert input from 2 binary switches to a number from 0-3, and attach a printed label sheet to the operator interface so my team members can know what's going on. No problem, I guess. Binary math is easy.
__________________
  #14   Spotlight this post!  
Unread 22-01-2006, 17:47
Billfred's Avatar
Billfred Billfred is offline
...and you can't! teach! that!
FRC #5402 (Iron Kings); no team (AndyMark)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: The Land of the Kokomese, IN
Posts: 8,522
Billfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond repute
Re: Using Switches on the Operator Interface

Quote:
Originally Posted by CronosPrime1
Well, I think I'll just wire several binary switches and ask the computer to compute values using binary. Like if I want to select between 4 things, I'll convert input from 2 binary switches to a number from 0-3, and attach a printed label sheet to the operator interface so my team members can know what's going on. No problem, I guess. Binary math is easy.
Binary math may be easy, but I'd avoid it on the OI.

Last season, I was field coach for 1293 during their short (two-match, if I recall) reign as #1 seed at Palmetto. I wasn't even doing the driving, and my mind had a million things going (time remaining, which goals were ours, which goals needed to be ours, is anyone in the loading zones, et cetera). Trying to throw in much of any sort of math would've had dire consequences.

The general thing you'll see on most OI panels is that they're simple. A driver should be able to judge what's going on by touch or a brief glance. This, in turn, gives them more time to figure out how to do more important things, like moving around those two 120-pound hunks of machinery blocking your path to the goal. (Of course, if your two switches corresponded to something visual on the robot, such as a left and right ball sucker, then by all means go for it.)

That said, binary is perfectly fine on the robot side for things like setting an autonomous mode. Even the most tense field coach in the world can figure that sort of thing out.

Hope this helps!
__________________
William "Billfred" Leverette - Gamecock/Jessica Boucher victim/Marketing & Sales Specialist at AndyMark

2004-2006: FRC 1293 (D5 Robotics) - Student, Mentor, Coach
2007-2009: FRC 1618 (Capital Robotics) - Mentor, Coach
2009-2013: FRC 2815 (Los Pollos Locos) - Mentor, Coach - Palmetto '09, Peachtree '11, Palmetto '11, Palmetto '12
2010: FRC 1398 (Keenan Robo-Raiders) - Mentor - Palmetto '10
2014-2016: FRC 4901 (Garnet Squadron) - Co-Founder and Head Bot Coach - Orlando '14, SCRIW '16
2017-: FRC 5402 (Iron Kings) - Mentor

94 events (more than will fit in a ChiefDelphi signature), 14 seasons, over 61,000 miles, and still on a mission from Bob.

Rule #1: Do not die. Rule #2: Be respectful. Rule #3: Be safe. Rule #4: Follow the handbook.
  #15   Spotlight this post!  
Unread 22-01-2006, 18:14
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: Using Switches on the Operator Interface

Quote:
Originally Posted by Billfred
The general thing you'll see on most OI panels is that they're simple. A driver should be able to judge what's going on by touch or a brief glance. This, in turn, gives them more time to figure out how to do more important things, like moving around those two 120-pound hunks of machinery blocking your path to the goal. (Of course, if your two switches corresponded to something visual on the robot, such as a left and right ball sucker, then by all means go for it.)
Yes - simple is really good!

Last year, we decided that to make driver reaction faster, we would only use momentary large (coin op arcade-style) push buttons on our operator interface (besides the joysticks of course). We would then use code to make them emulate toggle switches. (Such as hit it once to start a function, and hit it again to stop it).

This may not be perfectly suited for every application, but I can tell from experience (I was the co-driver for my team last year), that not having to look down at the button when you push it really helps. As you can see, our 2005 operator interface was about as simple at you could get.

__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
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
Alternative to limit switches? RbtGal1351 Electrical 27 10-12-2005 15:30
Robot Cart Switches Chaos204 Electrical 6 23-06-2005 20:57
limit switches stephenthe1 Programming 28 11-05-2005 16:37
Team selector switches on ISAAC Lloyd Burns Robotics Education and Curriculum 0 17-12-2002 08:32
Need help with custom switches archiver 2001 3 24-06-2002 00:35


All times are GMT -5. The time now is 01:04.

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