Non Linear Gauge Calculations
Re: Non Linear Gauge Calculations
Will do a screencast tonight.
Re: Non Linear Gauge Calculations
I hope this helps.
Re: Non Linear Gauge Calculations
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
OORAH!!!! Its a Marine Thing....USMC retired
Re: Non Linear Gauge Calculations
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.
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
Air Manager Evangelist
Re: Non Linear Gauge Calculations
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.
Re: Non Linear Gauge Calculations
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...
Example:
Example:
Code: Select all
img_rotate(img_needle, 22.5 / 30 * (knots^2 / 30))
Re: Non Linear Gauge Calculations
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.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...
Example:Code: Select all
img_rotate(img_needle, 22.5 / 30 * (knots^2 / 30))
OORAH!!!! Its a Marine Thing....USMC retired
Re: Non Linear Gauge Calculations
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.
Re: Non Linear Gauge Calculations
Figured it out, turns out it was a math calculation error in rotation. Gauge is complete. Thanks guys.
OORAH!!!! Its a Marine Thing....USMC retired
-
- Posts: 60
- Joined: Sun Jun 12, 2016 3:11 pm
Re: Non Linear Gauge Calculations
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
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