polishing
This commit is contained in:
parent
3aa9ab5cbd
commit
05805eeb00
@ -83,21 +83,16 @@ int currentPhase;
|
||||
bool isInTransition = false;
|
||||
bool inSelectionMode = true;
|
||||
|
||||
// PID Control variables
|
||||
// double Kp = 0.5, Ki = 1, Kd = 0.05;
|
||||
// PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
|
||||
|
||||
// #include "GyverPID.h"
|
||||
#include "pid.h"
|
||||
double Setpoint, Input, Output;
|
||||
GyverPID regulator(10, 2, 10, 1000);
|
||||
GyverPID regulator(50, 1, 0, 1000);
|
||||
|
||||
bool temperatureSensorError = false;
|
||||
|
||||
// Timing variables
|
||||
long phaseStartTime;
|
||||
long totalStartTime;
|
||||
long ssrLastSwitchTime;
|
||||
long totalElapsedTime;
|
||||
long totalProcessTime;
|
||||
long finishTime = 0;
|
||||
@ -107,7 +102,6 @@ bool isClick = false;
|
||||
bool isLeft = false;
|
||||
bool isRight = false;
|
||||
bool isComplete = false;
|
||||
const int ssrSwitchInterval = 1000; // SSR switching interval in milliseconds
|
||||
|
||||
// Buffer for formatted time strings
|
||||
char timeBuffer[10];
|
||||
@ -117,8 +111,6 @@ bool boolLastCompletedState = false;
|
||||
float failedReadingLastValue = 0;
|
||||
int failedReadingCount = 0;
|
||||
|
||||
#define PARTS 8
|
||||
|
||||
void setup() {
|
||||
pinMode(activeBuzzerPin, OUTPUT);
|
||||
Serial.begin(9600);
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
LP_THREAD({
|
||||
LP_TIMER(10, checkEncoder);
|
||||
|
||||
void checkEncoder() {
|
||||
enc1.tick();
|
||||
isLeft = enc1.isLeft();
|
||||
isRight = enc1.isRight();
|
||||
@ -13,8 +15,7 @@ LP_THREAD({
|
||||
else {
|
||||
handleExecutionSelection();
|
||||
}
|
||||
LP_DELAY(10);
|
||||
});
|
||||
}
|
||||
|
||||
void handleExecutionSelection() {
|
||||
if (isClick) {
|
||||
|
||||
@ -90,8 +90,6 @@ void startExecution() {
|
||||
phaseStartTime = totalStartTime = millis(); // Start the timer
|
||||
totalElapsedTime = 0;
|
||||
regulator.setpoint = 0;
|
||||
// digitalWrite(ssrPin, HIGH); // Start with heater on
|
||||
ssrLastSwitchTime = millis();
|
||||
calculateTotalTime();
|
||||
getPhaseAndTemperature();
|
||||
writeEEPROM();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user