#### Archived

This topic is now archived and is closed to further replies.

# Cabin Pressure and Temperature Question...

## Recommended Posts

Hello all...I'm curious if Cabin Altitude Pressure and Cabin Temperature can be realistically simulated, and if so, what .XML math formulas would be required to do this.I would like to include:Cabin Pressure,Cabin Altitude,and Cabin Altitude Rate, + or -Any ideas as to how to program this?Also, I'm unable to find the variable to find Airport Landing Altitude. Is there a way to display the landing altitude of the selected airport in a flight plan?Any help here would be greatly appreciated.Regards,Kevin

##### Share on other sites
 Help AVSIM continue to serve you!Please donate today!

Bump...Again, not looking to create a gauge here... just to simulate numerical readings. Is it possible, given the variables at hand and if so, what example in an .xml equation or formula would be needed to do so?Also, is an Airport altitude reading a possibility?Regards,Kevin

##### Share on other sites

Hi Kevin,ABout Cabin pressure/temperature: to my knowledge (but of course I can be wrong) this isn't modelled in FS, so I couldn't think of any way to display or derive relevant info.About the Airport Altitude: I don't understand what it exactly is you want. Read the altitude of an airport which is specified in a flightplan ?? (i.o.w. read the flightplan info or FS database in an xml gauge)Cheers< Rob

##### Share on other sites

I wonder if you can combine this...%GND ALT %((A:GROUND ALTITUDE, feet) )%!d!'...with the latitude/longtitude "stuff"? (*grin*)

##### Share on other sites

Kevin,I think several of us have a "fake" cab. press. sys. etc.Mathias Lieberecht's planes and an Airbus panel here on Avsim do.I have such a thing in the 767-300.It is just a matter of some combinations between L:Var's and A:Var's like Indicated- and Pressure Altitude, Ambient pressure, Bleed Air pressure etc.These combs can give you values to translate to needles or dig. readouts for cabin alt, cabin diff and cabin rate and the outflow valves etc.Several Modes Auto and Manual are possible.You can build in, simulate some failures with sound alarms and even depressurization with "Blow out"(Crash) or Blackout caused by lack of oxygen. Imagination is the limit....May be you can do something with the GPS Var's for WPT ALT.Also there some mysterious GPS VAR's like:WaypointAirportRunwayElevation WaypointAirportElevation But i never tried to implement them.Have a look at Matthias panels!Jan"Beatus Ille Procul Negotiis"

##### Share on other sites

Try this thought process:If we know the ambient pressure, and we know the pressure differential of the aircraft pressurisation system, its easy to do the math.Cabin pressure = ambient pressure PLUS the cabin pressurisation differential. For example, a KingAir has a cabin pressurisation differential of about 4.6 psi. In otherwords, it can pump an additional 4.6 psi of pressure into the cabin when compared with ambient pressure.So, at 18000 feet ASL, where ambient pressure is half of that at sea level we have the following:Ambient = 14.7 psi at sea level.Ambient = 18000 feet ASL = 14.7/2 = 7.35 psi.Cabin Pressurisation of 4.6 psiCabin altitude at 18,000 feet in a king air is then 7.35 + 4.6 = 11.95 psi.Obviously the cabin pressure decreases linear to ambient based on the pressure differential the higher we go.Some simple math to convert to other units (mmHg)is all that is requiredHope that mmakes sense?Steve

##### Share on other sites

Lot of info here:http://www.b737.org.uk/pressurisation.htmIn this string of the GPS airportaltitude is given:%((@c:WaypointAirportElevation, feet))%!d!May be you can do something with it.Jan"Beatus Ille Procul Negotiis"

##### Share on other sites

Here is a simplified formula for calculating "pressure altitude" for any given altitude up to 65,617' (Above 65,617' the forumula changes again, but for FS I don't think that's really an issue):h = altitude in feetPressSL = 2116.224 (lb/sqft)if h < 26089then delta = pow((1 - 1 / 135442), 5.255876)if h > 36089 & < 65617then delta = 0.22336 * exp((35089 - h / 20806)pressure = (PressSL * delta) / 144This will give you an accurate pressure altitude from which you can easily determine the pressure differential between cabin pressure and ambient pressure altitude.

##### Share on other sites

Wow...Thanks guys for pointing me in the right direction here!Bill... will try your "easy" formula in the morning. Sounds easy enough for you, but I'm still learning when it comes to more advanced .xml equations. How would I apply this to .xml? The eyes are getting fuzzy right now and sleep is calling. (what's sleep?)Jan... Tried the string example for the airport altitude and it's not working. Even entered a numerical value of "5" befor the "d" to see if that would work... to no avail. It'd be cool to include the airport altitude as it's included in the Secondary Page of the EICAS.Here's a screenshot of the current state of the EICAS... still a couple more pages left to do.Thanks again!

