make variable names more specific.

It's possible multiple vessels will need to be controlled in the future.
This commit is contained in:
Chris Giacofei 2024-05-02 13:00:03 -04:00
parent 455d5cc89f
commit 23f5c79cf3

View File

@ -22,9 +22,9 @@ double KettleSetpoint = 70;
double CurrentTemp; double CurrentTemp;
bool tuning = false; bool tuning = false;
EEPROMStorage<double> eepromKp(0, 2.0); // 9 bytes for doubles 8 + 1 for checksum EEPROMStorage<double> kettleKp(0, 2.0); // 9 bytes for doubles 8 + 1 for checksum
EEPROMStorage<double> eepromKi(9, 5.0); EEPROMStorage<double> kettleKi(9, 5.0);
EEPROMStorage<double> eepromKd(18, 1.0); EEPROMStorage<double> kettleKd(18, 1.0);
// User I/O objects. // User I/O objects.
Button Enter; Button Enter;
@ -32,7 +32,7 @@ slowPWM boilPWM;
MD_REncoder rotary = MD_REncoder(encoderDT, encoderCLK); MD_REncoder rotary = MD_REncoder(encoderDT, encoderCLK);
LiquidCrystal_I2C lcd(0x27, 20, 4); LiquidCrystal_I2C lcd(0x27, 20, 4);
Adafruit_MAX31865 thermoRTD = Adafruit_MAX31865(KettleRTD); Adafruit_MAX31865 thermoRTD = Adafruit_MAX31865(KettleRTD);
PID Controller(&CurrentTemp, &KettleDuty, &KettleSetpoint, eepromKp, eepromKi, eepromKd, P_ON_M, DIRECT); PID Controller(&CurrentTemp, &KettleDuty, &KettleSetpoint, kettleKp, kettleKi, kettleKd, P_ON_M, DIRECT);
// Return a character array to represent the // Return a character array to represent the
// On/Off state of the kettle. // On/Off state of the kettle.
@ -208,9 +208,9 @@ void loop() {
} }
void SaveTunings() { void SaveTunings() {
eepromKp = Controller.Kp(); kettleKp = Controller.Kp();
eepromKi = Controller.Ki(); kettleKi = Controller.Ki();
eepromKd = Controller.Kd(); kettleKd = Controller.Kd();
} }
void SerialSend() void SerialSend()