Skip to content
Snippets Groups Projects
Commit 790dd91a authored by Mirko Wächter's avatar Mirko Wächter
Browse files

added maxIntegral value to pid controller

parent df572916
No related branches found
No related tags found
No related merge requests found
......@@ -127,7 +127,7 @@ void PIDController::update(double deltaSec, double measuredValue, double targetV
if (!firstRun)
{
integral += error * deltaSec;
integral = math::MathUtils::LimitTo(integral, maxIntegral);
if (deltaSec > 0.0)
{
derivative = (error - previousError) / deltaSec;
......
......@@ -52,6 +52,7 @@ namespace armarx
// protected:
float Kp, Ki, Kd;
double integral;
double maxIntegral = std::numeric_limits<double>::max();
double derivative;
double previousError;
double processValue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment