pi without the d
This commit is contained in:
48
src/main.cpp
48
src/main.cpp
@@ -178,10 +178,8 @@ void printStatus(float avgTemp, float minTemp, float maxTemp) {
|
||||
Serial.print(F(" heat="));
|
||||
Serial.print(thermal.stepResponseHeaterPct(), 0);
|
||||
Serial.print(F("%"));
|
||||
} else if (thermal.isAdaptive()) {
|
||||
Serial.print(F("learned"));
|
||||
} else {
|
||||
Serial.print(F("manual"));
|
||||
Serial.print(thermal.regulatingModeName());
|
||||
}
|
||||
Serial.print(F(" sensors=["));
|
||||
|
||||
@@ -211,12 +209,16 @@ void printHelp() {
|
||||
Serial.println(F(" fan off cancel idle fan override (auto-off below 40C)"));
|
||||
Serial.println(F(" fan on idle fan 30% (optional, auto-off below 40C)"));
|
||||
Serial.println(F(" fan test N set fan PWM 0-255 for 15s (verify wiring)"));
|
||||
Serial.println(F(" autotune [C] learn PID (default: 40C when idle)"));
|
||||
Serial.println(F(" autotune [C] learn heat PI (default: 40C when idle)"));
|
||||
Serial.println(F(" autotune stop"));
|
||||
Serial.println(F(" stepresp [C] [heater%] fan step response (default: 45C 35%)"));
|
||||
Serial.println(F(" stepresp stop"));
|
||||
Serial.println(F(" pid show PID / adaptive status"));
|
||||
Serial.println(F(" pid default reset to factory PID"));
|
||||
Serial.println(F(" pid show heat + mix PI gains"));
|
||||
Serial.println(F(" pid default reset all PI to factory"));
|
||||
Serial.println(F(" pid save write current PI to EEPROM"));
|
||||
Serial.println(F(" mixpi show mix PI gains"));
|
||||
Serial.println(F(" mixpi <Kp> <Ki> set mix PI (spread -> fan)"));
|
||||
Serial.println(F(" mixpi default reset mix PI to factory"));
|
||||
Serial.println(F(" status print current readings"));
|
||||
Serial.println(F(" log on|off CSV data stream"));
|
||||
Serial.println(F(" help show this message"));
|
||||
@@ -393,6 +395,40 @@ void processSerialLine(const char *line) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(line, "pid save") == 0) {
|
||||
thermal.saveTuningToEeprom();
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(line, "mixpi") == 0 || strcmp(line, "mixpi show") == 0) {
|
||||
Serial.print(F("Mix PI Kp="));
|
||||
Serial.print(thermal.mixKp(), 3);
|
||||
Serial.print(F(" Ki="));
|
||||
Serial.println(thermal.mixKi(), 4);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(line, "mixpi default") == 0) {
|
||||
thermal.resetMixTunings();
|
||||
return;
|
||||
}
|
||||
|
||||
if (strncmp(line, "mixpi ", 6) == 0) {
|
||||
const float kp = atof(line + 6);
|
||||
const char *space = strchr(line + 6, ' ');
|
||||
if (space == nullptr) {
|
||||
Serial.println(F("ERR mixpi requires: mixpi <Kp> <Ki>"));
|
||||
return;
|
||||
}
|
||||
const float ki = atof(space + 1);
|
||||
if (kp <= 0.0f || ki < 0.0f) {
|
||||
Serial.println(F("ERR mixpi Kp must be > 0, Ki >= 0"));
|
||||
return;
|
||||
}
|
||||
thermal.setMixTunings(kp, ki);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(line, "help") == 0) {
|
||||
printHelp();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user