Parallax Forums
  HomeLog InRegisterCommunity CalendarSearch the ForumHelp
   
Parallax Forums > Public Forums > BASIC Stamp > Dual-Axis analog Joystick Help.  Forum Quick Jump
 
New Topic Post Reply Printable Version
[ << Previous Thread | Next Thread >> ] | Show Newest Post First ]

TheComputerCrew
TheFritch

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2009
Total Posts : 6
 
   Posted 11/6/2009 3:47 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
I am having trouble building a stable, high-resolution RC-Time circuit with this setup.






The PCB is out of an Xbox 360 wireless controller. The joystick has three solder points for each axis which I am assuming is similar to a dial potentiometer. I want to use this controller to power my robotics experiments. The wireless is proprietary and thus far, un-hackable. My goal here is to put together my own board with the original Xbox components (joysticks, tact switches, triggers, etc.) and have it fit back into the original controller case. Any help on utilizing these joysticks and other on-board components would be greatly appreciated.







This is the schematic









The joystick is obviously spring auto return to center. When I tilt the joystick all the "left" I get an rc-time of 35000. Back at center is 61000. All the way "right" is just below 35000. How could I possible utilize these readings. WHat am I missing here? Thank in advance to all!

Post Edited (TheComputerCrew) : 11/7/2009 12:07:05 AM GMT


Image Attachment :
Image Preview
IMG_1.jpg
  321KB (image/jpeg)
This image has been viewed 114 time(s).
Image Attachment :
Image Preview
rctimeschematic.jpg
  45KB (image/jpeg)
This image has been viewed 115 time(s).
Image Attachment :
Image Preview
IMG_1260.jpg
  373KB (image/jpeg)
This image has been viewed 114 time(s).
Back to Top
 

Franklin
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2005
Total Posts : 2631
 
   Posted 11/6/2009 8:12 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
Are you sure they are not just switches under there? That's what most game joysticks are.


- Stephen

Back to Top
 

Mikerocontroller
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 176
 
   Posted 11/7/2009 12:36 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
You should remove the joystick from the original circuit board. All those other components might be affecting your readings. Also be aware that your RCTIME variable could be overflowing. I have a similar joystick that I hacked from a Logitech gamepad controller. It has two 10K ohm potentiometers (X axis and Y axis) and a tactile switch (Z axis). I'm going to test mine this weekend and see what happens.
Back to Top
 

TheComputerCrew
TheFritch

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2009
Total Posts : 6
 
   Posted 11/7/2009 6:29 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
franklin said...
Are you sure they are not just switches under there? That's what most game joysticks are.


Yes sir, I am certain. It has one pot per axis and a z-axis tact switch. The black "box" on each axis rotates as you move the joystick. Also there are three solder points per pot.

Mikerocontroller said...
You should remove the joystick from the original circuit board. All those other components might be affecting your readings.


Didn't even cross my mind, thank you.

Mikerocontroller said...
Also be aware that your RCTIME variable could be overflowing


Forgive my "newbieness", but what is RCTIME overflow and how can I correct this? roll
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13553
 
   Posted 11/7/2009 7:57 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
It takes a certain amount of time for the pot to discharge the capacitor to where the Stamp pin will see its input change from high to low. The Stamp counts clock pulses in a 16 bit counter, once every 2us using a BS2, until this happens and that's what's stored in the variable in the RCTIME statement. If the pot resistance is "too high" or the capacitor value is "too high", the discharge will take too long and the count will pass 65535 pulses (2 to the 16th) and the counter will start over from zero. That's an overflow.

You fix this by not letting it happen by choosing a proper capacitor value. The Stamp Manual chapter on the RCTIME statement gives the formulas involved. You may need a small fixed resistor in series with the pot so that the total resistance has a minimum other than zero.

Post Edited (Mike Green) : 11/7/2009 4:03:02 PM GMT

Back to Top
 

TheComputerCrew
TheFritch

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2009
Total Posts : 6
 
   Posted 11/7/2009 8:51 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Mike Green said...
The Stamp Manual chapter on the RCTIME statement gives the formulas involved.


An invaluable resource. Thank you for your time, sir.
Back to Top
 

Mikerocontroller
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 176
 
   Posted 11/8/2009 10:37 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
Using your basic schematic with a 10k ohm variable resistor and 4.7 uf capacitor I got the following readings: MIN: 1 CENTER: 10200 MAX:23000. This was done on a Basic Stamp HomeWork Board. This board has built-in 220 ohm resistors on each I/O pin so I was able to eliminate the series resistor. Like Mike said, you need some series resistance because the variable resistor can short the Stamp pin to ground.
Back to Top
 

skylight
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Mar 2007
Total Posts : 389
 
   Posted 11/9/2009 12:06 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
The 220 ohm IS in series the pin won't short to GND
Back to Top
 

Mikerocontroller
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Apr 2008
Total Posts : 176
 
   Posted 11/9/2009 12:27 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
What I meant to emphasize is that the 220 ohm resistor is for protection of the Stamp. I thought some newcomers may think it is a trimmer resistor. I was also pointing out that non-HomeWork Boards don't have built-in protection resistors. Sorry for the confusion.
Back to Top
 

TheComputerCrew
TheFritch

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2009
Total Posts : 6
 
   Posted 11/11/2009 7:02 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Update.

First, thanks for everyone's responses.


Next, I took Mikerocontroller's advice from post #3 and removed the joystick from the board. This was a success due to the fact that the PCB's circuitry was adulterating my pot readings.

After removing the joystick, a simple RCTIME circuit taken straight from the "What's a Microcontroller" text, page 151, did the trick. The only modifications to the circuit from the text were the substitution of the joystick for the rotating pot (obviously), and the substitution of a 100µf capacitor. This capacitor was able to give me readings (after scaling and offset) from 506 to 998. The readings before being modified by code were 17 and 632.

Also, I utilized the z-axis tact switch that is built into the lower portion of the xbox360 joystick. It worked very well.

Although very rudimentary and simple, this proves that I can utilize all the input devices off of this circuit board and integrate them onto a custom PCB that will fit back into the xbox360 controller. This will preserve the function of every button and switch as well as provide an implementation of this controller into robotics control. It would be much simpler to use the existing hardware, but, unfortunately, it doesn't look as though Microsoft's wireless encryption will be decoded anytime soon.

Thanks all!!



Post Edited (TheComputerCrew) : 11/11/2009 3:08:44 PM GMT


Image Attachment :
Image Preview
xboxcontrolledservo.jpg
  363KB (image/jpeg)
This image has been viewed 23 time(s).
Image Attachment :
Image Preview
xboxcontrolledservo2.jpg
  437KB (image/jpeg)
This image has been viewed 23 time(s).
Back to Top
 
[ << Previous Thread | Next Thread >> ]
New Topic Post Reply Printable Version
 
Forum Information
Currently it is Friday, November 20, 2009 8:36 PM (GMT -8)
There are a total of 393,723 posts in 55,520 threads.
In the last 3 days there were 84 new threads and 703 reply posts. View Active Threads
Who's Online
This forum has 17685 registered members. Please welcome our newest member, Steve H.
57 Guest(s), 8 Registered Member(s) are currently online.  Details
Peter Jakacki, Mike Green, Ken Gracey (Parallax), aconz2, Cluso99, Little-endian, Rich_W8VK, Franklin