OptoBlog

To use a PID or not

Posted by Ben Orchard on Jul 22, 2015 12:26:00 PM

Loop the loop.

PID loops are used in a lot of different applications, and for good reason: they help keep our world under control. If you need to control a process temperature or pressure, you probably are going to use a PID loop. But are they always the right solution?

Ultra quick review; a proportional-integral-derivative control loop (or PID controller) compares a setpoint against a measured input value, and depending on the error, changes a control variable (output). It’s all about math. A PID loop is all about running a mathematical formula over and over at a specific rate.

The most common example of a PID loop that I often talk about in our monthly training class is the cruise control on a car. The speed of the car is the input, the accelerator is the output and the setpoint is what speed the car is doing the moment the driver presses the “set” button.

PID loops are so useful that sometimes we too quickly decide to use a one in a process when it may not be the best solution to the problem. In this week’s blog we are going to take a look at one instance where use of a PID loop may not be the best tool for the job.

Startup and/or shutdown.

The main situation that has caused me to question using a PID loop controller is during a process startup or shutdown. At those times the process is not in a steady state and so it has a very different control requirement. Trying to use the same PID loop settings in this stage of the process as when it is up and running could lead to a lot of frustration.

As I see it, there are two main ways to approach this scenario: you can continually change the PID values to match the process as it ramps up and down, or you can switch the loop into manual and programmatically nurse the output through the required sequence.

How do you decide which is the best approach? The way I chose is to understand the speed of the startup/shutdown procedure.

Some startup/shutdown sequences are very linear or simply require a stepped output. Some have lots of time built into them; they could be in the range of minutes or even hours. In these cases you might find better control is obtained by ramping the controlled output. Look and see if your control system supports a command like “Ramp Analog Output”. This approach can be very effective if your output is linear.

rampingPID_faststart

Once the process has reached its steady state, switch the PID loop controller to auto, and let it take care of it from there. (After you tune it, of course--a blog topic for another day!).

What if your output is not linear? What if you need to maintain a profile curve (or a straight line) while in the startup/shutdown phase of the process? In this case, programmatically changing the PID values during the dynamic part of the process might be required.

rampingPID_slowstart


This was the situation I found myself in back at the hospital. We had a pretty dynamic output (a steam plate heat exchanger) but a very slow startup was required, so I chose to programmatically use different P, I, D and setpoint values every hour and thus allow the PID to control the output over the startup phase of the process. What I did in effect was to use a PID loop controller to ramp the process input to its final setpoint over a period of 3 days.


Occam’s Razor.

PIDs can be complex. A simple web search will show hundreds of results on how to work with and tune PID loops. They are a critical part of the industrial control toolbox, but I think it is worth taking a moment to step back and decide whether a loop is the right way to get the job done.

Occam’s razor sums it up beautifully (and yeah, I’m massively paraphrasing here): if there are two solutions to get the job done, one complex and one simple, then choose the simple one--the one with fewer assumptions. Using a PID control loop assumes a great many things. While it is often the right tool to get things under control, it’s not always the only option. Sometimes some simple code will get things under control just as adequately.

Taking a moment to understand the full cycle of the process is the key.


Till next week, Cheers Mate.

(For more information on implementing PID loops and tuning them, check out our PID info page).

 

Topics: Process control, PLCs, Remote monitoring, Tips, IoT, PACs, I/O

Written by Ben Orchard

Subscribe to Email Updates

Recent Posts

Posts by Topic

see all