diff --git a/lambda-test/rules-test.c b/lambda-test/rules-test.c index 2d5903b..1dcc8d8 100644 --- a/lambda-test/rules-test.c +++ b/lambda-test/rules-test.c @@ -188,7 +188,6 @@ return true; } -/* static bool testTooRich(void) { Measurement meas = {0, 0, 0, 0}; @@ -217,24 +216,23 @@ meas.tempI = TEMP_FIRE_OUT + 1; meas.lambda = LAMBDA_TOO_RICH - 1; resetRules(true); - airgate = 100; + airgate = 50; reason(meas); assertFalse(rules[3].fired); - assertTrue(100 == airgate); + assertTrue(50 == airgate); meas.tempI = TEMP_FIRE_OUT + 1; meas.lambda = LAMBDA_TOO_RICH - 1; resetRules(true); - airgate = 50; + airgate = 25; reason(meas); assertTrue(rules[3].fired); - assertTrue(100 == airgate); + assertTrue(50 == airgate); cancelAlert(false); return true; } -*/ static bool testTooLean(void) { @@ -253,14 +251,14 @@ meas.lambda = 1300; resetRules(true); reason(meas); - assertFalse(rules[3].fired); + assertFalse(rules[4].fired); meas.tempI = TEMP_AIRGATE_50 + 1; meas.lambda = LAMBDA_TOO_LEAN + 1; resetRules(true); airgate = 50; reason(meas); - assertFalse(rules[3].fired); + assertFalse(rules[4].fired); assertTrue(50 == airgate); meas.tempI = TEMP_AIRGATE_50 + 1; @@ -268,7 +266,7 @@ resetRules(true); airgate = 100; reason(meas); - assertTrue(rules[3].fired); + assertTrue(rules[4].fired); assertTrue(50 == airgate); cancelAlert(false); @@ -285,27 +283,27 @@ meas.tempI = 50; age = 0; reason(meas); - assertFalse(rules[4].fired); + assertFalse(rules[5].fired); meas.tempI = TEMP_FIRE_OUT; age = 0; reason(meas); - assertFalse(rules[4].fired); + assertFalse(rules[5].fired); meas.tempI = TEMP_FIRE_OUT_RESET; age = 0; reason(meas); - assertFalse(rules[4].fired); + assertFalse(rules[5].fired); meas.tempI = TEMP_FIRE_OUT - 1; age = 0; reason(meas); - assertTrue(rules[4].fired); + assertTrue(rules[5].fired); meas.tempI = TEMP_FIRE_OUT_RESET; age = 0; reason(meas); - assertFalse(rules[4].fired); + assertFalse(rules[5].fired); cancelAlert(false); @@ -324,7 +322,7 @@ reason(meas); assertTrue(50 == airgate); assertTrue(heaterStateOff == getHeaterState()); - assertFalse(rules[5].fired); + assertFalse(rules[6].fired); age = 0; dir = firing_up; @@ -333,7 +331,7 @@ reason(meas); assertTrue(100 == airgate); assertTrue(heaterStateUp == getHeaterState()); - assertTrue(rules[5].fired); + assertTrue(rules[6].fired); cancelAlert(false); @@ -566,7 +564,7 @@ static const char testAirgate50_P[] PROGMEM = "testAirgate50"; static const char testAirgate25_P[] PROGMEM = "testAirgate25"; static const char testAirgateClose_P[] PROGMEM = "testAirgateClose"; -// static const char testTooRich_P[] PROGMEM = "testTooRich"; +static const char testTooRich_P[] PROGMEM = "testTooRich"; static const char testTooLean_P[] PROGMEM = "testTooLean"; static const char testFireOut_P[] PROGMEM = "testFireOut"; static const char testWarmStart_P[] PROGMEM = "testWarmStart"; @@ -584,7 +582,7 @@ {class, testAirgate50_P, testAirgate50}, {class, testAirgate25_P, testAirgate25}, {class, testAirgateClose_P, testAirgateClose}, - // {class, testTooRich_P, testTooRich}, + {class, testTooRich_P, testTooRich}, {class, testTooLean_P, testTooLean}, {class, testFireOut_P, testFireOut}, {class, testWarmStart_P, testWarmStart}, diff --git a/lambda/messages.h b/lambda/messages.h index 7c16f89..20f1e27 100644 --- a/lambda/messages.h +++ b/lambda/messages.h @@ -27,8 +27,6 @@ #define MSG_AIRGATE_50_0 "Air gate 50%" #define MSG_AIRGATE_25_0 "Air gate 25%" #define MSG_AIRGATE_CLOSE_0 "Close air gate" - #define MSG_TOO_RICH_0 "Too rich, open" - #define MSG_TOO_RICH_1 "air gate" #define MSG_FIRE_OUT_0 "Fire out?" #define MSG_HEATER_UP_0 "Oxygen sensor" #define MSG_HEATER_UP_1 "heating up..." @@ -56,8 +54,6 @@ #define MSG_AIRGATE_50_0 "Luftschieber 50%" #define MSG_AIRGATE_25_0 "Luftschieber 25%" #define MSG_AIRGATE_CLOSE_0 "Luftschieber zu" - #define MSG_TOO_RICH_0 "Zu fett, Luft-" - #define MSG_TOO_RICH_1 "schieber oeffnen" #define MSG_FIRE_OUT_0 "Feuer aus?" #define MSG_HEATER_UP_0 "Lambdasonde" #define MSG_HEATER_UP_1 "waermt auf..." diff --git a/lambda/rules.c b/lambda/rules.c index 59f85d8..4fcddad 100644 --- a/lambda/rules.c +++ b/lambda/rules.c @@ -69,27 +69,27 @@ } /** - * Notifies that the combustion is too rich and suggests to open the air gate. - * Disabled because it does not seem to be a good idea to give more air when - * the combustion is rich as this doesn't really make it leaner and more heat - * appears to be thrown out through the chimney. + * Notifies that combustion is (too) rich and suggests to set the air gate + * to 50%. + * It does however not seem to be a good idea to fully open the air gate as + * this doesn't make it noticeably leaner, but since the temperature of the + * exhaust gas going into the chimney rises, more heat appears to be thrown + * out of the chimney. */ -/* static void tooRich(bool* const fired, int8_t const dir, Measurement const meas) { if (meas.tempI > TEMP_FIRE_OUT && meas.lambda < LAMBDA_TOO_RICH && - getHeaterState() == heaterStateReady && airgate < 100) { - airgate = 100; - alert_P(BEEPS, LENGTH, TONE, - PSTR(MSG_TOO_RICH_0), PSTR(MSG_TOO_RICH_1), false); + getHeaterState() == heaterStateReady && airgate < 50) { + airgate = 50; + alert_P(BEEPS, LENGTH, TONE, PSTR(MSG_AIRGATE_50_0), PSTR(""), false); *fired = true; } } -*/ /** - * Notifies that the combustion is lean (again) and to set the air gate to 50%. + * Notifies that the combustion is lean (again) and suggests to set the air + * gate to 50%. */ static void tooLean(bool* const fired, int8_t const dir, Measurement const meas) { @@ -215,7 +215,7 @@ {false, airgate50}, {false, airgate25}, {false, airgateClose}, - // {false, tooRich}, + {false, tooRich}, {false, tooLean}, {false, fireOut}, {false, warmStart} diff --git a/lambda/rules.h b/lambda/rules.h index c0b78c4..6285921 100644 --- a/lambda/rules.h +++ b/lambda/rules.h @@ -41,7 +41,7 @@ /** Fire is considered fully burning if lambda is below this value */ #define LAMBDA_BURNING 1900 /** Combustion is considered too rich if lambda is below this value */ -#define LAMBDA_TOO_RICH 1200 +#define LAMBDA_TOO_RICH 1100 /** * Combustion is considered too lean if lambda is above this value * Too lean here rather means lean enough so the air gate can be set to 50%