defcon.klaxon
Lifetime Supporting Member
Hello all,
I got into a discussion with a co-worker about P and PI loop behavior. I am hoping that someone can confirm the proper way to describe the differences so that we can put the issue to bed, haha. This would also help me immensely in understanding PID loop control and tuning. I've tried Google for good explanations but I keep finding examples that don't really translate well to my situation (car steering/cruise control are what I typically find, which aren't going to work in this situation).
Let's say you have a PID loop that controls pump speed to maintain system pressure. To make the conversation less "hypothetical", let's say the loop controls pump speed (output is 0-100), and the process variable is water pressure (0-150 PSI); the setpoint is 50 PSI.
For the first experiment, you use only proportional gain; no integral or derivative functionality.
My belief is that a loop using only proportional gain will cause the output to be solely reliant on the error and the proportional gain; in other words:
This would mean that as the water pressure (PV) rises to the setpoint (SP), the output of the loop is going to reduce, eventually reaching 0. Then as the water pressure starts decreasing, the P loop will turn it back on, but will again eventually reach 0 and will do this ad infinitum. This is what I believed causes oscillations in P control loops; you either has little gain and you never quite get to your setpoint, or you have too much gain and you oscillate with over and under shooting. Further, it is my understanding that the only way that the loop's PV will reach an SP and maintain that SP is to add integrator functionality. If you have a PI loop, then once your PV reaches the SP the loop maintains the output that got you there. Finally, if your system is sluggish in responding, the integrator will "wind up" and add output to get your PV moving, whereas a P controller's output is simply proportional to your error, and will happily sit at an output all day long even if it isn't moving and won't change, whereas the PI will increase output until maxed out until your PV starts moving.
My co-worker believes, conversely, that a P loop will maintain an output once a setpoint is reached and that adding the integrator is to add accuracy in maintaining the output, the last 5% of getting the PV to equal the SP, in other words.
The reason my co-worker believes this is that the equation for the PID loop we're discussing takes into account the previous cycle's output, shown here:
He interprets this equation to mean that when there is zero error, the output is equal to the previous output and therefore the loop will maintain that output. I believe that the previous values are simply the previous cycle's values (you see that the D portion uses n-1 & n-2, which makes me think the previous two cycles) and that this actually proves me point; the output isn't going to maintain because it's simply the last cycle's output, not the starting point.
He's since left the office and I've manually calculated several scans of the equation above, and see the output dropping as the PV increases with the output reaching zero when PV = SP. I feel fairly confident in my understanding of the differences between P and PI loops, and I think my math checks out and proves it, but I'd like to hear what you guys have to say to see if my understanding is correct or if I'm mistaken. If nothing else this has been a good challenge to my understanding of P/PI/PID loops and will help me tune loops in the near future.
Thanks!
I got into a discussion with a co-worker about P and PI loop behavior. I am hoping that someone can confirm the proper way to describe the differences so that we can put the issue to bed, haha. This would also help me immensely in understanding PID loop control and tuning. I've tried Google for good explanations but I keep finding examples that don't really translate well to my situation (car steering/cruise control are what I typically find, which aren't going to work in this situation).
Let's say you have a PID loop that controls pump speed to maintain system pressure. To make the conversation less "hypothetical", let's say the loop controls pump speed (output is 0-100), and the process variable is water pressure (0-150 PSI); the setpoint is 50 PSI.
For the first experiment, you use only proportional gain; no integral or derivative functionality.
My belief is that a loop using only proportional gain will cause the output to be solely reliant on the error and the proportional gain; in other words:
Code:
Output = Kp*(SP-PV)
My co-worker believes, conversely, that a P loop will maintain an output once a setpoint is reached and that adding the integrator is to add accuracy in maintaining the output, the last 5% of getting the PV to equal the SP, in other words.
The reason my co-worker believes this is that the equation for the PID loop we're discussing takes into account the previous cycle's output, shown here:
He interprets this equation to mean that when there is zero error, the output is equal to the previous output and therefore the loop will maintain that output. I believe that the previous values are simply the previous cycle's values (you see that the D portion uses n-1 & n-2, which makes me think the previous two cycles) and that this actually proves me point; the output isn't going to maintain because it's simply the last cycle's output, not the starting point.
He's since left the office and I've manually calculated several scans of the equation above, and see the output dropping as the PV increases with the output reaching zero when PV = SP. I feel fairly confident in my understanding of the differences between P and PI loops, and I think my math checks out and proves it, but I'd like to hear what you guys have to say to see if my understanding is correct or if I'm mistaken. If nothing else this has been a good challenge to my understanding of P/PI/PID loops and will help me tune loops in the near future.
Thanks!
Last edited: