• 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.

FSX Speed Trend Vectors and FLC Mode XML

Messages
1
Country
germany
Hello,

iam new in this Forum but i have a little experience in FS Design.

I have the freeware Global XRS from Bill in use, and missing a Speed Trend gauge in the PFD, i testet some Variables but no positive results for me ;-)

2nd Question: any Idea for a FLC Mode (Autopilot) in XML?

Many Thanks and sorry for my bad english

Janek


EDIT:
After a long long Night, Speed Trend and LNAV for Simavionics added :o



Any idea for the FLC Mode?

Cheers
 
Last edited:
here is a variable to hold flight level.

(A:AUTOPILOT VERTICAL HOLD,bool)

i think you just need to add this, since your standard autopilot is
set to not hold vertical. Or you need to change the config to make it that way.
Then having this second switch will override the climb.

I think it will be easier to make a 3D switch and write this in XML format.

DG
 
here is a variable to hold flight level.

(A:AUTOPILOT VERTICAL HOLD,bool)

That only tells you whether the Vert Hold is active. It doesn't turn the function on/off at all. It also doesn't have anything to do with "hold[ing] flight level" at all.

These are the two command events:
AP_VS_VAR_INC Increments vertical speed reference
AP_VS_VAR_DEC Decrements vertical speed reference
 
Oops i thought i posted an event ID.

I figured we could get this post going. Sorry i was tired.
Of course I knew that was a variable....lol

He needs an action key and I think there was none.

Bill when you see me do that, just say DG your tired and confused again.....

DG:confused:
 
Regarding the speed trend vector, what code did you end up with? I have recently written one and I settled on this:

Code:
(A:AIRSPEED TRUE, knots) 30 > if{ 
6 s0 
(L:LastSpeedWAS, enum) 0 > if{ 
(L:trendy,enum) 0 == if{ 
(A:Sim on Ground,bool) if{ 2 s2 } els{ 1 s2 } 
(L:Accumulate0, enum) 1.50 * l2 * (L:Accumulate1, enum) 1.20 * l2 * + (L:Accumulate2, enum) 0.85 * + (L:Accumulate3, enum) 0.5 * + 2.8 / 6 * (A:Airspeed indicated, knots) + (>L:estimateT,enum) 
(L:Accumulate2, enum) (>L:Accumulate3, enum) 
(L:Accumulate1, enum) (>L:Accumulate2, enum) 
(L:Accumulate0, enum) (>L:Accumulate1, enum) 
                    0 (>L:Accumulate0, enum) 
} els{ (L:Accumulate0, enum) (A:AIRSPEED TRUE, knots) (L:LastSpeedWAS, enum) - 0.7 * + (>L:Accumulate0, enum) } 
} els{ (A:AIRSPEED TRUE, knots) (>L:estimateT,enum) } (L:trendy,enum) 0 > 
if{ (L:trendy,enum) 1 - (>L:trendy,enum) } els{ l0 1 - (>L:trendy,enum) } 
(A:AIRSPEED TRUE, knots) (>L:LastSpeedWAS, enum) 
}

It seems to be fairly stable and then the second part is simply to smooth out the movement, since the value only increments at 1Hz... I have similar for flight path angle and heading trend for a small marker that moves about in the middle of my PFD.

As for level change, I have a climb mode that initiates aft takeoff clamp is removed if the VS exceeds 1500 with N1 over 65% and difference from altitude set of over 1500 ft. It simply works by scaling the vertical speed variable from the AP according to the current deviation from a set N1 value (default if 87% but it is modified by ambient conditions). This has a repeat rate of about 5 seconds so that the aircraft has a chance to stabilise from the last input and it works quite well. Some limits are also imposed to ensure that it doesn't try to set any 'silly' values of VS... I've not actually tied it but I would imagine that it would also work fine for an idle descent mode - ie the target N1 is set to something like 30% and negative VS are applied.

What I usually use for descent (if not FMS PROF) is the FPA mode, where I can set an angle, for example -3.6 degrees, and the code will determine the correct VS to achieve that based on the current airspeed. This also works well, even to the extent that I can use it for VOR approaches down to minimums when the relevant altitudes and angle have been specified on the charts! The advantage of the FPA mode is of course that the descent rate will scale with airspeed, so the point of reaching the set altitude will remain (roughly) constant.

Code:
180 pi / s0 (L:FPASet,enum) l0 / tg s4 l4 (A:AIRSPEED TRUE,knots) * 101.26859 * s5 l5 100 / near 100 * (>L:FPAholdVS, enum)

Geoff
 
Regarding the speed trend vector (...)
Geoff

For the speed trend vector I use this simple formula:

(A:ACCELERATION BODY Z, Feet per second squared) 0.592483801 * 10 * (A:AIRSPEED INDICATED, Knots) +

The result of the above statement will give the predicted speed value, 10 seconds later.

This is because the phisics equation v = v0 + at, which means:
v (resulting speed) = v0 (actual speed) + a (acceleration) * t (time interval)

If you are modeling a trend vector on a PFD airspeed tape, you'll only use the
(A:ACCELERATION BODY Z, Feet per second squared) 0.592483801 * 10 *
part, as the (A:AIRSPEED INDICATED, Knots) is already indicated on the tape.

The 0.592483801 constant, was added to convert feet per second squared to knots per second, so the result is an airspeed in knots.

You'll have to play around with a shift to get the desired result, and this is very easy if you're familiar with the ace tool.

This thread might help

Try it and see if it works for you.
 
(A:ACCELERATION BODY Z, Feet per second squared) 0.592483801 * 10 * (A:AIRSPEED INDICATED, Knots) +

Yes, that would work here but I forgot to mention that my code above was from an FS9 project, where the ACCELERATION BODY Z is not available (would be nice if it was) :o

Effectively my code is doing the same: finding the speed change over a series of time intervals and then smoothing by weighting them a bit...

Geoff
 
Last edited:
Yes, that would work here but I forgot to mention that my code above was from an FS9 project, where the ACCELERATION BODY Z is not available (would be nice if it was) :o

Effectively my code is doing the same: finding the speed change over a series of time intervals and then smoothing by weighting them a bit...

Geoff
Sorry for that. I didn't knew that FS9 lack the ACCELERATION BODY variables. :(
 
Regarding the speed trend vector, what code did you end up with? I have recently written one and I settled on this:

Code:
(A:AIRSPEED TRUE, knots) 30 > if{ 
6 s0 
(L:LastSpeedWAS, enum) 0 > if{ 
(L:trendy,enum) 0 == if{ 
(A:Sim on Ground,bool) if{ 2 s2 } els{ 1 s2 } 
(L:Accumulate0, enum) 1.50 * l2 * (L:Accumulate1, enum) 1.20 * l2 * + (L:Accumulate2, enum) 0.85 * + (L:Accumulate3, enum) 0.5 * + 2.8 / 6 * (A:Airspeed indicated, knots) + (>L:estimateT,enum) 
(L:Accumulate2, enum) (>L:Accumulate3, enum) 
(L:Accumulate1, enum) (>L:Accumulate2, enum) 
(L:Accumulate0, enum) (>L:Accumulate1, enum) 
                    0 (>L:Accumulate0, enum) 
} els{ (L:Accumulate0, enum) (A:AIRSPEED TRUE, knots) (L:LastSpeedWAS, enum) - 0.7 * + (>L:Accumulate0, enum) } 
} els{ (A:AIRSPEED TRUE, knots) (>L:estimateT,enum) } (L:trendy,enum) 0 > 
if{ (L:trendy,enum) 1 - (>L:trendy,enum) } els{ l0 1 - (>L:trendy,enum) } 
(A:AIRSPEED TRUE, knots) (>L:LastSpeedWAS, enum) 
}

It seems to be fairly stable and then the second part is simply to smooth out the movement, since the value only increments at 1Hz... I have similar for flight path angle and heading trend for a small marker that moves about in the middle of my PFD.

As for level change, I have a climb mode that initiates aft takeoff clamp is removed if the VS exceeds 1500 with N1 over 65% and difference from altitude set of over 1500 ft. It simply works by scaling the vertical speed variable from the AP according to the current deviation from a set N1 value (default if 87% but it is modified by ambient conditions). This has a repeat rate of about 5 seconds so that the aircraft has a chance to stabilise from the last input and it works quite well. Some limits are also imposed to ensure that it doesn't try to set any 'silly' values of VS... I've not actually tied it but I would imagine that it would also work fine for an idle descent mode - ie the target N1 is set to something like 30% and negative VS are applied.

What I usually use for descent (if not FMS PROF) is the FPA mode, where I can set an angle, for example -3.6 degrees, and the code will determine the correct VS to achieve that based on the current airspeed. This also works well, even to the extent that I can use it for VOR approaches down to minimums when the relevant altitudes and angle have been specified on the charts! The advantage of the FPA mode is of course that the descent rate will scale with airspeed, so the point of reaching the set altitude will remain (roughly) constant.

Code:
180 pi / s0 (L:FPASet,enum) l0 / tg s4 l4 (A:AIRSPEED TRUE,knots) * 101.26859 * s5 l5 100 / near 100 * (>L:FPAholdVS, enum)

Geoff

Geoff,

Would you be whilling to share that code for the Climb mode? My email is Simpilot04 at gmail.com
 
Hi Geoff,

sorry for being so dumb but...

What exactly does trendy reflect in your code?

I incorporated the code into my B737 EADI in FS2004 and displayed trendy.

It appears to be always a positive number, between 0 and 7 maybe 8 (It changes so rapidly it is hard to tell).

How do you then use trendy to display to the pilot where the speed will be in 10 seconds?

I'd love to have a reliable speed trend vector in the EADI. I have a fake one at the moment that simply shows acceleration or deceleration.

Thanks

Walter
 
What exactly does trendy reflect in your code?

That is just a timer, so that I could tweak the gauge easily... You are right, it just counts from 0 to l0 and as l0 is declared as 6 at the beginning...

The estimate speed is given as (L:estimateT,enum)

Geoff
 
Geoff,

Would you be whilling to share that code for the Climb mode? My email is Simpilot04 at gmail.com

Here it is... You'll have to pick out what you need as in my panel everything is linked to everything else as the whole development has been somewhat 'organic'.

PITCH controller - you will need to set the N1 you want and the airspeed, then this will attemptt to maintain that airspeed by changing the VS. There are lots of variables here that you will need to replace with something appropriate to the aircraft you are working with...

Code:
<!-- TO pitch controller -->
<Element>
<Select>
<Value>

(L:PhaseTO1,enum) 2 == (L:PhaseTO2,enum) 2 == || (L:gctoga, enum) 1 == &amp;&amp; (A:PLANE ALTITUDE,feet) (A:AUTOPILOT ALTITUDE LOCK VAR,feet) - abs 250 &gt; &amp; (A:RADIO HEIGHT,feet) 6000 &lt; &amp; if{ (A:Airspeed select indicated or true, knots) (L:estimateT,enum) + 2 / 15 + (A:Autopilot airspeed hold var, knots) min (L:pitchspeed,enum) max (L:limspeed,enum) 10 + max (>L:pitchspeed,enum) } els{ (L:gctoga, enum) 1 == (A:PLANE ALT ABOVE GROUND,feet) 20 &lt;= &amp;&amp; if{ (L:BugV2,enum) int 0 + (L:limspeed,enum) 10 + max (L:pitchspeed,enum) != if{ (L:BugV2,enum) int 0 + (L:limspeed,enum) 10 + max (>L:pitchspeed,enum) } } els{ (L:PhaseTO1,enum) 2 &lt; (L:PhaseTO2,enum) 2 &lt; &amp;&amp; (L:gctoga, enum) 1 == &amp; (A:PLANE ALT ABOVE GROUND,feet) 40 &gt; &amp; (A:PLANE ALTITUDE,feet) (A:AUTOPILOT ALTITUDE LOCK VAR,feet) - abs 250 &gt; &amp; if{ (L:BugV2,enum) int 10 + (L:limspeed,enum) 10 + max (L:pitchspeed,enum) != if{ (L:BugV2,enum) int 10 + (L:limspeed,enum) 10 + max (>L:pitchspeed,enum) } } els{ (A:Autopilot airspeed hold var, knots) (L:limspeed,enum) 10 + max (L:pitchspeed,enum) != if{ (A:Autopilot airspeed hold var, knots) (L:limspeed,enum) 10 + max (>L:pitchspeed,enum) } } } } 

(L:gctoga, enum) 1 == (L:CLMB,enum) 1 == || if{ 

(A:Autopilot airspeed hold, bool) if{ (>K:AP_PANEL_SPEED_OFF) } 
(A:Autopilot mach hold, bool) if{ (>K:AP_PANEL_MACH_OFF) } 

<!-- Initialize --> 
(L:pitchinit,bool) ! if{ 
1 (&gt;L:pitchinit,bool) 
1 (&gt;L:Kp, number) 
0.6 (&gt;L:Ki, number) 
1 (&gt;L:Kd, number) 
100 (&gt;L:Kx, number) 
0.5 (&gt;L:AP_IAS_LOOP_TIME, seconds) 
0 (&gt;L:AP_IAS_LAST_ERROR, knots) 
0 (&gt;L:AP_IAS_INTEGRAL, knots) 
5 (&gt;L:AP_IAS_INTEGRAL_MAX, knots) 
500 (&gt;L:AP_VS_STEP_MAX, knots) 
} 

<!-- Run --> 
(A:AIRSPEED INDICATED, knots) 80 &gt; (P:Absolute time,seconds) (L:trptimer, enum) - abs (L:AP_IAS_LOOP_TIME, knots) &gt;= &amp;&amp; if{ 
(P:Absolute time,seconds) (>L:trptimer, enum) 

<!-- Data --> 
(A:AIRSPEED INDICATED, knots) (L:estimateT,enum) 2 * + 3 / sp1 
<!-- Calculate ERROR --> 
l1 (L:pitchspeed,enum) - (&gt;L:AP_IAS_ERROR, knots)
 
<!-- Calculate INTEGRAL -->
(L:AP_IAS_ERROR, knots) (L:AP_IAS_LOOP_TIME, knots) / (L:AP_IAS_INTEGRAL, knots) + (L:AP_IAS_INTEGRAL_MAX, knots) /-/ max (L:AP_IAS_INTEGRAL_MAX, knots) min (&gt;L:AP_IAS_INTEGRAL, knots) 

<!-- Calculate DERIVATIVE -->
(L:AP_IAS_ERROR, knots) (L:AP_IAS_LAST_ERROR, knots) - (L:AP_IAS_LOOP_TIME, knots) / (&gt;L:AP_IAS_DERIVATIVE, knots) 
<!-- Calculate OUTPUT -->
(L:AP_IAS_ERROR, knots) (L:Kp, number) * (L:AP_IAS_INTEGRAL, knots) (L:Ki, number) * + (L:AP_IAS_DERIVATIVE, knots) (L:Kd, number) * + (&gt;L:AP_IAS_OUTOUT, knots) 

(L:AP_IAS_OUTOUT, knots) abs 0.25 &gt; (A:PLANE ALTITUDE,feet) (A:AUTOPILOT ALTITUDE LOCK VAR,feet) - abs 250 &gt; &amp;&amp; if{ 
(A:PLANE ALTITUDE,feet) (A:AUTOPILOT ALTITUDE LOCK VAR,feet) &lt; if{ 
(L:CLMB,enum) 1 == if{ (A:PLANE ALTITUDE,feet) 15000 &gt; if{ (L:VStarget,enum) 1000 + s3 } els{ (L:VStarget,enum) 1800 + s3 } } els{ (L:VStarget,enum) 2800 + s3 } 
(A:Attitude indicator pitch degrees, degrees) /-/ (L:pitchlimit,enum) 2 - &gt; if{ (A:Attitude indicator pitch degrees, degrees) /-/ (L:pitchlimit,enum) &gt; if{ (A:VERTICAL SPEED, ft/min) (A:AUTOPILOT VERTICAL HOLD VAR,feet per minute) + 2 / 150 - l3 min s3 } els{ (A:VERTICAL SPEED, ft/min) (A:AUTOPILOT VERTICAL HOLD VAR,feet per minute) + 2 / l3 min s3 } } 
l20 50 min 15 max 15 - 30 * /-/ 1800 + s4 
l4 (A:PLANE ALTITUDE,feet) 0 max 36000 min 0.0333 * /-/ 1800 + int min l3 min 500 max s4 
} els{ (A:RADIO HEIGHT,feet) 2450 min 2.1721 * 1180 + /-/ s4 -500 l4 max s3 } 

l3 (&gt;L:AP_VS_UPPER, knots) 
l4 (&gt;L:AP_VS_LOWER, knots) 

<!-- Update VS using a max change of 900 and keeping within the limits set above -->
(A:VERTICAL SPEED, ft/min) (A:AUTOPILOT VERTICAL HOLD VAR,feet per minute) + 2 / (L:AP_IAS_OUTOUT, knots) (L:Kx, number) * (L:AP_VS_STEP_MAX, knots) min (L:AP_VS_STEP_MAX, knots) /-/ max + l3 min l4 max (>K:AP_VS_VAR_SET_ENGLISH) 

} } 

<!-- Update ERROR -->
(L:AP_IAS_ERROR, knots) (&gt;L:AP_IAS_LAST_ERROR, knots) 

}

} els{ (L:pitchinit,bool) if{ 0 (>L:pitchinit,bool) } } 

