refine logging

This commit is contained in:
2026-07-05 16:09:42 +02:00
parent 161cbab8a7
commit 0e4a30adf7
4 changed files with 107 additions and 19 deletions

View File

@@ -104,6 +104,16 @@ public:
bool isAutotuning() const { return autotuner_.isActive(); }
uint32_t autotuneElapsedMs(uint32_t nowMs) const { return autotuner_.elapsedMs(nowMs); }
const char *autotunePhaseName() const { return autotuner_.phaseName(); }
uint8_t autotuneCycleCount() const { return autotuner_.cycleCount(); }
uint8_t autotunePeriodCount() const { return autotuner_.periodCount(); }
float autotunePreheatTargetC() const { return autotuner_.preheatTargetC(); }
bool commitAutotuneIfDone() {
if (autotuner_.phase() != PidAutotuner::Phase::Done) {
return false;
@@ -358,10 +368,22 @@ private:
bool isBalancedChamber() const { return cornerSpreadC_ <= GOOD_SPREAD_C; }
float maxHeatStopTemp(float avgTempC) const {
if (isBalancedChamber() && avgTempC < targetTempC_) {
return targetTempC_ + BALANCED_MAX_ABOVE_TARGET_C;
if (avgTempC >= targetTempC_) {
return targetTempC_;
}
return targetTempC_;
float stopAt = targetTempC_;
if (isBalancedChamber()) {
stopAt = targetTempC_ + BALANCED_MAX_ABOVE_TARGET_C;
} else {
stopAt = targetTempC_ + cornerSpreadC_ * SPREAD_HEADROOM_FACTOR + 1.0f;
}
const float belowCutoff = cutoffThreshold() - 0.1f;
if (stopAt > belowCutoff) {
stopAt = belowCutoff;
}
return stopAt;
}
float allowanceFromMaxCorner(float maxTempC, float avgTempC) const {