Sign in to follow this  
Guest Ron Freimuth

Autoland Gauge in xml

Recommended Posts

I am trying to do an autoland gauge, but am not sure how to get one switch to do so many thing.This is how I want it to work : when first turned on, it turns on autopilot master, autopilot approach, set speed to 210, arms spoilers, set autobrake to 2 and sets flaps down one.After looking at how xml work I have come up with this: (L:Autoland, bool) 1 ==if{1 ( K:AP_MASTER) 1 (K:AP_APP_HOLD) 1 (A:Autopilot airspeed hold var, knots) 210 (K:SPOILERS_ARM) 1 (INCREASE_AUTOBRAKE_CONTROL) 1 (K:INCREASE_AUTOBRAKE_CONTROL) 1 (K:FLAPS_INCR) 1 } now my problem is do not know if this is correct should I have == instaed of ==if{. should > and < be in the code ?Trying to learn xml a bit better so any help would appreciated.

Share this post


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

>I am trying to do an autoland gauge, but am not sure how to>get one switch to do so many thing. First, there is "autoland_1 .." in the library. You might check it to see how it is structured. Certainly you would want to change some things for your requirements. In fact, I think the archive has three XML files, one uses the one most appropriate for his AC size; landing speed.>This is how I want it to work : when first turned on, it turns>on autopilot master, autopilot approach, set speed to 210,>arms spoilers, set autobrake to 2 and sets flaps down one.>>After looking at how xml work I have come up with this: >> (L:Autoland, bool) 1 ==if{1 ( K:AP_MASTER) 1>(K:AP_APP_HOLD) 1 (A:Autopilot airspeed hold var, knots) 210>(K:SPOILERS_ARM) 1 (INCREASE_AUTOBRAKE_CONTROL) 1>(K:INCREASE_AUTOBRAKE_CONTROL) 1 (K:FLAPS_INCR) 1 } >>now my problem is do not know if this is correct should I have>== instaed of ==if{. should > and < be in the code ? I can see a few problems. I'm sure others will also give ideas. (L:Autoland, bool) 1 == if{ 1 (>K:AP_MASTER) 1 (>K:AP_APP_HOLD) 1 (A:Autopilot airspeed hold var, knots) 210 (* NO! *) 1 (>K:SPOILERS_ARM) 1 (>K:INCREASE_AUTOBRAKE_CONTROL) 1 (>K:INCREASE_AUTOBRAKE_CONTROL) 1 (>K:FLAPS_INCR) } I think you need the tags around the . I added some required spaces and ">K:". I don't think one needs to put a '1' into any of the specific K: events above. However, to see the Autobrake to '2', I expect you would put a '2' into a variation of the K: event above. One that probably ends with "_SET". And, to set Flaps to detent 1, put a '1' in the analagous K:Flaps.. _SET. Which would ensure it is at 'detent 1', not simply incremented from its current detent. The one A:variable is Read Only. You will have to put your '210 kts' in another way. Something like "210 (>K:AP_SPD_VAR_SET)". But, also ensure the autopilot is On and Speed Control is active. Just a few things I saw, others will likely explain better. Ron

Share this post


Link to post
Share on other sites

Thanks for the reply. I decide to build one at a time so the first one to do is (>K:AP_MASTER)So I tried. But turns the AP on and off without me clicking it.This is the Value(L:Autoland,bool) ==if{ 1 (>K:AP_MASTER) } Have look at some other XML and mine does not seem to look any different. If I understand this correct this means when Autoland Switch is On, AP Master is on, is this right ???. Have tried differnt spaces with the result being the AP Master comes on and off without me clicking or does not work at all.This is the XML including the switch.(L:Autoland,bool)(L:Autoland,bool) ==if{ 1 (>K:AP_MASTER) } (L:Autoland,bool) ! (>L:Autoland,bool)can anyone see the problem ??????

Share this post


Link to post
Share on other sites

>Thanks for the reply. >>I decide to build one at a time so the first one to do is>(>K:AP_MASTER)>>So I tried. But turns the AP on and off without me clicking it. By itself, that would appear to turn the AP_MASTER On on every DOS tick.>This is the Value>>(L:Autoland,bool) ==if{ 1 (>K:AP_MASTER) } >>Have look at some other XML and mine does not seem to look any>different. Do not make the 'condtion if{ ' as "==if{ .." There has to be at least one space after the bool "==" (etc) and the "if{ ". I often put the if{ on the next line, and indented. Beyond that, there are lots of XML examples in this Forum, a Search might find something close to what you want. Most related to things I've never done myself. ;) Details of syntax, spaces, etc. mess everyone up when learning this FS XML. Ron

Share this post


Link to post
Share on other sites

Hi,Try:(L:Autoland,bool) if{ (A:Autopilot master,bool) ! if{ (>K:AP_MASTER) } (A:SOMETHING,bool) ! if{ 1 (>K:SOMETHING,bool) } } els{ ..... }or(L:Autoland,bool) if{ (A:Autopilot master,bool) ! if{ (>K:AUTOPILOT_ON) } (A:SOMETHING,bool) ! if{ (>K:SOMETHING_ON) } } els{ ..... }Now no on--off--on--off movements etc.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Have sorted the problem with autopilot coming on and off without clicking was due to using K:AP_MASTER, now use K:AUTOPILOT_ON.Have got the approach to hold and the Spoilers to arm.Now need to work out how to get the autothrottle to arm and Autobrake to set to 2. I think your code Jan might be what I am looking for for this so will give it a try. Thanks for the help, will post again if I encounter any more problems.

Share this post


Link to post
Share on other sites

Have encounter more problems, Need to set auto throttle to on, but can only find one variable K:AUTO_THROTTLE_ARM, so now have same trouble I had with AP_MASTER switching on and off. Have tried your code Jan but can not get it to work.Is there another code for auto throttle arm ? I have tried AUTO_THROTTLE_ON and AUTO_THROTTLE_SET, but they do not work.The codes I am trying at the moment are :(L:Autoland,bool) if{ 1 (A:Auto throttle,bool) ! if{ 1 (>K:AUTO_THROTTLE_ARM) } (A:Auto throttle arm) ! if{ 0 (>K:AUTO_THROTTLE_ARM) } } els{ .....} (L:Autoland,bool) if{ 1 (A:Auto throttle arm,bool)(>K:AUTO_THROTTLE_ARM) } (L:Autoland,bool) if{ 1 (Auto throttle arm,bool) 0 == if{ 1 (>K:AUTO_THROTTLE_ARM) } } if i can get this to work then the autobrake should I guess follow the same code, as K:INCREASE_AUTOBRAKE_CONTROL move the autobrake switch to max not one increasement at a time.

Share this post


Link to post
Share on other sites

Hi,(L:Autoland,bool) if{ (A:Autopilot master,bool) ! if{ (>K:AP_MASTER) } (A:AUTOPILOT THROTTLE ARM,bool) ! if{ (>K:AUTO_THROTTLE_ARM) } (A:SOMETHING,bool) ! if{ 1 (>K:SOMETHING,bool) } ..... } els{ ..... }Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Still no joy.This is the code I have at the moment :(L:Autoland,bool)(L:Autoland,bool) if{ 1 (A:Auto throttle arm,bool) 0 == if{ 1 (>K:AUTO_THROTTLE_ARM) } (L:Autoland,bool) if{ 1 (>K:AUTOPILOT_ON) (>K:AP_APR_HOLD_ON) (>K:SPOILERS_ARM_ON) } Autoland(L:Autoland,bool) ! (>L:Autoland,bool) Could I have a problem with my first value ?? I have looked at the Autoland gauge from the avsim file library and to set the auto throttle arm it uses the value I have. It also uses a lot of GVAR but I do not understand these, there has got to be a way to set the auto throttle armed without these.The Third value works perfectly, it turn on AP and APR and set spoilers to armed. ( They could be bothered to add on to the spoilers)Why AUTO_THROTTLE_ON OR AUTO_THROTTLE_ARM_ON could not be put into the programing of FS2004 I do not know.

Share this post


Link to post
Share on other sites

Sorted it. Should be A:Autopilot throttle arm, NOT A:Auto throttle arm now works fine, first part nearly done just the speed setting to do.

Share this post


Link to post
Share on other sites

>Sorted it. Should be A:Autopilot throttle arm, NOT A:Auto>throttle arm now works fine, first part nearly done just the>speed setting to do. I copy XML variables from Parameters.doc and paste them into a big comment at the bottom of a couple of my gauges. One section for A: variables, another for K:, etc. Also, many of the units. Then, I can copy and paste to my code as needed. Ron

Share this post


Link to post
Share on other sites

I think I will try that, saves copying errors. I have now nearly finished just need to sort the flare. I think I will try the Att hold variables and see how it goes, will also do search on here to see if I can find how you set the attitude to hold 6 degrees. been fun finding out how xml works so will have to look for another project when I finish this one.Thanks to all who replied.

Share this post


Link to post
Share on other sites

>I think I will try that, saves copying errors. >>I have now nearly finished just need to sort the flare. I>think I will try the Att hold variables and see how it goes,>will also do search on here to see if I can find how you set>the attitude to hold 6 degrees. I assigned 'synch FD bar' to "Ctl ". That moves the FD to the current AC pitch. I also assigned 'increase and decrease FD bar' to "Ctl -" and "Ctl +". That way, I can make the FD Bar move to current AC Attitude, then kill ALT hold (if on). I can then adjust the FD pitch from the KB and the AC pitch will follow. When the FD is not on "0.00" and the Autopilot is On, the AC pitch adjusts to the FD pitch setting. I often fly my AC by changing the FD pitch, letting the autopilot change the trim to hold that pitch. I have to hit "Ctl T" to disable the FD, it then moves to 0.0. While turning 'ALT' back on restores ALT/VS control. I display FD Pitch in my test gauge. I can see the value much more accurately than on the horizon indicator. I've also noted the Lear FD bars are not always at the height they should be. To hold pitch in your 'autoland' I expect you could control the autopilot and FD with XML Variables. I'm pretty sure there are 'increase FD pitch' and 'decrease FD pitch'. Incidently, they change by 0.2 degrees per increment. Your gauge might have to look at the A: FD pitch and keep incrementing or decrementating the K:SET for the FD to get the 6.0 degrees. Unless there is a K: event to set the FD bar to exactly the value you want. There is also a FD 'roll' variable. Note the autopilot follows the FD value in for both ALT/VS/GS (pitch) and HDG/NAV/ILS (roll), even if the FD Bars are not displayed. In your case, I think setting the FD pitch and letting the autopilot hold the AC to that pitch is an approach to try. Experimenting with this manually will give a better idea of what you want to control during an autoland. --- There are two 'AGL' values in XML: (A:Radio Height,ft) and(A:Plane Alt Above Ground,ft). They appear to be identical. Both give the distance to the AC's center, so may read 10 ft when on the ground. You will want to subract that distance to know how far the wheels are above the runway during the autoland. Ron

Share this post


Link to post
Share on other sites

I have tried K:AP_PITCH_REF_INC_UP but do I have to type this in six time to get the 6 degrees ?? K:INCREASE_AUTOBRAKE_CONTROL was easy as could get it to go to 1 2 3 4 etc using the A Variable then the the number 0 for off etc.But K:AP_PITCH_REF_INC_UP does not have this (or I do not have a gauge with this A:Variable) so how can you tell it to go up 6 degress, I have tried (>K:AP_PITCH_REF_INC_UP) 6 does nothing. This is the only thing left to do, can engage Autoland 20 nm fron runway and it does everything autopilot on, apr on, Flaps, Autobrake, Gear and speed, then when on the ground reverse thrust, throttle to idle at 60 knots autobrake off, flaps up, spoiler up autopilot off. But for the life of me can not get it to flare.The only other I noticed is when I engage Autoland before 20nmiles it turn the Alt Hold off, do not no why as Alt Hold is not in the Autoland code. Anyone else had this problem ??

Share this post


Link to post
Share on other sites

Hi, My approach for flare etc:Use Radio height extensively:Between 70 ft and 30 ft cut throttles, appr hold off, alt hold onThis gives pos pitch!Between 30 and 20 ft if pitch > 2 degrees + then alt hold off and att hold on.On ground and speed < 110 then att hold off, reversers on etc.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Unfortunaly mine does not give pos pitch when throttle are set to cut, so I need to find a way to get the AP to increase pitch, I have looked in the panel sdk and found a few A: and K: Var, so far have come up with this.(A:AUTOPILOT ATTITUDE HOLD,degrees) 6 == if{ (>K:AP_ATT_HOLD_ON)Will play with the A:Var and see if I can get the AP to increase pitch, Have also thought about using the above A:Var and then K:AP_PITCH_REF_INC_UP but not sure how it to get it to increase to 6 degrees or what ever the best pitch will be.

Share this post


Link to post
Share on other sites

>(A:AUTOPILOT ATTITUDE HOLD,degrees) 6 == if{>(>K:AP_ATT_HOLD_ON)>>Will play with the A:Var and see if I can get the AP to>increase pitch, >>Have also thought about using the above A:Var and then>K:AP_PITCH_REF_INC_UP but not sure how it to get it to>increase to 6 degrees or what ever the best pitch will be. There doesn't seem to be a way to set pitch_reference or Flight_director_pitch to 6 degrees directly. All I see in the EventIDs.doc are increment up or down. Only a few things can be SET directly, Throttle, Ailerons, Rudder, Elevators, Elevator Trim, etc. All I can think of is to increment or decrement the pitch_reference in a loop until the A:Pitch Ref (or FD Bar) gets to + 6.0 degrees. Within a small error range. One can use 'g1' to go to label :1, etc. I've made loops that terminate when some condition is reached with an if{ block. Note the pitch reference just might be over 6 degrees so if it is "> 6.0" then you have to use the decrement. I know the FD increments/decrements 0.2 degree per key hit. It may not hit exactly 6.0 degrees, so again, you have to check for just being within say, 0.1 deg of 6.0 degrees. "A:pitch_ref 6.0 - abs 0.1 lt; if{ ..... }" might be useful for the 'close enough' condition. I don't know about the 'pitch reference' but another problem with the 'FD Pitch' is that is is filtered, and moves somewhat slowly to the final value. So, 5 clicks to move it from 0.0 to 1.0 would only result in the A: variable Pitch getting to 1.0 after maybe a second. Ron

Share this post


Link to post
Share on other sites

Hi,A description of what's happening.Just try some settings of Radio Height.I know they work in my 767Imagine "established" and below 70 ft.Your VS is about -700 ft/min.Then throttles cut, approach off and ALT HOLD ON!That means while descending the plane is struggling to keep altitude.Pos pitch is the result, still descending!At that moment, eg pitch > +2 degrees, alt hold off and ATT HOLD ON to keep the pos pitch, while descending untill touch down.Then everything off etc.My Code:(A:RADIO HEIGHT,feet) 70 < (A:RADIO HEIGHT,feet) 30 > and if{ (A:AUTOPILOT THROTTLE ARM,bool) if{ (>K:AUTO_THROTTLE_ARM) } (A:GENERAL ENG1 THROTTLE LEVER POSITION,percent) 0 > if{ (>K:THROTTLE1_CUT) } (A:GENERAL ENG2 THROTTLE LEVER POSITION,percent) 0 > if{ (>K:THROTTLE2_CUT) } (A:AUTOPILOT APPROACH HOLD,bool) if{ (>K:AP_APR_HOLD) } (A:Autopilot altitude lock, bool) ! if{ (>K:AP_ALT_HOLD_ON) } } (A:RADIO HEIGHT,feet) 27 < (A:RADIO HEIGHT,feet) 17 > and if{ (A:PLANE PITCH DEGREES,degrees) -1 * 1 > (A:PLANE PITCH DEGREES,degrees) -1 * 6 < and if{ (A:Autopilot altitude lock, bool) if{ (>K:AP_ALT_HOLD_OFF) } (A:AUTOPILOT ATTITUDE HOLD,bool) ! if{ (>K:AP_ATT_HOLD_ON) } } } (A:SIM ON GROUND,bool) (A:AIRSPEED SELECT INDICATED OR TRUE, knots) s1 115 < l1 55 >= (A:RADIO HEIGHT,feet) 16 < and and and if{ (A:GENERAL ENG1 THROTTLE LEVER POSITION,percent) 0 == near if{ -16000 (>K:THROTTLE1_SET) } (A:GENERAL ENG2 THROTTLE LEVER POSITION,percent) 0 == near if{ -16000 (>K:THROTTLE2_SET) } (A:AUTOPILOT ATTITUDE HOLD,bool) if{ (>K:AP_ATT_HOLD_OFF) } (A:SPOILERS ARMED,bool) (A:TURB ENG1 REVERSE NOZZLE PERCENT,percent) 2 > and if{ (>K:SPOILERS_ON) } } etc.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi,I am a beinner just like you and have some questions.For what aircraft do you make this autoland gauge?Have you finished it by now?Would it be possible to see the complete code?I would be very interested to see what you put together.Would be a big help to get me on my way.Thanks for your effort.Roelof Kruijer (rkruijer@home.nl)

Share this post


Link to post
Share on other sites

Hi JanHave sorted the problem with the pitch angle I have used (>K:AP_PITCH_REF_INC_UP) six times, then when pitch angle is at the right angle then (>K:AP_ATT_HOLD_ON). Pitch can be altered quite easy by deleteing or adding one or more of the(>K:AP_PITCH_REF_INC_UP)I see how you got positvie pitch now Jan, with Alt Hold On the aircraft tries to climb so increases pitch then when pitch is correct ATT Pitch Hold, holds that pitch.Understand how XML work alot better now.Thanks for the Help Jan and Ron

Share this post


Link to post
Share on other sites

For what aircraft do you make this autoland gauge?The aircraft I made this Autoland Gauge for the Dreamwing Embraer 170Have you finished it by now?YesWould it be possible to see the complete code?I have made a complete panel with overhead and Pedestal, I will upload this to the Avsim file library in the new year so by all means downloaded it and take a look at the code.The best way to learn (My Experience) is to find an aircraft you like to fly and add things to it. If you are a beginner then download as many XML gauge as you can find and look at the code, also download the FS2004 SDK, A link for this can be found on this site do a search in the forum. I started by doing and Engine EICAS with N1, N2 , Oil Temp, EGT, etc. Give it a try and if you have a problem post on this forum, there is always someone who can help.

Share this post


Link to post
Share on other sites

>Dreamwing Embraer 170>Have you finished it by now? >Yes>I have made a complete panel with overhead and Pedestal, I>will upload this to the Avsim file library in the new year so>by all means downloaded it and take a look at the code.Thanks. I'll be looking forward to it. I am already past the things you adviced. See my recent topic "XML How to set Altitude?"Once you get a hold of this XML and RPN you begin to like it.I have already made some gauges for the PFokker100 but I am not finished yet. Roelof

Share this post


Link to post
Share on other sites

>Hi Jan>>Have sorted the problem with the pitch angle I have used>(>K:AP_PITCH_REF_INC_UP) six times, then when pitch angle>is at the right angle then (>K:AP_ATT_HOLD_ON). Pitch can>be altered quite easy by deleteing or adding one or more of>the (>K:AP_PITCH_REF_INC_UP) Does "(>K:AP_PITCH_REF_INC_UP)" increase the pitch reference 0.2 degrees at a time? As moving the FD bar does. Or, a different amount? Maybe six of them would increment by 1.2 degrees on each iteration. So you check for pitch angle, then do "(>K:AP_ATT_HOLD_ON)" when it is right (or, close to 6.0 deg). Sounds good to me. Be sure it works with different landing weights and CG's. Ron

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this