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

FSXA Automatic mixture control

Dutcheeseblend

Resource contributor
Messages
1,541
Country
netherlands
Hi everybody,

I'm in the progress of programming and animating my Fokker T.5 bomber. I can do a bit of basic XML, but this specific thing is slightly too difficult to me, also because I do not completely understand the original system :duck:. Therefore, I ask assistance.
The Fokker T.5 has two radial Bristol Pegasus engines :teacher:
Both have their own throttle, each of which can be put in four modes:
- Take-off (referred to as 'Start');
- Maximum velocity (referred to as 'Max. Snelh.');
- Cruise (referred to as 'Kruisen');
- Closed (referred to as 'Dicht').

The T.5 features (semi-)automatic mixture control. This is done with one lever, which controls the mixture of both engines. The lever is coupled to the throttle levers in some way.
The mixture lever has two positions:
- Normal (referred to as 'Normaal', not sure about the actual resulting setting);
- Lean (referred to as 'Arm', so I assume it is lean).

The mixture lever is coupled to the throttle levers in such a way that in all of four throttle positions, a 'Normaal' position of the mix lever is possible AND that the 'Arm' position is only possible in the Cruise throttle setting. This is for efficient cruising.

The mixture is automatically controlled for the setting with respect to altitude. So, auto-lean?

Can anybody help me with interpreting the two mixture lever positions? I assume 'Normaal' does not mean Rich, but I can not understand why there should be a setting between auto-lean and rich.

To support, some properties:

Throttle setting
Take-off:
830 HP, 2600 rpm, 1018mmHg

Max. V.:
830 HP, 2475 rpm, 940 mmHg

Cruise:
Normal mix: 2250 rpm, 832 mmHg
'Arm' mix: no mentioned properties, but denoted as 'very efficient'

After understanding the system, I need to code/animate it, I hope I can use standard FSX coding for the levers.

Thank you!

Daan
 
Last edited:
An image of the quadrant:

t5_levers.png
 
A throttle lever with only four stops would be a bit counterintuitive and inflexible, dontcha think? ;)
So the throttle markings are just for reference.

Regarding the mixture lever, you can of course use FSX' standard animation and mouse rectangles for it, but this will not model the automixture function of the real engine.
As far as I know, an engine with automixture control maintains an ideal fuel-air ratio for the engine, which is around 0.08 (roughly the stochiometric ideal ratio for complete combustion). On a P&W R1830, this ratio is attained in "auto rich" mode, while the "auto lean" mode uses a FAR of 0.06. There is also "emergency rich", which is all out and "idle cutoff", which basically cuts off fuel flow to the engine. And the mysterious "ground lean" function whose FAR I can't detemine.

Anyway, projected on the T.5's setup, I'd assign the "auto rich" FAR of 0.08 to "Normaal" and either "auto lean", i.e. 0.06 or "idle cutoff" to "Arm".

To have a bit of leverage (heh) in terms of keyframes, use a 0 - 100 animation with 0 being "Normaal" and 100 being "Arm". Counterintuitive, but you won't need to reshuffle keyframes if you decide to revert to the default mixture lever behaviour and anmation. Let the animation itself be driven by a custom L: var and set the actual mixture in a controller gauge.

