From 9a03a91261ac7cb6c435aecc0f70a8a069259d16 Mon Sep 17 00:00:00 2001 From: DeionSi Date: Mon, 30 Jan 2023 04:18:52 +0100 Subject: [PATCH] Use separate afrProtectDeviationLambda constant memory-mapped onto afrProtectDeviation (#989) * Use separate afrProtectDeviationLambda constant memory-mapped onto afrProtectDeviation * 3 decimal accuracy for Lambda * Add default for afrProtectDeviationLambda --- reference/speeduino.ini | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 43efb215..fa35e5ca 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -1062,11 +1062,8 @@ page = 9 afrProtectMAP = scalar, U08, 186, "kPa", 2.0, 0.0, 0.0, 511.0, 0 ; 8 bit value, 1 byte afrProtectRPM = scalar, U08, 187, "RPM", 100, 0.0, 100, 25500, 0 ; 8 bit value, 1 byte afrProtectTPS = scalar, U08, 188, "%", 0.5, 0.0, 0.0, 100.0, 1 ; 8 bit value, 1 byte -#if LAMBDA - afrProtectDeviation = scalar, U08, 189, "Lambda", {0.1 / stoich}, 0.0, 0.00, 25.5, 2 ; 8 bit value, 1 byte -#else - afrProtectDeviation = scalar, U08, 189, "AFR", 0.1, 0.0, 0.0, 25.5, 1 ; 8 bit value, 1 byte -#endif + afrProtectDeviationLambda = scalar, U08, 189, "Lambda", {0.1 / stoich}, 0.0, 0.00, 25.5, 3 ; 8 bit value, 1 byte + afrProtectDeviation = scalar, U08, lastOffset, "AFR", 0.1, 0.0, 0.0, 25.5, 1 ; 8 bit value, 1 byte afrProtectCutTime = scalar, U08, 190, "seconds", 0.1, 0.0, 0.0, 2.5, 1 ; 8 bit value, 1 byte afrProtectReactivationTPS = scalar, U08, 191, "%", 0.5, 0.0, 0.0, 100.0, 1 ; 8 bit value, 1 byte @@ -1648,11 +1645,8 @@ page = 15 defaultValue = afrProtectMAP, 180 defaultValue = afrProtectRPM, 4000 defaultValue = afrProtectTPS, 80 -#if LAMBDA - defaultValue = afrProtectDeviation, 0.10 -#else + defaultValue = afrProtectDeviationLambda, 0.10 defaultValue = afrProtectDeviation, 1.47 -#endif defaultValue = afrProtectCutTime, 0.8 defaultValue = afrProtectReactivationTPS, 20 @@ -2132,11 +2126,8 @@ menuDialog = main afrProtectMAP = "Minimum manifold air pressure the AFR lean protection will activate" afrProtectRPM = "Minimum RPM the AFR lean protection will activate" afrProtectTPS = "Minimum current throttle position for the AFR lean protection to activate" -#if LAMBDA - afrProtectDeviation = "Fixed mode = A fixed maximum lambda value (e.g. 0.95)\n\nTable mode = A maximum deviation (e.g. 0.1) from current lambda using target table + specified deviation" -#else - afrProtectDeviation = "Fixed mode = A fixed maximum AFR value (e.g. 14.0)\n\nTable mode = A maximum deviation (e.g. 1.5) from current AFR using target table + specified deviation" -#endif + afrProtectDeviationLambda = "Fixed mode = A fixed maximum lambda value (e.g. 0.95)\n\nTable mode = A maximum deviation (e.g. 0.1) from current lambda using target table + specified deviation\n\nChanging this also changes Maximum AFR" + afrProtectDeviation = "Fixed mode = A fixed maximum AFR value (e.g. 14.0)\n\nTable mode = A maximum deviation (e.g. 1.5) from current AFR using target table + specified deviation\n\nChanging this also changes Maximum Lambda" afrProtectCutTime = "Time delay before activating AFR protection when all conditions has been fulfilled" afrProtectReactivationTPS = "Going below this throttle position (%) will deactivate this protection" oilPressureProtTime = "Time delay before activating oil pressure protection when all conditions has been fulfilled" @@ -3018,13 +3009,10 @@ menuDialog = main field = "Minimum manifold air pressure ", afrProtectMAP, {afrProtectEnabled} field = "Minimum engine RPM ", afrProtectRPM, {afrProtectEnabled} field = "Minimum throttle position ", afrProtectTPS, {afrProtectEnabled} -#if LAMBDA - field = "Maximum lambda ", afrProtectDeviation, {afrProtectEnabled}, {afrProtectEnabled == 0 || afrProtectEnabled == 1} - field = "Maximum lambda deviation ", afrProtectDeviation, {afrProtectEnabled}, {afrProtectEnabled == 2} -#else - field = "Maximum AFR ", afrProtectDeviation, {afrProtectEnabled}, {afrProtectEnabled == 0 || afrProtectEnabled == 1} + field = "Maximum lambda ", afrProtectDeviationLambda, {afrProtectEnabled}, {afrProtectEnabled == 0 || afrProtectEnabled == 1} + field = "Maximum lambda deviation ", afrProtectDeviationLambda, {afrProtectEnabled}, {afrProtectEnabled == 2} + field = "Maximum AFR ", afrProtectDeviation, {afrProtectEnabled}, {afrProtectEnabled == 0 || afrProtectEnabled == 1} field = "Maximum AFR deviation ", afrProtectDeviation, {afrProtectEnabled}, {afrProtectEnabled == 2} -#endif field = "Time before cut ", afrProtectCutTime, {afrProtectEnabled} field = "" field = "Reactivate below throttle ", afrProtectReactivationTPS, {afrProtectEnabled}