mirror of https://github.com/rusefi/wideband.git
heater: shortcut if sensor is hot enough (#277)
* heater: shortcut if sensor is hot enough * heater: shortcut if sensor is hot enougth --------- Co-authored-by: Andrey Gusakov <dron0gus@gmail.com>
This commit is contained in:
parent
4bdd8f5c44
commit
fa042fb6f5
|
@ -13,6 +13,10 @@
|
||||||
#define ADC_MAX_COUNT (4095)
|
#define ADC_MAX_COUNT (4095)
|
||||||
#define ADC_OVERSAMPLE 16
|
#define ADC_OVERSAMPLE 16
|
||||||
|
|
||||||
|
// Algo settings
|
||||||
|
// TODO: move to settings
|
||||||
|
#define HEATER_FAST_HEATING_THRESHOLD_T 550
|
||||||
|
|
||||||
// *******************************
|
// *******************************
|
||||||
// Nernst voltage & ESR sense
|
// Nernst voltage & ESR sense
|
||||||
// *******************************
|
// *******************************
|
||||||
|
|
|
@ -71,6 +71,18 @@ HeaterState HeaterControllerBase::GetNextState(HeaterState currentState, HeaterA
|
||||||
switch (currentState)
|
switch (currentState)
|
||||||
{
|
{
|
||||||
case HeaterState::Preheat:
|
case HeaterState::Preheat:
|
||||||
|
#ifdef HEATER_FAST_HEATING_THRESHOLD_T
|
||||||
|
if (sensorTemp >= HEATER_FAST_HEATING_THRESHOLD_T) {
|
||||||
|
// if sensor is already hot - we can start from higher heater voltage
|
||||||
|
rampVoltage = 7.5;
|
||||||
|
|
||||||
|
// Reset the timer for the warmup phase
|
||||||
|
m_warmupTimer.reset();
|
||||||
|
|
||||||
|
return HeaterState::WarmupRamp;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// If preheat timeout, or sensor is already hot (engine running?)
|
// If preheat timeout, or sensor is already hot (engine running?)
|
||||||
if (m_preheatTimer.hasElapsedSec(m_preheatTimeSec) || sensorTemp > closedLoopTemp)
|
if (m_preheatTimer.hasElapsedSec(m_preheatTimeSec) || sensorTemp > closedLoopTemp)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue