We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b465d4 commit 779ad8cCopy full SHA for 779ad8c
src/QuickPID.cpp
@@ -367,10 +367,18 @@ byte AutoTunePID::autoTuneLoop()
367
case NEW_TUNINGS: // ready to apply tunings
368
*_output = 0;
369
_autoTuneStage++;
370
- return NEW_TUNINGS;
+ //return NEW_TUNINGS;
371
break;
372
+
373
+ case RUN_PID: // ready to apply tunings
374
+ return RUN_PID;
375
+ break;
376
}
- return RUN_PID;
377
378
+ if(_autoTuneStage < 1) // safety measure to avoid overflow of _autoTuneStage variable if its value is 0, which shouldn't happen never. Nonetheless...
379
+ return 0
380
+ else
381
+ return _autoTuneStage - 1;
382
383
384
void AutoTunePID::setAutoTuneConstants(float* kp, float* ki, float* kd)
0 commit comments