Integration in PID controller

877 Views Asked by At

I am trying to understand how come there is a phase difference is from the error signal and the output of my PID controller which consisting of I = 1.

As far i've understood should the integration return the area of the graph the error signal gives, but for some reason does not make sense when i simulate it in matlab. It seems to me that area keep growing in different rates, it looks to be offset by the step, and never goes below 0 (subtraction of area. ).

Blue line = PID Output => integral , RED = step with 10, Yellow = Error signal(input for PID), Purple = output of closed loop system

The System itself looks like this P = 1 , and I = 1. enter image description here

1

There are 1 best solutions below

14
On

When a PID loop has an error between set point and input signals, that error is used directly in the proportional and integral portions of the loop. In particular, as long as the error is negative, the integral will be applying its effect in the positive direction; not until the error is positive will the integral switch and apply its effect in the negative direction.

The terms "integral," "proportional" and "derivative" speak exactly to the mathematical properties of these respective parts of the loop. In particular, if the error is an exact sine wave, the proportional will match with an in-phase sine wave. The integral of a sine wave is another sine wave that is phase-shifted, and similarly with the derivative, so graphing all of these together will show two in-phase sine waves, and two other sine waves in other phases, one "before" and the other "after" the error phase.

When a loop is applied in a manner which would decrease the error over time, the effect of the proportional term is to bring the error term to a constant state - not necessarily zero. The effect of the integral term is to push the error term towards zero - push too hard and overshoot occurs. The effect of the derivative term is to push the error away from zero - this counteracts integral overshoot, but can also prevent steady-state operation.

Taking the system you have, notice that the proportional (in yellow) exactly mirrors the error (in purple), while the integral (in blue) is also mirrored and $\pi\over 2$ behind in phase from the error. Further, it is clear that as the integral part works to reduce the difference between the total output and the error, the proportional part of the output converges to $0$ while the integral part converges to match the input (in red). The total output is $100$% integral at $t=\infty$ since the proportional part has gone to $0$.