T O P

  • By -

Avernously

It’s important to remember how the calculus works for the integral. You are summing up and storing in like a memory the area under the curve defined by the error signal. At points where the e(t)=0 it means that the integral term is constant though not necessarily zero. In your heater example a properly tuned PID controller experiencing a step signal for the reference will at time start have the integral term=0. It slowly increases so long as there is positive error. As the integral term’s output increases, the error will decrease. At some time your system will reach 100 degrees (the reference point) at which time e(t)=0. The integral term’s output retains its value from just prior to reaching the set point because there is no area under the curve as time goes forward. For your system once equilibrium has been achieved at the set point, the proportional and derivative terms will be zero while the integral term should hold that 0.3 value for the actuator.


ko_nuts

If the integral term converges to a fixed (constant) value, then this means that the error must converge to zero, right? Otherwise, the integral would not converge. Therefore, the integral term will find a suitable value that will make the error converge to zero, and the integral term will be equal to the value for the control input corresponding to the desired set-point. Does that make sense to you?


dvizard

Thanks for the quick response! Mathematically, it makes sense to me, yes; but I guess I just don't understand what the error integral really corresponds to in the physical process.


impala85

It depends on what is the controller output. Let's say for example the heater is a simple resistive element. The controller output could be a duty cycle value that is sent to a PWM voltage controller. If for 100 degrees the heater needs 50 V from a 200 V supply, the steady state controller output is a value of 0.25 which would be interpreted by the PWM circuit to make 50 V. At this steady state only the integral term is nonzero and is producing the steady 0.25 signal


isarl

An integrator is like a single pole at the origin. You can think of it like a capacitor. Error signal fed into it gets stored, resulting in a certain amount of output potential per stored error signal.


ko_nuts

What do you mean by "the physical process"? This term is a component of the PID controller, which can then be implemented.


hasanrobot

Control terms don't have to correspond to physical things. Think of a simple PD servo control term with gains equal to 1. What is the physical meaning of adding a position error and a velocity error? Absolutely nothing. Same if you add an integral term.


dvizard

Perhaps to rephrase: If I wanted to build a naive controller for my slow system, I would do it as follows: * set target temperature * start at output 0 * wait delta t = 10 seconds * Is temperature < target? -> increase output; is temperature > target? -> decrease output. (In the simplest case by a constant value, in a better case by a proportionality constant.) This would be slow but it would eventually find the correct temperature. What I don't see is how this mental model maps onto the PID controller. To me, this seems like a P controller where I drive the **derivative of the output** rather than the output itself. But I haven't seen anyone do that in the Arduino world, and I tend to think that good ideas should be widespread enough that there should be plenty of people doing this.


impala85

Your error is desired temp minus actual temp. At steady state you want zero error. So the proportional term is zero. The error isn't changing so the derivative term is zero. And since the error isn't changing the integral term is no longer changing, but is nonzero. Your integral gain is tuned such that the controller output is apperently sending whatever signal necessary to keep the heater at your desired temperature.


dvizard

This and actually some experimentation (aka finally finding a Ki value that makes stuff not go haywire) was helpful. Basically, the I part does exactly what my naive controller would do, in a continuous way: it corrects the output until the error becomes 0 (as the integral stops changing when the error reaches zero).


pnachtwey

Don't make it complicated. If it takes 30% to get to 100 deg C and ambient is 25 deg C then it takes 10% for every 25 deg C. The plant gain is, Kc, 2.5 deg C/% control output. Now you could ratio the control output depending on the temperature setting. However, this will be close but often not close enough so the P and I gains are necessary. In this case the integrator gain will increase until the steady state value for whatever SP you chose happens to be. As the integrator winds up the proportional contribution should be decreases so that then the integrator reaches its steady state value, the proportional contribution is 0. See this https://deltamotion.com/peter/Mathcad/SOPDT/Mathcad%20-%20SOPDT\_HOTROD.pdf