</Value>
</Select>
</Element>

Hope this mess is of use to you!

Geoff
 
Hello. very interesting information. Do any of you know how to make a bank limit gauge for FS2004 (FS9) that the larger aircraft use? FSX has the parameter: (A:AUTOPILOT MAX BANK, degrees) but FS2004 does not. Also, aircraft.cfg can only use one setting. Yet, CaptainSim's 757, PSS 777,747 and LevelD 767's all have the gauge but in the *.gau format and not the xml format. The webpage http://www.fsdeveloper.com/forum/threads/autopilot-bank-limiter.212420/ has good information but I'm still not able to glean how mouse clicks are applied to the case to select the bank angle and also info about which parameter(s) is/are being used to maintain the bank angle. Any help would be greatly appreciated.
 
I use pitch control mode and N1 engines control for my Airbus A320 managed mode with my FMC


I am not a mathematician and I don't know how to create a PID controler, so I use timers ans ACCELERATION BODY Z variable to control pitch with a constant thrust and constant picth, without use FSX A/THR


sample :
Code:
(L:VS_Mode,bool) 1 == if{
                        -25 0.90 (A:ACCELERATION BODY Z, feet per second squared) rng
                        (A:Vertical Speed,feet per minute) 1500 &gt; and
                        (A:Airspeed select indicated or true, knots) (L:Speed_Managed,enum) 6 - &lt; and
                        (P:Absolute time,seconds) 1 % 0.1 1 * > ! and if{ 1 (>K:AP_PITCH_REF_INC_DN) }
                                                                        
                        0.90 25 (A:ACCELERATION BODY Z, feet per second squared) rng
                        (A:Vertical Speed,feet per minute) 3800 &lt; and
                        (A:Airspeed select indicated or true, knots) (L:Speed_Managed,enum) 15 - &gt; and
                        (P:Absolute time,seconds) 1 % 0.1 1 * > ! and if{ 1 (>K:AP_PITCH_REF_INC_UP) }
                                                                        
                        -1 0.90 (A:ACCELERATION BODY Z, feet per second squared) rng
                        (A:Vertical Speed,feet per minute) 1500 &gt; and
                        (L:Speed_Managed,enum) 5 - (L:Speed_Managed,enum) 1 + (A:Airspeed select indicated or true, knots) rng and
                        (P:Absolute time,seconds) 1 % 0.06 1 * > ! and if{ 1 (>K:AP_PITCH_REF_INC_DN) }
                                                                        
                        0.91 1 (A:ACCELERATION BODY Z, feet per second squared) rng
                        (A:Vertical Speed,feet per minute) 3800 &lt; and
                        (A:Airspeed select indicated or true, knots) (L:Speed_Managed,enum) 3 + &gt; and
                        (P:Absolute time,seconds) 1 % 0.06 1 * > ! and if{ 1 (>K:AP_PITCH_REF_INC_UP) }
                    
                        (* augmente le pitch si vitesse trop eleve sans notion d acceleration *)
                        (A:Vertical Speed,feet per minute) 3800 &lt;
                        (A:Airspeed select indicated or true, knots) (L:Speed_Managed,enum) 6 + &gt; and
                        (P:Absolute time,seconds) 1 % 0.03 1 * > ! and if{ 1 (>K:AP_PITCH_REF_INC_UP) }
                    
                        (* diminue le pitch si vitesse trop basse sans notion d acceleration *)
                        (A:Vertical Speed,feet per minute) 1200 &gt; and
                        (A:Airspeed select indicated or true, knots) (L:Speed_Managed,enum) 12 - &lt; and
                        (P:Absolute time,seconds) 1 % 0.03 1 * > ! and if{ 1 (>K:AP_PITCH_REF_INC_DN) }
                    
                        (L:TakeOffTHRCLBOk,bool) 1 == if{
                                                        (A:Indicated Altitude,feet) 10000 / s0
                                                        (L:TakeOffTHRCLBValue,number) l0 - (>L:THRUST,number)
                                                        (A:GENERAL ENG1 THROTTLE LEVER POSITION,percent) 91.5 &gt; (A:GENERAL ENG2 THROTTLE LEVER POSITION,percent) 91.5 &gt; and if{ (L:THRUST,number) 1 - (>L:THRUST,number) }
                                                        (L:THRUST,Number) (>K:AP_N1_REF_SET)
                                                        1 (>K:AP_N1_HOLD)
                                                        }
                        
                        
                        }

VS_mode = 1 when climb managed mode is engaged
L:Speed_Managed,enum) is the Speed setting in the FMC.
L:Thrust, number is the N1 value selected in the FMC

I adjust timers, Acceleration Body Z values according altitude.
I have 3 differents sections for the climb :
- 0 to 10000ft
- 10000 ft to crossover altitude
- crossover altitude to cruise altiude (in MACH control with permanent adjustment of the IAS value according altitude to correct the huge problem of FSX which not recalculate IAS value when you are in MACH mode).

Same thing for the descent, with a thrust to 0.

This method is empiric, and requires adjustements for each aircraft but works very well.

You can see the result on this old video, from minute 6, where aircraft is controld only by my FMC, with N1 control and pitch control :
 
Last edited:
Hello. Thank you for your reply but I am interested in a BANK LIMITER, not so much pitch, so to be honest, I'm confused of your reply information. In addition, I don't think Airbus ever used a Bank Limiter like Boeing does. However, thanks though.
 
Last edited by a moderator:
Back
Top