As described in the first part of this blog series, the ubiquitous PID is applied to nearly every sort of closed-loop control problem – many times by default. That previous post also described some of the unstated expectations baked into the PID algorithm, which can become obstacles to proper operation and tuning. It also discussed a solution for the common variant of non-linear response. However, the issues impeding optimal tuning are sometimes more complex, and require a more-involved strategy for taming a less-than-ideal control loop.
Problems like outside disturbances and multi-variable effects will also confound tuning efforts, and the quest for uncomplicated solutions has led to development of some useful variations of PID control that fall into the category of advanced regulatory control. In this second part of the blog series, I will describe a simple approach for addressing upsets by supplementing the PID’s feedback control with feed-forward action.
Simple model-predictive algorithms can be used with PIDs
Returning to the previously mentioned expectation of direct control, a PID assumes that all changes in the process variable (PV) are a direct result of its own control action. Process disturbances are a clear and common exception to that premise. Disturbances are generally a result of some upstream event or contributing effect from some variable other than the PV. When a disturbance occurs, the PID is effectively blind-sided and must adapt to the error as if the setpoint had changed.
So long as the dynamics of the disturbance are slower than the system’s response, order can eventually be reclaimed. There are cases, however, where disturbance dynamics exceed the ability of the PID to “fix” the problem – resulting in out-of-control excursions of the PV. Depending on timing, the normal response of the PID can even enhance the disturbance – leading to more serious complications. To counteract these effects, something must be done to predict the disturbance and act appropriately – independent of the PID’s normal ability to respond.
Multiple input systems
Another case where PID control falls short is with systems containing multiple drivers. A dominant driver can usually be handled adequately by the PID, but when another variable affecting the PV becomes significant, the PIDs will be limited in its ability to compensate. This is particularly true when the secondary effect has no interaction with the primary one. As with disturbances, the rapid and unexpected action of secondary drivers will cause undesired consequences which are not effectively counteracted by the PID.
When the trigger event or variable associated with a disturbance or alternate driver are understood and measurable, a corrective action can be implemented through the PID by means of feed-forward. Unlike the normal inherent feed-back control of a PID (driven by error), feed-forward can compensate for a system change before an error is detected. This is a highly desirable attribute, but is only achievable through accurate modeling.
The model which drives the feed-forward value can be calculation-based for simple systems where the chemistry or physics principals driving the system are well known and based on measurable variables. When the process effects are not easily modeled with formulas, it is still possible to rely on empirical data. This approach can be more limited, however, since data must be collected across the full range of possible conditions – and with enough samples to be statistically valid. When a data-driven model is achievable, combining it with the simple strapping table function described in Part 1 can serve as a low-cost model-predictive control.
When a model can be developed that closely matches a system’s real response, feed-forward control can actually be more desirable than feedback – resulting in faster response with less error. In reality, though, models are rarely accurate enough to precisely control systems without some measure of feed-back action. Ultimately, some appropriate mix of the feedforward and feedback actions will produce the best compromise, and can be accomplished without a lot of complicated coding.
Simple enhancements like those described both here and in Part 1 can expand the range of applicability for the already ubiquitous PID controller. Even when faced with deviation from the assumed ideal of linear first-order response and unfettered control over the process, this simple algorithm can be effectively applied to all but the most complicated of processes. As described in Part 1, non-linear response can be fixed by an external compensator.
Now this second post in the blog series has described how for many scenarios involving multiple variables or independent disturbances, simple model-predictive techniques can be combined with the feedforward capability of most standard PID functions to achieve a highly-satisfying result. Best of all, when paired with off-the-shelf software components from mainstream vendors, a high kudos-to-effort ratio can also be achieved.