:information_source: After reading up on this subject, I think it may still need some research.
Basicly there are two main sources of fouling, too rich mixture and too low combustion temperature:
Carbon deposit fouling; the result of too rich mixture (incomplete combustion).
They build up carbon at the spark plug which will eventually short the electrode.
Lead buildup; the result of a too cold combustion which does not allow the EDB lead scavenge agent to do their job (temps < 264°F)
Running the engine in a "cold combustion state" (low RPM / rich mixture, available from JSBSim trough a AFR property) will result in carbon deposits on the spark plugs, causing a rough engine and loss of power, and can finally to a loss of the spark plugs ignition (magneto check can reveal this).
To remedy, the engine needs to run on higher RPM/hotter combustion for 15-25 seconds (POH 3-20 says "several minutes" for safety, but the shell letter and pilot forums also talk about the smaller timeframe).
To simulate this, we might do the following simplificated implementation:
(I think this can be preferably done in pure systems-xml-space (kinematic with variable speed setting?), however a nasal timer might be easier here. This should be further investigated, however)
[x] Make the effects described here depending on the "spark plug icing" option enabled;
also extend the option label to include "fouling".
[x] in the fuel system, calculate the present carbon deposit level, depending on the current AFR and engine temp
[x] Support two independently simulated magneto/plugs combos
[x] Determining by random number at starting time which spark plug(s) will be affected
[x] Make the other magnetos plugs slowly foul if running on just one mag
[x] CHT as proxy? Or use Revise the spark plug temp we introduced for the spark plug icing
[x] slowly build up in a mixture-rich and/or cold combustion regime (several minutes)
[x] quickly decrease in a hot/lean regime (20-60 seconds)
[x] (The system may probably be simplified to simulate only the final effect on the two magnetos; so summarizing the 6 cylinders into 1 for each magneto)
[x] make flooded priming induce carbon deposits
[x] Depending on the carbon deposit level, for each magneto calculate the effects
calculate a normalized power output ratio (0.0->1.0)
[x] Calculate and apply RPM (and power) loss
Goals:
The goal here is to have a slight negative effect on power in cruise with spark plugs of a bad magneto.
It should be generally better to fly with the both setting unless, as the POH says, the engine really is running rough (probably meaning alot of breaking effect of the bad spark plugs).
[x] If switching solely to the bad magneto, power should decrease noticeably.
[x] If switching solely to a good magneto, power should be slightly worse than on both (this is already simulated by JSBsim <sparkfaildrop> engine.xml definition)
[x] The second goal is to simulate the RPM drop effect at the magneto check, which should exceed the normal drop value.
Note: The current lycoming-engine-xml says 0.15 power loss for a fully disabled magneto in "OK" status for the working one.
Implementation idea:
[x] It might be enough to calculate the loss-of-power based on the deposit state for each magneto (0.15 foreach max).
[x] Based on this we can calculate for each affected magneto a "internal friction" value
(this is somewhat hacky, but jsbsim does not have better hooks for that right now)
[x] Based on the magneto switch setting we can calculate a final "effect" value:
[x] if set to left or right: add the "internal friction" value of the respective selected magneto.
This applies both the "fly on one mag" effect from JSBSim, as well as the "fly on fouled spark plugs magneto" effect, which is usually even worse.
[x] if set to both: we assume the better magneto has most of the load.
-> calculate a weighted intermediary sum of the "internal friction" value of both mags: (<betterMag>*0.85) + (<worseMag>*0.15)
[x] extend the "repair" function to remove deposits on the plugs
[x] make the spark plug state persistent across sessions. (?Probably the effect is not strong enough to occur in a single session, and also descending seems to be a crucial factor (low-power descends), which can be seen in some aviation forums and is a factor for the next takeoffs mag check)
[x] I think that there is already a "rough engine running" sound. This may be adjusted and overlayed to the engine sound, getting stronger gradually with too rich/lean AFR and also a worsening spark plug fouling state (final friction value above?). Nice idea for the future. Currently no sound. We do it via the coughing implementation for now.
[x] If the "internal friction value" exceeds some threshold, rough running could also be achieved by utilizing the "coughing" effect we already have. This will worse the power too when running on one bad magneto.
[x] Coughing effect may also be applied when the AFR is too lean/rich and combustion is nearly out of range
(subject to "complex engine procedures" enabled)
[x] Reevaluate the "cold engine develops bad power" simulation: Probably this implementation here will be able to replace it => RESULT: It's still needed to simulate cold oil effects
[x] disable lead fouling when operating on AVGAS 100UL postponed
[x] Magneto malfunction": Make engine run rough when one magento failed
(Optional, separate issue, not Spark Plug related, but easy to implement piggy-back wise)
References:
Some more details in the c172p project: c172p-team/c172p#800
:information_source: After reading up on this subject, I think it may still need some research. Basicly there are two main sources of fouling, too rich mixture and too low combustion temperature:
Running the engine in a "cold combustion state" (low RPM / rich mixture, available from JSBSim trough a AFR property) will result in carbon deposits on the spark plugs, causing a rough engine and loss of power, and can finally to a loss of the spark plugs ignition (magneto check can reveal this). To remedy, the engine needs to run on higher RPM/hotter combustion for 15-25 seconds (POH 3-20 says "several minutes" for safety, but the shell letter and pilot forums also talk about the smaller timeframe).
To simulate this, we might do the following simplificated implementation: (I think this can be preferably done in pure systems-xml-space (kinematic with variable speed setting?), however a nasal timer might be easier here. This should be further investigated, however)
[x] Make the effects described here depending on the "spark plug icing" option enabled; also extend the option label to include "fouling".
[x] in the fuel system, calculate the present carbon deposit level, depending on the current AFR and engine temp
CHT as proxy? Or useRevise the spark plug temp we introduced for the spark plug icing[x] make flooded priming induce carbon deposits
[x] Depending on the carbon deposit level, for each magneto calculate the effects
[x] Calculate and apply RPM (and power) loss
<sparkfaildrop>
engine.xml definition)0.15
power loss for a fully disabled magneto in "OK" status for the working one.0.15
foreach max).(<betterMag>*0.85) + (<worseMag>*0.15)
[x] extend the "repair" function to remove deposits on the plugs
[x] make the spark plug state persistent across sessions. (?Probably the effect is not strong enough to occur in a single session, and also descending seems to be a crucial factor (low-power descends), which can be seen in some aviation forums and is a factor for the next takeoffs mag check)
[x]
I think that there is already a "rough engine running" sound. This may be adjusted and overlayed to the engine sound, getting stronger gradually with too rich/lean AFR and also a worsening spark plug fouling state (final friction value above?).Nice idea for the future. Currently no sound. We do it via the coughing implementation for now.[x] If the "internal friction value" exceeds some threshold, rough running could also be achieved by utilizing the "coughing" effect we already have. This will worse the power too when running on one bad magneto.
[x] Coughing effect may also be applied when the AFR is too lean/rich and combustion is nearly out of range (subject to "complex engine procedures" enabled)
[x] Reevaluate the "cold engine develops bad power" simulation: Probably this implementation here will be able to replace it => RESULT: It's still needed to simulate cold oil effects
[x] Add documentation
[x] Add option for using unleaded fuel: https://www.greencarcongress.com/2021/07/20210728-g100ul.html[x] Magneto malfunction": Make engine run rough when one magento failed (Optional, separate issue, not Spark Plug related, but easy to implement piggy-back wise)
References: