Post cranking fuel tweaks (#2718)

* post cranking factor limits

* sensible defaults

* but not for tests

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2021-05-17 14:24:29 -07:00 committed by GitHub
parent 4b0d75ff92
commit 8c3be2cefc
2 changed files with 9 additions and 2 deletions

View File

@ -132,8 +132,8 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
fuelCutoffCorrection = getFuelCutOffCorrection(nowNt, rpm PASS_ENGINE_PARAMETER_SUFFIX);
// post-cranking fuel enrichment.
// for compatibility reasons, apply only if the factor is greater than zero (0.01 margin used)
if (engineConfiguration->postCrankingFactor > 0.01f) {
// for compatibility reasons, apply only if the factor is greater than unity (only allow adding fuel)
if (engineConfiguration->postCrankingFactor > 1.0f) {
// convert to microsecs and then to seconds
running.timeSinceCrankingInSecs = NT2US(timeSinceCranking) / 1000000.0f;
// use interpolation for correction taper

View File

@ -488,6 +488,13 @@ static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
static const float advanceBins[] = { 0, 200, 400, 1000 };
copyArray(engineConfiguration->crankingAdvanceBins, advanceBins);
#if !EFI_UNIT_TEST
// don't set this for unit tests, as it makes things more complicated to test
engineConfiguration->postCrankingFactor = 1.2;
#endif
engineConfiguration->postCrankingDurationSec = 10;
}
/**