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

MSFS How to stop the prop windmilling when engine off?

Messages
216
Country
unitedkingdom
I have a piston engine/propeller defined in my engines.cfg (it's on a glider with a retractable engine/prop) and I'm finding it extremely difficult to set the parameters so the prop stops when the engine is switched off while airborn. The real aircraft has a prop brake which operates before the caboodle is retracted. I'm working with the assumption MSFS knows nothing about retractable props, but I'm ok if MSFS thinks the prop is fixed.

I've spent hours messing with the propeller_moi, max_rpm_friction_scalar, idle_rpm_friction_scalar and engine_friction_table but the setting to get the prop to actually stop while airborn seems to be a REALLY complex balance of those parameters. In particular the engine_friction_table seems to be torque figures which accelerate or decelerate the rotating prop more in the style of a PID controller applying forces and to get a 'perfectly damped' response is almost impossible. If the tuning is underdamped the prop PRM can go negative, and then the prop will accelerate negative without limit (with the typical -300:-25, 300:25 engine_friction_table initial entries). With higher 'friction' values the prop ends up windmilling at (say) 200 RPM which is extremely sensitive to tiny changes to the engine_friction_table and still has a dependency on airspeed, prop pitch, and cylinder capacity.

In MSFS the simvar for 'prop RPM' is writeable, but if you set it to zero (with engine off) you end up fighting with the sim which is still trying to change it.

I've looked at adding 'feathering' support to the prop (no need for an animation, I just need to be able to stop the prop windmilling) but looking at old FSX posts that looks like it might be problematic too.

I suspect this is a path well trodden by you experienced power devs during the FSX days - any hints much appreciated.
 
Messages
1,944
Country
us-ohio
experienced power devs during the FSX days
LOL that's like saying "has beens"... :D

Feathering works and it's probably the only way to stop the prop spin in flight. You need to set that there's a feathering switch in the aircraft's cfg... and use the switch (it's a defined key event) to control the prop feather.
 
Messages
216
Country
unitedkingdom
Might want to look into custom animation
Thanks dale but our 3D model and custom animations are already working like a champ, independently of the MSFS flight modelling of the engine and propeller.

My issue is with MSFS flight modelling of the engine and prop. Like everyone I'm using MSFS built-in support for engine thrust via settings in engines.cfg (i.e. like 99.99% of aircraft in FSX/MSFS). Start the engine, MSFS plays the appropriate sounds, applies the thrust at the configured point in the aircraft, plane takes off fine, engine RPM can be controlled with the MSFS stock throttle support. All great, what everyone would expect. Now turn off the engine (not common in powered aircraft, I admit). This is when it gets difficult to find the settings for the behaviour I want. MSFS models a WINDMILL effect on the prop, so it continues to rotate (i.e. "PROP RPM:1" does not go to zero). There are a lot of configurable parameters for the engine/prop and I'd like to set the friction (or anything else) such that the prop stops rather than autorotates.

Note I can ensure my modelled animated 3D prop stops when the engine is off, but I'd very much prefer to have MSFS decide for itself that the prop has stopped, rather than have MSFS think the prop should still be rotating at 200 rpm with whatever that implies in the rest of the MSFS simulation and I fake the RPM on the engine gauge.

The config parameters look easily comprehensive enough to get what I want, but I'm struggling between the prop windmilling at +200 RPM and -infinity RPM which is crazy.
 
Messages
93
Country
unitedstates
I did not mean to imply that your animations are not working.

It is not just a matter of whether the animation is working correctly, there is the other "layer" that connects the animation to the sim-state of the aircraft. If the sim expects all props to windmill, then all props will windmill. (Props, not engines -- the basic animations are probably not strongly integrated as the systems would be.)

What I am offering (based on always incomplete knowledge) is my view that you will likely be unable to find any engine variable which will change the default prop animation action. In other words, I do not think you can stop the default prop windmilling (will gladly accept being informed to the contrary). Stated another way, in my expectations "MSFS deciding for itself that the prop has stopped" is unlikely.

If that is the case, then relying on the default animation definition will not change the behavior. But defining custom animation behavior -- with a *conditional test* of engine rpm -- might get it done.
 
Messages
106
..any hints much appreciated.
No hints presently, but in early versions of MSFS, the prop did stop windmilling on all fixed pitch prop aircraft as soon as the engine stopped . Either Asobo has changed the basic behavior or is can still be achieved. I wouldn't give up too early ;)
 
Messages
216
Country
unitedkingdom
the prop did stop windmilling on all fixed pitch prop aircraft as soon as the engine stopped
Thanks bstolle but I'm trying to stop the prop windmilling while the plane is airborn... all the fixed pitch prop a/c I've tested in MSFS windmill really fast when you cut the engine, e.g. the Robin Cap 10 prop windmills ~ 500 rpm. I accept this may be correct for those aircraft (although I doubt it) I'm hoping appropriate engine friction settings or whatever would allow that speed to be adjusted down to zero. I'm getting increasingly pessimistic though, as it is easier to hit minus 800 rpm than zero.
 
Messages
106
I'm talking about the airborne case as well. The props used to immediately stop when you shut down the engine during flight, regardless of the speed.
A windmilling start was impossible, so this has been changed.

Just tested and the prop still stops windmilling e.g. on the DR400 at ~20kts. So it's definitely possible. :)
 
Messages
216
Country
unitedkingdom
Thanks bstolle I'll check out the Robin DR400 although slightly mystified how I'm going to fly at 20 knots. I like your encouraging style! "A windmilling start was impossible" - this is really helpful to know (as someone who hardly ever flies power a/c in MSFS) - this is the issue that is causing me major problems.
 

n4gix

Resource contributor
Messages
11,662
Country
unitedstates
What you want to do should work using a conditional test with two branches: stopped or spinning. I haven't gotten around to digging deeply into the new MSFS animation scripts yet, but the principle is still valid I am fairly sure.

What you need is to create a custom variable such as (L:engine stopped,bool) and then write the script such that when zero (stopped) the prop animation is zero. If the custom variable is one, then the normal prop animation variable is used! Easy peasy... :wizard:
XML:
<Animation>
  <Parameter>
    <Sim>
      <Variable>
        (L:engine stopped,bool) !
        if{ 0 }
        els{ (A:PROP ROTATION ANGLE:1 }    
      </Variable>
    </Sim>
  </Parameter>
</Animation>
 
Messages
216
Country
unitedkingdom
thanks n4gix - I guess there are two parallel threads in this one -
  1. MSFS simulation concerned with the [PISTONENGINE] / [PROPELLER] in engines.cfg (my issue), and
  2. Animation - how would you control the animations of the prop and RPM gauge if you wanted to disconnect that from the exact behaviour of MSFS variables such as "PROP RPM:1".
I'm 100% ok with issue 2. using a very similar technique to your suggestion, with a custom HTML/JS gauge that creates the animation variables for the prop and also to extend and lower the engine (see my profile pic) and manage the various interlocks that ensure the engine isn't started unless it is fully extended. The main reason for the custom animation is that MSFS (AFAIK) has no explicit "prop lock" and it seems to me it is nigh-on impossible to get the MSFS simulated engine/prop to stop spinnng while airborn. I do stop my animated prop, exactly as your code suggests (thanks for that).

My challenge has been entirely issue 1. particularly stopping and starting the MSFS simulated piston engine / prop in flight. By default (I mean using typical engines.cfg settings), the prop will windmill when airborn and the engine is cut. The speed of windmilling is undocumented but dependent upon at least engine fricton (table, idle rpm, max rpm), prop moi, prop pitch, cylinder capacity, cylinder compression, airspeed, altitude). If it makes it clear how my animations are independent of this simulation, I have a 'plan B' replacing the piston engine with a jet and the sounds/animations will remain unchanged (my challenge with the [TURBINEENGINE] is I absolutely cannot get it to spool up/down quick enough). Essentially I only need the simulated MSFS engine/prop to provide the correct controllable thrust/drag, including turning the engine on and off. Engine ON is ok, engine OFF is a real pain.

