## 5 Controller Packet Loss Compensation
### Adaptive Digital PID-Like Control Law  
As mentioned, with knowledge of the process parameters, a control law for the identified plant model can be designed. It has been estimated that over 90% of industrial control system implementations worldwide are of the PID-type; in this section, practical details of the application of the buffering method to a simple anti-wind-up digital PID-like controller will be discussed. Consider a digital controller for the plant (1), and assume that \(A(1)\approx 0\). Assume that the closed-loop is required to have dynamics given by:  
\[G_{{}_{CL}}(z)=\frac{D(z)G(z)}{1+D(z)G(z)}=z^{-d}\;\frac{K_{{}_{P}}B(z)}{P(z)} \tag{13}\]  
where \(K_{P}=P(1)/B(1)\) to ensure offset-free control and \(P(z)\) is a stable monic polynomial which forms the design specification, and is typically of first or second order. Observe that the numerator in (13) is a scaled version of the process open-loop numerator; as such there is no cancellation of open loop zeros and the closed loop effectively contains the same delay as the open loop process. Solving expression (13) for the required controller \(D(z)\):  
\[\frac{D(z)G(z)}{1+D(z)G(z)} = z^{-d}\;\frac{K_{{}_{P}}B(z)}{P(z)}\] \[P(z)D(z)G(z) = z^{-d}\;K_{{}_{P}}B(z)(1+D(z)G(z))\] \[= z^{-d}\;K_{{}_{P}}B(z)+z^{-d}\;K_{{}_{P}}B(z)D(z)G(z)\] \[P(z)D(z)G(z)-z^{-d}\;K_{{}_{P}}B(z)D(z)G(z) = z^{-d}\;K_{{}_{P}}B(z)\] \[D(z)(P(z)G(z)-z^{-d}\;K_{{}_{P}}B(z)G(z)) = z^{-d}\;K_{{}_{P}}B(z)\] \[D(z) = \frac{z^{-d}\;K_{{}_{P}}B(z)}{P(z)G(z)-z^{-d}\;K_{{}_{P}}B(z)G(z)}\] \[= \frac{z^{-d}\;K_{{}_{P}}B(z)}{P(z)z^{-d}\;\frac{B(z)}{A(z)}-z^{- d}\;K_{{}_{P}}B(z)z^{-d}\;\frac{B(z)}{A(z)}}{P(z)z^{-d}\;B(z)-z^{-d}\;K_{{}_{P}}B(z)z^{-d}B(z)}\] \[= \frac{K_{{}_{P}}A(z)}{P(z)-z^{-d}\;K_{{}_{P}}\cdot B(z)}\]  
Given the choice of \(K_{P}\), one sees that the controller (14) contains an integrator since \(P(1)-K_{{}_{P}}\;B(1)=0\). In the adaptive design procedure, both \(A(z)\) and \(B(z)\) are estimated directly by RLS as described in Section 4.4 and \(P(z)\) is specified by the designer; hence the controller is trivial to implement as the control gains are very simple functions of the estimated plant parameters and design specification. A typical design specification is to set \(P(z)=1-p_{1}z^{-1}\), _i.e._, a first-order exponential response with parameter \(p_{1}\). When this first-order specification is used with the simple plant Model (12), the classical adaptive controller of [PERSON] and Edgar [30] is recovered. In the controller (14), however, one may actually use any plant model \(G(z)\) and any suitable monic polynomial \(P(z)\). Hence the proposed controller design given by (14) is a generalized form of this adaptive controller. The described approach is an identifier-based Certainty-Equivalence pole-placement design, in which minimum-variance parameter estimates are obtained by RLS and a deterministic Linear Time Invariant (LTI) compensator is designed based upon these estimates [27]. The derivation leading to expression (14) given above ensures that \(D(z)\) gives closed-loop poles located at \(P(z)\). To implement anti-wind up for this controller, assuming that the process actuator has upper and lower amplitude and rate saturation limits denoted as \(u_{max}\), \(u_{min}\), \(\Delta u_{max}\) and \(\Delta u_{min}\) respectively, then the anti-wind-up control law can be implemented as:  
\[\Delta u(k)=sat\{u(k)-u(k-1),u^{-},u^{+}\} \tag{15}\] \[u(k)=u(k-1)+\Delta u(k)\]  
where the unconstrained \(u(k)\) is first computed, \(sat\{\}\) is the usual saturation function and the saturation limits \(u^{+}\) and \(u^{-}\) are taken as:  
\[u^{+}=\min\{u_{\max}-u(k-1),\Delta u_{\max}\} \tag{16}\] \[u^{-}=\max\{u_{\min}-u(k-1),\Delta u_{\min}\}\]