Jump to content

Recommended Posts

Posted

Thought I'd share a project I am working on to set up a few rotaries to put on the back of my Warthog throttle using an Arduino Leonardo running MMJoy2. The software makes it brilliantly easy to set up a USB HID controller.

 

Right now I have everything set up and wired in a cardboard box.

attachment.php?attachmentid=120137&stc=1&d=1438224040

 

I can use them to control things like radar elevation, range, trim wheels, radio dials, etc. Each rotary encoder is also a push button, so with a downward press they can do anything any other button can.

attachment.php?attachmentid=120138&stc=1&d=1438224040

 

My next step is to take my roughed out specs for an enclosure, get it a little more precise, find someone to print it out and, and put everything inside.

I envision this sitting on the lip on the back of the throttle, attached on the top by the two screws exposed on the top of the throttle with the rotaries exposed through the holes on the lid and USB cable off to the left side. Later I could add more controls (buttons, potentiometers, whatever) by printing a new lid with more holes, or maybe adding a rotary on the right side, etc.

attachment.php?attachmentid=120139&stc=1&d=1438224040

wiring.thumb.png.e2f8b49c4ae5948c49cc4fea2261a467.png

encoders.thumb.png.5dc249a61db1ea856eb889b7505d0d5e.png

enclosure.thumb.png.9ddcdfbcf1fa6dd6eb5e8e5972836262.png

Posted (edited)

Cool,

 

I personally would add a 3 position toggle switch to implement a 'modeswitch' to increase the capabilities to 9 rotary inputs...

 

But I don't know if the joystick driver does support this. How are the rotaries represented in Windows?

Edited by f4l0
Posted (edited)

That's a good idea!

 

Right now they are represented as buttons. Left is button 1, right is button 2, pressing down is button 3 and so on.

 

I did get them set up as virtual axis using mmjoy2 in which case left/right is presented as an axis, but there is a lot of bouncing. I suspect I'm just not doing the configuration right due to it being an encoder and have asked over at SimHQ about that to see if there is some way to smooth it out properly.

 

Someone also commented on my video about getting better results with multi-turn potentiometers instead, so I may look into that option as well.

 

All interesting things to try. I had to start somewhere, and so this the start. But getting great comments and ideas from people! :)

 

For now I've gone over the measurements on my enclosure, made a bunch of minor tweaks to the lid, and am working on getting a first print.

Edited by xaoslaad
Posted (edited)
Someone also commented on my video about getting better results with multi-turn potentiometers instead, so I may look into that option as well.

 

For trim 10 turn (or maybe 5) pot' give you much more precision adjust than key press (what Encoders do).

 

For reference (look at eBay): http://www.potentiometers.com/select_multi.cfm

 

Encoder is good for things like adjust course, select radio channels (if the plane allow - "Hello Mig-21")...

Edited by Sokol1_br
Posted (edited)

Sokol1_br,

Thanks for the explanation. I got the virtual axis setup working with press to center, which is kind of nice and this allows for really tiny adjustments. The bouncing was just my bad configuration, as I suspected.

 

I had the precision initially set very high, but had to turn it down to 10 to get a reasonable balance between fine adjustment and speed. It's really nice and I had the P-51D flying very very level very easily, so I'm pretty happy with it.

 

Maybe to f4l0's idea I can use a toggle switch to shift between using them as virtual axis and buttons, so depending on the aircraft and what I want to do (radios, trim wheels, etc., etc.) I can switch the behavior.

 

Interesting ideas anyway.

 

Edit: If I add a Shift for a toggle the buttons only work when the shift is on, but the rotaries work in both cases. Not really what I had in mind, but it could be lived with.

 

It could in effect be a 3 axis / 9 button controller.

Edited by xaoslaad
Posted

I personally would add a 3 position toggle switch to implement a 'modeswitch' to increase the capabilities to 9 rotary inputs...

 

But I don't know if the joystick driver does support this. How are the rotaries represented in Windows?

 

I dont see how this mode switch will increase the encoder capacity. :huh:

 

Unless the switch change the wiring between the encoder and the Arduino pinout...

 

Encoder is see be Windows as 2 buttons, turning the encoder for right press one, turning for left press other, they just are not hardware buttons, but based on code output.

 

The third button on encoder, by press the knob, is just a ordinary NO momentary switch.

 

Anyway MMjoy firmware can handle 6 encoder (besides 8 axis - 12 bits and up to 96 buttons, what depends on Arduino board version).

Posted (edited)

With this switch, one encoder could control/manipulate different values.

I don't know the MMJoy firmware. But if one has access to the Arduino code, one could add the switch functionality. The behavior of the switch would be to change the internal processing of the encoders and the related output. E.g:

 

handleEncoderChange(encoder) {
 if( MODESWITCH == 0 ) {
   changeAxisValue(axis1, encoder)
 } else if( MODESWITCH == 1 ) {
   pressButton(button, encoder)
 }
}

 

One could also try HID ...

Edited by f4l0
Posted (edited)

I'm not sure if this will help explain.

 

With MMJoy2 you can set up a virtual axis, such that a press in either direction increments or decrements the axis. Pressing down centers the axis.

 

By adjusting the precision I have a nice adjustment between precision and speed. At 14 you can make minute changes but it takes all day. Any lower and it starts stepping more like a button.

attachment.php?attachmentid=120169&stc=1&d=1438293601

 

You can also set a shift such that hardware button 1 with shift 1 is one button to windows and hardware button 1 with no shift is a second button to windows and so on. You can have up to 3 shifts.

 

attachment.php?attachmentid=120170&stc=1&d=1438293601

 

In windows it looks like this:

attachment.php?attachmentid=120171&stc=1&d=1438294234

 

Toggle hardware button 10 off and the buttons do not register. Toggle it on and they do.

 

The only hiccup is with mmjoy2 the virtual axes have no care in the world about what the shift state is. Whether it's on or off the axes are adjusted.

 

To put it another way, if I just configured them all as buttons and no virtual axes with a toggle I could have 18 buttons in windows. With a 3 way like he said I could have no shift, shift 1, and shift 2, and have 27. If I could work up a four way rotary or something 36, granted to use a button from any set I'd have to flip the toggle to use that set. For my case, I think it would just be nice to flip them so I can use them as buttons for the radio, radar range, elevation, whatever, or as an axis for a trim wheel, etc. Which to be honest I can do now - I'd just have to be careful not to map the axis and the buttons for any one encoder simultaneously. It'd be better if the toggle would turn the axes off like I can the buttons.

full-28577-106602-axes.thumb.png.273f9d21490224c9e4bccea90856ec10.png

full-28577-106603-buttons.thumb.png.f8d94c889436b87ce6f666a7b52bd40f.png

properties.png.4e3c897f6563e7bacef7bdf40622404b.png

Edited by xaoslaad
Posted

Right. And as far as I can tell the one weakness with mmjoy2 is I can't see or edit the source. I'm at the mercy of available hex files. I mentioned the idea on the SimHQ thread though, so maybe it will come alond as a feature eventually. :)

Posted (edited)

In il-2 CLoD you can modify a axis behavior with a "shift" (this game allow that any key/button became a modifier), but this don't result practical in most cases.

 

If I use a rotarie for adjust elevator trim, then change the rotarie behavior with the "shift" to adjust the rudder trim when I go back to elevator the rotarie don't remember this last position for this surface and result in a jump in the adjust...

 

Is useful, for example, for use the joystick Y axis as wheel brakes for British planes, press the "shift", move the stick back and the wheels is braked with the force proportional to stick (Y) movement.

 

In this page the guy explain some Arduino code for Flight Simulation, can be useful to make you own custom firmware.

 

https://simelectronics.wordpress.com/2012/11/03/gear-panel-tutorial-part-3-toggle-switch-input/

Edited by Sokol1_br
Posted

This is the final result for now. In time I may print a new top and add more rotaries, buttons, and or switches, depending on what I decide I want...

 

attachment.php?attachmentid=120369&stc=1&d=1438970185

20150807_135337.thumb.jpg.505bad94d35e34abd8ba41e7904d046f.jpg

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...