Touch screen controls X Plane NOT Air Manager panel

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Message
Author
User avatar
Sling
Posts: 5244
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Touch screen controls X Plane NOT Air Manager panel

#11 Post by Sling »

Tom,

Happy to assist if I can but your hardware question is somewhat off topic for this thread. Can you start a new thread with your question and I’ll respond there.

Tony

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

Re: Touch screen controls X Plane NOT Air Manager panel

#12 Post by jph »

Hi Tom,

Personally, I would never even attempt to use AM for yoke and other primary flight controls. It is FAR FAR better to use a standard joystick input such as an arduino in HID mode or even, if you have to a Bodner board.
;)
Joe. CISSP, MSc.

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

Re: Touch screen controls X Plane NOT Air Manager panel

#13 Post by miner_tom »

I agree! I dd try but as I laid out in my last post, even with attempting to write XLUA code, a year ago, there was no way to query the A to D converter on the Arduino with a "dataref" command in order to get the voltage which would represent the current "position" of the yoke. Perhaps that has changed but I don't have the desire to go through all the research again in order to write a calibration routine for my hardware. SimVim took care of that. My hardware is really analog, using rotary potentiometers and the yoke and pedals are very realistic. In reality, since there are cables and pullys in the console, I can barely tell the difference from, say, a Cessna 150. I still use AM for panel design, that works good. With the only caveat that I believe that AM tends to "grab and not release" the COM port on windows. Getting X Plane, AM and SimVim to work and play nice together has been a chore, and I am not completely there (and probably won't ever be), but at least it works good enough.

Regards
Tom

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

Re: Touch screen controls X Plane NOT Air Manager panel

#14 Post by jph »

miner_tom wrote: Wed Feb 10, 2021 5:22 pm I agree! I dd try but as I laid out in my last post, even with attempting to write XLUA code, a year ago, there was no way to query the A to D converter on the Arduino with a "dataref" command in order to get the voltage which would represent the current "position" of the yoke. Perhaps that has changed but I don't have the desire to go through all the research again in order to write a calibration routine for my hardware. SimVim took care of that. My hardware is really analog, using rotary potentiometers and the yoke and pedals are very realistic. In reality, since there are cables and pullys in the console, I can barely tell the difference from, say, a Cessna 150. I still use AM for panel design, that works good. With the only caveat that I believe that AM tends to "grab and not release" the COM port on windows. Getting X Plane, AM and SimVim to work and play nice together has been a chore, and I am not completely there (and probably won't ever be), but at least it works good enough.

Regards
Tom
Hi Tom,
Just out of interest, what is the issue with calibration etc ? - there is absolutely no issue no issue in calibrating a HID joystick / analog axis in Windows / and further functions in X-Plane itself. You dont need to write any form of calibration routine.
Perhaps I'm misunderstanding - some or all haha - but I am not sure why you need simvim if you use a HID input. You dont use encoders with a HID /joystick device, it is all analog based.
For example, if you use an Arduino Pro Micro or Leonardo, then you can write a full HID game controller / joystick interface using the readily available Joystick2 library. All the inputs can be - in fact, are expected to be - analog. So no issue with your existing analog pots etc.
Calibration for main movement etc is done in windows and is excellent.
Altering linearity / response curves etc etc is fully available in X-Plane per axis. and is really excellent.
A single cheap Arduino - the ali express ones are perfect (must be the 32U4 based units - or DUE but DUE is overkill) can give you 8 axis, 32 buttons and 2 hats. You can even use multiple controllers on 1 arduino, however, you will run out of pins first ;) . A single arduino Pro Micro 32U4 unit would cost you around 2 or 3 dollars.

As an aside, the arduino DUE is an interesting beast in that it has 2 'serial' outputs in which one can be configured as a full HID unit, and the other can be a standard serial unit that can run messageport.
So in effect you can run a full HID joystick AND any custom stuff you want at the same time grabbing and using data from either. I did a simple proof of concept and it worked fine - only in the context of HID and serial simultaneously - but that would allow 1 serial to work in AM no issues and the other to be seen in Windows as a standard HID game controller.

If you are not sure about HID (human interface device) etc then let me know. There is a superb library for the arduino that allows you to do virtually anything with your analog setup.

Joe
Joe. CISSP, MSc.

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

Re: Touch screen controls X Plane NOT Air Manager panel

#15 Post by miner_tom »

jph wrote: Thu Feb 11, 2021 9:30 am
miner_tom wrote: Wed Feb 10, 2021 5:22 pm I agree! I dd try but as I laid out in my last post, even with attempting to write XLUA code, a year ago, there was no way to query the A to D converter on the Arduino with a "dataref" command in order to get the voltage which would represent the current "position" of the yoke. Perhaps that has changed but I don't have the desire to go through all the research again in order to write a calibration routine for my hardware. SimVim took care of that. My hardware is really analog, using rotary potentiometers and the yoke and pedals are very realistic. In reality, since there are cables and pullys in the console, I can barely tell the difference from, say, a Cessna 150. I still use AM for panel design, that works good. With the only caveat that I believe that AM tends to "grab and not release" the COM port on windows. Getting X Plane, AM and SimVim to work and play nice together has been a chore, and I am not completely there (and probably won't ever be), but at least it works good enough.

Regards
Tom
Hi Tom,
Just out of interest, what is the issue with calibration etc ? - there is absolutely no issue no issue in calibrating a HID joystick / analog axis in Windows / and further functions in X-Plane itself. You dont need to write any form of calibration routine.
Perhaps I'm misunderstanding - some or all haha - but I am not sure why you need simvim if you use a HID input. You dont use encoders with a HID /joystick device, it is all analog based.
For example, if you use an Arduino Pro Micro or Leonardo, then you can write a full HID game controller / joystick interface using the readily available Joystick2 library. All the inputs can be - in fact, are expected to be - analog. So no issue with your existing analog pots etc.
Calibration for main movement etc is done in windows and is excellent.
Altering linearity / response curves etc etc is fully available in X-Plane per axis. and is really excellent.
A single cheap Arduino - the ali express ones are perfect (must be the 32U4 based units - or DUE but DUE is overkill) can give you 8 axis, 32 buttons and 2 hats. You can even use multiple controllers on 1 arduino, however, you will run out of pins first ;) . A single arduino Pro Micro 32U4 unit would cost you around 2 or 3 dollars.

As an aside, the arduino DUE is an interesting beast in that it has 2 'serial' outputs in which one can be configured as a full HID unit, and the other can be a standard serial unit that can run messageport.
So in effect you can run a full HID joystick AND any custom stuff you want at the same time grabbing and using data from either. I did a simple proof of concept and it worked fine - only in the context of HID and serial simultaneously - but that would allow 1 serial to work in AM no issues and the other to be seen in Windows as a standard HID game controller.

If you are not sure about HID (human interface device) etc then let me know. There is a superb library for the arduino that allows you to do virtually anything with your analog setup.

Joe
Joe, perhaps there was, indeed, something that I missed. I'm always up for learning new things. Like I said, my console is old. Perhaps older than you. The information that is passing from the yoke, pedals, throttle, etc, is only an analog voltage. That is it. 5 volts DC goes from the Arduino to the resistors which represent the controls just described, and then back to an Analog to Digital converter input on the Arduino. The Arduino senses the voltage and then transmits that information back to X plane, where the Air Manager plugin uses it (or is it the other way around...where the arduino transmits the data to air manager through a COM port if it is windows). At least, that is what I had intended to do. When I used Air Manager in that way, the yoke display in X Plane was tilted to the right. As described above, I wanted to find out if there was a calibration routine that would zero out that offset. There was not. I attempted to write one in LUA but found that the version of LUA that Air Manager used is XLUA and it is only a subset of the greater LUA programming language.

Below is one of my original posts that I made to Sim Innovations last year.

I am running X Plane 11 and Air Manager with Arduino Hardware on an old "Precision Flight Controls" console, on which, I am really only using the Yoke (pitch and roll), the rudders, the throttle and the mixture.

I originally connected up the hardware with Simvim and ran it with X Plane. So, I KNOW that it works.

Changing to Air Manager I was required to write a LUA script for the flight controls. The Throttle and mixture controls worked well with the datarefs that I used for X Plane in LUA.

I am having a problem with the yoke_roll. The problem is that when the program is initialized "sim/cockpit2/controls/yoke_roll_ratio" is somehow initialized or getting an initial value to start with other than zero. The "yoke_roll_ratio" will be within -1 to +1 but starts with something like 0.20205. That means that the display of the yoke is crooked and will not correct automatically. "yoke_roll_ratio" is getting its initial value from somewhere.

Now, I made an assumption that a calibration function was necessary because as I mentioned, I used to use Simvim and there was a built in calibration function. But in my case I don't know how to write one.



Well, I got a few replies but nothing helped and as I decided to "move on" I found the solution in SimVim, which is another plugin. That plugin, has an analog calibration routine, built in. When it starts, the Arduino connects through a COM port. When I need to calibrate, I choose which input to calibrate (there is a choice) and I move the control to full swing in both directions and then release. The calibration routine internally determines what the maximum voltage and the minimum voltage is input to the A/D and the rest is history. Works fine and I don't have to reinvent the wheel. I was actually told by a couple of the good people at Air Manager that what I wanted to do could not be done. So I found another way. I am not advertising here but SimVim now has a panel product that somewhat competes with Air Manager but is not nearly as detailed. That is why I like to use Air Manager for my panels. But, at some point, I am going to test the SimVim product. Getting Air Manager and SimVim to play nice with each other is a chore. For example, Air Manager likes to grab the COM port and not release it, so that SimVim can't connect to X Plane. I have to start X Plane, then Simvim and then choose a different "screen" to be able to start Air Manager. Then they play nice. kind of.

What am I missing?

Tom

User avatar
Sling
Posts: 5244
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Touch screen controls X Plane NOT Air Manager panel

#16 Post by Sling »

Tom,

Xplane and all other sims for that matter have built in calibration for controls. The controls however need to be connected as a HID device. This is how joysticks, yokes, pedals etc you may buy work. The good news is you can fabricate your own HID interface or if you don’t feel up to that you can buy ready made HID interface cards such as the Bodnar cards you may of heard mentioned elsewhere. It’s a simple case of connecting your pots to the analog inputs on the HID card.

I’d recommend you go this route to keep your controls platform independent and without having to worry about calibration outside of the sim.

I’m currently building a throttle quadrant that will use hall effect sensors and a DIY HID so I will have these same challenges.

Tony

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

Re: Touch screen controls X Plane NOT Air Manager panel

#17 Post by jph »

Thanks Tony,
Tom, as Tony and I are saying, there is absolutely no issue in connecting you analog flight controls to the sim - WITHOUT using Air Manager. Even as Tony says, quadrants etc. IN fact !. it is really the ONLY way to do this properly.

Let me try to explain a bit more.
- oh, also if the stuff you are using is over 63 years old, then yes, it is older than me/// ;) - I think there is only 2 years between you and me lol :P

ALL 'joysticks', flight controllers, yokes, pedals, quadrants etc that you can buy ARE exactly the same as you have regarding input. They have, as you mention, 5V from the controller (arduino for example) to the 'potentiometer' and the output of the pot, the wiper, goes to the adc on the arduino. - exactly as you are saying.
The difference is - that none of them use, or need to use - Air Manager for this primary sim function.
In a typical flight yoke that you might buy - then - just as you have, the yoke turns a potentiometer, the potentiometer is connected to 5V and the ANALOG output is connected to an ADC.
The 'controller' (arduino / Bodner board etc), then passes the data directly to Windows via a route called 'HID' - basically, you plug in the USB, the PC recognises it as a HID game controller / joystick and then you have full calibration control in windows per device, also, you have addition superb features for each axis within x-plane etc. YOU DONT HAVE TO 'PROGRAM' ANYTHING if you dont want to.

The difference here is that Air Manager is NOT in the equation.

So, as you rightly say, you have - already - the analog potentiometers etc built into your rig, so you only need to connect them to a suitable controller board. As Tony and I are saying, you can make one yourself if you are ok with Arduino programming and library use, or, you can buy, relatively cheaply, a suitable board from Leo Bodner.
You simply connect your existing ANALOG units to the board, then plug it into windows. Thats it. !.. - no programming, no lua absolutely nothing! - then you have full control for calibration etc. Again I stress. NO AIR MANAGER for this part. ALL your existing controls will work fine. Calibration is built into Windows. Further adjustments to the axis settings are built into X-Plane.

If you buy the Bodner board - for example - http://www.leobodnar.com/shop/index.php ... cts_id=204
then it is all done for you and you only need to connect your existing analog controls - exactly as you mentioned - 5v to the pot, and the analog output to the adc input of the board - (as - for example) above and simply PLUG IT INTO USB - it is plug and play, it is all done for you directly from your existing analog controls.
Again, I must stress, this is completely outside of air manager and is absolutely the best way. This is not something Air Manager was designed to do.
This is the absolutely NORMAL way of connecting analog input controls, flight controls etc to a PC and then to your flight sim and you get full setup and calibration etc etc built in free of charge with nothing to program or change on your part.

Your system is based - as are 99% - on analog potentiometers. There are some different input methods that can be used today - such as the hall effect units that Tony mentioned, but, they are still - in almost all cases - working in the same way as your 'potentiometers' in respect of giving an analogue signal output, that goes to an ADC on the controller etc.

No worries if there is any more clarification needed, or any more questions. I and others are happy to help.
Best regards,
Joe
Joe. CISSP, MSc.

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

Re: Touch screen controls X Plane NOT Air Manager panel

#18 Post by miner_tom »

jph wrote: Fri Feb 12, 2021 11:26 am Thanks Tony,
Tom, as Tony and I are saying, there is absolutely no issue in connecting you analog flight controls to the sim - WITHOUT using Air Manager. Even as Tony says, quadrants etc. IN fact !. it is really the ONLY way to do this properly.

Let me try to explain a bit more.
- oh, also if the stuff you are using is over 63 years old, then yes, it is older than me/// ;) - I think there is only 2 years between you and me lol :P

ALL 'joysticks', flight controllers, yokes, pedals, quadrants etc that you can buy ARE exactly the same as you have regarding input. They have, as you mention, 5V from the controller (arduino for example) to the 'potentiometer' and the output of the pot, the wiper, goes to the adc on the arduino. - exactly as you are saying.
The difference is - that none of them use, or need to use - Air Manager for this primary sim function.
In a typical flight yoke that you might buy - then - just as you have, the yoke turns a potentiometer, the potentiometer is connected to 5V and the ANALOG output is connected to an ADC.
The 'controller' (arduino / Bodner board etc), then passes the data directly to Windows via a route called 'HID' - basically, you plug in the USB, the PC recognises it as a HID game controller / joystick and then you have full calibration control in windows per device, also, you have addition superb features for each axis within x-plane etc. YOU DONT HAVE TO 'PROGRAM' ANYTHING if you dont want to.

The difference here is that Air Manager is NOT in the equation.

So, as you rightly say, you have - already - the analog potentiometers etc built into your rig, so you only need to connect them to a suitable controller board. As Tony and I are saying, you can make one yourself if you are ok with Arduino programming and library use, or, you can buy, relatively cheaply, a suitable board from Leo Bodner.
You simply connect your existing ANALOG units to the board, then plug it into windows. Thats it. !.. - no programming, no lua absolutely nothing! - then you have full control for calibration etc. Again I stress. NO AIR MANAGER for this part. ALL your existing controls will work fine. Calibration is built into Windows. Further adjustments to the axis settings are built into X-Plane.

If you buy the Bodner board - for example - http://www.leobodnar.com/shop/index.php ... cts_id=204
then it is all done for you and you only need to connect your existing analog controls - exactly as you mentioned - 5v to the pot, and the analog output to the adc input of the board - (as - for example) above and simply PLUG IT INTO USB - it is plug and play, it is all done for you directly from your existing analog controls.
Again, I must stress, this is completely outside of air manager and is absolutely the best way. This is not something Air Manager was designed to do.
This is the absolutely NORMAL way of connecting analog input controls, flight controls etc to a PC and then to your flight sim and you get full setup and calibration etc etc built in free of charge with nothing to program or change on your part.

