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

How to create lag?

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
Hi guys

Im attempting to get around some limitations in turbine engine starts in FSX by taking control over the N1 RPM value directly. I want it to increment at a set rate up till 6% at which point if the fuel valves are open and the ignition system armed i will trigger the combustion flag and then i want to increment at a higher rate but make it slow down as it reaches idle RPM which is around 30% or so. If i let the sim deal with it by itself the N1 RPM remains at 0 while N2 increases and the engine starts almost immediately ie the spool up is a bit rapid. Then it overshoots the idle RPM by a very high margin.

So the question is....how do i create lag ie change the spool up acceleration when im controlling the RPM values directly?

Thanks
JB
 
Can that even be done in principle?

ENG N1 RPM index and ENG N2 RPM index are both non-settable in the SDK's list of Simulation Variables
 
Variable Description Units Settable

TURB ENG N1:index Turbine engine N1 Percent Y

TURB ENG N2:index Turbine engine N2 Percent Y

TURB ENG CORRECTED N1:index Turbine engine corrected N1 Percent Y

TURB ENG CORRECTED N2:index Turbine engine corrected N2 Percent Y

TURB ENG CORRECTED FF:index Corrected fuel flow Pounds per hour Y

TURB ENG MAX TORQUE PERCENT:index Percent of max rated torque Percent Y

TURB ENG PRESSURE RATIO:index Engine pressure ratio Ratio Y

TURB ENG ITT:index Engine ITT Rankine Y
 
Most of the engine variables are indeed settable. So far the only conclusion i can come to is to use varying +=/-= settings based on the gauge timing to increment/decrement RPM/Fuel Flow etc until it reaches a value related to throttle position vs altitude since most governors on turbine engines increase the idle RPM with altitude. This is how you create DEECs and such....
 
Jon, one thing you must keep in mind is that in 3d models, there are actually three "turbine fan" objects!

Code:
N1_0_still       (A:ENG N1 RPM:1, percent) 6.25 < if{ 1 } els{ 0 }

N1_0_slow        (A:ENG N1 RPM:1, percent) 6.25 >
                     if{
                         (A:ENG N1 RPM:1, percent) 12.5 < if{ 1 } els{ 0 }
                       } els{ 0 }

N1_0_blurred     (A:ENG N1 RPM:1, percent) 12.5 > if{ 1 } els{ 0 }

The above is the "default script" for controlling visibility of the 3d object(s).
The _still object is displayed and animated when N1% is < 6.25%...
The _slow object is displayed and animated when N1% > 6.25 and < 12.5%...
The _blurred object is displayed and animated when N1% is >12.5%

All three objects are "rotated" using this evaluated script:
Code:
(A:GENERAL ENG RPM:1,degrees per second) (E:ABSOLUTE TIME, second) * 360 % 3.6 /

From a modeling perspective, typically only the _still and _slow objects are 3d modeled, with the _blurred object being only a flat disk to which a "blurred fan texture" has been applied.

So, what does all this mean? If you wish to take full control via your C++ gauge code, then you also must assume full control of the 3d object's visibility and animation rotation yourself in the modeldef.xml script!
 
A:GENERAL ENG RPM is not settable from simconnect. however your Turbine Engine N1/N2 RPMs are settable. This leads me to believe that GENERAL ENG RPM is something that is derived from the other RPM variables and as such, i am not responsible for them. The engine variables that are not settable are either variables that can be directly controlled via key events, or they are derived from the values of other variables for example TURB ENG JET THRUST is not settable. I imagine that is because it is derived from some complex algorithm involving RPM, EPR, (for interests sake TURB ENG PRESSURE RATIO is settable by simconnect), Fuel flow, and temperature. So all i would be doing is removing the limits that .air files have on complex fuel flow/rpm/temperature curves or i am effectively putting in a governor which stops a engine from over revving or such. How FSX interprets this in terms of thrust output, fan animations etc, cannot be taken control of by simconnect. Sometimes im kinda annoyed at the variables that cant be controlled....like the afterburner stages. I would really like to be able to directly control fuel flow in afterburner and deny afterburner if certain criteria are met like certain systems being switched off or such....or being able to light the burners at a slower rate rather than having them being controlled directly by the throttle.
 
