View Single Post
  #5   Spotlight this post!  
Unread 21-01-2017, 13:41
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 213
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: PID loop speeds up as it gets closer to target?

We are running on the roboRIO. Have you taken a look at my code that i linked in the first post?

Relevant code:
Code:
    rotateToAngleRate = 0.0f;
    turnController = new frc::PIDController(kP, kI, kD, kF, this, this);
    turnController->SetInputRange(0.0f,  180.0f);
    turnController->SetOutputRange(0.2, 1.0);
    turnController->SetAbsoluteTolerance(kToleranceDegrees);
    turnController->SetContinuous(true);
Code:
    turnController->Enable();
    speedWhileRotating = rotateToAngleRate;
    std::cout << "speedWhileRotating: " << speedWhileRotating << std::endl;
    isRotDone = false;
    degreesToAngleAbs = fabs(degreesToAngle);
Reply With Quote