News:

Forum Updated! 

Main Menu

Analogue twinsticks

Started by NFG, November 17, 2008, 02:40:31 PM

Previous topic - Next topic

NFG

Recently the only game I'm playing is Geometry Wars 2: Retro Evolved and I'm getting good at playing with the little analogue sticks on the 360 controller.

It got me thinking: there's probably a good way to create analogue twinsticks, a la Robotron:


but with analogue precision.  In fact, I thought, there's probably a good way to link analogue controls to the existing digital sticks, so the same device could work for both kinds of games.

So I started looking into it.  I still haven't solved the problem, but here's where I've gotten so far...

The 360 analogue sticks use 0-10k Ohm potentiometres (give or take: the actual measured resistance was 0.6k - 11k, but assuming a tolerance of 10%, this is probably just fine with 0-10k), two for each stick, just like the GameCube and Playstation.

Approximate movement is 80 degrees, definitely falls short of 90 degrees as it never passes the corners during normal use.


[To be continued shortly...]

NFG

So here was idea #1:  Attach an arm with a fulcrum to the bottom of the joystick, with the other end connected to the potentiometer.  I reckon this would actually work, as long as the length of the arm and the fulcum point was properly worked out.


At first I was worried about the corners: There'd be a subtle difference between UP, UP RIGHT and UP LEFT.  But then I remembered the 360 analogue sticks were ROUND, so they never got anywhere near the corners anyway.

The problem with this design is twofold:
1. Mounting the fulcrum and the potentiometer would be troublesome
2. the bottom of the stick is not always flat.  My treasured optical Sanwas are quite bumpy...

The end of the fork is not shown quite accurately, the tines would be longer to accomodate left/right movement.  The arm cannot be firmly fixed to the base of the stick, as the sticks rotate.

My next thought, and the one I'm currently favouring, is a linear potentiometer, instead of rotary.  If the mechanism was attached as shown, no complicated mechanisms would be required, and the only thing I'd have to ensure was that the length of the pot was the same as the base of the joystick shaft's throw (in this case, 2cm).  Mounting the pot so it didn't get thrown around or flex the arm is not a concern at this time, so don't worry about how the image appears to be completely batshit insane.  =)


At this point you're probably wondering "But NFG, why not just use an analogue stick?  Are you fucking mental?"

To which I reply: Shut up, that's why.

So that's where I am currently.  Any suggestions?

kendrick

QuoteAt this point you're probably wondering "But NFG, why not just use an analogue stick?  Are you fucking mental?"

You stated at the beginning that the end goal was to have a stick that performed both analogue and digital functions at the same time, right? Since you're starting with Sega hardware, why not do hall-effect sensors scavenged from the Saturn mission stick? No additional levers to fail, and it doesn't get in the way of the digital switches if you have an additional plate perpendicular to the stick where the magnets and/or proximity reflectors would be placed.

NFG

Hall Effect would have been my preferred method, in fact, but for one small problem: I don't understand them.  They operate on wickedly small voltages and require some non-trivial amplification to work in, say, a 5V environment.  I cannot easily re-use a Saturn's mechanism 'cause, even if it worked, the amps and logic are Saturn-specific, and I want general purpose (While the stick is in a Saturn shell, it has a NeoGeo output and I use adaptors for the systems I play on).

So Hall Effect would require a lot of work to implement, far more than a few mechanical linkages.

Of course I'm happy to be proven wrong.  Please do so!

kendrick

You'd have to do some funny A-D-A conversion, but it's easily done. I don't know what's available down under, but here in the States a company called Allegro sells what they call linear hall effect sensors that take in 5 volts and output 2.5 volts at a neutral state. As you bring one pole of the magnet closer, the voltage increases up to five. Bring the other side of the magnet close, and voltage drops slowly to zero. This is easily translated into the linear sweep of a pot. Here's a link:

http://www.allegromicro.com/en/Products/Categories/Sensors/linear.asp

Most hall effect devices are actually switches, rather than linear whatsits. So they close or open when a magnet is close, like a solid-state reed switch.

NFG

I've actually been to that site before, but I didn't pay much attention to the Hall Effect units since they change output voltage, not resistance, and it was too much effort to work out the Vdrop for the pots I had...

Guess I'll give it a modicum of thought.

As an aside, the resistance of the xbox pots seems to be happily linear, the halfway point is about 6k Ohms, roughly halfway between 0.6k and 11k.  SHould make finding a replacement easier.

NFG

Working on this still...  I've picked up two sets of analogue arcade sticks to play with.  The first set was an N64 unit which used the same encoder wheels seen on the N64 pads (I had hoped they'd use some more robust potentiometers, oops) and were useless.  The new pair is from a Naomi set I think, with a delicious all-metal construction that'll probably last longer than I will.


The problem now is the potentiometers themselves...


