## Non Linear Gauge Calculations

### Re: Non Linear Gauge Calculations

A two minutes example:

Imagine you want to make and indicator like this one:

The data table will be like this (Y=degrees, x=knots):

Choose Polynomial -> Cubic Regresion (it depens on the sort of curve you need). You see if the curve goes through the points.

And the equation is:

So, to obtain the degrees you want to rotate (clockwise, 0 in north), you input the knots in x, and get the rotation in y.

The second method would be make three linear equations, from 0 to 90º, from 90 to 180, from 180 to 270.

Depending how the dividers (knots lines) are marked it will be more exactly the first or the second method.

The equation method is more elegant anyway

Arturo.

Imagine you want to make and indicator like this one:

The data table will be like this (Y=degrees, x=knots):

Choose Polynomial -> Cubic Regresion (it depens on the sort of curve you need). You see if the curve goes through the points.

And the equation is:

So, to obtain the degrees you want to rotate (clockwise, 0 in north), you input the knots in x, and get the rotation in y.

The second method would be make three linear equations, from 0 to 90º, from 90 to 180, from 180 to 270.

Depending how the dividers (knots lines) are marked it will be more exactly the first or the second method.

The equation method is more elegant anyway

Arturo.

### Re: Non Linear Gauge Calculations

This looks great. Thanks Arturo. Should be able to work on this the next couple of days. Will keep you posted.

### Re: Non Linear Gauge Calculations

Well, that wasn't the fastest response I've ever posted. Apologies everyone. I got engaged and obviously got sidetracked. Programming the gauges wasn't succesful; seems like i was missing a piece of the puzzle. However, I managed to get my airmanager's plain vanilla RPM and airspeed gauges to work with A2A Cherokee. The solution is to use only that aircraft while in the simulator (FSX). As soon as I use another aircraft, then reverting back to A2A Cherokee renders those gauges useless. I am happy right now since that's the aircraft I am flying for my pilot's licence.

I appreciate everyone's help; I hope i didn't let you guys down.

Best

I appreciate everyone's help; I hope i didn't let you guys down.

Best

### Re: Non Linear Gauge Calculations

I had that issue as well with the Mindstar GPS. We still have to look into that. I'll put it on the to do list.

### Re: Non Linear Gauge Calculations

Well... I have done some non-linear stuff here:

Working on my EFIS, I was about to solve the vertical speed indicator. The real one has a non-linear scale which moves against the vertical speed trend, and a needle which rotates to point the correct value and also moves its center of rotation in order to be always perpendicular to the scale.

VSI scale preview is attached. Now, what I have done is dividing the whole range into 5 intervals, and in each interval I did a polynomial regression to get the correct functions for: movement of the scale, rotation of the needle, x movement of the needle and y movement of the needle depending on the vertical speed.

Result is here (bottom right is the VSI): https://www.youtube.com/watch?v=15KHUfk ... e=youtu.be

Preview of the crazy code attached.

Pavel

Working on my EFIS, I was about to solve the vertical speed indicator. The real one has a non-linear scale which moves against the vertical speed trend, and a needle which rotates to point the correct value and also moves its center of rotation in order to be always perpendicular to the scale.

VSI scale preview is attached. Now, what I have done is dividing the whole range into 5 intervals, and in each interval I did a polynomial regression to get the correct functions for: movement of the scale, rotation of the needle, x movement of the needle and y movement of the needle depending on the vertical speed.

Result is here (bottom right is the VSI): https://www.youtube.com/watch?v=15KHUfk ... e=youtu.be

Preview of the crazy code attached.

Pavel

*Pavel Brodský*

Prague, Czech Republic

Prague, Czech Republic

### Re: Non Linear Gauge Calculations

Good work Pavel. That's not a straight forward VSI to code. Non linear is one thing but the moving needle rotation point is another. Do you know if this is accurate to the real instrument?

My Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig

Air Manager API Tutorial Video Series https://www.youtube.com/channel/UC8ZqXX ... subscriber

Air Manager API Tutorial Video Series https://www.youtube.com/channel/UC8ZqXX ... subscriber

### Re: Non Linear Gauge Calculations

Yes, this is how the real EFIS works... The centre of rotation movement is one thing, but the moving dial is the weirdest VSI I have ever seen (but it looks cool!)

Pavel

Pavel

*Pavel Brodský*

Prague, Czech Republic

Prague, Czech Republic

### Re: Non Linear Gauge Calculations

Cool from a being different point of view but personally not my favourite implementation of a VSI. Still when you are making a replica instrument you should stay faithful to the original as you have done. Once again good work.

My Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig

Air Manager API Tutorial Video Series https://www.youtube.com/channel/UC8ZqXX ... subscriber

Air Manager API Tutorial Video Series https://www.youtube.com/channel/UC8ZqXX ... subscriber

### Who is online

Users browsing this forum: No registered users and 8 guests