Atrixium / Atrixium-HOTAS

2 stars 0 forks source link

Wow, so there's a lot going on here. #2

Open warrenernst opened 3 years ago

warrenernst commented 3 years ago

Hi, it's Warren from YouTube. This seems like the best/only communication method here so...

I've just downloaded and installed Eagle and checked out the Schematic and Board files, none of which made any sense to me (WHY is he still keeping the 15-Pin gameport?) until I opened and read the ODT file and learned that the plan is to make the WCS the "brains," with the stick connecting to it via the gameport and the pedals via a 6-pin DIN connector. This would allow all three devices to connect to the computer via a single USB cable. This made good sense because a lot of older games can only accept input from one device, AND the Top Gun stick is a "dumb" analog joystick device, so why not?

My use case in 2021 is different. I already have a modern standalone pedal set which can connect via USB directly. My preferred joystick is either the vintage Thrustmaster FLCS or F-22, both of which already have shift registers built-in, so all one needs to convert one of these "smart" sticks is an Arduino micro programmed to use the shift registers and then the 5 wires from the stick connect directly, and then the two pots for the axes get wired in directly too, adding a third line to each pot. The original PCBs in the base of these sticks get discarded.

Ideally, I'm hoping to use my preferred WCS Mk II as a third standalone USB device, and even more ideally, I was hoping to NOT have to rewire all the buttons and switches on the throttle, but maybe that's just not possible? I initially thought your PCB was merely taking the existing wiring down the shaft of the throttle, connecting them somewhat neatly into the shift registers, and then THAT signal was getting processed by the Arduino micro.

Yes, this would mean my flight gear would use 3 USB connections, but modern PC games don't have any problem with mixing 3 devices into one HOTAS, AND I could more easily mix and match things over time.

Sooooo, with all that said, I guess my first question has to do with rewiring the throttle to take advantage of your shift register circuit. I assume now that it was necessary?

Or more broadly, do you see all this work you did making your WCS a "smart base" for the stick and throttle applicable to my goals? I'd love to hear your thoughts.

-Thanks

Atrixium commented 3 years ago

For what you're looking to do, my method is probably overkill, but the same techniques would apply for a simpler circuit, although if you had enough inputs on your microcontroller you wouldn't even need the shift registers. For me the shift registers were necessary because of the number of buttons I was dealing with and my desire to use a cheap, smaller micro that I already had on hand.

As you figured out, this was all because I had some older games that only recognized one joystick at a time, so I figured I'd mash them all together into one and solve that problem, it definitely would have been much easier to just make 3 separate USB devices!

Now as for rewiring, I didn't really have to do any for the throttle itself, I just figured out what buttons referred to what wire and wired them into my board, the switches in the grip all have their commons tied together and then signal wires are broken off from each one and run down as a ribbon cable past the throttle pot,so the wiring is actually pretty straightforward. In the Throttle Wiring file I actually have the colour code that I found in mine, yours might be the same, so that could save some effort! I did rewire the throttle pot to read out a proper analog value that the Arduino could read though, just as I did with the joystick, it was just a simple matter of setting it up so the wiper went to the analog in and then I have 5V and Gnd on either side, the pot was in surprisingly good condition for it's age, but if it needs replacing, it's a standard, off-the-shelf pot.

If you don't want to go as far as ripping out the mainboard in the WCS MkII, you might be able to just tap into the wiring where it is on the board, there's some complex circuitry they put in there to handle all those buttons on the old gameport system, so I'm not sure exactly what the effect would be, at minimum you'll probably have to un-solder the switch wires. I don't recall off-hand if the stock board had a shift register to handle all the switches or not, I do remember there being a lot of glue logic chips in there though and rather than reverse engineer it, I just ripped it all out and started fresh.

If you do decide to go the shift register route, it's way easier than it looks, I just hooked the shift registers up in a daisy chain, wired them to the SPI lines on the Arduino and used the SPI library to clock in the shift register data as fast as possible, one Byte at a time and then aggregated the two bytes into one 16 bit variable with each bit representing a button; once you have that, a bit of bit-masking gets you the switch status and the whole thing only takes a couple milliseconds.

For your setup, after conversion to USB, I'd be tempted to add a USB hub into all that empty space in the WCS Mk2 so your other peripherals could plug into it and you only have one wire going to the PC!

Hopefully that answered your questions, but if not, shoot back and we'll work it out!

warrenernst commented 3 years ago

Thanks for your detailed reply. Since we've chatted, I've dissected a newer Thrustmaster Attack Throttle and figured out its internal Shift Register scheme, documented it on Reddit for someone, who followed my instructions and successfully converted it with a Pro Micro. I've ordered up some Pro Micros myself and plan on doing the same...

And then finally this morning I took apart a WCS Mk II. Actually, I went to my stash and found one I opened up years ago (in 2000!) and then went to town tracing it out with my newfound knowledge in my head. I'm surprised how simple it is. 9 wires to the handle through the stalk with a common ground between all 7 buttons and the 1 switch going to 8 pads on the original PCB. Then 3 wires for the Pot. And then a few extra wires for the two switches on the base.

No need for a shift register circuit at all if I use a board with enough button inputs. I think the Teensy 2.0 has a few more than a Pro Micro - need to double check that and then see if it is even necessary.

Good idea about tucking in a small USB hub in the base of the throttle.

I'll be in touch with progress. Probably in a couple of months.

Atrixium commented 3 years ago

Awesome! Good job on that, hopefully it works out and I'll be happy to see what you come up with!

On Sat, Apr 3, 2021 at 11:06 AM warrenernst @.***> wrote:

Thanks for your detailed reply. Since we've chatted, I've dissected a newer Thrustmaster Attack Throttle and figured out its internal Shift Register scheme, documented it on Reddit for someone, who followed my instructions and successfully converted it with a Pro Micro. I've ordered up some Pro Micros myself and plan on doing the same...

And then finally this morning I took apart a WCS Mk II. Actually, I went to my stash and found one I opened up years ago (in 2000!) and then went to town tracing it out with my newfound knowledge in my head. I'm surprised how simple it is. 9 wires to the handle through the stalk with a common ground between all 7 buttons and the 1 switch going to 8 pads on the original PCB. Then 3 wires for the Pot. And then a few extra wires for the two switches on the base.

No need for a shift register circuit at all if I use a board with enough button inputs. I think the Teensy 2.0 has a few more than a Pro Micro - need to double check that and then see if it is even necessary.

Good idea about tucking in a small USB hub in the base of the throttle.

I'll be in touch with progress. Probably in a couple of months.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Atrixium/Atrixium-HOTAS/issues/2#issuecomment-812903144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKSHLNEP4INRJ52VJ45E6LTG5KLHANCNFSM4WH5WHYA .

warrenernst commented 3 years ago

So if you don't mind, can I run some things by you? I have some Arduino Pro Micros coming, along with some SN74HC165 Shift Register circuit boards like this one (https://www.sparkfun.com/products/retired/11512 ), but because I've never actually used them before, or the MMJoy2 software everyone seems to be using, I guess I don't know the best plan of attack.

As you may recall, the WCS Mk II is wired like this: 1 pot in the base, and 6 buttons and one 3-way switch in the handle, electrically looking like 8 buttons. There's no PCB in the handle. Thrustmaster literally used a LOT of hot glue to affix the buttons and switch to the inner shell of the handle. There are 9 wires going up the to the handle through the "stalk": 1 is a ground wire that goes directly to one button, and then there's a series of wires inside the handle that connects to each and every button's ground terminal to that first button's ground terminal. In other words, it's a common ground wire for all the buttons. I've traced that wire directly to the ground wire on the controller chip in the base - it's the same chip used in the Thrustmaster Attack Throttle which I already know the guts of well. The 8 other wires each go to the other terminal on all the buttons or the single switch. There's no resistors I can see in the handle or wired to the buttons or the switch, but I suppose it's possible they are buried under an ocean of hot glue. Do you happen to recall any resistors there under the glue, in the handle?

Now then. I have no idea the best way to wire these buttons up. My initial thought was to connect the common ground wire to +5V on the Pro Micro, and then connect the 8 other wires to different pins on the Pro Micro, but then I remembered how that's a bad practice. One should use a resistor to avoid phantom button presses, and I don't see any with the buttons. But that seems to REALLY complicate wiring - adding 8 resistors to these 8 wires. Or can I still connect the common ground wire to the GRND pin, maybe put a single resistor on that wire, and then just do a direct hookup of the other pins? Can the software allow for switching reading High or Low for button presses? Or am I talking crazy and my inexperience is showing? Or, what do you think I should do here? I get the feeling that I am missing something pretty basic because I don't have any direct experience with the hardware or the software.

Another option is to use a Shift Register again. According to my reading, a shift register circuit using a SN74HC165 (just like the Attack Throttle and the FLCS) could connect easily to these 8 buttons wired this way: a common ground and 8 signal wires is all it takes - no resistors, apparently. All one would need is a circuit board to make life easy, like this one, described with some detail here (although it shows a pull up resistor for the button in their example), and then we just connect the shift register to the Pro Micro in the way we do for the Attack Throttle. Fortunately, these little SN74HC165 Shift Register boards are available from clone shops on eBay, and for $5 each, I ordered a few already to play with later. These look kind of similar to your Shift Register prototype boards, huh?

So...what do you think is the best way forward? Thanks for the input. (No pun intended ;-) )

warrenernst commented 3 years ago

Oh, or now that I've stepped away from it a little bit, it seems what I've really got here is a 1x8 button matrix, huh?

Atrixium commented 3 years ago

It sounds like you're on the right track, I used an individual resistor for each signal pin so that I could pull each signal high and then they would be brought to ground when a button is pressed; I actually reused the resistor networks from the original WCS board where I could and had to add a few discrete resistors for the extra buttons. I think if I was to do it again, I would have gone with surface mount resistors, that was a lot of holes to drill, in fact I probably would have used surface mount everything to eliminate as much drilling as possible!

If you use a microcontroller that has enough inputs, you might find that the microcontroller actually has built in pull ups and that would allow you to forgo any external pullup resistors; in the case of the shift register though, I found I needed a pullup for each button to get clean signals. Of course you can choose to sense on High instead of Low signals, but you would still need a pulldown resistor for each signal wire, I found it was easier to stick with convention on this and I think you will too.

Those shift register breakout boards are basically what I modelled my prototype boards after, I could have ordered some, but I'm notoriously cheap and like to do things the hard way :D I also wanted to make them universal so I could use them with any SO16 chip I wanted to try out, they make breadboarding so much easier! The fact that those 74HC165s are so cheap is what brought me to use them, you can get better ones that use less power and switch faster, but these definitely do the job for a good price.

Me personally, I would stick with the Pro Micro and the shift registers because I already know that works, you could basically rip the code as it is and modify it to suit your needs and set your board up however you like, if you even want to use a board, there's no reason you couldn't dead bug it, I just like making PCBs :)

My best advice would be to breadboard it all out and try it before committing a design, you might find a method that works better, my design spent a long time as a huge breadboard monstrosity before I design and make the board.

Keep me posted on what you decide to do and good luck!

On Fri, Apr 9, 2021 at 5:35 PM warrenernst @.***> wrote:

Oh, or now that I've stepped away from it a little bit, it seems what I've really got here is a 1x8 button matrix, huh?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Atrixium/Atrixium-HOTAS/issues/2#issuecomment-817041349, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKSHLIWLTJXRSANXPD3Z23TH6MLRANCNFSM4WH5WHYA .