Animation and mouse rect (the tooltip is for checking whether the system works or not):
Code:
<PartInfo>
<Name>T5_Mixture</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>100 (L:T5 Mixture, bool) 100 * -</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Toggle Mixture Lever (L/R:%((A:GENERAL ENG MIXTURE LEVER POSITION:1, percent))%!3.1f!/%((A:GENERAL ENG MIXTURE LEVER POSITION:2, percent))%!3.1f!|%((A:RECIP MIXTURE RATIO:1, ratio))%!1.4f!/%((A:RECIP MIXTURE RATIO:2, ratio))%!1.4f!</TooltipText>
<MouseFlags>LeftSingle</MouseFlags>
<CallbackCode>
(L:T5 Mixture, bool) ! (&gt;L:T5 Mixture, bool)
</CallbackCode>
</MouseRect>
</PartInfo>


Controller gauge code (2D panel gauge or hidden polygon with <Visibility> code attached), assuming that "arm" is "idle cutoff" and "normaal" is "auto rich":
Code:
(L:T5 Mixture, bool)
if{
0.08 (A:AMBIENT DENSITY, kilograms per cubic meter) 0.1 * / 16383 * s0
l0 (>K:MIXTURE1_SET)
l0 (>K:MIXTURE2_SET)
}
els{
(A:GENERAL ENG MIXTURE LEVER POSITION:1, percent) 1 &gt;
if{ 0 (>K:MIXTURE1_SET) }
(A:GENERAL ENG MIXTURE LEVER POSITION:2, percent) 1 &gt;
if{ 0 (>K:MIXTURE2_SET) }
}

(I hope that the registers work.)

The equation used for setting the mixture lever(s) is sourced from here:
https://books.google.de/books?id=NtHy4YZDF_0C&pg=PA130&lpg=PA130&dq=fuel-air-ratio+density+simulation&source=bl&ots=qxWds8UgGa&sig=1yIK_9gfNTm_xs-4Fo4W6lXxLhU&hl=de&sa=X&ved=0ahUKEwitgePStovLAhXMDSwKHdNqCoEQ6AEILjAC#v=onepage&q=fuel-air-ratio density simulation&f=false

And a short overview about FAR and power+economy is available here:
https://books.google.de/books?id=qNuCBgAAQBAJ&pg=PT61&lpg=PT61&dq=aircraft+range+and+endurance+fuel-air&source=bl&ots=IixdgQuRN6&sig=N7b2o4n2BNu9mHkLy9gzA4ZTdg0&hl=de&sa=X&ved=0ahUKEwiL3IP0tYvLAhUGlCwKHcnqCywQ6AEIVjAH#v=onepage&q=aircraft range and endurance fuel-air&f=false

I've tried another approach in setting the mixtures by using FSX' (A:RECIP MIXTURE RATIO:index, ratio) variable and then lean or enrich the mixture whenever its value wasn't 0.08. Needless to say, it made the mixture levers a wee bit jittery, so I stuck to the direct method posted above.
 
A throttle lever with only four stops would be a bit counterintuitive and inflexible, dontcha think? ;)
So the throttle markings are just for reference.

Yep, I know, it was put a bit clumsy probably. Anyway, thanks for your extensive reply!

I agree with you on the assumption that 'Normaal' would equal Auto Rich. Didn't find anything on that in the SDK however, so I thought I was on dead track.

Working on the system right now.
 
Ok, it works, but not entirely. I think I should not use 0 but 0.06 for the 'Arm' mode, since otherwise the fuel is cut off while it should be leaned. So, would it become this?

Code:
(L:T5 Mixture, bool)
if{
0.08 (A:AMBIENT DENSITY, kilograms per cubic meter) 0.1 * / 16383 * s0
l0 (>K:MIXTURE1_SET)
l0 (>K:MIXTURE2_SET)
}
els{
0.06 (A:AMBIENT DENSITY, kilograms per cubic meter) 0.1 * / 16383 * s0
(A:GENERAL ENG MIXTURE LEVER POSITION:1, percent) 1 &gt;
if{ l0 (>K:MIXTURE1_SET) }
(A:GENERAL ENG MIXTURE LEVER POSITION:2, percent) 1 &gt;
if{ l0 (>K:MIXTURE2_SET) }
}
 