##### Share on other sites

Kevin,The string works only in the GPS.So i think may be you need to copy a lot of macro's from the GPS gauge to your eicas.Jan"Beatus Ille Procul Negotiis"

##### Share on other sites

>Bill... will try your "easy" formula in the morning. Sounds>easy enough for you, but I'm still learning when it comes to>more advanced .xml equations. How would I apply this to .xml?> The eyes are getting fuzzy right now and sleep is calling. >(what's sleep?)Honestly, I don't have a clue. I gave up on XML math as being incomprehensible to my 56 year old, fossilized brain. C may be terse, but at least it doesn't suffer from Reverse Polish Notation... :)Here is the complete code segment in C, perhaps someone would be kind enough to translate it to XML for you. Note that even though the cabin is pressurized, there is still a delta factor due to the increased altitude of the aircraft, hence we have to apply the delta correction to the cabin pressure, just as we do the outside ambient pressure altitude. This is designated as "delta_2..."The variables are declared as:ac_alt = 0 ; presssl = 2116.224 ; //pressure at Sea Levelalt_pressure = 0 ; delta_1 = 0 ; delta_2 = 0 ; cab_pressure = 0 ;//ac_alt = ALT_FROM_BAROMETRIC_PRESSUREvar.var_value.n ; if ( ac_alt < 36089 ) { delta_1 = pow ( ( 1 - ac_alt / 135442 ) , 5.255876 ) ; } if ( ac_alt > 36089 ) { delta_1 = .22336 * exp ( ( 36089 - ac_alt ) / 20806 ) ; } alt_pressure = ( presssl * delta_1 ) / 144 ; delta_2 = pow ( ( 1 - cabaltl / 135442 ) , 5.255876 ) ; cab_pressure = ( presssl * delta_2 ) / 144 ; pressure_diff = cab_pressure - alt_pressure ; // end code segmentI hope this is helpful! Perhaps someone will be kind enough to 'translate' this into XML for you... :)

##### Share on other sites

Jan...Don't have a clue as to what I'm doing wrong with the airport altitude. I imported ALL the GPS macros into the gauge, and I still get a big, fat zero for APT altitude. I have a flight-plan loaded, and yet nothing... I'm about to give up on this one unless someone else might have a bright idea.Also, not being very familiar with more complex .xml string equations, can you make heads or tails with applying Bill's math to an .xml string?Regards,

##### Share on other sites

Kevin,Go in the GPS to NRST, then APTS, then cursor, then select an airport and press ENT button.Then you get the airport info with ICAO code, name, city, region, position and...ELEVATION!Once you have selected that airport the next code will show you the elevation:%((@c:WaypointAirportElevation, feet))%!d!If you didn't select, this code shows: 0So if you want the landing altitude of the destination in her window, you must first go to the GPS to look wether the destination airport shows up and if so, to select that airport.Still you need an awful lot of GPS macro's!!May be their is an easier way, but i did't tested.Hope it helps,Jan"Beatus Ille Procul Negotiis"

##### Share on other sites

Hmm, sounds interresting. Maybe some day I'll dig more into this. Thanks."You can build in, simulate some failures with sound alarms and even depressurization with "Blow out"(Crash) or Blackout caused by lack of oxygen. Imagination is the limit...."Can you cause red and black outs with xml events?

##### Share on other sites

Karl,I "modelled" that in the 767; with A:G forces and a custom L:Oxysys you can trigger an event which calls for a black(+) or red(-) bitmap, full screen, so the rest becomes invisible and also uncontrollable and finally, when you are not able to correct the forces or to descend to an altitude with enough oxygen, you will endup with a crash.Kind off childish, but it works.Jan"Beatus Ille Procul Negotiis"

##### Share on other sites

Errr, ok talk about a late reply here...Been searching high and low and finally came across this post.I have just started programming XML for FS9, and found this forum to be an excellent source of advice. Much of the info here and also the tutorials on FS2X.com really provide a solid starting point for the novice programmer.I am working on an AN-72 in Gmax, and have now turned my attention to the addictive art of gauge programming, and succeeded in creating a cabin pressurisation gauge system. Complete with altitude selection, rate selection, vs indication, cabin alt indication, differential pressure indication and differential pressure protection (not to exceed 7.8 psi).Since this aircraft is capable of flying with an open cargo door i have also included a Cabin altitude warning light which comes on when cab alt rises above 10.000 feet. Next up is an oxygen system with a certain capacity. That should not be a problem to model, i think.But i would also like to implement a blackout effect as time above 10.000 ft progresses, just to spice things up and force user action on the warning. Much like the G force effect already present in FS9. Is there a way to make use of that effect, controlled via an oxygen system L: variable? Has anyone found a more subtle approach than just blacking out the entire screen over the past years? It would be great to have a progressing black out effect depending on lack of oxygen versus elapsed time, preferably also usable in a vc.grtWillem.