The 'windmilling' of the [PISTON ENGINE] [PROPELLER] has serious implications for the engine restarting, plus bizarrely in MSFS some flight manoevers can bounce the prop into negative RPM, at which point the MSFS model uncontrollably accelerates the engine/prop RPM negative (the 'engine friction' is implemented as a 'torque' rather then energy loss, resulting in instability in the model).

As a multi-decade sim glider developer I unfortunately have negligible experience of flightsim engine/prop management, but maybe the gliding requirement to stop/stow the propeller/engine is also way out there in terms of power sim development so I'm still in my own tiny niche...

I'm getting close to an OK (but not ideal) solution with engines.cfg settings, with engine friction table settings that slow the prop windmilling to 65 RPM while airborn (and the prop has -1lb thrust), the engine can restart from there, and the +65 RPM provides enough of a margin that manoevering is unlikely to bounce the prop into negative RPM and accelerate out of control. When I first posted I was hoping for a less fraught solution.
 
Last edited:
Messages
216
Country
unitedkingdom
MSFS Update 8 arriving tomorrow has a complete re-implementation of the support for props, and Asobo have explained stopping/restarting the prop (e.g. by feathering, or any other means) is not supported in MSFS pre-Update 8. I have fingers crossed the new support is adequate for motor-gliders (i.e. the stop has to be effective at all airspeeds, the prop should not rotate forwards or backwards at all after you've stopped it, this should be true for all airspeeds and manoevers) , and the SDK documentation is updated to show how to use it. If I was pessimistic, I'd say Asobo have spend hundreds of hours ensuring the prop windmills with the correct speed and momentum for different angles of attack so helicopter engine-off landings work well, but reliably STOPPING the prop (i.e. as if the engine has siezed) will still be nigh-on impossible with whatever settings that have been provided.

I'll update this thread after I've had a look at what's in Update 8.

edit... Update 8 prop support update #1 2022-03-05:
(i) with no SDK documentation yet for a bunch of new parameters in engines.cfg / [propeller], it is extremely difficult to take advantage of the new support unless you are Asobo. They mention providing advice to some commercial developers. They've suggested they will provide docs at some point.
(ii) prop feathering is now working, but the zero-rpm balance point still seems difficult to achieve, i.e. we seem to have great control over the aerodynamics of the prop, but still can't control the friction of the engine. Currently hard to tell without the SDK docs.

edit.. the SDK docs have been updated for the new prop support: https://docs.flightsimulator.com/ht...t_SimO/Engine_Config_Definition.htm#PROPELLER
 
Last edited:
Messages
216
Country
unitedkingdom
I can imagine this thread is getting a bit dull, but the new prop support seems to be entirely aerodynamic and the other aspects of the systems/engine haven't changed (perhaps for a long time).

I need to reliably FEATHER and UNFEATHER the prop.

The 'old' FSX references to -1 (&gt;K:PROP_PITCH1_SET) still work like a charm to get the prop to feather. I'm struggling to work out the equivalent XML how to get the stopped prop to UNFEATHER. I don't need to increment/decrement the pitch slowly or smoothly, just get the prop pitch on 22 degrees or ~90. I don't need code to link the prop change to a moving knob in the cockpit, just the 'action' code that will affect the prop pitch. I'm actually simulating the propeller folding into the fuselage and I'm trying to tell MSFS to stop simulating the drag of the prop in the new (Update 8) prop physics.

I've seen this useful thread on this site: https://www.fsdeveloper.com/forum/threads/prop-feathering.436888/ but I still can't find a permutation of X (&gt;PROP_PITCH1_SET) and/or (&gt;PROP_PITCH1_HI) or (&gt;PROP_PITCH1_LO) which will UNFEATHER the prop. (I'm watching A:PROP BETA while my XML code gets triggered once-per-change in the nav lights (for dev purposes) - feathering 22 -> 90 degrees works, unfeathering back to 22 is a mystery.

Any help much appreciated.

engines.cfg:
Code:
PROPELLER SECTION:
; Updated feathering support
propeller_type = 0; !! 1 ; 0=Constant Speed, 1=Fixed Pitch
feathering_switches = 1 ; !!
prop_feathering_available = 1 ; !! 0 ; Prop feathering available?  0=FALSE, 1=TRUE
beta_feather = 90 ; !! 0 ; Feathering pitch angle (degrees)
min_rpm_for_feather = 0 ; Minimum RPM for prop feathering
fixed_pitch_beta = 19 ; !! 20 ; Fixed pitch angle of fixed pitch prop, (degrees)
beta_max = 90 ; !! 0 ; Maximum blade pitch angle for constant speed prop, (degrees)
beta_min = 22 ; !! 0 ; Minimum blade pitch angle for constant speed prop, (degrees)
prop_tc = 1.15 ; !! 0 ; Prop time-constant
defeathering_accumulators_available = 1 ; !! 0 ; Defeathering accumulators available? 0=FALSE, 1=TRUE
 
Messages
1,944
Country
us-ohio
You have this line: feathering_switches = 1 ; !! which allows you to toggle the feathered condition of any individual prop using a switch. You just need to use the correct event: TOGGLE_FEATHER_SWITCH_# where # is the engine number 1,2,3 or 4. Also, using PROP FEATHERED:index is a better method to determine whether the prop is feathered or not.
 

DragonflightDesign

Resource contributor
Messages
888
Country
northernireland
I had a similar problem with the B-314, but that is not a simple feather-unfeather procedure. Depending on where the prop is in the feather cycle (rpm vs blade angle) the system reacts in different ways if the unfeather command is issued. I ended up creating my own feathering system by reading prop blade angle and rpm rather than whether the sim thought it was feathered or not. However, it still needed the 'prop_feathering_available' and 'defeathering_accumulators_available' entries in the aircraft.cfg file because, although they were unused, if they weren't there I got into a code fight with the sim that I wasn't going to win :rolleyes:

If Ed's suggestion doesn't work, you may need to consider going a similar route.
 

DragonflightDesign

Resource contributor
Messages
888
Country
northernireland
I used a combination of _DECR, _INCR and _SET. Bear in mind that I program for P3D, so based on what I have read about Asobo's past performance it is quite possible that the _INCR and _DECR methods are not yet implemented in the SDK.
 
Messages
216
Country
unitedkingdom
Thanks - it's very helpful to know what *should* work.

The current theory I'm working on is those events are non-functional in MSFS 2020, and have been replaced with new undocumented B: variable code hidden in the template system (still unpicking the templates used by the King Air). This has not mattered before because feathering in MSFS 2020 absolutely didn't work at all pre the recent Update 8, so there's no extant 3rd party code using feathering. But there's a big difference between the announced new prop physics (parameters kinda now documented in the SDK) and actually configuring an aircraft to feather/unfeather the prop.

We just went through a similar snafu with throttle support, where Asobo replaced the long-standing throttle position simvars with undocumented stuff hidden inside their templates, and every 3rd party aircraft not using their XML templates (including mine) broke.
 
Messages
158
Country
us-northcarolina
I too am having trouble with the unfeathering using the new prop physics introduced in SU8. I've been trying, off and on, over the last three weeks to get it to unfeather, with no positive results.

I can fake feathering and unfeathering easily enough. Setting the prop pitch to -1 will get the prop down below 100 RPM, and I have XML code that will stop it visually when it reaches that rate. Setting the prop pitch to 16382 will "unfeather" it and it will windmill and the engine can be restarted to full power and RPM. But this all a visual fake - the actual drag on the airplane is not reduced with the prop "feathered" this way. The aerodynamics of the 310 is such that without a feathered prop all you can do is fly to the scene of an accident. Faking it is not an option here. We must truly feather the prop and be able to unfeather it.

I can feather the prop with the new feathering switch and the prop will go into a slow rotation around -60 RPM and I can stop that visually with code. The drag on the aircraft is reduced pretty dramatically. It is truly feathered.

But things don't seem right - the PROP FEATHERED bool NEVER goes true.

According to something I read, a second press of the feathering switch should unfeather it. But it doesn't, the -60 RPM remains in place. If I force the pitch to 16382 and force the RPM with SimConnect to about 1500, then I can restart the engine but after then even at full engine power the RPM will never get above about 500 - the physics engine must still think it's feathered.

Why doesn't PROP FEATHERED go to 1 when I press the switch?
Why doesn't it unfeather when I press the switch again?

Hours and hours and I can't answer this yet.

Code:
feathering_switches=1
prop_feathering_available=1
prop_auto_feathering_available=0
min_rpm_for_feather=700
beta_feather=89.5
power_absorbed_cf=0.1
defeathering_accumulators_available=1
 
Messages
216
Country
unitedkingdom
There really are multiple issues here and IMHO the Asobo code for feathering is essentially unusable. My practical suggestions for feathering do come after these 'strategic' comments so skip to there if necessary.

Asobo clearly have at least three sets of developers that don't communicate with each other:

(1) the ones working on the core flight sim, which is mostly inherited from FSX and uses the 'real time' variables - this is mostly stuck in 'legacy' land

(2) the people working for Seb who care a lot about air movement both in the environment and around the plane

(3) the people working on the template system

They've evolved a method so aircraft developers are not expected to include any custom programming in their aircraft. Instead, new incremental requirements are fed into the 'templates' team and they will extend existing templates or create new ones so the aircraft developer just includes the new template 'HelicopterCollective' and that will do whatever is necessary to get that function to work. If you look at those templates you will find embedded within it will be 'case' statements checking if aircraft = asobo aircraft 1 then do X, if aircraft = asobo aircraft 2 then do something else, etc. I.e. the templates have already expanded to hundreds of thousands of lines of XML to cater for each requirement that Asobo has discovered on its existing aircraft. Unfortunately they have accidentally implemented a full function programming language in XML with variables, if statements, select statements etc and the people doing it have obviously never been instructed in the principles of programming languages, so they already have self-modifying code and rely heavily on textual methods for code modification, i.e. one string passed as a parameter containing RPN will be concatenated with other code already in the template. There is no support for comments. There is absolutely no way that HUNDREDS OF THOUSANDS OF LINES of this code is supportable. I know text in caps looks like it is coming from a crazy person but that is an insane amount of code to have in a language that has evolved by adding special meaning to randomly added XML tags. Asobo have backed themselves into a corner and the XML they have will only have minor incremental development very soon, when it has enough basic functionality to support the planes Asobo are thinking of providing. This means features in other planes in MSFS need to behave the same way as some existing feature in an Asobo plane, so you can use that template.

Regarding FEATHERING:

After maybe 20 hours I decided the new propeller support in Update 8 is not ready for use in a motor glider. The main issues are (1) the update only affects the propeller, not the engine and (2) Asobo have implemented their feathering functionality in a template, not in the core sim.

Issue (1) means you cannot stop the prop spinning because the engine implementation of friction is broken (it's implemented as a torque). At best you can get the prop to slow down, depending on airspeed or manoevers, and then fake the prop stopping in your animation. E.g. the Cessna 152 has the new prop support and the unchanged engine support so the prop windmills at a phenominal rate engine off.

Issue (2) means the previous set of FSX/MSFS variables can no longer be relied up. This has happened before with the throttle control - after an update only planes using the Asobo template continued to work - those looking at the throttle position variable stopped working.

So my first suggestion would be if possible use the Asobo template - this sounds feasible for you if you have a 'conventional' feathering requirement all the way from the 'propeller' control. I.e. the template expects you to have a control you can slide in and out and it takes care of the rest, with the control at one end causing prop feathering and presumably the template code worries about all the interlocks of when and if the engine will restart or whether you have power or hydraulic pressure to feather/unfeather the prop.

Alternatively (what I necessarily do in my motor glider) use the 'old' propeller support and fake the entire feathering process. If you are prepared to do the coding necessary then the only serious challenge is to keep the prop windmilling within bounds due to the problematic engine simulation of friction. The technique works because the old prop support has zero drag. For my requirement I only need the prop in two states: engine running producing thrust, or zero drag, so I'm ok there. However, if I wanted to add drag to simulate a windmilling propeller, then I already have quite simple 'active flight control' code running which manipulates the spoilers 0..1% which would work fine for that. Of course I also need to hide the small movement of the spoilers in the spoilers animation so I only have the spoilers actually move greater than (say) 1%, as all normal usage of spoilers is bigger than that anyway.

Good luck,
B21
 
Top