Skip to content

Commit

Permalink
Merge pull request br3ttb#7 from gnalbandian/patch-1
Browse files Browse the repository at this point in the history
Changed return value for the current tunning stage
  • Loading branch information
Dlloydev authored May 18, 2021
2 parents 0fbd0da + 779ad8c commit 98cef95
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/QuickPID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,18 @@ byte AutoTunePID::autoTuneLoop()
case NEW_TUNINGS: // ready to apply tunings
*_output = 0;
_autoTuneStage++;
return NEW_TUNINGS;
//return NEW_TUNINGS;
break;

case RUN_PID: // ready to apply tunings
return RUN_PID;
break;
}
return RUN_PID;

if(_autoTuneStage < 1) // safety measure to avoid overflow of _autoTuneStage variable if its value is 0, which shouldn't happen never. Nonetheless...
return 0
else
return _autoTuneStage - 1;
}

void AutoTunePID::setAutoTuneConstants(float* kp, float* ki, float* kd)
Expand Down

0 comments on commit 98cef95

Please sign in to comment.