|
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
|