xaoslaad Posted July 30, 2015 Posted July 30, 2015 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. 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. 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.
f4l0 Posted July 30, 2015 Posted July 30, 2015 (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 July 30, 2015 by f4l0 f4l0 Developer of Simshaker for Aviators Feel the brrrrttt: [Official] SimShaker for Aviators Forums thread at ED forums SimShaker for Aviators (simshaker-for-aviators.github.io)
xaoslaad Posted July 30, 2015 Author Posted July 30, 2015 (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 July 30, 2015 by xaoslaad
Sokol1_br Posted July 30, 2015 Posted July 30, 2015 (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 July 30, 2015 by Sokol1_br
xaoslaad Posted July 30, 2015 Author Posted July 30, 2015 (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 July 30, 2015 by xaoslaad
f4l0 Posted July 30, 2015 Posted July 30, 2015 Yeah switching between axis and button mode would be nice. Status could be emitted by a simple LED ;). f4l0 Developer of Simshaker for Aviators Feel the brrrrttt: [Official] SimShaker for Aviators Forums thread at ED forums SimShaker for Aviators (simshaker-for-aviators.github.io)
Sokol1_br Posted July 30, 2015 Posted July 30, 2015 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).
f4l0 Posted July 30, 2015 Posted July 30, 2015 (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 July 30, 2015 by f4l0 f4l0 Developer of Simshaker for Aviators Feel the brrrrttt: [Official] SimShaker for Aviators Forums thread at ED forums SimShaker for Aviators (simshaker-for-aviators.github.io)
xaoslaad Posted July 30, 2015 Author Posted July 30, 2015 (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. 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. In windows it looks like this: 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. Edited July 30, 2015 by xaoslaad
f4l0 Posted July 31, 2015 Posted July 31, 2015 I guess you need to modify the actual firmware flashed on the Arduino... f4l0 Developer of Simshaker for Aviators Feel the brrrrttt: [Official] SimShaker for Aviators Forums thread at ED forums SimShaker for Aviators (simshaker-for-aviators.github.io)
xaoslaad Posted July 31, 2015 Author Posted July 31, 2015 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. :)
Sokol1_br Posted July 31, 2015 Posted July 31, 2015 (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 July 31, 2015 by Sokol1_br
xaoslaad Posted August 7, 2015 Author Posted August 7, 2015 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...
Recommended Posts