Fixed glitch where the PID would randomly start again

This commit is contained in:
-help 2024-01-27 08:53:56 +02:00
parent d79bf1025f
commit 9b6040a98a
3 changed files with 15 additions and 6 deletions

View File

@ -13,7 +13,7 @@ PidController::PidController(double *input, double *output, double *setpoint)
controller.setSampleTime(20);
controller.setWindUpLimits(-100, 185);
controller.start();
}
double *PidController::compute()
@ -51,4 +51,10 @@ void PidController::stop()
{
controller.stop();
controller.reset();
}
void PidController::start()
{
controller.start();
}

View File

@ -15,6 +15,7 @@ public:
void debug();
void debug2(const char* extraText);
void stop();
void start();
boolean started = false;

View File

@ -57,11 +57,11 @@ LEDS leds = LEDS();
ReflowProfile profile = ReflowProfile(new ReflowStep[5]{
ReflowStep(ReflowProcessState::PREHEAT, 2, 100),
ReflowStep(ReflowProcessState::SOAK, 2, 140),
ReflowStep(ReflowProcessState::REFLOW, 2, 160, EASE_IN_OUT),
ReflowStep(ReflowProcessState::COOL, 2, 20),
ReflowStep(ReflowProcessState::DONE, 0, 0)},
ReflowStep(ReflowProcessState::PREHEAT, 2, 50),
ReflowStep(ReflowProcessState::SOAK, 2, 70),
ReflowStep(ReflowProcessState::REFLOW, 2, 85),
ReflowStep(ReflowProcessState::COOL, 2, 20),
ReflowStep(ReflowProcessState::DONE, 0, 0)},
"meow\0");
// Reflowprofile profile = Reflowprofile(new ReflowStep[5]{
@ -108,6 +108,8 @@ void setup()
}
reflowProcessState = USER_INPUT;
profile.start();
controller.start();
}
void loop()