Potentiometer low resolution in Air Manager

Are you building a cockpit, planning to build one or just dreaming, this is your cockpit builder meeting point

Moderators: russ, Ralph

Post Reply
Message
Author
Macsbig
Posts: 31
Joined: Sun Jan 01, 2023 9:02 pm

Potentiometer low resolution in Air Manager

#1 Post by Macsbig »

Hi all,

I've made a C152 panel using 3D printed parts and Air manager.

The issue I'm having is this - the 10K, 10 turn pot I'm using for the trim wheel is only changing the value about every 45 degrees of revolution or so, and is therefore not sensitive enough, and feels "odd" in the sim. The 10k linear pots I'm using for the throttle, mixture and carb heat all work great.

If I use an Arduino sketch, the value of the Trim pot changes all the time when I'm turning, and if AM was picking up the signal like this, it would be great; so I'm assuming this is an Air Manager issue, or something I'm missing here?

Is there a way to increase the resolution Air manager is reading at? After all, there are 1023(?) positions on the Arduino if I am correct.

Many thanks

Mark
Currently building my own home cockpit, general purpose one with 3 x 32” wrap around monitors and two lower monitors for instruments and PFD’s. Currently, putting together parts for the Toliss A321

User avatar
Corjan
Posts: 2941
Joined: Thu Nov 19, 2015 9:04 am

Re: Potentiometer low resolution in Air Manager

#2 Post by Corjan »

Hi,


My guess is that you are using lua scripting to do this.

If you are, there is a hysteresis argument in the hw_adc_input_add:
https://siminnovations.com/wiki/index.p ... _input_add

It defaults to 0.02 (2%), but you can also set it to 0.00 to get the exact ADC value.


Hope this helps,

Corjan

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Potentiometer low resolution in Air Manager

#3 Post by Keith Baxter »

Hi,

Please show you pot code.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Macsbig
Posts: 31
Joined: Sun Jan 01, 2023 9:02 pm

Re: Potentiometer low resolution in Air Manager

#4 Post by Macsbig »

Corjan wrote: Mon May 01, 2023 11:47 am Hi,


My guess is that you are using lua scripting to do this.

If you are, there is a hysteresis argument in the hw_adc_input_add:
https://siminnovations.com/wiki/index.p ... _input_add

It defaults to 0.02 (2%), but you can also set it to 0.00 to get the exact ADC value.


Hope this helps,

Corjan

Hi Corjan, thanks for the reply.

You are correct, in that it seems to be moving 2% at a time, and I'm using LUA. I'll take a look at your link!

Many thanks

Mark

EDIT:
Yep, that was it! I've learnt something new again today and am very grateful !!
I've set it to 0.002, and it's perfect, thanks again!

Mark
Currently building my own home cockpit, general purpose one with 3 x 32” wrap around monitors and two lower monitors for instruments and PFD’s. Currently, putting together parts for the Toliss A321

SimPassion
Posts: 5346
Joined: Thu Jul 27, 2017 12:22 am

Re: Potentiometer low resolution in Air Manager

#5 Post by SimPassion »

Macsbig wrote: Mon May 01, 2023 12:12 pm .../...
I've set it to 0.002, and it's perfect, thanks again!

Mark
0.002 is somewhat near to 0, just in any doubt. Not sure the ADC value will make the difference on 3rd digit on the fract part ... 🤔 (Not checked in any case on my own, though I will to see if I'm fully wrong on this)
For sure between 0.2 and 0 it would make the difference and it worked for you because your selected hysteresis 0.002, was more like 0 ...

Macsbig
Posts: 31
Joined: Sun Jan 01, 2023 9:02 pm

Re: Potentiometer low resolution in Air Manager

#6 Post by Macsbig »

SimPassion wrote: Mon May 01, 2023 12:57 pm
Macsbig wrote: Mon May 01, 2023 12:12 pm .../...
I've set it to 0.002, and it's perfect, thanks again!

Mark
0.002 is somewhat near to 0, just in any doubt. Not sure the ADC value will make the difference on 3rd digit on the fract part ... 🤔 (Not checked in any case on my own, though I will to see if I'm fully wrong on this)
For sure between 0.2 and 0 it would make the difference, and it worked for you because your selected hysteresis 0.002, was more like 0 ...

I tried 0.0, and it was picking up erroneous readings, so I experimented until I found a value that worked for me. To be honest, it's the first time I've used AM for a hardware project (used MobiFlight before, and AM for screen panels/instruments), something I did find is whenever I changed the code, to try it I had to exit AM and restart, instead of just pressing play - or it got a little confused (odd values from the code execution). Have you experienced that?

Mark
Currently building my own home cockpit, general purpose one with 3 x 32” wrap around monitors and two lower monitors for instruments and PFD’s. Currently, putting together parts for the Toliss A321

Post Reply