warrenernst commented 3 years ago

Hi again. So I have a completed project to share with you.

So I'm done, and have successfully converted one of my WCS Mk II throttles to USB, using an Arduino Pro Micro board and MMJoy2 software. As it turns out, whereas most TM gear from this era uses a Shift Register, the WCS Mk II uses a 1x8 button matrix for the buttons and switch in the handle, and as a result, it's really easy to convert.

All it took was snipping off the 9 wires from the handle to the original PCB, using the White wire (which TM uses as a common ground for all the handle buttons) as the "1" in the 1x8 matrix, and then the other 8 wires are the "8" in the 1x8 matrix, meaning you need 9 free pins on your Pro Micro to wire them up. I just crimped female Dupont connectors and then stuck them right on the Pro Micro. There are enough free pins on my board to also connect the two switches on the base, meaning it's a 4x10 matrix using only 11 button positions, but the "wasted" buttons don't mean a thing. And of course, the pot wires up to an analog pin along with a VCC and Ground pin.

So far, I've converted an FLCS, and F-22 Pro, an Attack Throttle, and now this WCS Mk II, and by now I've gotten the process for any of these down to about an hour. Next are some TQS throttles, but I'm awaiting more Pro Micros. I have a few more to convert for spares.

Anyway, I wanted to thank you for posting your original videos and the project here to inspire me to finally getting to this project,. It's been fun, and I'm looking forward to using this stuff again. If you have any interest in my pinouts, photos, or MMJoy2 settings for any of this hardware, let me know and I'll be happy to share. Take care.

Atrixium commented 3 years ago

Awesome! Sounds like you found a better solution, I'm glad I was able to help you get there! Maybe throw your findings into a YouTube video or GitHub repo for others to spread the knowledge.

Good job!

Rob

On Mon., May 10, 2021, 11:14 warrenernst, @.***> wrote:

Hi again. So I have a completed project to share with you.

So I'm done, and have successfully converted one of my WCS Mk II throttles to USB, using an Arduino Pro Micro board and MMJoy2 software. As it turns out, whereas most TM gear from this era uses a Shift Register, the WCS Mk II uses a 1x8 button matrix for the buttons and switch in the handle, and as a result, it's really easy to convert.

All it took was snipping off the 9 wires from the handle to the original PCB, using the White wire (which TM uses as a common ground for all the handle buttons) as the "1" in the 1x8 matrix, and then the other 8 wires are the "8" in the 1x8 matrix, meaning you need 9 free pins on your Pro Micro to wire them up. I just crimped female Dupont connectors and then stuck them right on the Pro Micro. There are enough free pins on my board to also connect the two switches on the base, meaning it's a 4x10 matrix using only 11 button positions, but the "wasted" buttons don't mean a thing. And of course, the pot wires up to an analog pin along with a VCC and Ground pin.

So far, I've converted an FLCS, and F-22 Pro, an Attack Throttle, and now this WCS Mk II, and by now I've gotten the process for any of these down to about an hour. Next are some TQS throttles, but I'm awaiting more Pro Micros. I have a few more to convert for spares.

Anyway, I wanted to thank you for posting your original videos and the project here to inspire me to finally getting to this project,. It's been fun, and I'm looking forward to using this stuff again. If you have any interest in my pinouts, photos, or MMJoy2 settings for any of this hardware, let me know and I'll be happy to share. Take care.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Atrixium/Atrixium-HOTAS/issues/2#issuecomment-837079491, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKSHLJ7NH7BUCE4AKSTUYDTNAPBVANCNFSM4WH5WHYA .

warrenernst commented 3 years ago

Thanks Rob. For the time being, I have my work posted on Reddit here: https://www.reddit.com/r/HotasDIY/comments/n9k22l/thrustmaster_wcs_mk_ii_throttle_converted_to_usb/