Your system is based - as are 99% - on analog potentiometers. There are some different input methods that can be used today - such as the hall effect units that Tony mentioned, but, they are still - in almost all cases - working in the same way as your 'potentiometers' in respect of giving an analogue signal output, that goes to an ADC on the controller etc.

No worries if there is any more clarification needed, or any more questions. I and others are happy to help.
Best regards,
Joe

Joe,

Based upon what you are saying and what I believe that it was Sling, also added, I could use the calibration capabilities of X Plane, as long as my analog devices are attached as HIDs (human interface devices). Would that be a correct statement?

It sounds so simple. I wonder why over the last year nobody has given me that advice despite my pathetic cry's for help in posts. Either to Air Manager or to X Plane.

As an old EE, having designed and built perhaps hundreds of boards, I have no desire to re-invent the wheel. I have an Arduino running, and don't wish to start all over since I did a lot of extra work that I found was necessary in order to "clean up" the signals from the potentiometers. Why, you might ask? Because when I did the first build of the Arduino interface, I ignored the possibility that stray EMI (electro-magnetic interference ) might be getting into the unshielded wires connecting the pots to the A/D converter. I am sure that the noise was within the input bandwidth of the A/D. Huge caps alone would not be the answer. Better to prevent something from getting in as opposed to having to get rid of it. I should have known better, having spent decades reducing EMI in commercial PCBs. I should have known better!! I noticed that after the first build, there was quite a "wiggle" in the simulator control. Could not hold the flight control steady and this really had an affect when attempting landing. So, I tore the thing apart and used shielded CAT-7 cable for the connections and also added a 1/2" square copper bar, insulated from the chassis, as a ground return, while eliminating possible ground loops. Also added bypass caps to the A/D inputs for filtering. I have a photo attached and hopefully that will come through.
Circuit_1.gif
[attachment=0].

So, with that confession of complete overkill, you know why I really don't want to start over again with changing the circuitry. Is there a way to use the Arduino without AM or SimVim to control as a joystick? Of course, as configured now, X Plane does not recognize any of my hardware, as you would expect. That is why I am using the added plugins.

Thank You all for your help and patience.

Tom

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

Re: Touch screen controls X Plane NOT Air Manager panel

#19 Post by jph »

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. CISSP, MSc.

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

Re: Touch screen controls X Plane NOT Air Manager panel

#20 Post by jph »

Tom,
here is an example of the easy to use windows (win 10 in this case) calibration and setup routine ...

I just programmed an Arduino Pro Micro (32U4 based) Leonardo clone - with one of the Joystick2 library examples.

7 independent Axis, 32 buttons and a Hat Switch.

The board - I renamed to 'Example Controller Board' - but it is a Leonardo.. and would normally show as a Leonardo..

However, the point of this post is to show how the windows built in setup allows absolutely easy calibration. You may not have seen this option if you have never had a joystick (hid) plugged in. It is plug and Pray ..(I mean plug and play lol :lol: )
ProMicro32U4_1.jpg
ProMicro32U4_2.jpg
This is Arduino (32U4 pro micro), but you get the exact same options with the Bodner board - AND you don't have to do any Arduino programming to set up the device as a basic HID unit.

I fully understand if this is 'information overload' Tom, and I do apologise if it is. It is hard work for ALL of us when we come across new areas that we haven't explored. But no worries. Ask away if needed.
Can I see more piccies of your sim setup / hardware - it looks to be something special ..

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(Ignore this below for now Tom - this does NOT apply to what we are discussing above !!!!.)


(but - Out of interest - for any others that want to know how to change the name of the device showing up in the devices / game controller option - to their own device name - as opposed to 'Arduino Leonardo' - let me know... it involves editing the boards.txt file, and can brick - / semi brick your Leonardo if not careful /// :shock: ;) - so be careful.....

Joe
Joe. CISSP, MSc.

Post Reply