Multi Engine Throttles have not a smooth movement

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Multi Engine Throttles have not a smooth movement

#11 Post by Ralph »

It can indeed be a software issue. Just trying to rule out the obvious :) I'll see if I can find two potentiometers and give it a try.

User avatar
Huberflight
Posts: 42
Joined: Sat Mar 31, 2018 2:27 pm

Re: Multi Engine Throttles have not a smooth movement

#12 Post by Huberflight »

Thanks for your help Joe,

I think you are right.
I once tested an alternative in terms of control with the same hardware. And it worked fine. The idea behind my design was not to have to recalibrate the thrust quadrant over and over again. I currently have four aircraft that I simulate in my process trainer. In order to make the conversion as easy as possible, I thought to do everything with an I / O system. I haven't searched yet, but is there a script directly for the Arduino to control my thrust quadrant?

Greetings Björn
When it looks not right, go around. It's easier to explain why you done it, than for others to finde out why you don't.

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

Re: Multi Engine Throttles have not a smooth movement

#13 Post by jph »

Huberflight wrote: Sat Apr 03, 2021 6:37 am Thanks for your help Joe,

I think you are right.
I once tested an alternative in terms of control with the same hardware. And it worked fine. The idea behind my design was not to have to recalibrate the thrust quadrant over and over again. I currently have four aircraft that I simulate in my process trainer. In order to make the conversion as easy as possible, I thought to do everything with an I / O system. I haven't searched yet, but is there a script directly for the Arduino to control my thrust quadrant?

Greetings Björn
Hi Björn,
Have a look at this link. This is the best library to use. There are example sketches included that you can customise as needed. Have a play with it.
He uses the standard HID AXIS naming conventions - ''Rudder' 'Throttle' XAxis, RxAxis etc so there are more than 8 axis naming options available but only 8 physical axis, but just work with the first 7 or 8. The axis are calibrated in Windows using standard windows game controller settings, then in X-Plane you can set ANY of the axis to ANY axis function as you need. You can also then fully customise response curves etc in X-Plane. These settings are all non volatile so you wont need to keep re-doing them.
https://www.instructables.com/Create-a- ... ick-Libra/
If you look on Github and scroll down the page you can see all the library calls. It is very well done.
https://github.com/MHeironimus/ArduinoJ ... ersion-2.0

There is a wiki here for the library that offers various examples but it is easy to 'roll your own' :)
https://github.com/MHeironimus/ArduinoJ ... brary/wiki

The Pro Micro arduino and Leonardo are suitable and have 12 x 10bit ADCs (Leonardo) and 9 x 10bit ADCs (Pro Micro) which are fine for these types of axis. You 'can' use a DUE with this library to give 12 bit AXIS but it is a waste of a DUE unless you made it multi function using HID AND serial at the same time - but best to stick with the Pro Micro 32U4 or Leonardo (the ones on Aliiexpress are superb quality and cheap)
Take a look and see if it's for you. You can also always increase the resolution using the nice cheap external 16 bit ADC units. but, not needed here me thinks.
To make a complete sketch for the AXIS you only need to assign the ADC inputs to the appropriate axis calls. and loop it in Main() - oh, if you want buttons or hats you need to specify them as well.
The examples are great. Have a look at the 'Joystick Test' and then 'flight controller test' sketch. You can flash these to a Pro Micro or Leonardo and see the operation in Windows without actual potentiometer hardware connected to the Pro Micro. This shows all the calls you should need. You can use this as the basis for your Game Controller. You can enable or disable axis and number of buttons / hats etc just after the include. I think the maximum number of axis is 7. In the Joystick Test sketch the defaults are used, in the Flight Controller test' an example of enabling and disabling axis and option - buttons, hats etc - is shown. The axis are enabled with the 'true' / 'false' The only thing that can be slightly confusing is the use of HID naming conventions.

Code: Select all

Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, 
  JOYSTICK_TYPE_MULTI_AXIS, 32, 0,
  true, true, false, false, false, false,
  true, true, false, false, false);
You can still only have 7 axis maximum per joystick, but you can also have multiple joysticks on a single arduino - again, there is an example for multiple joysticks on one arduino in the 'examples'.
The Joystick API details give all the info and you can play about at your leisure without hardware connected.
I seem to remember that in the past, I modified the library to give a full 8 axis... but I would have to find it. Or, it maybe that only 7 show up in windows (if you enable 8) but it is visible to X-Plane.. I cant remember.. :? Getting old :D . Once you have it set up and tested it is a standard USB 'plug and pray' joystick to windows and X-Plane and works great.

There is a nice Leonardo version available with excellent 3 pin headers for each pin - 5V 0V and actual pin - which is really nice for such a use -
https://www.aliexpress.com/item/3286589 ... 4c4dM34nwp. I received 4 a few weeks ago and they are superbly made. You can use normal R/C servo extension leads to plug in and connect to your pots. But ANY Leonardo version will do.

Ps, there is also the option of using a ready made board such as the ones from Bodner -
http://www.leobodnar.com/shop/index.php ... ddd87cd0fb
But they are bloody expensive for what they are ! - compared to a chinese Leonardo such as the one I listed to above, and you can, of course, modify your own arduino version code as much as you want to.

Hope that helps ?
Joe
Last edited by jph on Sat Apr 03, 2021 8:42 am, edited 2 times in total.
Joe. CISSP, MSc.

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Multi Engine Throttles have not a smooth movement

#14 Post by Ralph »

I have two potentiometers on my desk, but I haven't had time to test it. I'll try next week. But there're too many things to do...
What you can try in the mean time is adjusting the hysteresis: http://siminnovations.com/wiki/index.ph ... #Arguments
Increasing it result in less 'data', and maybe a more stable behavior. You would loose resolution, but it is just for testing.

User avatar
Huberflight
Posts: 42
Joined: Sat Mar 31, 2018 2:27 pm

Re: Multi Engine Throttles have not a smooth movement

#15 Post by Huberflight »

Ralph wrote: Sat Apr 03, 2021 8:24 am I have two potentiometers on my desk, but I haven't had time to test it. I'll try next week. But there're too many things to do...
What you can try in the mean time is adjusting the hysteresis: http://siminnovations.com/wiki/index.ph ... #Arguments
Increasing it result in less 'data', and maybe a more stable behavior. You would loose resolution, but it is just for testing.
Hi Ralph.

Yes, I´ve done it before and it make the thinks more worst :cry:

The Idea from Joe is very good. I will test it in the next few days.
But normally I will work with AM. Because my whole system is build with it, it works pretty good and an old dog will not learn new tricks :D .
But to be seriously, I can't be the first with this problem and hopefully we will find a solution.
When it looks not right, go around. It's easier to explain why you done it, than for others to finde out why you don't.

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Multi Engine Throttles have not a smooth movement

#16 Post by Ralph »

I'll add it to my to do list for Friday. If it is really a software bug then we should fix this before the release.

User avatar
Huberflight
Posts: 42
Joined: Sat Mar 31, 2018 2:27 pm

Re: Multi Engine Throttles have not a smooth movement

#17 Post by Huberflight »

Ralph wrote: Wed Apr 14, 2021 5:28 pm I'll add it to my to do list for Friday. If it is really a software bug then we should fix this before the release.
Hi Ralph,
du you have tested it?

Greedings Björn
When it looks not right, go around. It's easier to explain why you done it, than for others to finde out why you don't.

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Multi Engine Throttles have not a smooth movement

#18 Post by Ralph »

No but can you test with the latest 4.0 beta?

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Multi Engine Throttles have not a smooth movement

#19 Post by Ralph »

We have tested this with two potentiometers, and your script. We tested it with the throttles only, so we did not have 6 ADC's running simultaneously.
With the two throttles it is working perfect. So I'm not sure if you tested this with throttles only... If yes, then I think you're experiencing some local distortion. Bad wiring, bad grounding, crosstalk, that kind of stuff. Or maybe even a faulty Arduino (clone?).

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

Re: Multi Engine Throttles have not a smooth movement

#20 Post by jph »

Ralph wrote: Fri May 14, 2021 9:35 am We have tested this with two potentiometers, and your script. We tested it with the throttles only, so we did not have 6 ADC's running simultaneously.
With the two throttles it is working perfect. So I'm not sure if you tested this with throttles only... If yes, then I think you're experiencing some local distortion. Bad wiring, bad grounding, crosstalk, that kind of stuff. Or maybe even a faulty Arduino (clone?).
Hi @Ralph
Did you notice the OP is using an Arduino connected to a Rasb PI ? - Just out of interest - which adds another layer. In the first image he posts here, it shows the setup with just two pots, but the mega connected to the PI.
Perhaps you did ? and if so apologies. Otherwise it is a PI controlling an Arduino.
As for 'clones' ? it is for the most part totally open source hardware so there are no 'clones'. It is only that a trademark infringement may occur in very limited circumstances. ;)
Joe
Joe. CISSP, MSc.

Post Reply