control-theory

Scaling PID (Proportional Integral Derivative) Output

I have implemented a PID function using the formula, correction = Kp * error + Kd * (error - prevError) + kI * (sum of errors) What should I do to keep my output between a certain range? say 0-255 If I disregard any value not between 0 to 255 it produces a jiggly behavior? ...

PID controller integral term causing extreme instability

I have a PID controller running on a robot that is designed to make the robot steer onto a compass heading. The PID correction is recalculated/applied at a rate of 20Hz. Although the PID controller works well in PD mode (IE, with the integral term zero'd out) even the slightest amount of integral will force the output unstable in such a...