The 128 Button, 6 Axis, 17 Slider, 4 POV Hat Switch Joystick Controller

stick

[Paul Stoffregen], creator of the Teensy series of dev boards, previously implemented a six-axis joystick for Teensyduino, the Arduino library for the Teensy. He had originally tried 8 axes, but a few problems cropped up, deadlines approached, and he left it as is. A few recent projects gave him some insight into how to implement a joystick with more than six axes as a USB HID device, so he started looking at how to read an improbable amount of pots and buttons for a USB joystick.

So far, the biggest problem is figuring out what software can actually use an HID joystick with this many controls. The answer to that question is none. The Linux-based jstest-gtk is able to read 6+17 pots, the four hat switches, but only 64 of the 128 buttons. A user on the Teensy forums, [Pointy], has been working on his own joystick test app that works on Linux Windows, but testing the joystick on Windows is an exercise in futility for reasons no one can figure out.

As for why anyone would want a six-axis, 17-slider, 128-button joystick, think about this: with this much control, it would be relatively simple to build the MIDI controller to end all MIDI controllers, or a cockpit simulator for everything from a C172, 737, to a Kerbal interplanetary cruiser. That’s an impressive amount of control, and all from a $20 Teensy dev board.

Further testing of this Teensy joystick is desperately needed, so if you’re able to help out drop a note in the forum thread.

