File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ void loop() {
74
74
_myPID.Compute ();
75
75
analogWrite (outputPin, Output);
76
76
}
77
- // delay(1); // adjust loop speed
77
+ delay (1 ); // adjust loop speed
78
78
}
79
79
80
80
float avg (int inputVal) {
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ void loop() {
75
75
_myPID.Compute ();
76
76
analogWrite (outputPin, Output);
77
77
}
78
- // delay(1); // adjust loop speed
78
+ delay (1 ); // adjust loop speed
79
79
}
80
80
81
81
float avg (int inputVal) {
Original file line number Diff line number Diff line change @@ -248,14 +248,18 @@ byte AutoTunePID::autoTuneLoop()
248
248
break ;
249
249
case STABILIZING:
250
250
if (_printOrPlotter == 1 ) Serial.print (F (" Stabilizing →" ));
251
+ _t0 = millis ();
251
252
_peakHigh = _atSetpoint;
252
253
_peakLow = _atSetpoint;
253
254
(!_direction) ? *_output = 0 : *_output = _atOutput + _outputStep + 5 ;
254
255
_autoTuneStage = COARSE;
255
256
return AUTOTUNE;
256
257
break ;
257
258
case COARSE: // coarse adjust
258
- delay (2000 );
259
+ if (millis () - _t0 < 2000 ) {
260
+ return AUTOTUNE;
261
+ break ;
262
+ }
259
263
if (*_input < (_atSetpoint - _hysteresis)) {
260
264
(!_direction) ? *_output = _atOutput + _outputStep + 5 : *_output = _atOutput - _outputStep - 5 ;
261
265
_autoTuneStage = FINE;
You can’t perform that action at this time.
0 commit comments