Go to Post We try to limit ourselves only by physics. As the first person on the planet to communicate over a quantum encrypted AOL instant messenger session, I try to ignore those limits as well. - EricVanWyk [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 15-02-2008, 05:09
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
Simulating a potentiometer

Ok, this might sound like a dumb question but how can I simulate a potentiometer with a switch? (sorry it is late and I am not thinking clearly but I do want to do this and without using a digital pot...)

I want to make a simple control test box that does not require any changes to the software in which I can be able to plug in a SPDT switch into the y port and have the OI read either 0, 127, or 255, unfortunately, I will not have access to the OI until after I build this... so I am looking for ideas now before I arrive on site to try this test box.

I am using a 2 position switch with (SPDT with off in the middle) and I took a 50 k ohm resistor and connected it between the switch common (port Y signal) and the wiper (+5 volts) so that in the off position it should read like a mid-range 100 k ohm pot (giving me a 127, I hope). In one position it is connected to the +5 volts wiper which should read as a 255, but with the 50 K ohm in place, I will only get either a 255 or a 127...

I was contemplating not putting the 50 K ohm in there at all and tying one wiper to +5v and the other to ground but because I don't know how the OI is internally wired to the Y port line, I am not sure if in this configuration whether the P_Y port will read the open switch like a mid range pot at 127....

Any ideas on how to set this switch up so that I can read a 0, 127, & 255?


Thanks
Attached Images
File Type: bmp joystick switch.bmp (14.2 KB, 52 views)
  #2   Spotlight this post!  
Unread 15-02-2008, 07:48
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,798
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: Simulating a potentiometer

Japper,
There is an equivalent input schematic on the IFI website. The OI is specifically designed for the joysticks to have one side tied to the +5 volt supply and a series resistance. In conjunction with the internal resistance, the joystick forms a voltage divider. When the port is pulled to near ground, the OI assumes that the joystick has been disconnected and disables the PWM being addressed by that port. Connecting a 50K resistor is perfectly acceptable to simulate a joystick at the rest position. Likewise a 100K resistor should simulate one extreme on the joystick. We use an SP11T switch with 9.1K resistors across each position, connected to one of the ports to give us 11 operator selected auto modes.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.

Last edited by Al Skierkiewicz : 18-02-2008 at 07:54.
  #3   Spotlight this post!  
Unread 15-02-2008, 19:51
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: Simulating a potentiometer

Thanks Al..

How would that be wired?


Are you suggesting that the switch common would be tied to the signal line going to p_Y and then one wiper would be tied to a 50 K resistor to + 5 volts and the other wiper tied to a 100 K resistor to + 5 volts

---- Or ---

that the switch common would be tied to the signal line going to p_Y and a 50 K resistor to +5v then one wiper would be tied to a 100 K resistor to + 5 volts and the other wiper tied diredctly to + 5 volts ?

I tried to draw it in the attached schematic.

Thanks
Attached Images
File Type: bmp which configuration.bmp (46.9 KB, 46 views)
  #4   Spotlight this post!  
Unread 16-02-2008, 14:16
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Simulating a potentiometer

This may be too late to help.
If all you are looking to do is get three numeric values. According to the documentation no connection gives a 127. If it's a three position switch with off in the middle Wire the common to the Analog input pin. wire a 100K to the +5Vaux and to one side of the switch and then wire a small value resistor to the other side ( I calculated a value less than 100 ohms and I think the input should be able to be directly connected to +5v but I wouldn't tell you to do that until I had actually tried it myself. I'd try a 1K just to be safe and see what values you get.) also connected to +5Vaux.

So switched to the 100K you should get close to zero
switched off you take advantage of the system thinking the joystick is disconnected and get 127
and switched to the low value resistor it should give a 254.


I'll try shorting the input and see if that blows anything and let you know.

Steve

OK tried the spark test... no sparks and the port still operates normally. I thought it would. must be a high impedance input only reading voltage.
Attached Thumbnails
Click image for larger version

Name:	potentiometer_sim.jpg
Views:	51
Size:	29.6 KB
ID:	6290  

Last edited by Steve_Alaniz : 16-02-2008 at 14:57. Reason: Additions
  #5   Spotlight this post!  
Unread 17-02-2008, 08:17
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: Simulating a potentiometer

Yes this work great Steve-

Thanks!
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
Potentiometer Problems Nicole_Ypes Electrical 7 08-02-2007 18:59
Simulating Motion with Physical Dynamics Madison SolidWorks 5 08-02-2007 12:19
Potentiometer fezkazi Electrical 3 24-01-2007 13:29
Simulating autonomous mode - i need help!! :( itay_ms Programming 5 21-01-2007 11:28
Potentiometer Joshua May Technical Discussion 8 22-05-2004 19:51


All times are GMT -5. The time now is 21:05.

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