Non Linear Gauge Calculations

Questions about deployment and use of Air Manager Instruments

Moderators: Ralph, russ

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

Re: Non Linear Gauge Calculations

#21 Post by Ralph » Tue Apr 12, 2016 6:49 am

Will do a screencast tonight.

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

Re: Non Linear Gauge Calculations

#22 Post by Ralph » Tue Apr 12, 2016 7:57 pm

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 » Tue Apr 12, 2016 9:01 pm

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: 588
Joined: Tue Oct 27, 2015 5:37 pm

Re: Non Linear Gauge Calculations

#24 Post by russ » Wed Apr 13, 2016 3:43 am

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: 5088
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Non Linear Gauge Calculations

#25 Post by Ralph » Wed Apr 13, 2016 5:36 am

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: 5088
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Non Linear Gauge Calculations

#26 Post by Ralph » Wed Apr 13, 2016 8:18 am

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 » Wed Apr 13, 2016 12:26 pm

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: 5088
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Non Linear Gauge Calculations

#28 Post by Ralph » Wed Apr 13, 2016 3:51 pm

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 » Wed Apr 13, 2016 4:45 pm

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: 57
Joined: Sun Jun 12, 2016 3:11 pm

Re: Non Linear Gauge Calculations

#30 Post by tomlithgow » Sun Jun 12, 2016 6:31 pm

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

Who is online

Users browsing this forum: No registered users and 10 guests