Touch screen controls X Plane NOT Air Manager panel

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Message
Author
miner_tom
Posts: 71
Joined: Tue Apr 21, 2020 8:12 pm

Re: Touch screen controls X Plane NOT Air Manager panel

#21 Post by miner_tom »

jph wrote: Sat Feb 13, 2021 10:46 am Hi Tom,
No worries, I understand. I also come from an Analog background via Amateur Radio - way back - since about 40 years ago. I am a 'G4' - G4XRZ 'A' licence holder. also was a 'B' licence before that. Also started EE training in 1973 in the Royal Navy (UK) as an Artificer, but decided the Navy was not for me so opted out after less than a year. Never did like taking orders .. :lol: .
Luckily, I was also working with digital processing / logic gates etc, and computing, since the late 70's so mixing the 2 - analog and digital - was reasonably ok for me.

To clarify a couple of points.
The HID 'device' (Arduino or Bodner board etc) is seen by windows as a 'game controller' / 'Joystick' . - it appears in control panel > hardware and sound > devices, from there, you right click on it and select game controller settings, and you are presented with a full calibration and test setup built in to windows. - THIS is the calibration.
Within X-Plane, you can then add all sorts of response curves etc, or indeed, recalibrate again, but the main calibration is in Windows. X-Plane allows non linear response curves etc to be added. - note - again - there is no programming for this at all - on your part - once the device is seen as a HID game controller in windows.

Now, as to your question re - programming an Arduino as a HID device...
This is absolutely possible, BUT... you need an Arduino capable of acting as a HID device.
An UNO, or Mega etc is NOT suitable - !! :!:
You would need to use an Arduino Leonardo, or, a Pro Micro which is basically a miniature Leonardo. The thing / difference / about these types of Arduino is that they have an ATMega 32U4 processor which allows HID. These are the only options (there are, in reality a few others - but forget them for now)
The programming within the Arduino IDE is the same as you are used to if you use the normal Arduino IDE. A library is available for HID / game controller / joystick from - https://github.com/MHeironimus/ArduinoJoystickLibrary
Again, please remember this will ONLY work with the 32U4 based boards.
The library comes with samples / examples for you to test.

There is a much easier way if you do not want to delve into the depths of Arduino programming, and that is to use the aforementioned Leo Bodner board - in fact, I would definitely recommend this for your purpose. It simply replaces your current arduino that is used for the potentiometers

http://www.leobodnar.com/shop/index.php ... cts_id=204

or

http://www.leobodnar.com/shop/index.php ... cts_id=180

These REPLACE the arduino in your system and you simply connect your existing wires from your potentiometers. It is then all plug and play. Windows sees it as a HID device, you can then use the internal windows full calibration routines, and you can add fancy features in X-Plane such as non linear responses if you need.

NO Air manager, No SimVim etc,
Simply wire up your pots to the board, plug it into a usb port and away you go.
Each pot uses the board's common terminal.
From - for example, the bodner board, each 5v supply to the pot(s) are common and each 'gnd' is also common. The wipers go to the input of the adcs on the board.
It really is as simple as that.

Note - It is actually bad practice to use a main chassis ground in the case of computer to external device connection as this can cause huge issues with differential voltages.
you will not have ANY issues with RMI / EMI ground loops etc - do not use a chassis point in a metal case - for example - as a common ground. - and certainly NEVER a mains earth / gnd connection on a chassis to a computer common.

We can look at your basic schematic / pot and button hook up diagram if you want and point you at where to connect them to the bodner board, or the 32U4 based arduino.
But, when you get you head around it, it is really easy (with the Bodner board) and you can probably sort it all in no time at all.

Keep firing away with questions Tom,
Happy to help.

Look here for an example for the connection based Leo Bodner board - find the pot example. In this case all the commons are on the board so you simply connect each pot to the board as shown. It is really as easy as that.

http://www.leobodnar.com/shop/index.php ... cts_id=180

Hope that helps sir ?

Joe.
Joe,
No worries, I understand. I also come from an Analog background via Amateur Radio - way back - since about 40 years ago. I am a 'G4' - G4XRZ
I am KE6EXT, or at least I was. Looking forward to getting back to HAM radio soon, but this time I am going to buy a radio as opposed to building one.
The HID 'device' (Arduino or Bodner board etc) is seen by windows as a 'game controller' / 'Joystick' . - it appears in control panel > hardware and sound > devices, from there, you right click on it and select game controller settings, and you are presented with a full calibration and test setup built in to windows. - THIS is the calibration.
I had no idea of the above.
Note - It is actually bad practice to use a main chassis ground in the case of computer to external device connection as this can cause huge issues with differential voltages.
Yes, no kidding. Through coax, however, it is ok if only one end of the shield is grounded. Like I showed in the picture, all lines were isolated from chassis ground. For reasons of fate, most of my EE career has revolved around reducing EMI for getting FCC certification. Not that I ever woke up one day and said to myself "gee, I think that I want to spend my life in radiation chambers, and revising PCB layouts to reduce the emissions by 2dB at 800MHz". It was more like "well, nobody else wants to do it".
Again, please remember this will ONLY work with the 32U4 based boards.
Well, the board that I used is the Arduino Mega. Not one that works in the capacity that would be useful as an HID.

Honestly, I did not know a lot about building a sim when I started this project. I'm not a gamer, although my latest work was merging object detection, augmented reality and gaming. Shameless plug here for my youtube video https://www.youtube.com/watch?v=XKi0TFinFhg&t=17s.

What happened was, I had just gotten my A&P, which in the US is an FAA certification for working on aircraft. Not sure why, since I am too old to be crawling in and out of aircraft the size of a Volkswagen beetle. I just wanted to learn to repair aircraft in case I got my own plane. Have not done that yet. Well, there was this old simulator console in the lab that nobody was using and I had done volunteer work for the school so they said that I could "borrow" it. It was attached to a 25 year old Apple 2 computer. The basic 6 worked but the graphics were so bad for this day and age that I could not live with it. I though to myself, well, as an EE, I should be able to modernize this thing. What I should have done is to run into someone like you with your knowledge base. I am sure that the whole project would have gone easier. A LOT easier.

Now that you have a link to my video, you will know how to send me a comment. Perhaps we can converse further from there.

Regards
Tom

User avatar
jph
Posts: 2856
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Touch screen controls X Plane NOT Air Manager panel

#22 Post by jph »

Hi Tom,
Nice video but augmented reality is in its absolute infancy so it is not something I am personally interested in - but I do understand the attraction but visual recognition of objects is in the stone age relative to real world applications. Similar to VR, where we are probably 5 years - or more away - from real quality stuff. VR has been 'the next best thing and the new killer app' since the early 90's.............. ;)

However, to your current issue, - it is absolutely easy to sort out.

There is no problem in leaving your existing Arduino if it controls other aspects of your sim apart from the axis. - presuming you are using the existing 'mega' for other functions such as buttons or whatever, then simply remove the 'axis' code - or simply leave it and ignore it in AM etc - , leave the existing Arduino mega board in place and then add the Bodner or 32U4 board for the AXIS channels only. It is straight foreword if you do it that way.
Send a PM to me with your email address and I am happy to assist in anyway I can, and you can teach me a thing or two. :)

Joe.
Joe. CISSP, MSc.

Post Reply