There's roughly 60 degrees movement on the Xbox 360 analogue pots, where these arcade sticks have about 120 degrees. 

The 360 pad resistance ranges from about 2k Ohm to 3k Ohm, and the arcade stick ranges from about 2.6k to 4.6k Ohm.

The 360 pad uses a 10k Ohm pot, these sticks use 5k Ohm.

So I'm considering my options.  The sticks use a TOCOS TP9-series part which I might be able to replace...  Or I'm thinking I might just offset the gearing a bit so the starting point is 2k Ohm, and restrict the travel to half the current distance so instead of 2k Ohm from min to max it's only 1k Ohm, which would duplicate the range of the 360 pads.

These sticks are beautiful.  More things should be made of metal.  =)

NFG

OK, so just to see what'd happen, I hooked the sticks directly up to the xbox pad.  Had to remove the existing pots (and kind of made a mess of it, oops) and wired in the new sticks.  My crazy hope was that the 360 pad would automatically cope with the new pots and just work, but it wasn't to be.

Basically, it's exactly what I feared: the shift in range from 2.6-4.6 (instead of 2-3) kOhms means that one direction on each axis works fully, but the other does not go all the way.  When playing Geometry wars (the whole reason for this ridiculous project) up and left are fine, right and down are slow. 

Oh, and I accidentally reversed the GND and Vcc to the pots, so everything's backwards.  I should fix that.  =D

NeWmAn

Ok, maybe a stupid suggestion but...
Your Xbox pad has a 2K fixed value + 1K delta, so why not change the Naomi pot to have 1K as a max value then wire a 2K resistor in series with the Joystick's potentiometer?
To change the value from 4.6 K to ~ 1k a 1200 Ohm resistor in parallel to the potentiometer should suffice, as it is (4.6*1.2)/(4.6+1.2) =0.95


NFG

It's a sad fact that I am not really good at a lot of real, basic electronics.  While I totally understand what you just said, I don't have enough 'core' knowledge in this sort of thing to have thought of that out of the blue...

So thanks for the tip.  I'll mull that over until I think it's MY idea, and give it a go.  =D

NFG

Picked up some 1k resistors, which should give me 1.5-3.5 range on each axis.  That should result in a stick that maxes out before the full throw is reached in any direction, which is fine.  Since I only really want to use this for Geometry Wars I'll be OK, as long as the pad nor game tries to auto-range the stick based on the max. 

Thanks for the suggestion, newman.  Fingers crossed... 

undamned

RISE FROM YOUR GRAVE!!! :D

So, I thought of this thread today because I've been learning a bit about pad hacking lately and if you would be at all interested, I found a way to replace the analog sticks w/ 8 way digital ones.  Stinks losing the analog accuracy, but its nice to be able to control an analog stick input w/ a digital stick input.

If there is any interest in this, I'll put together a proper blog entry.
-ud
"Don't need to ask my name to figure out how cool I am."

NFG

I reckon that'd be an interesting read indeed.  Do write it up.

I imagine what you're doing is no different than the digital->analogue PC-style mods I've seen.  A couple of resistors and you're away.

NFG

While working on this project I ran into a tiny snag while playing the rather excellent PacMan Championship Edition DX.

Basically PacMan would move at half speed if there are no analogue trigger inputs at all.  I had removed 'em and made external connections for future use.

Well, that future has arrived!  I had to choose between putting the pots back or making a dongle that'd give the pad some inputs.  Here's that dongle:


This immediately cured my problem: the pad gets analogue trigger input, and the game runs full speed. 

NFG

Here's another shot of the 360 pad mod I made:


The pad's made a significant sacrifice towards my pursuit of awesome, as you can see.  The DB-15 handles all the digital inputs, the DB-9 does all the analogue ones.  Normally the pad is fine without any analogue inputs, but PacMan just freaks out when there's no input from the shoulders.

So I attached the shoulders.  Sort of.  Dodgy, but functional!  =D

skforty

Not to resurrect an older thread for no reason, but just wanted to say a couple things.  I recently had a similiar challenge when i adapted a NAOMI monkey ball arcade controller to work with a gamecube controller.  The differences in pots were a pain so i can commiserate.

Also, if you didnt want to hook back up the analog trigges, you could just put 2 x resistors there so you dont leave 0 voltage, which is why they think they are engaged (apologies if you already knew that).  For example...

http://www.slagcoin.com/joystick/pcb_wiring.html

Sorhp

I know I'm dragging up a really old thread, but geometry wars 3 on the pc recently came out, and I want to build a stick with 2 naomi analog joysticks wired up to an Xbox 360 pad, so Im hoping for a recap on this subject Lawrence, and maybe you can talk about some of your experience with geometry wars and your setup??? :)

Do the 1k resistors work out ok?