Basically yes (I'd assign register #1 to the "else" condition), but you can also cut down on duplication even more by writing it this way.

Code:
(L:T5 Mixture, bool) if{ 0.08 s0 } els{ 0.06 s0 }

l0 (A:AMBIENT DENSITY, kilograms per cubic meter) 0.1 * / 16383 * s1
l1 (>K:MIXTURE1_SET)
l1 (>K:MIXTURE2_SET)
 
Ok, thanks, that works perfectly! This is the first time I use registers, but it works fine.

After some testing, I see in the tooltip that the mix lever position does change (a higher value for the 'Normaal' position and a lower value for the 'Arm' position). The A:RECIP MIXTURE RATIO however does not change, it is constant for both automix lever positions with a value of 0.083. I am a little confused that this does not change...
 
This should do it as well:

Code:
(L:T5 Mixture, bool) if{ 0.08 } els{ 0.06 }
(A:AMBIENT DENSITY, kilograms per cubic meter) 0.1 * / 16383 * d
(>K:MIXTURE1_SET)
(>K:MIXTURE2_SET)
 
Mixture should vary with altitude as the square root of the relative density.
<Value>(A:ambient density, slug per cubic feet) 0.002377 / sqr 16383 * (>K:mixture_set) </Value>
Roy
 
After some testing, I see in the tooltip that the mix lever position does change (a higher value for the 'Normaal' position and a lower value for the 'Arm' position). The A:RECIP MIXTURE RATIO however does not change, it is constant for both automix lever positions with a value of 0.083. I am a little confused that this does not change...

I've just tested the four-stage configuration in FSX and it works for me.


Mixture should vary with altitude as the square root of the relative density.
<Value>(A:ambient density, slug per cubic feet) 0.002377 / sqr 16383 * (>K:mixture_set) </Value>

Source?
The other equation is literally the only one I could find on that subject.
 
I know the code I posted works after a fashion, though it does seem to give a pretty constant 0.108 for fuel air ratio
I use<Value>(A:ambient density, slug per cubic feet) 0.002377 / sqr 16383 * (>K:mixture_set) </Value>
But I said it was the square root of the density ratio, despite the fact that "sqr" is not the square root. So I was wrong in what I said, and no one else commented on it either!.

If you set the fuel_air_auto_mixture= 1 in the piston section of the aircraft.cfg or set automixture on in the aircraft realism drop down, it seems to stay at 0.083 all the time.
And of course that effectively disables the manual mixture control.
On the assumption that 0.083 is what the sim likes best, I'm going to do a set of runs in my B-17 and see how manual control of mixture at 0.083 and mixture lever% relate to relative density.
Roy
 
I knew the 'alien units' was density in slugs (not garden variety)... so, wasn't asking about that. LOL
 
So as to be politically correct with aliens who suffer from unitsphobia, I have changed the mixture setting equation to aid the poor souls in comprehending what it means. No more ugly slugs and uglier kilothings.
Here it is:
(A:sigma sqrt,number) 4.0 pow 0.65 * 16383 * (&gt;K:mixture_set)

What that does is sets the mixture to give 0.08 fuel air ratio. It works nicely up to sigma = about 0.6 (16000 ft) Above that it starts to drop down to about 0.07 at around 25,000 ft.

You could change the 0.65 scalar if you wanted something different than 0.08 FA ratio. 0.65 gives you 65% mixture lever position at sea level which also give 0.08 FA ratio.

Without any automatic control and at 100% mixture lever setting the FA ratio rises with increasing altitude. As long as the FA ratio is at 0.09 or less it makes very little obvious difference, but as it goes above 0.09 the fuel flow decreases which indicates a reduction in power. Above .10 the power is quite significantly reduced and the same is true below 0.06. You have to be careful not to have the mixture lever percent below 10% because that is about where it acts as a fuel shut-off.

Perhaps I should have said that sigma is air density ratio.
Roy
 
Heh.

I'm still more interested in the source for this equation than anything about the units used for its variables though. Or is it self-deveoped?
 
I first considered how to automatically control mixture when I built a B-17 around about 2004. I recall learning that fuel air mixture ratio (FAR) had to track density ratio.
This aspect is common to both your equation and mine.
The question is how do you change FAR? There is a sim var (A:RECIP MIXTURE RATIO:1, ratio) and it is settable, but not directly controlled by an Event.
The obvious way is to adjust the mixture control. Mixture has a sim var (A:GENERAL ENG MIXTURE LEVER POSITION:1, percent) and many events . The precise event is to set it "Set mixture lever exact value (0 to 16383)".

However the FSX mixture control does not have a 1:1 relationship with FAR.
100% mixture at sea level seems to give about 0.087 FAR
75% gives 0.083
50% gives 0.071
25% gives 0.052
10% gives 0.024 and kills the engine.
That curve is hard to model best I can get is FAR=0.2791 ln(mixture as part) +0.0895. By mixture as part I mean 75% is expressed as 0.75
I was basically looking at mixture lever reduction with altitude while achieving a reasonably constant FAR and my equation does that.

I guess I'm the source of the actual equation.
But I would counsel you against paying too much attention to real engine theory because we are not always going to see that in the sim.
Here are two sources. The first is about pollution from piston engines but it covers mixture control in detail
http://www.hjelmco.com/upl/files/2425.pdf
The second covers a load of testing done in the sim
http://www.flightsim.com/vbfs/showt...ton-engines-modeled-in-a-realistic-way-by-FS9

I do not see the connection between what the mixture control does and relative density in your equation.

Roy
 
Back
Top