Last edited:
I should have read the SDK more carefully and realised that TURB ENG N1 (N2) are settable:confused:

However, what effect would setting them have? My (admittedly imperfect) understanding is that FS models jet/turbine engines by using tables in the .air file to obtain N1, N2, gross thrust etc based on throttle lever position, Mach number, and Inverse Air Pressure Ratio (sea level pressure/pressure at altitude). If , for example, N1 is set by the user would FS not promptly recalculate and substitute its own value, overriding the one that’s just been set?

I can’t see sufficient information in the .cfg or .air file to define fully engine performance. This makes me wonder if there isn’t a built-in generic engine model to which we have no access in the same way that there’s a built-in generic inaccessibkle 6-DOF model for flight dynamics?
 
FSX will attempt to overwrite them with its own values if you are not setting it constantly. The whole point of making these variables settable is to allow the engine to perform differently to what is specified in the air/cfg files based on various system functions. For example, in a F-15 with its Digital Electronic Engine Control (DEEC), if the DEEC switches are on, you can get faster engine acceleration than when it is off. If it is off, not only is engine acceleration reduced, but it limits the fuel flow to prevent you from overdriving the engine and afterburner is also inhibited. Also idle rpms are adjusted with the governor settings for altitude/speed etc. Theres a lot more freedom to be had with jet engine modelling by taking control of the fuel flow/RPM/EPR values when it comes to doing extremely indepth system modelling. Ultimately, i think setting them will merely have a different effect on your final thrust output.
 
I appreciate what you want to achieve. My question is, can it be done within the limitations of FSX?

Apart from anything else, letting the user and FSX both set the same variable seems likely to lead to inconsistent results, if not worse.
 
FSX will only try to write to it IF YOU STOP writing to it. Otherwise the whole point of making those variables settable was to allow users to control them which is the whole point of Simconnect. And that is why one coder once said to me, "With Simconnect, there are no limitations in FSX other than your skills and imagination".
 
I know the purpose of being able to set variables but given that there are features that don't work as documented in FSX it's desirable to know that what you want to do does acually work. i'm not saying it can't be done - just that I'd like confirmation that it can.

Reverting to the wider point there are tables in the .air file and values in the .cfg relating to control of engines. My incomplete understanding of the realtionship between the tables based on the descriptions given in the ESP/P3D file samples is shown in the figure - note the big question mark! In particular what is NFFC and where does it come from?

The .cfg file contains static_thrust (used to calculate Gross Thrust), inlet_area (used to calculate Ram Drag), ThrustSpecificFuelconsumption (used to calculate fuel flow from Gross Thrust), rated_N2_rpm (to convert) from % to actual), thrust_scalar (presumably a "fiddle factor), and fuel_flow_gain (??????)

The figure implies that Corrected N2 varies directly with throttle lever position. That's obviously not the case because it lags. I assume that it's the commanded Corrected N2 and that lag is modelled separately The only an engine's rpm can be increased is by increaing its fuel flow. I assume that fuel_flow_gain is effectively a time constant to model this lag.

I understand that in the real world, Corrected N2 is non-dimensionalised and is the actual N2 divided by the square root of ambient temperature ratio. Is this the case in FSX?

Can anyone expand or clarify on these points?

EDIT - I REPOSTED THE SUBSTANCE OF THIS POST TO THE FLIGHT DYNAMIC FORUM HOPING FOR A WIDER RESPONSE
 

Attachments

  • Slide1.JPG
    Slide1.JPG
    33.1 KB · Views: 528
Last edited:
Back
Top