Go to Post I remember eating dinner once. Long before Build season. Now, we only eat aluminum swarf and disappointment. - BeardyMentor [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 25-02-2007, 05:43
Japper's Avatar
Japper Japper is offline
Registered User
FRC #3692 (RocknRobots)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Rutland Wisconsin
Posts: 147
Japper has a spectacular aura aboutJapper has a spectacular aura about
Converting Joystick controls over to switches

I am not sure if it is too late to do this now that the robot has shipped but we were under the gun to get things
on our robot working and the operators didn't get adequate driving time.

What we noticed is that the operators are having a heck of a time getting "used to" the manipulator controls
that we set up with joysticks.

Is it possible (per the rules & between now and the competition) to construct a new controller box with
switches and then re-write the code to use this set up and use the fix-it window to tweak the code?


If this is within the scope of the rules, I would appreciate any info on how to accomplish this with switches.

What I especially need help in understanding is the following:

I plan to use some SPDT toggle switches (with off positions).

If I connect these switches to the X & Y pins on the joystick ports (port 3 & port 4 on our OI) and the switched
values are either +5v, ground, how do I simulate (set up the hardware) so that the off condition
is read by the OI as it currently is by the joystick as a neutral condition (127)?


Does this require some sort of a weak pullup (or a trimmer pot) on the switch common to obtain this
neutral condition (value 127)?

Please advise...

Thanks for the help!
  #2   Spotlight this post!  
Unread 25-02-2007, 09:58
Chris Marra's Avatar
Chris Marra Chris Marra is offline
The Blue Alliance Staff / 177 Alum
no team (TBA / Bobcat Robotics)
Team Role: College Student
 
Join Date: Oct 2004
Rookie Year: 2005
Location: South Windsor, CT
Posts: 309
Chris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond reputeChris Marra has a reputation beyond repute
Re: Converting Joystick controls over to switches

I encourage you to take a look at The Blue Alliance's coverage on this topic, and read the show notes. If you can obtain a joystick port extension cable (these contain the full amount of wires, compared to how many a kit joystick would have), and cut it open, you can crimp on quick-connects and use some other small wire to create interconnects to your switches. I will note, this can be a painstakingly long process (I've done something like 50 crimps on our OI this year).

If you look at the joystick pinout in the shownotes however, you'll notice that Port 4 steals some functions from Port 1 so that you can make a more extensive switch box. Port 2 also does this, but if you use 2 sticks for drive, using port 4 makes the most sense. So to wire it up from there you just connect ground + any one of the digital bits to wire a switch into the corresponding variable. If you want to use potentiometers off of the x, y, and etc. lines, I will let a smarter person than me answer because I'm not positive the way I did it was correct.

You'll also need to consider a custom enclosure for it. Radioshack doesn't carry the most suitable project boxes, but specialty electronics stores around you probably would, and you can use a mill, drill, or anything else to cut the holes in the surface of it. Switches that mount circular work best compared to square hinges just due to how hard it is.
__________________
Team 177 - Bobcat Robotics
  #3   Spotlight this post!  
Unread 25-02-2007, 10:53
desi_technology's Avatar
desi_technology desi_technology is offline
Registered User
AKA: Shahil
FRC #0176 (Aces High)
Team Role: Alumni
 
Join Date: Oct 2005
Rookie Year: 2004
Location: Connecticut
Posts: 20
desi_technology is on a distinguished road
Send a message via AIM to desi_technology
Re: Converting Joystick controls over to switches

if you want to use the analog inputs i would suggest using resisters so that it would change the value of that input. This is how we did out autonomous switch using six resisters on an analog input so we would roughly get 6 different ranges which can be fiqured out pretty easily using the ifi dashboard.
__________________
AWARDS:
2007- Greater Tronoto Winners Thanks To 1114, 2056
2007- Connecticut Finalists

2006- UTC WINNERS, THANKS TO 177,1124
2006- BAE FINALISTS
2005- UTC Woodie Flowers Winner
2005- UTC Engineering Inspiration Award Winner
2005- Long Island Safety Award
2004- BAE Granite State Winners
2004- Nationals Finalist Award in Newton Division
1999- Nation Champions