Comments

  1. >Pointy], has been working on his own joystick test app that works on Linux

    The link seems to point to a post regarding a .NET joystick test app for Windows 7 and doesn’t telle anything about Linux, kinda contradicting the post.
    Am I missing something ?

  2. NATO says:

    Where is the picture of the joystick? I see the teensy board configured to read a bunch of pots and buttons that are placed in a row but the joystick isn’t there?? Or is someone implying that a flat board with a bunch of pots and buttons = joystick?

    Joystick interfaces used to be very interesting for data logging. In the 80’s, we didn’t have an affordable ADC input peripheral that was meant for data logging in your average XT PC, but we did have joystick cards (which were usually incorporated in to sound cards such as the original Sound Blaster series of cards).

    This doesn’t look like a joystick, it looks like a USB version of the joystick data loggers of the 80’s. I hereby rename this project “joystick interface data logger”

  3. Tig3rch3n says:

    Would it work with something like Ableton as kind of Midi Controller?

    • Whatnot says:

      I’m sure there are examples and libraries for MIDI on arduino/teensy. And think it’s best to use those, but yeah when combined you can read the data as done here and then wrap them in MIDI packets to send them out I expect. I just don’t think registering as a joystick and then getting a MIDI program to turn that into MIDI is all that handy, even when ableton supports such a thing (no idea if it does).

      • You’re absolutely right. In fact, it would be particularly pointless to hack the joystick data from a Teensy 3.1 into MIDI, since Teensy 3.1 has a native, class-compliant USB MIDI implementation. All you need to do is select it from the Tools > USB Type menu in Arduino, and then use the built-in usbMIDI functions to send or receive MIDI at native USB speed.

        • nick klaus says:

          Not strictly true Paul standard MIDI uses 8 bit output, whist adequate for most level sliders, some effects need finer control then the 0.4% per bit that 8 bit offers, also 8 bit is inadequate for encoder to deck control (Scratching)
          High end equipment these days use both protocols, MIDI for legacy support and HID if your dj software supports it.

    • nick klaus says:

      @Tig3rch3n

      It will control Ableton but not as a MIDI controller but as a HID controller, at a better resolution than MIDI.

  4. kommune78 says:

    He is called [Paul Stoffregen] not [Paul Stoffergen]

  5. Richard Öhling says:

    Could use something like that in an arcade cabinet or a jukebox.

  6. Ren says:

    What is a Hat switch?

    • It’s the four-way button *on top* of a joystick. As in, a directional control for your thumb.

    • default_ex says:

      The DPad on most controllers is a hat switch. Essentially it’s 4 buttons with a hat over them. Hat doesn’t really stand for anything, it’s a literal use of the word hat, just not the kind of hat you’d wear on your head (unless your a weirdo).

    • Whatnot says:

      Seems the term hat-switch comes from the looks being similar to a coolie hat, but,:and I wikipedia quote:
      “A coolie (alternatively spelled cooli, cooly, kuli, quli, koelie and other such variations), during the 19th and early 20th century, was a label applied to a slave or unskilled manual labourer from Asia,”
      So they sanitized it to ‘hat’

      Anyway the name is established, but its also known as POV switch.

      Incidentally I always found the POV (or hat) switch hard to use in flight simulators, just doesn’t feel natural somehow, maybe because it switches view so rapidly so you don’t really experience it as looking around.

      But you can assign it to anything of course.

  7. Paul B. says:

    Perhaps my brain is muddled by V-day planning, but how can a 3-D joystick have 8 axes of freedom? I count X,Y,Z,pitch,yaw and roll which is 6, whenever more dimensions are discussed it is in reference to a multi-jointed device like a robotic arm, was he planning on also measuring the arm positioning in addition to hand positioning in 3D space? Otherwise 8 degrees of freedom doesn’t make any sense.

    • Ren says:

      Don’t forget the 4th Dimension, Time! Would Haptic feedback count as an axis? What if one feedback was vibration and another was electrical shock? (tongue in cheek)

    • svofski says:

      It does not have to be one joystick. It can be two analog thumbsticks, some analog triggers and maybe a couple of pedals. Or like NATO pointed it out, it can be actually a data logger for something completely unjoysticklike.

    • defaultex says:

      Well you could have: motion for 3-degrees, orientation for another 3-degrees and then scaling for another 3-degrees.

    • Whatnot says:

      Hmm, good point, but you could have the hat-switch to look around be a small joystick on the joystick, which would require an additional 2 axis, while still being a single joystick as it were

    • Thrust for every engine, Flaps, trim surfaces….

      BTW, a couple rotary encoders could be a nice adittion for flight sims.

      • Whatnot says:

        thrust would be a slider though not an ‘axis of freedom’

      • If you’re able to help with testing such encoders on actual PC or Mac software, please join that forum conversation!

        You’ll need a real Teensy 3.1 and some encoders to test. (full disclosure: I’m the creator of Teensy and author of the Teensyduino extension for Arduino)

        I really am interested in create new USB device types that offer these expanded capabilities. I’ve got the hardware and low-level USB programming covered, but the big limitation is always the experimenting with what can actually work with available software and operating systems. I truly do need your feedback and help testing.

    • Eric Parker says:

      Yeah… I have a 6DOF joystick/controller I can’t imagine fitting any more axes…axii..axises? I know how to say the plural out loud but not spell it. ANYHOW. Possibly in addition to those, you could have inertia, like in a Wii nunchuk

      • Whatnot says:

        Do you or anybody else here happen to know of a commandline type of utility to activate the vibration of joysticks/joypads? I used to play a game with the mouse, since that was the best way for that game IMO, but a joypad I had connected would rumble at appropriate times, and I had that joypad on a shelf under my desktop and found it was a nice feature, since you could feel the vibration while using a mouse. Best of both worlds as it were. So if I could make my own rumble notifications that way it would be useful.

  8. justice099 says:

    Actually, this could be useful for a motion capture puppet.

  9. mojojoe says:

    Hmm, if you labelled each button with different alphanumeric and symbollic characters, you could use it for text entry.

  10. rasz says:

    Perfect for USB Oscilloscopes, or any other PC hardware you want to interface with without touching your mouse.

    Is it possible to enumerate as a Keyboard + 8 mouses instead ? :)

    • Yes, it’s possible, but it is possible on any PC-based operating system to read more than one mouse in any meaningful way? If you try plugging more than one into your PC, you’ll see the operating system merges all their data, so they all move the same pointer and their buttons are become logically OR’d.

    • Whatnot says:

      Mice send relative information though, not absolute values. So you’d have to think of a new library for that, and then think up what the hell to do with it in a practical sense :)

      • Whatnot says:

        Wait I found a use, register as 8 mice and windows will probably crash, you’d have a crash dongle.

      • Actually, the USB mouse on Teensy 3.1 sends high resolution absolute coordinates.

        In your sketch’s setup() function, you use Mouse.screenSize(width, height), to tell it the screen resolution you’re targeting. Then in the rest of your sketch, you can use Mouse.moveTo(x, y) to send the mouse pointer to any pixel position on your screen.

        • Whatnot says:

          Hmm, but isn’t there a difference between a mouse, as being detected as a mouse at the USB port, and the final coordinates as used for the cursor? Does windows if it sees something ID’d as ‘mouse’ not expect it to be relative? Or is that translated at low level driver level to in the end always have absolute as the data windows gets?

          And while on the subject, that sort of annoys me about so called touch pads for windows, I don’t think you can make them work as absolute so that where you touch it is relative to the screen position, it’s only drag-the-cursor kind of stuff. Which is odd since touch screens DO obviously tell absolute position. So I guess we need to use a teensy to make a touchpad which then emulates a touchscreen if we want a touchpad that works as 1:1 device. And although that would perhaps not be handy on a pre-w8 desktop with hard to determine positions, it would be good if you have an interface with fixed elements, like a custom program or a tile-like UI, you could put a picture of tile-outlines on the pad to orient yourself, and once you got the start position any dragging would be intuitive.

  11. Mike Hughes says:

    “testing the joystick on Windows is an exercise in futility for reasons no one can figure out.”

    Probably cuz it’s not WHQL listed?

  12. Chris C. says:

    Let’s assume the pictured board were actually used as a controller, perhaps for a synthesizer. Last year I fully read a datasheet for a trimpot for the first time, and found it was only rated to “200 rotational cycles”. This was a bit surprising, but not really. Trimpots are often used in situations where they may only be adjusted once in their operating life, and so might be built as cheaply as possible. I’m curious how they hold up in the real world under frequent adjustment. Anyone have a story to share?

    • NewCommentor1283 says:

      i have that exact same potentiometer,
      200 rotational cycles?
      no wonder it’s wearing out already!

      i know i might be overloading it but usually when you do that they become useless,
      but mine still works okay.
      it was in storage for years and worked like new,
      6 months of breadboard useage later
      (fast rotations)
      it is now a bit scratchy but not burnt out.

      but for DC its fine with capacitor on output

  13. echodelta says:

    I would like to have 128 pots to set the 128 harmonics that are in ZynAddSubFX. I don’t know weather the program will let that be done. Hammond organ types have just 9 controls by comparison.

  14. cliped says:

    The MIDI controller to end all MIDI controllers with 17 pots and 128 buttons?
    You obviously are too focused on using an arduino and have missed the midibox…

  15. othar says:

    Ultimate Mame arcade cabinet anyone ? 4 players = 4 joysticks..4 spinning wheels.. 32 player buttons.. 12 controls buttons … and be fool.. add 4 trackballs…

  16. doragasu says:

    Nice build, but it will be a real challenge to create a control panel for that all, and to wire everything to the PCB.

    A whole lot of time ago (around 2005) I made a 48 button, 8 digital + 4 analog axes HID interface (running perfect in both Windows + Linux), including a (yet untested) arcade monitor video amplifier + protection interface: http://kernelhacks.blogspot.com/2012/04/amuse.html

  17. nick klaus says:

    I have been working on a similar device for the Arduino Uno to control Virtual DJ via HID (not MIDI) and it is fully functional (128 buttons and 48 * 8 bit pots) so I can confirm this project will also control any DJ software that supports HID. (Ableton & Serato)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,650 other followers