PI control algorithms

Special K

Diamond Member
Jun 18, 2000
7,098
0
76
I have a general question about the integral term that is used in PID control algorithms. The integral term is just the integral of the error of the system over all time, correct? And then this value is multiplied by some gain factor to form the integral term of the input that is sent back to control the system. I have 2 questions: first of all, does the integral term treat all error as a positive value, or does it give error in one direction from the setpoint a positive value, and error in the other direction a negative value? And then my second question is, suppose you have a system whose state is "higher" than whatever the desired setpoint is. Then say that the system is controlled and gradually settles in on the setpoint, without any oscillations. The system will be at the desired point, but the integral of the error will still be a positive value, and will therefore contribute a corrective value to the system's input to drive it below the setpoint to produce "negative error" in order to cancel out the positive integral error that had been accumulated. Is that how the integral term really works, or am I missing something here? I haven't had a complete class on control (yet), but I've read a little about it and just didn't quite understand that part of it.
 

sgtroyer

Member
Feb 14, 2000
94
0
0
I'm not really well versed in control system theory, but here's what I think...

From what I can tell, the integral term considers the sign of the error. No absolute value function is present. That is, if the error is positive, the integral will increase. If the error is negative, the integral will decrease.

The second question is a lot trickier. It can be hard to describe and understand these things in words, sometimes it's just easier to trust the math. The math should show you that it will actually work: it will converge without overshooting. As far as I know, you get overshoot in a PD system, but not in a PI system. I think the root of your conceptual problem comes from confusing the output of the controller with the output of the "plant". The controller takes as inputs the reference value and the output of the plant. We'll call those r and y, respectively. It outputs a control signal s. In this case, x(t) = kp*(r(t)-y(t)) +ki*integral(r(tau)-y(tau),tau,0,t). Or in words, x is the sum of a proportional term and integral term. But you're not concerned with x, you're concerned with y, the output of the plant. x is the input to the plant, which has some transfer function, and y is the output. So when the output y settles to the setpoint, the error is zero. x may continue to go negative because of the integral error, but my guess is the plant transfer function will keep y at the setpoint.

Try to create an actual example and see what the results show. I haven't done this, so I'm just speaking on gut feel. I'd be interested in knowing how it actually works out.
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
PI systems will overshoot by their very nature.

If there is a positive error-sum, then the error will be forced negative for a time to bring the total error-sum back to zero.
 

Shalmanese

Platinum Member
Sep 29, 2000
2,157
0
0
IIRC, the integral is calculated in such a way that it gives more weight to more recent input. Thus, if you reach your desired goal, the influence of the I will decrease over time.
 

f95toli

Golden Member
Nov 21, 2002
1,547
0
0
To make things even more confusing what is true for a PI or PD system is not true for a PID-system. As has been mentioned above there are simple mathematical interpretations of what the I in PI does but that is not true for PID systems; there is no simple way to determine the best value for I and D in a PID system.
There are rules of thumb and also clever algorithms that work fairly well but it is still more or less an art to find the right set or parameters for a real system.