In this case I’m using it to control the position of a motor.
In some systems it is important to prevent “windup” of the accumulator(also called saturation).
Windup occurs when the small errors build so high that when movement finally occurs it takes a long time for the accumulator to reduce to an insignificant amount.
Then increase your integral term until the final desired position is reached.
The integral term is usually much smaller than the proportional term.
Attached to my motor shaft is an analog encoder that also outputs a value of 0-5VDC over a single rotation of the motor (US Digital MA3 encoder).
The idea is that when I turn the pot the motor follows the turn and stops where the pot stops.This value needs to be scaled to a value that matched the pulse-width modulation range for the controller. You’ll notice that the division of the PID is accomplished by right-rotates as opposed to division.This is just a faster way of accomplishing the same thing.ITerm – The I term is generally much smaller than the P term.There is also an accumulator associated with the I term. Eventually even small errors build up to be large number, when that happens a small I term will cause to move the motor.A negative error signal causes the P term create a negative motor movement.