Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heater: shortcut if sensor is hot enough #277

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions firmware/boards/f1_dual_rev1/wideband_board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#define ADC_MAX_COUNT (4095)
#define ADC_OVERSAMPLE 16

// Algo settings
// TODO: move to settings
#define HEATER_FAST_HEATING_THRESHOLD_T 550
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be board specific? Why not make generic for all boards?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. tested only on dual_rev1
  2. not sure if all boards can measure 550 C. (clamping of input signal on opamp)


// *******************************
// Nernst voltage & ESR sense
// *******************************
Expand Down
12 changes: 12 additions & 0 deletions firmware/heater_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ HeaterState HeaterControllerBase::GetNextState(HeaterState currentState, HeaterA
switch (currentState)
{
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 (m_preheatTimer.hasElapsedSec(m_preheatTimeSec) || sensorTemp > closedLoopTemp)
{
Expand Down
Loading