Attila Sukosd's blog

Reusing an old game port steering wheel —

Introduction

Well, I have this bad habit of holding on to everything, so as you can imagine, I have quite a few old stuff lurking around. One of these was this good old thurstmaster formula 1 racing wheel, which served me well back in the days, but is now completely useless as modern PCs have no game ports.

Gameport? What is that?

The game port was a traditional connector for video game input devices back in the day, usually integrated on the sound card. Since USB has taken over for almost all devices out there, the game port has pretty much vanished from the game controller industry. This is indicated clearly by even Microsoft discontinuing game port support from Windows Vista.

It featured a number of analog (converted into digital with an ADC [analog digital converter on the sound card]) and digital signals, which were usually driven by potentiometers and switches. This allowed for 4 digital buttons, and 4 analog axis, which could be used in one joystick, or two with an appropriate splitter cable. (More at: http://en.wikipedia.org/wiki/Game_port)

Thrustmaster Formula 1 Steering Wheel

The steering wheel contains two buttons on the wheel itself, a stick shift with up and down (respectively two more buttons), and an accelerator and brake pedals. The steering wheel and the pedals are the analog signals, using the supplied Vcc and GND to return a voltage corresponding to the position of the wheel. After measuring the signals with a volt meter, the readings did not seem to vary a lot, so putting in an extra resistor on the two analog lines (acting as a voltage divider) allowed for some better measurements.

Arduino

Even though I have been doing some microcontroller programming the last couple of years, I have only recently discovered the Arduino. It seems like a hot topic nowadays, and it turns out it can be pretty useful in certain situations. The aim of the device is to provide everyone a relatively easy start into the microcontroller world, and yet it still manages to keep the flexibility to do advanced stuff too (such as in line assembly or direct register manipulations). It provides some very convenient libraries to prototype projects fast, without having to deal with very low level issues such as timers/interrupt service routines and such.  (More at: http://www.arduino.cc/)

The Project

To give a better idea on how the project is built up, here is an overview:

The first step in the process is that the joystick needs to be calibrated. Why? Because every analog joystick is a bit different, which means returns a different range of values for the same position. Moreover, due to mechanical wear, this calibration process needs to be redone every now and then too.

During the calibration process, the two analog axis need to be moved to their furthest possible locations in order to find out the minimum and maximum positions, as well as their center. The center is also important, because there are cases where the center is NOT in the middle of the maximum-minimum location, and in that case the joystick would constantly “turn left” (or right in the case of a steering wheel), or accelerate/brake without pressing the pedals.

So to return meaningful and uniform values from any kind of joystick, the decision was made that it will return the location of each axis in percentage, being 50% the neutral position. (The calculation on how the values were normalized can be found in the source code)

Once the values are read out of the joystick, a packet size of 7 bytes are sent over the serial line to the PC. These 7 bytes consist of the first byte indicating if the joystick has been calibrated or not, then the values for the X and Y axis, and the values for the four buttons. (This could be further optimized by modifying individual bits in a byte for both the calibration and the 4 buttons, but programming wise this was simpler and there aren’t any latency concerns to worry about)

On the PC side, a small C code is sitting and listening on the serial port for packets, once it receives them it does some post processing (inverting axis: I found out that apparently >50 is braking and < 50 is accelerating… would have thought the opposite…), and sends the received values to the PPJoy Virtual Joystick (http://ppjoy.blogspot.com/) over some IOCTLs.  PPJoy emulates a joystick device, which can then be used in any game which supports the standard joysticks.

And thats it! A few hours of hacking over the weekend, and the old steering wheel is back in action.

 

Sure I could have went out and bought a new USB steering wheel, or an existing game-port to USB  device, but where is the fun in that? The journey is just as important as the results right? ;)


Categorised as: Default


16 Comments

  1. [...] [Atiti] has a bad habit of hanging on to old things. Some people call this sort of behavior “hoarding”, but around here we understand his affliction. It turns out that in his collection of old computer peripherals, he located a Thrustmaster Formula 1 racing wheel he used back in the day. Analog racing wheels can cost a pretty penny nowadays, depending on what you buy, so he decided to see if he could hack this outdated controller to work with his new PC. [...]

  2. bob says:

    Does this provide for any force feedback? I have a MS sidewinder force feedback pro joystick. It’s awesome, until you use MS’s newest OS. How can I configure it to work on USB with the force feedback workings? I would gladly rebuild the entire joystick if need be.

    [Reply]

    admin Reply:

    Unfortunately no. Back in the days when this steering wheel was made, force feedback wasn’t very common, so it lacks all the hardware (motors+sensors+microcontroller)

    However, you might be able to build an adapter to yours like this guy:
    http://code.google.com/p/sw3dprousb/

    ;)

    [Reply]

    Niclas Reply:

    Impressive work!
    I’m also interested in re-using my old force feedback wheel. Do you think this (http://code.google.com/p/sw3dprousb) project is applicable on a arduino chip?
    Best regards,

    Niclas

    [Reply]

  3. [...] [Atiti] has a bad habit of hanging on to old things. Some people call this sort of behavior “hoarding”, but around here we understand his affliction. It turns out that in his collection of old computer peripherals, he located a Thrustmaster Formula 1 racing wheel he used back in the day. Analog racing wheels can cost a pretty penny nowadays, depending on what you buy, so he decided to see if he could hack this outdated controller to work with his new PC. [...]

  4. Frederic says:

    Nice hack!!!
    i was wondering how to convert a hais controller for dreamcast(basically 1 joystick and 8 buttons) to usb for PC?

    Tx
    Fred

    [Reply]

    admin Reply:

    Hi Fred,

    Have a look at this: http://mc.pp.se/dc/controller.html
    Or this: http://mc.pp.se/dc/dchid.html
    Or this: http://code.lardcave.net/entries/2010/10/19/032116/

    Apparently it uses a serial transmission, so you should be able to process that with any microcontroller and send it over to the PC over USB.

    Hope it helps :)

    [Reply]

  5. Silas says:

    Cool project.

    I just got a wheel and pedals from the thrifts store for pretty cheap. Are you releasing your source code?

    [Reply]

    admin Reply:

    Thanks :)

    Sure, I can upload the code. It’s nothing fancy, just a quick hack :)

    [Reply]

    Silas Reply:

    That would be great.

    I am mostly looking at code to talk with PPJoy.

    Thanks.

    [Reply]

  6. Gerjan says:

    I found this article because I was Googling for a way to use old gameport joysticks with Windows 7.
    The thing is, I’m a flightsimmer and I have an old, but beautiful stick and throttle setup (Suncom F-15E Talon) that uses the gameport. I would very, very much like to use it in Windows 7 with new flightsims.
    I even have an Arduino that I use for other purposes, but I’m not technical enough to figure out what it is you did with the wires and what code you used on the arduino and on the PC.

    I know I’m probably asking for a lot, but I’d love to find out how exactly you hooked up the gameport to the arduino and use your code to get my old joystick up and running again.
    Could you explain this to me or expand this article so we can all find out how to do this? I know you’d make a lot of flightsimmers really happy if you did.

    Thanks in advance,

    Gerjan

    [Reply]

  7. fernando says:

    Hi! I had the same nostalic situation! I found my thrustmaster steering wheel with 4 buttos and 3 axis (steering, throttle and a pair of sensitive side-steer levers -as f1 transmission-).
    I also realized the lack of gameport or MIDI connectors on my pc, only Parallel or USB.
    BUT I HAVE NOT ANY STUDIES OF ELECTRONICS OR PROGRAMMING. I only have some idea of making boards with resistors, and such other simple components. I’m an excellent tutorial follower! haha
    I have read about a guy that made an adapter for another model of steering wheel, just joining cables ( http://www2.burg-halle.de/~schwenke/parport.html ) but i dont know if it will work.

    So, I wonder: Is there any chance you can explain a for-dummy way to do something like that, or if the page I found is also compatible for my situation.

    I appreciate your attention

    Fernando
    Argentina

    [Reply]

  8. Michele says:

    Dude, your work is great!

    It would be even greater to have some schema and the code.
    I’d like to do something like that for my Microsoft Wheel.
    But I don’t know where to start, I don’t know how to connect the gameport to the arduino and the C code for arduino itself.

    I hope :)

    [Reply]

  9. Laci says:

    Szia, kérdezhetek magyarul is?
    Elég rossz az angolom, és nem teljesen értem a fentebb leírtakat. Nekem egy Microsoft Sidewinder Force Feedback Wheel (gameport) -hoz kellene valamilyen megoldás, hogy windows 7 vagy XP alatt is tudjam használni. Van egy Arduino UNO-m is, de nem értek a programozásához. Ha Arduinoval meg lehet oldani, akkor honnan tudnék szerezni hozzá source code-t, hogy működhessen? Működhet a force feedback is? Ha bármilyen működő megoldás létezik, akkor egy részletes leírást szeretnék. Egy beteg barátomnak szeretném elkészíteni meglepetésnek, mert nincs pénze kormányt vásárolni, ez a kormány viszont teljesen új állapotú, és csak áll a sarokban :) Köszönöm, ha tudsz segíteni!

    Üdv: Laci

    [Reply]

  10. Gustavo says:

    hello, would you mind to share your code and pins of arduino? i have an old thrustmaster F1 gameport controller and my son wants to play with it.

    thanks in advance,

    Gustavo

    [Reply]

  11. Hi there, I check your new stuff like every week. Your story-telling style is awesome, keep it up!

    [Reply]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>