View Single Post
  #12   Spotlight this post!  
Unread 02-11-2015, 09:02 AM
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,712
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: PID control help

Quote:
Originally Posted by cstelter View Post
After reflecting on the code from last year a bit, I'm thinking the same thing could have been accomplished (more simply) simply by writing a PID command along the lines if

Code:
public void returnPIDValue()
{
    return leftEncoder.getDistance()-rightEncoder.getDistance();
}

public void returnPIDOutput(double output)
{
    driveTrain.tankDrive(baseSpeed+output, baseSpeed-output);
}
the setpoint of the PID would always be zero (a zero difference between left and right distance).

Our code did something similar, but not entirely identical.

Thoughts?
The same thing can also be accomplished by doing something like this:

Code:
public void returnPIDValue()
{
    return leftEncoder.getDistance()-rightEncoder.getDistance();
}

public void returnPIDOutput(double output)
{
    driveTrain.arcadeDrive(baseSpeed, output);
}
The original question that never got answered needs answered to really give a good answer for the best way to do this.
Reply With Quote