# HG changeset patch # User Michiel Broek # Date 1627656353 -7200 # Node ID bafc2d6a07907173f9d1d15492088cb2aec44241 # Parent 8a67450424b7a15ef1cea8fd4ea95732d1a2c586 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature. diff -r 8a67450424b7 -r bafc2d6a0790 image/version.txt --- a/image/version.txt Thu Jul 29 22:38:30 2021 +0200 +++ b/image/version.txt Fri Jul 30 16:45:53 2021 +0200 @@ -1,1 +1,1 @@ -0.3.14 +0.3.18 diff -r 8a67450424b7 -r bafc2d6a0790 image/w/js/webui.js --- a/image/w/js/webui.js Thu Jul 29 22:38:30 2021 +0200 +++ b/image/w/js/webui.js Fri Jul 30 16:45:53 2021 +0200 @@ -89,6 +89,12 @@ $("#mlt20").show(); $("#but00").text('+sp'); $("#but20").text('-sp'); + $("#midline").show(); + $("#timer").hide(); + $("#mid00").show(); + $("#mid20").show(); + $("#but02").text('+%'); + $("#but22").text('-%'); break; case 121: this.clearScreen(); $("#mltline").show(); // boil @@ -98,6 +104,7 @@ $("#but00").text('+sp'); $("#but20").text('-sp'); $("#midline").show(); + $("#timer").show(); $("#mid00").show(); $("#mid20").show(); $("#but02").text('+%'); diff -r 8a67450424b7 -r bafc2d6a0790 main/recipes.c --- a/main/recipes.c Thu Jul 29 22:38:30 2021 +0200 +++ b/main/recipes.c Fri Jul 30 16:45:53 2021 +0200 @@ -311,7 +311,7 @@ */ if (_xml_add_type == MASHTYPE_TEMPERATURE && recipe.Mashsteps == 0) { _xml_add_type = MASHTYPE_INFUSION; - _xml_add_infusion = _xml_add_temp + 1.25; +// _xml_add_infusion = _xml_add_temp + 1.25; recipe.MashStep[recipe.Mashsteps].Ramp_time = 1; } recipe.MashStep[recipe.Mashsteps].Type = _xml_add_type; @@ -319,7 +319,11 @@ recipe.MashStep[recipe.Mashsteps].Ramp_time = (uint16_t)(_xml_add_temp - recipe.MashStep[recipe.Mashsteps - 1].End_temp) + 1; } if (_xml_add_type == MASHTYPE_INFUSION) { - recipe.MashStep[recipe.Mashsteps].Infuse_temp = _xml_add_infusion; + if (recipe.Mashsteps == 0 && _xml_add_infusion < _xml_add_temp) { + recipe.MashStep[recipe.Mashsteps].Infuse_temp = _xml_add_temp + 1.25; + } else { + recipe.MashStep[recipe.Mashsteps].Infuse_temp = _xml_add_infusion; + } recipe.MashStep[recipe.Mashsteps].Infuse_amount = _xml_add_amount; } else if (_xml_add_type == MASHTYPE_DECOCTION) { recipe.MashStep[recipe.Mashsteps].Infuse_temp = 98.0; diff -r 8a67450424b7 -r bafc2d6a0790 main/task_driver.c --- a/main/task_driver.c Thu Jul 29 22:38:30 2021 +0200 +++ b/main/task_driver.c Fri Jul 30 16:45:53 2021 +0200 @@ -20,6 +20,7 @@ #define SSR_PUMP CONFIG_SSR_PUMP_GPIO ///< GPIO Pump relay pin #define PWM_MLT CONFIG_PWM_MLT_GPIO ///< GPIO PWM MLT pin +#define HENDI_SWITCH 6 ///< Hendi power on/off at % bool outEnable = false; ///< Enable outputs flag DRIVER_State * driver_state; ///< Driver state @@ -136,15 +137,16 @@ /* * If the Hendi is on, the lowest setting is 500 Watt. So, if we need less then - * 10% power, turn it off, just like the manual knob. + * HENDI_SWITCH power, turn it off, just like the manual knob. */ - MLT((val >= 10) ? 1:0); + MLT((percent >= HENDI_SWITCH) ? 1:0); if (val != oldval) { - log_msg(TAG, "MLT_PWM(%d) val=%d %.0f watt", percent, val, (percent / 100.0) * equipment.MLT_watt); + log_msg(TAG, "MLT(%d) MLT_PWM(%d) val=%d %.0f watt pv: %.3f", (percent >= HENDI_SWITCH) ? 1:0, + percent, val, (percent / 100.0) * equipment.MLT_watt, driver_state->mlt_pv); ledc_set_duty(LEDC_HIGH_SPEED_MODE, LEDC_CHANNEL_0,/* 1024 - */val); ledc_update_duty(LEDC_HIGH_SPEED_MODE, LEDC_CHANNEL_0); - if (val >= 10) { + if (val >= HENDI_SWITCH) { runtime.MLT_usage += (xTaskGetTickCount() - MLT_time) * (percent / 100.0); } MLT_time = xTaskGetTickCount(); @@ -329,14 +331,12 @@ if ((PID_GetMode() == PID_AUTOMATIC) && (MLT_Mode == MLT_MODE_PID)) { /* Mash power limited */ PWMout = (PWMout * equipment.MashPower) / 100; -// if (PWMout > equipment.MashPower) -// PWMout = equipment.MashPower; } /* - * Do not send power values < 10%. + * Do not send power values < HENDI_SWITCH. */ - if (PWMout >= 10) { // Hendi minimum power is 500 Watt, this is 10% + if (PWMout >= HENDI_SWITCH) { // Hendi minimum power is 500 Watt, this is 10% if ((((PWMout / 100.0) * equipment.MLT_watt) + equipment.HLT_watt) > equipment.Max_watt) { if (HLT_pin) { ESP_LOGI(TAG, "Current %.0f Watt above %d limit, shutdown HLT", diff -r 8a67450424b7 -r bafc2d6a0790 sdkconfig --- a/sdkconfig Thu Jul 29 22:38:30 2021 +0200 +++ b/sdkconfig Fri Jul 30 16:45:53 2021 +0200 @@ -121,10 +121,8 @@ # # BrewBoard Configuration # -CONFIG_TEMP_SENSORS_ONEWIRE=y -# CONFIG_TEMP_SENSORS_SIMULATOR is not set -CONFIG_ONE_WIRE_MLT=27 -CONFIG_ONE_WIRE_HLT=26 +# CONFIG_TEMP_SENSORS_ONEWIRE is not set +CONFIG_TEMP_SENSORS_SIMULATOR=y CONFIG_SSR_MLT_GPIO=32 CONFIG_PWM_MLT_GPIO=0 CONFIG_SSR_HLT_GPIO=33