• 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

I use this for a specialized auto mixture control. Each setting has a range, if the mixture falls out of that range a "kick" of the mixture is given to get it back in range. Good to +/-0.004

(L:MixPWR, bool) = auto mixture system on/off
(L:MixSEL, number) - 0 = full rich, 7 = full lean, 3 = same as FS automix

Code:
(L:MixPWR, bool) 1 == (A:ENGINE TYPE, number) 0  == and if{
(A:RECIP MIXTURE RATIO:1,percent) 5.16 6.76 7.36 7.96 8.26 8.46 8.74 8.85 8 (L:MixSEL, number) case < if{ (A:GENERAL ENG1 MIXTURE LEVER POSITION, percent) 163.84 * 40 + 16384 min (>K:MIXTURE1_SET) }
(A:RECIP MIXTURE RATIO:1,percent) 5.24 6.84 7.44 8.04 8.34 8.54 8.82 8.93 8 (L:MixSEL, number) case > if{ (A:GENERAL ENG1 MIXTURE LEVER POSITION, percent) 163.84 * 40 - 0 max (>K:MIXTURE1_SET) }

(A:NUMBER OF ENGINES, number) 2 == if{
(A:RECIP MIXTURE RATIO:2,percent) 5.16 6.76 7.36 7.96 8.26 8.46 8.74 8.85 8 (L:MixSEL, number) case < if{ (A:GENERAL ENG2 MIXTURE LEVER POSITION, percent) 163.84 * 40 + 16384 min (>K:MIXTURE2_SET) }
(A:RECIP MIXTURE RATIO:2,percent) 5.24 6.84 7.44 8.04 8.34 8.54 8.82 8.93 8 (L:MixSEL, number) case > if{ (A:GENERAL ENG2 MIXTURE LEVER POSITION, percent) 163.84 * 40 - 0 max (>K:MIXTURE2_SET) } }

(A:NUMBER OF ENGINES, number) 3 == if{
(A:RECIP MIXTURE RATIO:3,percent) 5.16 6.76 7.36 7.96 8.26 8.46 8.74 8.85 8 (L:MixSEL, number) case < if{ (A:GENERAL ENG3 MIXTURE LEVER POSITION, percent) 163.84 * 40 + 16384 min (>K:MIXTURE3_SET) }
(A:RECIP MIXTURE RATIO:3,percent) 5.24 6.84 7.44 8.04 8.34 8.54 8.82 8.93 8 (L:MixSEL, number) case > if{ (A:GENERAL ENG3 MIXTURE LEVER POSITION, percent) 163.84 * 40 - 0 max (>K:MIXTURE3_SET) } }

(A:NUMBER OF ENGINES, number) 4 == if{
(A:RECIP MIXTURE RATIO:4,percent) 5.16 6.76 7.36 7.96 8.26 8.46 8.74 8.85 8 (L:MixSEL, number) case < if{ (A:GENERAL ENG4 MIXTURE LEVER POSITION, percent) 163.84 * 40 + 16384 min (>K:MIXTURE4_SET) }
(A:RECIP MIXTURE RATIO:4,percent) 5.24 6.84 7.44 8.04 8.34 8.54 8.82 8.93 8 (L:MixSEL, number) case > if{ (A:GENERAL ENG4 MIXTURE LEVER POSITION, percent) 163.84 * 40 - 0 max (>K:MIXTURE4_SET) } }
}
 

That was the reply I was looking for, thank you!

And it prompted me to investigate a bit:

1. Setting (A:RECIP MIXTURE RATIO:1, ratio) via SIMVARS (XMLTools) does nothing except forcing the FSX mixture to 100%.

2. Taking the default FSX Beaver and AFSD, I've noted the mixture and the respective FAR in 10% intervals. FSX calculates FAR even without the engine running, which helps you to work around the "too lean" point. I've then used LibreOffice's curve fitting functionality to fit a curve through the data points and it turns out that the best fit is a polynom of the fourth degree.
Plotting mixture over FAR (as required for an automixture gauge), the fourth degree curve fit was worse and I had to resort to a sixth degree polynom. The resulting equation is a bit over the top, but I'm pretty sure that FSX can handle it.

Both plots with their respecive fitted curve and associated equation are attached to this post.

3. FAR*Sigma is enough to adjust for altitude, correct?





Appendix: The Mixture-Far table.

Code:
Mixture FAR
100  0.0894
  90  0.0884
  80  0.0863
  70  0.0837
  60  0.0799
  50  0.0729
  40  0.0652
  30  0.0570
  20  0.0477
  10  0.0232
  0   0


- Edit:

Here's the XML-ready equation:

Code:
0.08 s31

l31 6 pow 18455504984.06 * l31 5 pow 5089775900.44 * - l31 4 pow 538524693.79 * + l31 3 pow 26973650.93 * - l31 2 pow 635322.89 * + l31 5164.66 * - (A:SIGMA SQRT, number) * 163.83 * (>K:MIXTURE1_SET)

I'm not sure about the use of sqrt(sigma). Could be that one might have to get rid of the square root.

Code:
(A:SIGMA SQRT, number) 2 pow



I use this for a specialized auto mixture control. Each setting has a range, if the mixture falls out of that range a "kick" of the mixture is given to get it back in range. Good to +/-0.004
[snip]

I've tested something similar using the EventIDs for "Mixture Increase/Decrease Fine" whenever mixture was short of/high of the target value (plus a bit of a buffer to compensate for floating points). It produced quite a bit over lever jitter. Should have maybe tried it within a two or three second timer to smooth things out.
 

Attachments

  • FAR_vs_Mix.png
    FAR_vs_Mix.png
    23.8 KB · Views: 539
  • Mix_vs_FAR.png
    Mix_vs_FAR.png
    24.4 KB · Views: 490
Last edited:
Plotting mixture over FAR (as required for an automixture gauge), the fourth degree curve fit was worse and I had to resort to a sixth degree polynom. The resulting equation is a bit over the top, but I'm pretty sure that FSX can handle it.

Actually you could parse the table with XMLTABLES class (XMLTools' most handy class IMO) instead of having to calculate complex polynomials.

Tom
 
I'm using XMLTables often enough. Polynominals are area nice bit of change.
 
Bjorn
The problem with your equation is that it really only works at sea level and Sigma = 1.0
For example .08 FAR and sea level is about 60% mixture in your chart. If you leave the mixture at 60% and climb to where Sigma is 0.5, the FAR is doubled to about 0.16 (and the engine quits at about 0.14)
To get 0.08 at Sigma=0.5 you need about 17% mixture. 17% mixture at Sigma=1 gives 0.04 FR
If you just multiply mixture by 0.5
3. FAR*Sigma is enough to adjust for altitude, correct?
, that would give you 30% and at Sigma=0.5, 30% mixture gives 0.111 FAR
Put simply, for a given mixture setting FAR varies inversely with sigma. For a given FAR, mixture does not vary inversely with sigma. We need to work out how the mixture varies with sigma for a given FAR

I have noticed that, in general, the sim likes straight line interpolation in its engine calculations. It certainly does that for the jet turbine tables and I found similar characteristic for EPR.
In your Mix vs FAR chart:
For sigma =1, FAR is 0.08 at 60% mixture and drops as a straight line to 0.05 at about 22% mix. Below that it again is a straight line down to zero at zero mix.
Since we do not want a FAR above 0.8 in this scenario, we can forget what happens above 60% mix. (it is more or less another straight line)

My results for sigma are for 0.997 and 0.5. They are similar to yours but not identical.
With my results I found:
For sigma =1, FAR is 0.08 at 65% mixture and drops as a straight line to 0.05 at about 22% mix. Below that it again is a straight line down to zero at zero mix.The engine loses combustion at 15.5% mix and 0.036 FAR
Above sea level the same relationship continues but at steeper gradients.
For sigma=0.75, FAR is .1041 at 60% mixture and drops as a straight line to 0.0666 at 22% mix. From there it drops as a straight line to zero at zero mix.
The desired value of 0.08 is at about 28% mix.
At sigma=.623, 0.08 FAR occurs at 22%mix
For sigma = 0.5, FAR is 0 .16 at 60% mixture and drops as a straight line to about .1 at 22% mix. From there it drops as a straight line to zero at zero mix.
The desired value of 0.08 has moved onto the lower straight line and is at about 17% mix.

So for sigmas between 1.0 and 0.623, 0.08 FAR occurs on a line between 0.65 mix and 0.22 mix. mix=1.1575*sigma-.5071
For sigmas less than 0.623 0.08 FAR occurs on a line between 22% mix and, theoretically, zero. mix=0.3609*sigma-.0072

Currently under flight test and looking good so far. More data tomorrow.
Roy
 
I see. Well, I'd simply recreate my plot for sigma vs mixture lever then, no biggie. Or simply use (the bloody efficient) XMLTables which does use linear interpolation between datapoints. Or use your equations, which would be way too simple though. :D
The disadvantage is, of course, that, in my application scenario, I'd need separate equations/tables for FAR 0.08 and FAR 0.06. This takes away a lot of the flexibility in case my assumptions for auto rich/lean FAR are too far off.
 
The disadvantage is, of course, that, in my application scenario, I'd need separate equations/tables for FAR 0.08 and FAR 0.06.
Then choose which table you need based on the auto rich, auto lean or just manual switching.
I'll also create equations for 0.06
Roy
 
Then choose which table you need based on the auto rich, auto lean or just manual switching.

That's a given.

I'm meanwhile asphyxiating a poor C172 pilot during high altitude FAR research. Want to know if there's an obvious mathematical connection between the mixture values for FAR 0.08 and 0.06.


- Edit:

FSX seems to use linear interpolation for FAR vs mixture vs sigma. I could predict mixture requirements for FAR=0.07 by mapping FAR=0.08 and FAR=0.06 and then calculate the average value for each line.


The attached plot shows FAR vs mixture*. I take that yours looks more or less like it, Roy?


*Regarding the polynominals: I couldn't help it! At least they show that a third degree one fits about as well as a sixth degree one.
 

Attachments

  • FAR.png
    FAR.png
    34.6 KB · Views: 570
Last edited:
I take that yours looks more or less like it, Roy?
Yes very similar. I think the straight lines would be more obvious if you uses a graph that was not smoothed.
For 0.06 FAR I find the same 22% break point and in this case it is at 0.828 sigma. For sigma values greater than 0.828, mixture is 0.7751*sigma -0.4128. For altitudes above that sigma it is 0.26*sigma -0.0024.
The B-17 used auto rich or auto lean according to the label riveted to the engine controls panel. I think "HOVER" meant hanging around at endurance.

Power settings.jpg
Roy
 
Last edited:
Yes very similar. I think the straight lines would be more obvious if you uses a graph that was not smoothed.

Well yes. One of the display modes for graphs is a linear connection between points. But as I've said, I wanted to try a polynominal fit.

For 0.06 FAR I find the same 22% break point and in this case it is at 0.828 sigma. For sigma values greater than 0.828, mixture is 0.7751*sigma -0.4128. For altitudes above that sigma it is 0.26*sigma -0.0024.

Thanks for the equations.

The B-17 used auto rich or auto lean according to the label riveted to the engine controls panel. I think "HOVER" meant hanging around at endurance.

"Hover" was probably used in the circuit prior to landing.
 
Hovering, according to B17PTM (Pilot Training Manual), is/was flight at maximum endurance. Flight at 120 mph, no flaps, manifold at 28" hg, 1400 rpm and at low altitude.
You prompted me to look this up! Interesting read, signed by Hap Arnold.
This manual says there are four mixture lever operating positions in the B-17
Auto-Rich maintains the FAR for all flight conditions and was used for ground take-off, climb, landing and certain conditions of cruising.
Full-Rich was only used if Auto failed or the cylinder temps were excessive. You had to break a safety wire to get this position.
Auto-lean was used in cruise or a cruising descent
Mixture was varied according to altitude and temperature (because there is/was no density sensor)
Idle-cut-off was fully lean and used to stop engines without backfiring.
Roy
 
Hovering, according to B17PTM (Pilot Training Manual), is/was flight at maximum endurance. Flight at 120 mph, no flaps, manifold at 28" hg, 1400 rpm and at low altitude.
You prompted me to look this up! Interesting read, signed by Hap Arnold.
This manual says there are four mixture lever operating positions in the B-17
Auto-Rich maintains the FAR for all flight conditions and was used for ground take-off, climb, landing and certain conditions of cruising.
Full-Rich was only used if Auto failed or the cylinder temps were excessive. You had to break a safety wire to get this position.
Auto-lean was used in cruise or a cruising descent
Mixture was varied according to altitude and temperature (because there is/was no density sensor)
Idle-cut-off was fully lean and used to stop engines without backfiring.

That clears up what "idle cut off" in the DC-3 (which uses the same R-1820 as the B-17) does. Neat!
 
It is probably worth mentioning that despite the fact that the B-17 engine is turbocharged and can maintain manifold pressure up to 27,000 ft, the sim treats it mixture-wise as a normally aspirated engine. If you turn off the turbocharged capability in the aircraft.cfg, it has no effect on mixture, though it does of course drastically reduce power and fuel consumption and kills the ability to climb to over 30,000 feet.

Anyhow, this thread made a change for me, flying piston planes again. Fun, but... back to the Tornado flight test
Roy

2016-2-24_10-6-19-549.jpg 2016-2-26_11-13-12-481.jpg
 
Last edited:
Now you know how I felt after the whole JT8D ordeal. Escept it was mildly life changing to boot.
 
Thanks for all research, might give the tables a go. I was a little distracted by real life things, like studying, so was silent on this.
I conclude that I should relate sigma (which is an altitude/atmosphere representation if I understand correctly) to the mixture (lever) percent for either FAR selection.

One question: is is allowed and/or advisable to distribute XMLTools when the T.5 would be released? If not, I should find another option.
Thanks!
 
There's not much of a difference between installing it seperately and shipping it with an add-on, because in both cases you'll need to edit the dll.xml. A separate download has the advantage that you can simply tell users to read XMLTools' installation instructions instead of having to explain the procedure yourself.



Btw:
Here are the xml curves used for the left engine lever for the PW R1830 discussed above. The animation and interaction in the VC is driven by the L: var.

Code:
<!-- Mixture Levers-->

<!-- Automixture -->
<!-- Sigma (density ratio) drives the automixture equations. First, normalize sqrt(sigma) into sigma by the power of 2. -->
(A:SIGMA SQRT, number) 2 pow s30

<!-- Left engine lever with four detents: Idle cutoff; Auto lean = FAR ~0.06; auto rich = FAR ~0.08; emergency (full) rich -->
(L:Mixture L, number) 0 ==
(A:GENERAL ENG MIXTURE LEVER POSITION:1, percent) 1 &gt; and
if{ 0 (>K:MIXTURE1_SET) }

(L:Mixture L, number) 33 ==
if{ l30 3 pow 46.13442 * l30 2 pow 50.55361 * - l30 39.55905 * + 0.5 - 163.83 * (>K:MIXTURE1_SET) }
   
(L:Mixture L, number) 66 ==
if{ l30 3 pow 84.11033 * l30 2 pow 63.17016 * - l30 45.16123 * + 0.03497 - 163.83 * (>K:MIXTURE1_SET) }
   
(L:Mixture L, number) 99 ==
(A:GENERAL ENG MIXTURE LEVER POSITION:1, percent) 99 &lt; and   
if{ 99 163.83 * (>K:MIXTURE1_SET) }
 
There's not much of a difference between installing it seperately and shipping it with an add-on, because in both cases you'll need to edit the dll.xml. A separate download has the advantage that you can simply tell users to read XMLTools' installation instructions instead of having to explain the procedure yourself.
Clear, and that's exactly what I'm worried about. Doing more things than just unzipping is difficult for some. Maybe silly opinion, but still...
Next to that, XMLTools cannot be used if only installed in the aircraft's folder, right? I'm having a thought of version conflicts now.

Here are the xml curves used for the left engine lever for the PW R1830 discussed above. The animation and interaction in the VC is driven by the L: var.
Nice! Is this code leaner for PC performance than using the XMLTables, equal or heavier?

I still need to find correct Bristol Pegasus 26 data to complete the engine modelling. I now have the auto-lean cruise range for 45% to 55% of throttle. We'll see...
 
One question: is is allowed and/or advisable to distribute XMLTools when the T.5 would be released? If not, I should find another option.
Thanks!

You can freely distribute XMLTools.dll with your addon; if it is a commercial project you must contact me first (still free of charge). To avoid version conflicts, it is highly recommendable that you distribute the latest XMLTools installer (2.01 so far) that comes with the package.
You are not allowed to distribute the complete package; however you can put a link to the dowload page in Resources section of this forum.

Nice! Is this code leaner for PC performance than using the XMLTables, equal or heavier?

Using XMLTables class to parse curves is a similar method to the one used by FS/P3D to parse its own tables. Depending on the complexity of the curve, writing a polynomial might be more or less accurate than using the class. Difference in performance will be insignificant for practical purposes.

Tom
 
Back
Top