Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 6 FirstFirst 1 2 3 4 5 ... LastLast
Results 51 to 75 of 144

Thread: Many axis joystick

  1. #51
    Junior Member
    Join Date
    Feb 2014
    Posts
    2
    Hey Paul,

    This is exactly what I have been looking for. I write HID client drivers for our embedded OS (QNX) and I picked up a Teensy 2.0 and 3.0 (kickstarter) for the express purpose of testing the driver. So I am very glad to see this experiment as I wanted to test the limits of the driver. I'll load this up on the 3.0 I have here, I haven't looked at the code yet, however given that you have a breakout board leads me to believe that I'd need to have the same thing here, which isn't so great as I am terrible with electronics

    Erick

  2. #52
    Senior Member
    Join Date
    Mar 2013
    Location
    Austin TX
    Posts
    406
    Quote Originally Posted by PaulStoffregen View Post
    It'd be nice to know at least a few programs that can really use so many sliders and buttons...
    I would be interested to know if this can be used with MAME. There are dedicated controllers like this and these and these. For those controllers one of the key things is simultaneous buttons at once (not limited to 6 as some are). If it works I could see this being used as a controller for a MAME CP.

  3. #53
    Junior Member
    Join Date
    Feb 2014
    Posts
    2
    With the for 128 buttons, 6 axes, 17 sliders and 4 hats, things parsed nicely

    http://pastebin.com/XnpWHJzU

    and reports started to come in cleanly as well. I'll have to start to dump random values into each usage so I can actually test this further.

    Anychance you could post the code with 8 axes as well?

    Thanks,

    E.

  4. #54
    Quote Originally Posted by PaulStoffregen View Post
    Maybe when there's at least a Windows test program? I
    You will be pleased to know I have finally got something working. My UI only has 12 sliders but I can now read all sliders, axes , hats and buttons, I just got the ExtremeJoystick sketch to send out random values, and everything looked good.

    I need to do some tidying up and add some error trapping, then I should be able to post a version for you guys to test. I may even squeeze in some more sliders to the UI.

    Click image for larger version. 

Name:	joytest.png 
Views:	1097 
Size:	47.4 KB 
ID:	1463

    I don't know if you read them Paul, but I posted some comments here about custom USB devices. I don't know if there are any other options, but at the very least the installer should warn about overwriting all files in the teensy folder.

    Regards,

    Les

  5. #55
    Junior Member
    Join Date
    Feb 2014
    Posts
    1
    Quote Originally Posted by PaulStoffregen View Post
    In case anyone else is following this Joystick thread, here's the latest code for Teensy 3.1. Just replace these 4 files in hardware/teensy/cores/teensy3 and your joystick will become 128 buttons, 6 axes, 17 sliders and 4 hats.
    I am sitting in front of a desk with 150 custom buttons, 9 sliding pots, 6 rotary encoders and a 6-axis joystick. I would dearly love to replicate it at home, and have started doing so, and I happen to have received my teensy 3.1 last week. And I have some free time coming up...

    So yes, I am following it, and very much hoping to implement most of it soon. Guess I'd better go buy a hundred odd buttons.

  6. #56
    Member geekguy's Avatar
    Join Date
    Feb 2014
    Location
    Beaverton, OR
    Posts
    66
    Quote Originally Posted by tyggerjai View Post
    I am sitting in front of a desk with 150 custom buttons, 9 sliding pots, 6 rotary encoders and a 6-axis joystick. I would dearly love to replicate it at home, and have started doing so, and I happen to have received my teensy 3.1 last week. And I have some free time coming up...
    I am starting to design what I hope will be a nice small remote robot controller. I found this 3-Axis joystick w/button at RobotShop. I'm thinking that having two, or maybe even three, of these, along with some sliders, buttons, and a few hats, would make for a great controller.

    Right now, I'd use one joystick for motion control, with the option to configure to use two joysticks, and the third joystick to control the pan/tilt on the front. This would suit the current configuration of my W.A.L.T.E.R. 2.0 just fine.

    If I don't use two joysticks for motion, I'd configure the second one to control a second pan/tilt on the top of my robot, which I have not added yet. Now, I am thinking four joysticks would be optimum for what I want to do, now and in the future - two for motion control, and one for each pan/tilt unit. I'm going to design it around a Teensy 3.1.

    Afterall, can we have too many joysticks?

    8-Dale

  7. #57
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Quote Originally Posted by PaulStoffregen View Post
    More sliders could be possible if the resolution were decreased......
    Reducing to only 12 bits would allow 22 sliders.
    Regarding this, is the 'limit' the HID report size?,

    I'm assuming
    128 buttons @ 1bit
    6 axis @ 16bit
    17 sliders @ 16bit
    4 hat swiches @4bit

    =512 bit or 64Bytes (I remember reading that this was the largest allowed single report)

    So in theory I can cut back on the number of buttons and/or reduce the resolutions on the axis (both sliders and axis) and have any number of buttons and sliders so long as it doesn't break the 64Byte limit?

    Also, this is for the teensy 3.1 isn't it?
    Last edited by locodog; 02-16-2014 at 02:15 PM.

  8. #58
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,290
    Quote Originally Posted by locodog View Post
    So in theory I can cut back on the number of buttons and/or reduce the resolutions on the axis (both sliders and axis) and have any number of buttons and sliders so long as it doesn't break the 64Byte limit?
    Yes, the USB packet size limit is 64 bytes, and the HID code supports only single-packet reports.

    You can reassign the 512 bits any way you like. All you have to do is edit the HID report descriptor, and then edit the usb_joystick.h code to put the data into the bits you allocated.

    Also, this is for the teensy 3.1 isn't it?
    Yes.

  9. #59
    I have just uploaded Alpha 0.92 of the joystick test application for windows.

    You can download it here.

    It now has RawInput & DirectX input methods, and under raw input will show up to 18 sliders.

    Don't forget it's Alpha so probably has bugs, please post feedback here or on my site!

    Regards,

    Les

  10. #60
    Junior Member
    Join Date
    Feb 2014
    Posts
    1
    Hello there , is this board/shield being actually sold ? if so , please provide link ... if not, i wonder what price is the author targeting and what release date he is aiming for.

  11. #61
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Quote Originally Posted by r3l1c View Post
    Hello there , is this board/shield being actually sold .
    I don't think it is a shield being developed, this is the code you would need for a tensey 3.1 to then go on and build the circuits for inputs (just a few multiplexers pots and buttons)

  12. #62
    Member geekguy's Avatar
    Join Date
    Feb 2014
    Location
    Beaverton, OR
    Posts
    66
    Quote Originally Posted by PaulStoffregen View Post
    I'm still debating whether this belongs in a future version of Teensyduino's Tools > USB Type menu. Maybe when there's at least a Windows test program? It'd be nice to know at least a few programs that can really use so many sliders and buttons...
    As soon as I have both of my robots fully operational, I'm going to start working on a wireless robot controller. This controller will have at least three 3-axis joysticks (possibly 4), some sliders, hats, and of course several buttons.

    I'm looking at using this joystick, and hope to get one to play with soon. They are pretty expensive, but if they have the right specfications, I want to use them.

    For instance, I could use a single one of these to control the gripper on my SES Rover (Y = raise/lower, X = open/close gripper, Z = wrist rotate). One could be used for locomotion control (Y = left motor, X = right motor, Z = rotation). Two sticks could be used for locomotion using the Y-axis of each to control left and right motors.

    There are so many possible combinations for controlling robots, using this extreme joystick! One controller could even be used to control two robots. My controller could easily use up nine axis, with three of these joysticks, twelve axis with four of them.

    Unfortunately, it might take me awhile to get the parts I need to start building this.

    8-Dale

  13. #63
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,290
    Quote Originally Posted by r3l1c View Post
    Hello there , is this board/shield being actually sold ?
    Here's a blog post about the breakout board I made. It was designed for general purpose testing of the pins on a Teensy. I just used it for (partially) testing this joystick code, since it was sitting on my desk.

    http://www.dorkbotpdx.org/blog/paul/...n_test_circuit

    This board isn't sold anywhere. But if you really want one, I do have several extra bare PCBs. You'd need buy all the parts elsewhere and solder all of them, which takes at least a few hours by hand soldering.

  14. #64
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,290
    I've added the PCB gerber files and placement diagram on this project's blog page at DorkbotPDX.org.​

    http://www.dorkbotpdx.org/blog/paul/...n_test_circuit

  15. #65
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Hi Paul I see you've published on Hackaday, I've had a bit of success myself with my Arduino and I can confirm (well, suppose with authority) that your many axis joystick will be fully functional for virtual dj (my example is 128 * 1 bit and 48 *8 bit) and I can further suppose that any dj software that accepts HID will be too. (Ableton & Serato)

    If you were wanting to tap into this DJ controller market, a return HID packet back to the 'joystick' controlling LEDs and such would be the next step and a then 2 packet reports,

    I'll write up a promo-post at the VDJ forums.

  16. #66
    Junior Member
    Join Date
    Mar 2014
    Posts
    10
    This is awesome! I am developing my own game controllers right now with the teensy 2.0 and 3.1.

    I've been keeping a close eye on this thread.

    How does one integrate an encoder to one of these? My understanding on the 2.0 you use pins 5,6,7,8? I hooked one up the other day and I only had it functioning in the sketch as regular button presses. I tried using the #encoder.h and implemented the example sketch into the example joystick sketch. everything was working fine in serial mode but not back in HID mode.

    Please describe as simple as possible. I am very new to this stuff.

    Ill dig around and see if I can put some of these to use!

    Currently i need about 32 buttons.

    I would assume I can make some kind of switch matrix for this?
    Last edited by stevos758; 03-12-2014 at 06:37 PM.

  17. #67

    This is exactly what I've been looking for!

    Quote Originally Posted by PaulStoffregen View Post
    In case anyone else is following this Joystick thread, here's the latest code for Teensy 3.1. Just replace these 4 files in hardware/teensy/cores/teensy3 and your joystick will become 128 buttons, 6 axes, 17 sliders and 4 hats.
    Works great as-is with Controllermate for mac os x. Seems to recognize all inputs.

  18. #68
    Junior Member
    Join Date
    Mar 2014
    Posts
    13
    Hi there

    I'm a complete electronic dunce, trying to learn and create a lighting control board that will run using HID over the usb link. So 6 axis, 17 sliders and 128 buttons is just what I'm looking for.

    My biggest problem is building the connections between the sliders, axis, buttons and the teensy3 board.

    The board posted here only has 33 buttons and 14 sliders on it (I assume the 6 axis is accessed via the pins on the edge of the board).

    I assume the buttons uses a mapping matrix that requires the 2 parts of the switch to connect to a number of shared lines (36 runs via 12 channels 6 rows and 6 columns). So 128 buttons would work how and be connected to the Teensy how?

    Any suggestions on where to start would be appreciated.

  19. #69
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,236
    A few of us up on Lynxmotion have been playing around with a DIY remote control for awhile now (first with RC output, which I converted to XBee). First versions used a Basic Atom Pro for the micro-controller, but I have played around with some different Arduino boards as well. On those we have been using a 16 button keypad (later added some external buttons as well), that we read in on 8 IO pins (4x4, later 4x5 for external switches).

    A diagram showing the keypad wiring is up on the posting: http://www.lynxmotion.net/viewtopic....=5447&start=91
    Note the keypad is setup that each of the switches in a row are wired to each other, likewise for columns.

    On these I used external PU resistors. Probably here can get away with using internal weak PU resistors. Reading the matrix, You start off with all of the rows logically set high, and then set one of them low and then look at the inputs for the columns. If you read a low value you know the button is pressed, then you go on to the next row (set the previous row back high, and set the next row low)... Actually I was concerned about setting the rows actually high as if you press multiple ones, you will can get a direct routing of a high value to a low value, so I personally instead of setting the value to a high, changed the pin to INPUT, this way it floated and if multiple buttons were pressed it relied on the PU resistors for the other side to read high... (Sorry if I did not explain that very well).

    Another approach if you have spare Analog pins available is using setting them up with a resister network, such as described in: http://forum.arduino.cc/index.php/topic,8558.0.html

  20. #70
    Member geekguy's Avatar
    Join Date
    Feb 2014
    Location
    Beaverton, OR
    Posts
    66
    Quote Originally Posted by KurtE View Post
    A few of us up on Lynxmotion have been playing around with a DIY remote control for awhile now (first with RC output, which I converted to XBee). First versions used a Basic Atom Pro for the micro-controller, but I have played around with some different Arduino boards as well. On those we have been using a 16 button keypad (later added some external buttons as well), that we read in on 8 IO pins (4x4, later 4x5 for external switches).
    Yes, indeed! You, and others there, have done great work on these controllers. I'm going to be taking a closer look at your work as I start my own controller design. It would be really interesting to see what you could do with a Teensy 3.1 in your design.

    8-Dale

  21. #71
    Junior Member
    Join Date
    Mar 2014
    Posts
    13
    Ok so some more digging has me thinking. Let's start with my goal. It is based on the above post re a joystick of 128x1bit (buttons) and 48x8bit (sliders/axis etc) to build a control system for lighting control software (QLC+).

    So as a noob I was confused about the pin descriptions of the teensy, until I read the USB-midi page. It includes a circuit diagram to connect many 74HC4051 integrated circuits to handle lots of buttons and sliders. Buttons going to a digital pin and sliders going to an analog pin. One has to use 3 digital pins that connect to all the 74HC4051 (a "bus" of some sort?) and then each of them additionally occupies either a digital or a analog pin on the teensy.

    I was already aware of the button matrix method (from the BU0836A). So my first question now is this: If we use the row/column button matrix, then a 8x8 button pad (8 rows and 8 columns) would use 2 of 74HC4051 chips? They both have 8 channels and the matrix works on detecting which rows and which columns have been switched so that will work? The issue then becomes to write the software to read the signals on the eight columns an rows and interpret that to find out which buttons have been pressed. and then in turn to send this through to the HID packet.

    My second question relates to the other pieces of hardware. For my goal, I do not need LED's, maybe later but not now. I also need just a signal that a button has been pressed (momentary on), so there is no latching logic required - again maybe later but not now. My initial build will probably be two 8x8 button matrices made of B3F square switches. Now the question is this: Apart from serial diodes, what other electronics needs to be fitted to the button circuit to make it work with the 74HC4051 chips?

    The same question relates to the sliders. There will be 48 potentiometers (5k ohm, I guess) that each connects to 1 pin on the 74HC4051 , which in turn uses 1 analogue pin on the teensy and share the same 3 digital pins with the 74HC4051 used for the switches. What other circuit components are needed to make this work?

    The USB-midi example seems to suggest: none!

    So my joystick plan is this:

    1. Buttons on an 8x8 keypad (with serial diodes) made in the configuration of 8 rows by 8 columns and each row and column mapping to a channel on a 74HC4051. For 128 buttons that would be four 74HC4051 chips using 3 (common) teensy digital pins plus 4 additional digital pins.

    2. Sliders have one leg linked to a channel on the 74HC4051. So for 48 sliders that gives me six 74HC4051 chips, using the same 3 common chips as the buttons plus 6 more analog chips.

    3. Teensy software to read and calculate button states and set the appropriate bits in the HID packet. The same software should read the values from the faders and convert it to 8 bits. This software is also a grey area to me. I'm hoping some the Teensy guru's will help here.

    4. Teensy software to create the appropriate HID headers etc to make it readable by the lighting controller software.

    If I can build a 128 button 48 fader joystick to run my lights, it would be fantastic!! This is exciting.

    Please advise this (an hopefully future) noob(s).

  22. #72
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    I'd like to be able to use this in a couple of different flight simulator projects I'm working on. Can someone point me to the pinout needed to wire this thing up as configured in this thread? (6 axes, 12 (17?) sliders, 128 buttons) I'm assuming that the buttons are arranged on a row/column basis. Can the buttons be wired using a diode isolation matrix in order to allow many (or all) to be closed at once?

    I'll be ordering two Teensy 3.1s in a few minutes.

    Thanks All!

    g.

    [edit: Ordered!]
    Last edited by f15sim; 03-27-2014 at 04:05 PM.

  23. #73
    Junior Member
    Join Date
    Mar 2014
    Posts
    10
    Quote Originally Posted by f15sim View Post
    I'd like to be able to use this in a couple of different flight simulator projects I'm working on. Can someone point me to the pinout needed to wire this thing up as configured in this thread? (6 axes, 12 (17?) sliders, 128 buttons) I'm assuming that the buttons are arranged on a row/column basis. Can the buttons be wired using a diode isolation matrix in order to allow many (or all) to be closed at once?

    I'll be ordering two Teensy 3.1s in a few minutes.



    Thanks All!

    g.
    I am also awaiting an answer for this. I need to know how to hook up the matrix. Good luck with your projects!

  24. #74
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    stevos758, if the board uses a "typical" row & column matrix, this should work:


    I drew that up about 14 years ago (wow!) to help explain how switch matrices could be wired up to the R&R Electronics EPIC controller. Think of the "DBx" labels as "Row x" and the "Mod x, Row y" labels as "Column x"

    It wouldn't take much work to convert that to a little PCB that could support row & column terminal blocks with the diodes stand on end between them.

    Here's another question - with the Teensy 3.1 configured as this "mega" joystick, would it still be possible to communicate with it? I ask because it would be nice to be able to write a configuration tool that would allow you to reverse axes, tweak dead zones, adjust response curves, etc.

    g.

  25. #75
    Junior Member
    Join Date
    Mar 2014
    Posts
    10
    Quote Originally Posted by f15sim View Post
    stevos758, if the board uses a "typical" row & column matrix, this should work:


    I drew that up about 14 years ago (wow!) to help explain how switch matrices could be wired up to the R&R Electronics EPIC controller. Think of the "DBx" labels as "Row x" and the "Mod x, Row y" labels as "Column x"

    It wouldn't take much work to convert that to a little PCB that could support row & column terminal blocks with the diodes stand on end between them.

    Here's another question - with the Teensy 3.1 configured as this "mega" joystick, would it still be possible to communicate with it? I ask because it would be nice to be able to write a configuration tool that would allow you to reverse axes, tweak dead zones, adjust response curves, etc.

    g.
    Thanks for the Pro-Tip! I plan on making the matrix PCB with my CNC. I just need to know what pins to hook it up too. I actually don't need all of the buttons and axis. Just more buttons than the stock teensy.

    From my newb expriments you can edit and flash in minutes very easily. It's not a pain like flashing HID to Arduino Uno's

    I would also like to include some rotary encoders but I haven't figured that out yet.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •