Skip to content

Commit

Permalink
enabled PID after brew was aborted
Browse files Browse the repository at this point in the history
adding TRACE log for brew PID
  • Loading branch information
LoQue90 committed Nov 3, 2024
1 parent 2d1770a commit 8c0b01f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1654,12 +1654,13 @@ void looppid() {
LOGF(TRACE, "Current PID diff'd input: %f", bPID.GetDeltaInput());
LOGF(TRACE, "Current PID D part: %f", bPID.GetLastDPart());
LOGF(TRACE, "Current PID kD: %f", bPID.GetKd());

// Combined PID output
LOGF(TRACE, "Current PID Output: %f", pidOutput);
LOGF(TRACE, "Current Machinestate: %s", machinestateEnumToString(machineState));
// Brew
LOGF(TRACE, "timeBrewed %f", timeBrewed);
LOGF(TRACE, "Brew detected %i", brew());
LOGF(TRACE, "brewPIDdisabled %i", brewPIDDisabled);
}
}

Expand Down Expand Up @@ -1765,6 +1766,13 @@ void looppid() {
}
}
}
// Reset brewPIDdisabled if brew was aborted
if (machineState != kBrew && brewPIDDisabled) {
// enable PID again
bPID.SetMode(AUTOMATIC);
brewPIDDisabled = false;
LOG(DEBUG, "Enabled PID again after brew was manually stopped");
}

// Steam on
if (machineState == kSteam) {
Expand Down

0 comments on commit 8c0b01f

Please sign in to comment.