Visit us at:

www.aceshigh176.org
  #4   Spotlight this post!  
Unread 25-02-2007, 12:21
Danny Diaz's Avatar
Danny Diaz Danny Diaz is offline
Smooth Operator
AKA: FrankenMentor
None #0418
Team Role: Alumni
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Manchester, NH
Posts: 545
Danny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond repute
Send a message via AIM to Danny Diaz
Re: Converting Joystick controls over to switches

Quote:
Originally Posted by Japper View Post
Is it possible (per the rules & between now and the competition) to construct a new controller box with
switches and then re-write the code to use this set up and use the fix-it window to tweak the code?
Tread carefully when interpreting the Fix-It Window Rules. <R19> tells you that you are able to create SPARE and REPLACEMENT PARTS during the Fix-It windows between now and the FIRST regional, and <R22> tells you that you're able to create SPARE, REPLACEMENT, and UPGRADE parts after the first regional. So, in your case, I interpret your new OI as being an UPGRADE part since you're doing a redesign and also software modifications. This means you have to wait until the first regional has completed, but after that you're able to begin working on your upgraded OI. If your team is only able to attend one regional, and it happens to be at the start of the season, you're going to have to wait until you get to the competition site to work on your upgrade. Other teams at the competition would be more than happy to help you out if you need help, but that's how the cookie crumbles.

-Danny

Quote:
<R19> During the “FIX-IT WINDOWS” following the shipment of the ROBOT: During this period, all teams may utilize one or two 5-hour FIX-IT-WINDOWS to manufacture SPARE and REPLACEMENT PARTS and develop software for their ROBOT at their home facility. Fabrication of UPGRADE PARTS is not permitted during this period. The timing of these “FIX-IT WINDOWS” is at the discretion of the team, but all work must be completed by 5:00pm on the Friday following the ROBOT shipment deadline. Teams may manufacture all the SPARE and REPLACEMENT parts they want, but the amount of parts they can bring to a competition event is limited (as specified in Rule <R31>).
Quote:
<R20> Prior to the competitions: After the close of the “FIX-IT WINDOWS” and prior to the competition, the team must put down their tools, cease fabrication of ROBOT parts, and cease all development of ROBOT software. Take this opportunity to rest, recover from the build season, and relax. Teams may scout other teams, gather and exchange information,
develop game-playing strategies, collect raw materials, prepare tool kits, plan how to make repairs, etc. in preparation for the upcoming competitions. But no construction or fabrication of any hardware, or development of any software, is allowed.
Quote:
<R22> During the “FIX-IT WINDOW” following each Regional Competition weekend: During this period, all teams (not just those teams attending a Regional Competition) may utilize one or two 5-hour FIX-IT-WINDOWS to manufacture SPARE, REPLACEMENT and UPGRADE PARTS and develop software for their ROBOT at their home facility (not at the competition site). The timing of these “FIX-IT WINDOWS” is at the discretion of the team, but all work must be completed between the opening of the Competition (at 8:30 am on the Thursday of the Competition weekend) and 8:30 am on the Thursday following the Competition weekend. At the conclusion of a regional competition event, teams may take a limited
amount of broken or malfunctioning COMPONENTS or MECHANISMS back to their home facility to make SPARE or REPLACEMENT PARTS. The purpose of this rule is to allow teams to make critical repairs to existing parts to enable them to compete in following events. The intent of this rule is not to have teams take their entire ROBOT back home and make large-scale revisions or upgrades to the ROBOT. Teams may manufacture and/or repair all the parts they want, but the amount of parts they can bring to the competition
event is limited (as specified in Rule <R31>).
__________________
Danny Diaz
Former Lead Technical Mentor, FRC 418
  #5   Spotlight this post!  
Unread 25-02-2007, 12:22
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: Converting Joystick controls over to switches

Quote:
Originally Posted by Japper View Post
I plan to use some SPDT toggle switches (with off positions).

