Derivative Action: Handle With Care

In the previous lesson we saw how PI Control can give us great control of a process despite disturbances atacking from all angles.

This final lesson talks about how Derivative Action can be added to PI to get even better performance from our loops.

Imagine you are back in your car. You are in a rush to get back home before the football starts. So you put your foot down.

After a while you need to change lanes again to pass some slow-coach. You move your wheels to the pre-set angle that worked so well earlier.

However, because you are going faster, you start to move across the lane quicker. You end up overshooting the target lane and have to turn the wheels in the other direction to get back on track.

You get into the target lane eventually, after correcting your oversteer, but the maneuver wasn’t as slick as you had come to expect.

Now, imagine if, immediately after you had turned the wheels, the car had (Knight Rider style) worked out that you were moving across the lanes a bit too fast and that at this rate you would overshoot the target unless the angle was reduced. Imagine if the car had then taken it upon itself to correct your steering angle, reducing it so that you had minimal, if any, overshoot.

Well that’s the idea behind Derivative action. As you might have guessed, derivative action uses the rate-of-change of the error to calculate its contribution to the controller output. So let’s think through how that actually works in the above example.

When the steering wheel is turned, the position-error of the car starts to reduce rather quickly as you get closer to the target lane. In other words, the rate of change of the error is large and negative. This manifests itself as a negative derivative action, which works to reduce the steering angle which in turn will reduce the overshoot. The trick, of course is to have just enough D to remove the overshoot (and that’s where proper tuning comes in – trial and error just doesn’t cut it).

So adding derivative action can allow you to have bigger P and I gains and still keep the loop stable, giving you a faster response and better loop performance.

If you think about it, Derivative action improves the controller action because it predicts what is yet to happen by projecting the current rate of change into the future. This means that it is not using the current measured value, but a future measured value.

The units used for derivative action describe how far into the future you want to look. i.e. If derivative action is 20 seconds, the derivative term will project the current rate of change 20 seconds into the future.

The big problem with D control is that if you have noise on your signal (which looks like a bunch of spikes with steep sides) this confuses the hell out of the algorithm. It looks at the slope of the noise-spike and thinks:

“Holy crap! This process is changing quickly, lets pile on the D Action!!!”

And your control output jumps all over the place, messing up your control.

Of course you can try and filter the noise out, but my advice is that, unless PI control is really slow (even after tuning with the blueprint), don’t worry about switching D on.

Summing it all up

The Proportional action of a PID controller, simply gives you a controller output that is proportional to the instantaneous error. It will always leave you with a “steady state error” if there are disturbances in your system. In other words if there are changing disturbances and you only have Proportional control, you will never get to your setpoint.

To remove this steady state error we can use Integral action, which keeps adding (integrating) all the values of the error over time to the controller output allowing it to overcome those pesky disturbances.

Derivative action allows us to have bigger P and I actions and still keep the loop stable. It does this by looking at the rate of change of the error and pulling the controller action back if it can see that this rate of change will overshoot the setpoint in the near future. The result (if carefully tuned) is a faster, better performing control loop. However noise on the measurement signal makes Derivative action very difficult to get right.

So now, hopefully, you understand exactly how and why a PID controller does its thang.

The next step to mastering PID Control is to learn the very valuable skill of PID Tuning. Very few engineers actually understand how to tune a PID loop properly.

But don't just take my word for it: An Atricle in Control Engineering Magazine (Jan '09) says:

"there is a dearth of personnel having sufficient know-how to tune and optimize a PID loop"

If you would like to learn how to tune a PID loop, may I humbly suggest that you consider my PID Tuning Blueprint. Master this PID Tuning Process and you can be one of those rare breed of engineers who can confidently tune a PID loop for maximum performance first time, every time.

I'll Give You All The Tools And Training You Need To Tune Your PID Loop - From Just $97

Click Here to Order

“Its power and utility is embedded in its simplicity.

Your Blueprint launched our process from ‘expect the worst, but hope for the best’ process to one that is reliable and predictable. ”

Anthony Keefe
Michigan, USA

Click Here to Learn More...