• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 Altimeter problem

Messages
1,468
Country
italy
Today is unusual in that it is a clear bright day but with low pressure. LIMF currently has a pressure of QFE 944mbs. When I dial that into my altimeter it only goes down to 948mbs (27.99ins). Is this the reason?
Code:
<Mouse>
      <Help ID="HELPID_GAUGE_ALTIMETER"/>
      <Tooltip ID="TOOLTIPTEXT_ALTIMETER_FEET"/>
      <Area Left="0" Right="31" Top="1" Bottom="124">
         <Help ID="HELPID_GAUGE_KOHLSMAN_KNOB"/>
         <Area Left="0" Right="16" Top="0" Bottom="124">
            <Cursor Type="DownArrow"/>
            <Click Event="KOHLSMAN_DEC" Repeat="Yes"/>
         </Area>
         <Area Left="17" Right="31" Top="0" Bottom="124">
            <Cursor Type="UpArrow"/>
            <Click Event="KOHLSMAN_INC" Repeat="Yes"/>
         </Area>
      </Area>
     <Area Left="88" Right="120" Top="1" Bottom="124">
         <Help ID="HELPID_GAUGE_KOHLSMAN_KNOB"/>
         <Area Left="0" Right="16" Top="0" Bottom="124">
            <Cursor Type="DownArrow"/>
            <Click Event="KOHLSMAN_DEC" Repeat="Yes"/>
         </Area>
         <Area Left="17" Right="31" Top="0" Bottom="124">
            <Cursor Type="UpArrow"/>
            <Click Event="KOHLSMAN_INC" Repeat="Yes"/>
         </Area>
      </Area>
   </Mouse>

If so what suggestions would you make?
thanks
 
AFAIK, 948 mb is the lower limit in FS and common in RW altimeters. Same thing happens if you try to set it using (>K:KOHLSMAN_SET), so it's not the KOHLSMAN_DEC event causing the limit.

Google something like "altimeter Kohlsman only goes down to 948 mb" and you will get several hits.

For example, from the U.S. FAA Instrument Flying Handbook 2012 (page 5-4):

A sensitive altimeter is one with an adjustable barometric scale
allowing the pilot to set the reference pressure from which the
altitude is measured. This scale is visible in a small window
called the Kollsman window. A knob on the instrument adjusts
the scale. The range of the scale is from 28.00 to 31.00 inches
of mercury ("Hg), or 948 to 1,050 millibars.


On the other hand, you do a lot of aircraft system and gauge work, so you could always write your own altimeter algorithm and compute (L:INDICATED ALTITUDE, feet) utilizing any Kohlsman range you want.

Bob
 
Last edited:
Hi Bob,
Yes I'm resigned to having to re-work the precision altimeter and the AP as a spin off probably. The altimeter should go down to 940mb actually. That is 'all' the altimeters I have used / use do that!
 
Hi Bob,
Yes I'm resigned to having to re-work the precision altimeter and the AP as a spin off probably. The altimeter should go down to 940mb actually. That is 'all' the altimeters I have used / use do that!
I am interested in doing such a custom system as well. Have you already done it?
 
I am interested in doing such a custom system as well. Have you already done it?

Not a ‘sensitive altimeter’, but I wrote a pressurization system for my Cessna 421 and the pressure/altitude equations are, naturally, the same. An altimeter algorithm for (L:INDICATED ALTITUDE, feet) is straight forward.

Probably you are already aware, but you can find Atmosphere and Altimetry equations in Ed Williams Aviation Formulary v1.46. That’s all one needs to compute Indicated Altitude with a 'Kohlsman' reference pressure correction. Googling Indicated Altitude Formula will yield similar.

You might also find this FS Developer thread useful. It mentions use of the website Wolframalpha.com. The Williams formula I was using expressed pressure as a function of altitude but I needed it the other way around – altitude as a function of pressure. Wolframalpha to the rescue with the algebra assist.

Bob
 
Last edited:
Take a look at this FSDeveloper post by Teson several years ago.

Using that equation, (S^N - P^N)/K, I get computed Indicated Altitude (hI) vs (A:INDICATED ALTITUDE, feet) differences from zero to about 3% depending on Sea Level pressure selection and Kollsman choice.

Bob
 
Last edited:
Thanks Bob,
for the links. I'll peruse them later on. I have actually got it up and running now. Also I had to make adjustments to the AP as that was using an A var to pass indicated altitude. The only thing now is to get an accurate conversion between mb and inches. Almost every website I visited gave a different conversion value.
The L vars initiate with a zero so are preset with 1013.2 and 29.92 when the panel loads. And from there it just a matter of making sure both the precision and standby altimeters are in step. My error rate "at the moment" is about 17ft per 1,000. Now to make relevant corrections to the precision altimeter test procedures. In the real a/c if you press the test button in flight it fails the altimeter!!!!
 
The only thing now is to get an accurate conversion between mb and inches. Almost every website I visited gave a different conversion value.
Well, that ought to be the easiest thing of all. I am sure the only differences are in number of significant digits. 1 inch of mercury = 33.863886667 millibar. So, 29.92126 InHg = 1013.25 mb

You have it up and running? What was your equation for Indicated Altitude given Ambient pressure and Kollsman setting?

Bob
 
Well this is what I've got at the moment. And it does seem to work. I've done three test flights. A round trip from/to Shoreham (as that's at sea level)
LIPZ to LOWI (sea level to the mountains) LIMZ to LIMF (to test the QFE on landing) and the numbers were pretty close to what they were before. For the precision altimeter I'm thinking of adding temperature correction which was not there before unless it was hard coded in the MS A var equation.

I'm sure you'll find fault though o_O


Code:
<!-- Initialise Standby altimeter --> 
   <Element>
      <Select>
         <Value>(L:standby_kohlsman, millibars) 0 == if{ 1013.20 (>L:standby_kohlsman, millibars) }</Value>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:standby_kohlsman, millibars) (A:SEA LEVEL PRESSURE, millibars) - 29.54545 * (A:PLANE ALTITUDE, feet) + (&gt;L:standby_indicated_altitude, feet)</Value>
      </Select>
   </Element>
  
   <!-- Initialise Precision altimeter --> 
   <Element>
      <Select>
         <Value>(L:precision_kohlsman, millibars) 0 ==
         if{ 1013.20 (>L:precision_kohlsman, millibars) }</Value>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:precision_kohlsman, millibars) 33.86530749 / (>L:precision_kohls, inHg)</Value>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:ALT_TEST,bool) 0 == (L:alt_fault,bool) 0 == and if{ (L:precision_kohlsman, millibars) (A:SEA LEVEL PRESSURE, millibars) - 29.54545 * (A:PLANE ALTITUDE, feet) + (&gt;L:precision_indicated_altitude, feet) }</Value>
      </Select>
   </Element>
  
   <!-- QFE Chinagraph -->
   <Element>
      <Select>
         <Value>(L:scratchpad,bool) 0 == if{ (L:Nav_InfoWayAirportElevation,feet) 29.54545 / (>L:QFE_form,number) (L:standby_kohlsman, millibars) (L:QFE_form,number) - (>L:QFE,number) } els{ 0 (>L:QFE_form,number) }</Value>
      </Select>
   </Element>
 
I'm sure you'll find fault though o_O

Nope. I'll take a look at it, but I think your approach to utilize (A: PLANE ALTITUDE, feet) is clever and logical - and better!! We always have that in FS, so why not use it?

There is a simple, linear relationship between (A:SEA LEVEL PRESSURE, inHg) minus (A:KOHLSMAN SETTING HG, inHg) and (A:INDICATED ALTITUDE, feet) minus (A: PLANE ALTITUDE, feet) so,

(A:SEA LEVEL PRESSURE, inHg) = a
(L:Kohlsman Setting, inHg) = b (whatever Kohlsman setting you want)
(L:Indicated Altitude, feet) = c (what you want to compute)
(A: PLANE ALTITUDE, feet) = d
0.032465 = e

(c-d)=-1000(a-b)+e

Solving for c:
c=-1000a+1000b+e+d

The XML:
Code:
(A:SEA LEVEL PRESSURE, inHg) -1000 * (L:Kohlsman Setting, inHg) 1000 * + 0.032465 + (A: PLANE ALTITUDE, feet) + (>L:Indicated Altitude, feet)
I didn't double check it, but this, in fact, looks equivalent to your code above. Your approach seems completely accurate w.r.t. FS and is certainly better than the atmospherics I referenced!

(L:Kohlsman Setting, inHg) is any Kohlsman setting you desire, and (L:Indicated Altitude, feet) is the Indicated Altitude that you want to compute, which should agree perfectly with (A:INDICATED ALTITUDE, feet) when the Kohlsman setting is between 28 and 31 inHg.

Bob

tested with different SL Pressures, Plane Altitudes and Kohlsman Settings, but not different temperatures .. which I think will not change the results very much
 
Last edited:
Volo,

Instead of
Code:
1013.20 (>L:precision_kohlsman, millibars)
(L:precision_kohlsman, millibars) 33.86530749 / (>L:precision_kohls, inHg)

why don't you make it simple:
Code:
(L:precision_kohlsman, inHG)

FS will convert any value entered as millibars to inHG and vice versa.

Tom
 
Will it Tom? That would make things a lot simpler. Though you can see from my code above that all the calculations are based on milkybars and the inHG is only for display. The 29.54545 btw is how many feet the sim allocates to each milkybar. Just finished the rotating kohlsman knob which was not there originally. It has one quirk in that it tends to run away by itself in one direction. Can't really see why yet.

PS Just tried out your suggestion Tom and the sim converted 1013.2mb into 320inHg Oops!!
So I'll stick with <Value>(L: Precision_kohlsman, millibars) 33.86530749 / (>L: Precision_kohls, inHg)</Value> for the moment!
 
Last edited:
PS Just tried out your suggestion Tom and the sim converted 1013.2mb into 320inHg Oops!!

In FSX it works perfect.

Code:
1013.20 (>L:precision_kohlsman, millibars)
(L:precision_kohlsman, inHG) = 29.92

Maybe a bug in FS2004?

Anyway, I recommend you not to stick to first result of a test when it gives you unreasonable values...

Tom
 
In FSX it works perfect.

Code:
1013.20 (>L:precision_kohlsman, millibars)
(L:precision_kohlsman, inHG) = 29.92

Maybe a bug in FS2004?

Anyway, I recommend you not to stick to first result of a test when it gives you unreasonable values...

Tom
I've done a few more test flights and my calculations always agree within a foot or two of (A:INDICATED ALTITUDE, feet) and where QFE has been set the needle has been close to zero (which is how it is in real life) so from the point of view of using pressure altitude to gauge height i'm reasonably content!
 
I've done a few more test flights and my calculations always agree within a foot or two of (A:INDICATED ALTITUDE, feet) and where QFE has been set the needle has been close to zero (which is how it is in real life) so from the point of view of using pressure altitude to gauge height i'm reasonably content!

Great! However, it has nothing to do with the fact that you can directly use a unit conversion in the same LVar instead of adding extra LVars and/or calculations, no matter which method is of your preference.

Tom
 
Great! However, it has nothing to do with the fact that you can directly use a unit conversion in the same LVar instead of adding extra LVars and/or calculations, no matter which method is of your preference.

Tom

I take your point Tom. My xml will never be as elegant as yours though!
 
My xml will never be as elegant as yours though!

Well, I cannot agree more with you here :D:D:D:D

Now seriously, remember that comments and/or hints like the one I posted in reply #11 are usually destinated not only to the OP of the thread but other users that might find them useful. They are of course far from mandatory;).

FS has many weak points related to gauge programming, but this auto internal conversion of LVar units is a real good one...

Tom
 
<Value>(L: Precision_kohlsman, millibars) 33.86530749 / (>L: Precision_kohls, inHg)</Value> produces 29.92
If the auto conversion worked then I wouldn't get 29.92 as the answer surely?
<Value>(L: Precision_kohlsman, millibars) (>L: Precision_kohls, inHg)</Value> produces 1013.2
Here's a snapshot of blackbox too.
kohl.jpg

So no automatic conversion there unfortunately. Unless the L var is exactly the same perhaps i.e. (L: Precision_kohlsman, inHg).
However that's no good to me because my conversion is based on millibars not inches.
<Value>(L:ALT_TEST,bool) 0 == (L:alt_fault,bool) 0 == and if{ (L: Precision_kohlsman, millibars) (A:SEA LEVEL PRESSURE, millibars) - 29.54545 * (A: PLANE ALTITUDE, feet) + (&gt;L: Precision_indicated_altitude, feet) }</Value>

As for my programming skills. Yes, they are sometimes round the houses but the results are always correct. I do occasionally have lucid moments though:yikes:
But always appreciate the help and suggestions on here.
 
<Value>(L: Precision_kohlsman, millibars) (>L: Precision_kohls, inHg)</Value> produces 1013.2
Right, so the conversion would be written a little differently, such as:

1013.2045 (>L: Precision_kohlsman, millibars), then
(L: Precision_kohlsman, inHg) yields 29.92

but as written, if (L: Precision_kohlsman, millibars) is 1013.2 and that is stored as (>L: Precision_kohlsman, inHg) then (L: Precision_kohlsman, inHg) now yields 1013.2
 
Back
Top