If I connect these switches to the X & Y pins on the joystick ports (port 3 & port 4 on our OI) and the switched
values are either +5v, ground, how do I simulate (set up the hardware) so that the off condition
is read by the OI as it currently is by the joystick as a neutral condition (127)?


Does this require some sort of a weak pullup (or a trimmer pot) on the switch common to obtain this
neutral condition (value 127)?
First, I will note that if you search a bit on the forums here, you will find several different threads that will provide additional insight beyond this response.


When an analog input is open circuited, no current will flow into the pin, thus when the OI samples the input, it will read zero volts. Anything below about 500-600mV will be interpreted by the OI as a disconnected potentiometer and result in an analog value of 127. This is done so that a disconnected joystick is interpreted as a 'stopped' condition as opposed to 'full speed in reverse'.

A full scale reading is obtained when the potentiometer's wiper is at the +5V end of the range, and a zero reading is obtained when the wiper is at the other end of its travel, (i.e. 100K ohms of resistance between +5V and the analog input).


So to do what you want, connect the switch common to the analog input pin. Connect one of the switch positions to the +5V Aux pin, and then use something like a 82K or 91K resistor between the other switch pin and +5V Aux to repesent the other. You could try a 100K ohm resistor, but tolerance stack up may result in a voltage close to the trip point where the OI decides nothing is connected... and since you only need to represent something distictively less than 127, any value from about 68K on up should be adequate.

Alternately, you could just wire your switches to the switch inputs and be done with it. Ports 2 and 4 have 8 switch inputs, the extra four on each are the switch inputs from ports 1 and 3. If you are already using those inputs for something else, then using the analog inputs should work fine.
__________________
--Dave
  #6   Spotlight this post!  
Unread 27-02-2007, 09:27
Japper's Avatar
Japper Japper is offline
Registered User
FRC #3692 (RocknRobots)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Rutland Wisconsin
Posts: 147
Japper has a spectacular aura aboutJapper has a spectacular aura about
Re: Converting Joystick controls over to switches

I used the four analog inputs on port 4 as each of my four switches is replacing a joystick X or Y value. I hacked up a Radio Shack joytick "Y" cable to get all the port pins that I needed...

On the switches, I connected one pole to +5v and the other to Ground and then tied the switch common to the appropriate joystick port pin and the wiper of a 100K ohm trimmer pot (which is tied to +5v and ground through 1K ohm bleeder resitors.)

In the switch off position for each switch, I adjusted the trimmer pots to 2.5V and verified that switching to either of the two positions gives me +5 or 0V on the common.

This should work (in theory) but I do not have an OI to test it with right now...

Also, I tied the port 4 trigger switch pin to ground (this is not used on my port 3 or port 4 joysticks). Then I modified the code to read this port 4 trigger switch and if it is low to process code specifically for the control box or if it is high to process code specifically for the joysticks, that way I can use either without changing the code...

Hope it works...

Thanks for everyone's feedback on this issue !!!
  #7   Spotlight this post!  
Unread 27-02-2007, 09:50
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Converting Joystick controls over to switches

As for the legality, there's nothing stopping you from doing the whole shebang a few times for practice, then doing it again at the competition with your finely-honed mad skills of OI-upgrading. You can get around all the roadblocks first and find out the raw materials you need now rather than at the competition saying "oh crap, now I have to go a-running to radio shack. Does anyone know where a radio shack is?"

You may not be able to use the parts you make, but you can use your skills obtained from making the parts. I find that 90% of the time it takes to do anything for the first time is just stumbling about, looking for tools and parts.

Last edited by Bongle : 27-02-2007 at 10:21.
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
Converting .wmv Jay W. IT / Communications 6 04-05-2005 15:43
Using non joystick controls with Operator Interface (Hacking Various Controllers) Astronouth7303 Control System 58 02-02-2005 15:56
Converting CAD!? Tton 3D Animation and Competition 3 25-03-2003 17:29
Converting Files Hailfire Programming 9 28-12-2002 18:59
when is over, over. archiver 2001 2 23-06-2002 23:05


All times are GMT -5. The time now is 10:59.

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