Thread: PID Help
View Single Post
  #2   Spotlight this post!  
Unread 05-02-2014, 19:42
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: PID Help

The first thing to check is the sign of everything.

Are you doing PID on the jaguar or on the cRio?

First, make sure that a positive value for motor results in a positive change (We usually define positive as forward, right, up, right-turn). If not, invert it after the PID control.

Second, make sure a positive change in the sensor results in a positive change in the sensor signal. If you roll it in the positive direction, do your counts and go up and velocities positive? If not, invert it before the PID control.

Then, you can try running PID control. If the direction is wrong, the control loop will compensate in the wrong direction, and since it keeps getting further from the target, it will keep compensating further in the wrong direction until it hits the limits of its authority.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote