3

Confusion in PID loop for the case of zero error?

Above is the link of question that answers my query to some extent but i have confusion regarding output of derivative block

I understood that output of integral block will be zero because here zero is multiplied with gain Kp and output of integral block will be some constant because integral of zero is some constant ,but what about output of derivative block?and what will be reason for that output(If non zero output)? Apparently it seems that output of derivative block will also be zero since mathematically derivative of zero is also zero

yoyo
  • 31
  • 1
  • 2
    Derivative of a constant zero signal is zero and so derivative block output will be zero – AJN Oct 09 '21 at 06:35
  • The integrator gives information about the history of the error signal (it works out the area under the error graph up to the current time); the proportional gain gives information about the current instantaneous value of the error signal; and the differentiator predicts what the error signal value will be at a future time. – Chu Oct 09 '21 at 08:46

2 Answers2

4

The value of the error at a given point of time does not really give you insight into the derivative.

If the error is constant with time (and is zero, or something other than zero) then the derivative with respect to time is zero.

If it happens to be crossing zero at a given time the derivative will depend on the rate of change of the error, and could be positive or negative.

In a real controller there may also be noise, which can be a particular issue with the derivative term.

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
3

I have explained operation of a PI controller in my answer to Understanding the flow of a PI Controller?. You might find it useful to read that as it gives a simple example of what happens the P and I terms in a cruise control system.

enter image description here

*Figure 1. The classic PID control function. Source: Wikipedia - PID controller.

I mentioned in my linked answer that it had dawned on me rather late in life that as the integral action corrects the output the error falls to zero so the contribution of the proportional control also falls to zero. The output when the error is zero is maintained purely by the integral action.

I understood that output of integral block will be zero ...

No, it won't. The output of the integral block will be KP times the arithmetic sum of all the errors since the system was started. (There may be an anti-windup feature to limit the maximum integral error.)

... but what about output of derivative block?and what will be reason for that output(If non zero output)? Apparently it seems that output of derivative block will also be zero since mathematically derivative of zero is also zero.

The derivate output is proportional to the rate of change of the error. In my cruise control example this value will be non-zero if the set point suddenly changes (you bump the setpoint up or down 10 kph) or the vehicle's velocity changes due to a change in the road's slope. The system then reacts much more quickly than it would if waiting for PI control only.

Transistor
  • 168,990
  • 12
  • 186
  • 385
  • This is not a criticism just a request for clarification. Should not the \$K_d\$ parameter's sign be negative so that if the error rate was high and positive, the derivative part of the PID would slow down the action of moving in the wrong direction too quickly. This was what I was taught many years ago but, like I said (or implied) calling it \$K_d\$ (in your picture) does not mean it's wrong rather, it's just less-helpful to someone trying to understand PID controllers. – Andy aka Oct 09 '21 at 08:53
  • @Andyaka, I was never taught this stuff and I didn't pay much attention to the signs while writing the original answer. Let's see: the error signal will be positive if setpoint > actual; if the \$ \frac {de}{dt} \$ is positive it means the error is increasing (my cruise control car is slowing down); the positive \$K_d\$ will increase the output giving a positive kick to the throttle. I think that's what's needed, isn't it? – Transistor Oct 09 '21 at 09:15
  • Rethink: if setpoint is greater than actual then, we can presume that the "actual" is moving towards the setpoint hence the error is reducing but, the rate at which the error is reducing might be constant or, it might be.... I'm getting in a muddle now so I'll simulate something I think because me brain is not working properly this morning!! – Andy aka Oct 09 '21 at 10:16
  • @Andy, knock the cruise control on your car up 10 or 20% and feel the D kick. "*... we can presume that the "actual" is moving towards the setpoint hence the error is reducing ...*" Not at the instant of setpoint change. There will be a big positive change between this error calc and the previous one. – Transistor Oct 09 '21 at 10:29
  • No problem, just my brain not doing what it should do. – Andy aka Oct 09 '21 at 10:50
  • The derivative on setpoint change is a well known problem in PID controllers. This is often solved by taking the derivative of the pv instead of the error or by resetting the controller on setpoint change. Either way, in my experience, the derivative action you describe is specifically avoided and not desirable. – Joel Keene Oct 09 '21 at 22:44
  • The derivative should counteract the proportional gain, to stop it from overshooting. For many controllers this isn't helpful, mainly for controllers where there is a long delay between actuator and feedback is it useful. – Joel Keene Oct 09 '21 at 22:53