##### Share on other sites

I haven't tried this, but it should work...Create a transparent full-screen bitmap (R,G,B, 0,0,0), as the basis for a pop-up window. Then add a layer of, say, 25% opacity gray (50,50,50, perhaps). Code that window to pop up whenever the situation suits. You could use as many pop-ups as you like, each with increasing opacity level. The obvious problem is that each change would be abrupt.There is probably some way to perform a top-to-bottom "wipe." Using Flash, perhaps, but that's beyond me.Good luck,Glenn

##### Share on other sites

Hi Glenn,thanks for your reply!I'll try your approach, and if gives me an acceptable result i'll stick with it. Will this work in the VC also you think? I guess i'll find that out soon enough eh?Still open for more suggestions...thanksgrtWillem.btwis this modelled in FSX ?

##### Share on other sites

Hi, Willem...I don't know how you'd handle it in the VC view. I was guesstimating an approach for a 2D panel in FS9.Good luck with your experiments!Glenn

##### Share on other sites

Man,i have been strugling to da max this evening...Here's what i did:I created a bitmap (RGB 0,0,0) and via FSPanelStudio created a new window with that background bitmap. This gives me a transparent window that i can be able to have pop-up when needed.Glenn: you talk about adding a layer with an opacity of 25 percent grey. Maybe you could expand on that? I don't entirely understand i'm afraid, where would i add that layer and what format should it be (*.bmp?)?I struggled with that for some time and decided to try a different appoach:For now i use SHIFT F4 for calling up the transparent window i created.That works.Next i created an xml gauge with the following code:(L:Gforce_effect, number) 1 ==Using FSP the gauge is placed on the new window.For testing purposes i have built a switch that sets L:Gforce_effect, number to 1 when switched.That also works.So now when the window is "visible" (in all its transparency) and i use the switch, a red rectangle pops up.The problem now lies in the fact that i am unable to control the transparency of the rectangle with the Transparency="0.4" function.Changing the figure has no effect, the rectangle remains solid. When the value is 0.5 or higher the rectangle disappears.I think i could also use a bitmap in the gauge that has transparency controlled by an alpha channel. But this seems to work differently from the method used when texturing a model (i know how to do that, by adding the alpha channel bitmap with DXTBmp etc).If the vector drawn rectangle approach is not possible the way i am trying here, i will have to use the bitmap way but i don't know how to go about that (i read that ImageTool is to be used for this, never used that before). Any help is much appreciated!grtWillem

##### Share on other sites

Hello grt Here is code for dimming FMC using a L:vars goes from black to clear maybe you can use this with your own color and L:var control. (L:DimPage,number) 1 ==(L:DimPage,number) 2 ==(L:DimPage,number) 3 ==(L:DimPage,number) 4 ==(L:DimPage,number) 5 ==(L:DimPage,number) 6 ==(L:DimPage,number) 7 ==(L:DimPage,number) 8 ==(L:DimPage,number) 9 ==(L:DimPage,number) 10 ==(L:DimPage,number) 11 ==(L:DimPage,number) 12 ==(L:DimPage,number) 13 ==(L:DimPage,number) 14 ==(L:DimPage,number) 15 ==(L:DimPage,number) 16 ==(L:DimPage,number) 17 ==(L:DimPage,number) 18 ==

##### Share on other sites

Hi,thanks for you input!However, basically the principle of your code and mine remains the same.I guess it just cannot work the way i want it to, ie have the vector rectangle to be the only visible element of the gauge. I think it needs a visible background bitmap.Now i have it working with bitmaps that have a 0,0,0 background and added to that a gaussian monochromatic noise pattern, which changes density between bitmaps.So bitmap 1 has noise only at the edges, the center of the screen remains free. On bitmap 2 the noise closes in a bit, etc, etc.(i use layers with masks in PhotoShop for this. start of with the most noised up layer, apply a mask to that. Copy the layer, make the old one invisible, paint with black on the mask to remove noise so that only the edges are noised up, save as Blackout_x.bmp, copy the layer again, make the previous one invisible, now use white to paint on the mask to bring back some of the noise, save as...,copy layer, paint white on mask, etc,etc)I now have 8 bitmaps that use this same visibility routine :(L:Gforce_effect, number) 6 ==As you can see basically the same as your code, except i use a bitmap now iso vector rectangle.For now still controlled by the switch (each click adds 1 to L:Gforce_effect, number), but at least i now have something that kind of works.Not as subtle as i would like, so if you have any other suggestions feel free!grtWillem.

##### Share on other sites

• Tom Allensworth,
Founder of AVSIM Online

• ### Hot Spots

• Flight Simulation's Premier Resource!

AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!