Non Linear Gauge Calculations

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

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

Re: Non Linear Gauge Calculations

#21 Post by Ralph »

Will do a screencast tonight.

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

Re: Non Linear Gauge Calculations

#22 Post by Ralph »

I hope this helps.


User avatar
shadyowl2
Posts: 176
Joined: Tue Dec 08, 2015 5:06 pm

Re: Non Linear Gauge Calculations

#23 Post by shadyowl2 »

Ralph wrote:Will do a screencast tonight.

As Always Ralph, Spot on, Coded the gauge in 20 minutes...It has some bugs but it works.....If I get to FlightSimCon 2016 Drinks are on me :mrgreen:
OORAH!!!! Its a Marine Thing....USMC retired

User avatar
russ
Posts: 593
Joined: Tue Oct 27, 2015 5:37 pm

Re: Non Linear Gauge Calculations

#24 Post by russ »

Nice job explaining it all Ralph!

Just one little technique I use (possibly helpful for others also using paint.net) to avoid all the trial and error. I put the needle on a layer over the background. "Select all" on the needle layer and then select the move tool and rotate the needle image by one of its corners. The rotation angle is shown in the bottom margin of the window and you can quickly note the values for each changeover point quickly without any guesswork.
Russ Barlow
Air Manager Evangelist

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

Re: Non Linear Gauge Calculations

#25 Post by Ralph »

That's an even better practice. I could have done the same in Skinman, but I'm usually too lazy :) For this example it was also good to show an alternative option.

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

Re: Non Linear Gauge Calculations

#26 Post by Ralph »

I did something wrong. The airspeed indicator would move just a little bit in the beginning, and make bigger movements as the airspeed increases. Silly me... :oops:

Example:

Code: Select all

img_rotate(img_needle, 22.5 / 30 * (knots^2 / 30))

User avatar
shadyowl2
Posts: 176
Joined: Tue Dec 08, 2015 5:06 pm

Re: Non Linear Gauge Calculations

#27 Post by shadyowl2 »

Ralph wrote:I did something wrong. The airspeed indicator would move just a little bit in the beginning, and make bigger movements as the airspeed increases. Silly me... :oops:

Example:

Code: Select all

img_rotate(img_needle, 22.5 / 30 * (knots^2 / 30))
How did you come up with those numbers based on your gauge? I'm assuming that's the last line of code? I think this is where my problem is in my gauge also.
OORAH!!!! Its a Marine Thing....USMC retired

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

Re: Non Linear Gauge Calculations

#28 Post by Ralph »

You would only want to use that if you're making an airspeed indicator. Knots has to be equal to 30 for it to move to 30 knots (duh :)), 30^2 = 900 / 30 = 30. This will make it move very slow from the beginning. But if you're not making an airspeed indicator then just forget this.

User avatar
shadyowl2
Posts: 176
Joined: Tue Dec 08, 2015 5:06 pm

Re: Non Linear Gauge Calculations

#29 Post by shadyowl2 »

Figured it out, turns out it was a math calculation error in rotation. Gauge is complete. Thanks guys. :D
OORAH!!!! Its a Marine Thing....USMC retired

tomlithgow
Posts: 60
Joined: Sun Jun 12, 2016 3:11 pm

Re: Non Linear Gauge Calculations

#30 Post by tomlithgow »

Reading the above, in the short instrument creation experience I've had, I used both formulae and approximation to the curve by breaking into linear relationships between values and needla position.

I jumped in at the deep end with the ASI for the DHC-6 Twin Otter. I measured the angles of a number of scale graduations from a good photo of an actual ASI. Then I put these into an Android App called Curve Fitter. This allowed me to try various complexity of formula from linear, to quadratic, cubic, fourth power, etc to find the best compromise fit to the graduations. I then used this formula to position the graduations on the dial I was creating so that when the formula is used in the Lua script it matches precisely.
I

Post Reply