Thank you!
1st post (and I'm dragging up a really old thread , lol sorry guys)

NFG

I haven't done anything with this since I first started talking about it, though I have started looking at the problem again since GW3 came out.  I don't think it's a very good game, TBH (my review) but it would be great to have these sticks working anyway...

Apparently I bought the resistors like four years ago?  Geez I should do something about that.  =/

Sorhp

#18
Dude, let's make this happen! I want to multiboot every twin stick shooter I can, I just bought a panel from Japan, it's on its way, should be here soon, then I want to hook the stick in to an Xbox 360 pad

I agree with your review on gw3, gw2 will probably always be my favorite. Truth be told, I have a robotron cabinet, it's gutted, I bought it that way. I plan on dropping in an Xbox 360 and having all gw's and any other twin stick shooter in it I can grab, then later drop a computer in it to have anything else I may want. But first off, I need a little help getting the sticks going, it won't be anything without them

Thank you for any thoughts or build alongs!

Sorhp

From a friend on klov:

Quote:
Originally Posted by sorhp
So I bought the panel, waiting on it to start its way to me... In the mean time, I'm trying to learn what I need to do to wire in the joys to an xbox360 controller , there's been some discussion on using resistors for the pots. Can you please help enlighten me on how I may accomplish this?

Thank you
Ben
the NAOMI analog joysticks use 2 5K pots, one for the x-axis an 1 for the y-axis.

the Xbox 360 controllers also use 2 pots for each analog stick, one for the x-axis and 1 for the y-axis... I'm unsure of the pot value you'll need to measure that to see how well the naomi sticks match up.

the way the sticks work in both cases is that they attach a voltage source to one end of the pot and a ground source to the other end of the pot and then the sweeper arm of the pot will output a voltage somewhere between 0 and whatever the high end voltage was set at (it doesn't matter to the pot).

Assuming you set the high end at 5V if the stick is sitting in the center both outputs should (theoretically) be somewhere around 2.5V, then when you move it all the way left it might read 0 and if you move it all the way right it might read 5V.

this doesn't necessarily work out so perfect you usually only achieve 70 or 80% of the voltage range and neutral isn't always right in the middle like that. what you need to do is measure the voltage outputs of the Xbox 360 sticks at neutral and at the maximum and minimum ranges and then calibrate the NAOMI sticks so that neutral is in the same place (there might be a set screw on the gear setup for this)... you can also calibrate it electronically by adding resistors to one end of the pot or the other, essentially shifting the voltage range. if you wanted to get fancy you could add another pot instead of a resistor and that would let you dial in the voltage precisely.

I didn't use my sticks on a 360 controller. mine is in an actual NAOMI setup so calibration is done by the hardware... this is all just based on my electronics knowledge.

Sorhp

My Naomi Sticks have arrived, (took long enough)  I took apart my 360 wired pad tonight and hope to get a reading on the pots quickly, wish me luck!

NFG


Sorhp

it looks like my pots read really far off on the xbox 360 controller from the pots on the Naomi joysticks... If I want the naomi sticks to work on the 360 pads what pots do I need to get to put in the sticks?

Sorhp

#23
... or should I just place some resistors in line with the existing pots on the naomi sticks and call it good, what watt resistors did you get? I'm thinking maybe 1/4 watt?.... Lawrence would you mind doing the project with me at the same time so we can both get this right?

Sorhp

So far, I have removed the pots from the 360 pad (no easy feat)
Then wired up the pot pads to a terminal connector.

Started wiring up my Naomi sticks and placing a 1k 1/4 watt resistor on each wire (not certain if I should be placing a resistor on each wire or just the power wire, or?)

Have not tested yet

NFG

At some point you're going to make me haul it out and see what it does, aren't you?  ;)

I wonder if it'd be any easier or more compatible to use 3rd party pads.  They might use different pots than the official ones.

Sorhp

I had a wired official controller that I took apart, and I got a great deal on 2 more on eBay a few days ago. I destroyed the pots on the one I took apart. But I saved the pcb (I think) I'll put it all together tonight and test things out. If this doesn't work, I'm game for finding a third party pad, just don't want to buy too many different ones to keep the total cost down :)

And yes... I'm hoping you will drag yours out to see what kind of result you get :)

Sorhp

had a little time this morning to test it out... I have the right stick working perfectly, the control is correct.  the left stick ... only the y axis is working.

the x axis for some reason is pulling from the z axis , when I go into the settings in windows, the x axis immediately shifts to the left, and the raw data shows 0... but when I press the right analog trigger the z axis moves normally, and the x axis moves all the way to the right... so strange, I checked all of my work, I dont have any solder splashes that I can see. there is one trace that looks like it may have possibly had a Surface mounted Diode, but it's very hard to tell, and they may have removed it out in design, but I have no way of knowing until I get another controller

Sorhp

grabbed another controller from a pawn shop today and tried again, this time i wasnt so rough on this one :) happy to report that it works... now if only I was a better Geometry Wars player  :P

NFG

It worked!?  Wow. =D

How'd you wire it up exactly?

Sorhp

I placed a 1/4 watt 1k resistor in line with each wire going from the Xbox 360 pad to the pots on the joysticks. As predicted, the full throw of the pots doesn't push the full power limit of the threshold, which is not necessary for geometry wars or most twin stick shooters .


Sorhp

Apparently it doesn't work with the xbox360, I believe I may need to use the original pots or find some pots I can drop in... Really frustrating, I have now destroyed 2 wired xbox360 controllers experimenting... Lesson learned: use a good de soldering technique and flux when removing the pots .

What value pots do I need to use again? 5k or 10 k?

Sorhp


I ordered some 10k pots from China, they'll be here soon for me to try in the Naomi Joys, I just hope theyre the correct pots :) (size wise)

NFG

I've started working on this project again, because Nex Machina is amazing.  It was sort of like starting over because (holy shit) it's been eight years since I did most of my hacking at it before...

Here's what I've done this time, using a Hori 360 pad. 

1. Wired it up direct, each pot a direct replacement for one in the pad.  It works, but movement range is restricted to about 50% of the original.  It doesn't go more than two thirds of the way to max on any axis.  As far as Nex Machina is concerned, this means I can shoot in all directions, but the player moves very slowly.  It is therefore critical that full range be restored.

2. Tried the 1k resistors, which made it much worse.  Movement was limited to little more than the deadzone.

3. The Hori pots run on 1.5V, so I shoved 5V from the USB cable into it instead.  This maxed it out, as you can imagine, but the full stick range was subsequently unable to move it very far from the diagonal corner it'd wedged itself into.  ;)

The issue is that the Sega sticks seem to use a linear 0-10k range for the full motion of the pot, but the Hori is limited to about 60 degrees move movement around the axis, but still goes 0-10k.

So the Sega stick gets ~2.5-5k range, far less than the Hori pad requires.

Before I go all DIY and create a whole new USB interface, I'm hoping to figure out a way to connect the Sega sticks to the Hori pad, thereby preserving both PC and X360 use.

Anyone else get this working in the last decade?  ;)

Sorhp

I bought the pots but never installed them, I'll dive back in soon

What I have done is get the analog Arcade naomi Joysticks and put the xbox 360 pots in sequence with the existing pots on the naomi sticks, it works, but theres issues I don't know exactly how to describe, mostly in the manner of actuation without ever putting the joystick into motion... Im locked in to seeing the project through, just NEED MORE TIME TO MYSELF! LOL

RDC

#35
Do you actually need the Analog function? As in there are some parts in the game where you actually have to press the stick only part way to do this or that?

If not, you can just wire the switches of the Dual Stick up to the POTs of whatever controller you're wanting to use (6 wires) and off you can go. It will only work Digital, aka full blast, in whatever direction the stick is pressed, but if the Analog feature isn't really necessary, that's one solution, albeit not really an Analog twinstick then.

If the Analog must be kept, I'm sure we can figure out something.

Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Sorhp

Unfortunately here we need to retain the analog function.  The correct pot values need to be used if we omit the original pots

NFG

Well the new sticks are analogue too, that's the point.  If I just wanted digital directions I'd use the d-pad.  ;)

But yeah, in addition to varying speeds, you get more than 8 directions to move and shoot too.  I suppose it might be enough, if I tried it, but I'd like to be able to shoot NNE as well as NE, you know?

RDC

If all 3 leads of the POT are wired up, then the value of the POT is really pointless. They are used as voltage dividers in that case, so 1k, 5k, 10k or 100k, they will all work the exact same there. Might not sound right, but you can take any power source you like, 5v or less, and wire one outside lead of the POT to positive, the other outside lead to negative, and set them all to the same position and you'll get the same voltage out of the center lead on every one of them. The current will be different, but that's not how the controllers read the position, they read the voltage. That's the same no matter the value of them, because they are used as voltage dividers and the value is always balanced out no matter the overall value.

OK, so the replacement sticks are a POT type as well? Then the issue is they aren't moving far enough? thus not outputting a high enough voltage.

What hardware are you trying to make work with what there Lawrence? If I can get a hold of it here I'll see what's going on. I know that would be easy enough to correct with a PIC and DAC and some code, but I'd like to see the issue first hand here and mess with some and look for another solution first if I can.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

NFG

Yeah, the issue is both old and new pots are 10k, and both are using approximately 60 degrees of arc, but one does 0-10k, and the other a mere 2.5-5k.  The pad I'm trying to apply the new pots to is a Hori Pad EX Turbo.



Here's the pot inside the pad:



and here's a sketch of the gearing for the Sega stick: