None Notebook

This notebook contains material from CBE30338; content is available on Github.

< 5.3 Creating Bode Plots | Contents | Tag Index | 5.5 Baroreflex as a Linear Control System >

Open in Colab

Download

5.4 Controller Tuning Rules in Frequency Domain

Demonstrate the use of a Bode plot for controller tuning. The notebook uses the Python Control Systems Library.

5.4.1 Closed-Loop Transfer Functions

5.4.1.1 Process Transfer Functions

The process output $y$ is modeled as the output of a linear system described by the transfer function

$$y = G_p(s)G_v(s) u + G_d(s) d$$

where $G_p(s)$ is the process response to a manipulated variable, $G_v(s)$ is the transfer function of the actuator dynamics, and $G_d(s)$ is process response to a disturbance. The measured process output is given by

$$y_m = G_m(s) y$$

where $G_m(s)$ is the sensor transfer function. We assume the sensor has unit gain, i.e., $G_m(0) = 1$

5.4.1.2 Control Transfer Functions

The controller generates a command $u$ in response to the reference input $r$ and measured process output $y_m$. This is modeled as

$$u = G_r(s)r - G_y(s)y_m$$

where $G_r(s)$ and $G_y(s)$ are the controller transfer functions. Textbook simulations often set $G_r(s) = G_y(s)$ for PID control. In practice, however, it is generally desireable to avoid excessive action in response to setpoint changes, so generally $G_r \neq G_y$.

Below we employ a parallel implementation of PID control for output feedback where

$$G_y(s) = K_p\left[ 1 + \frac{1}{\tau_Is} + \frac{\tau_D s}{\alpha\tau_Ds + 1}\right]$$

where parameter $\alpha$ limits excessive derivative action. Typical values of $\alpha$ are in the range 0.2 to 0.1.

For the reference signal, $G_r(s)$ has the same general form but with additional parameters $\beta$ and $\gamma$

$$G_r(s) = K_p\left[ \beta + \frac{1}{\tau_Is} + \gamma\frac{\tau_D s}{\alpha\tau_Ds + 1}\right]$$

Commonly $\gamma = 0$ to avoid derivative action on the reference signal. Parameter $\beta$ is typically set to a value $0\leq\beta\leq 1$ that balances prompt response to a setpoint against undue 'kicks' caused by sudden changes in setpoint.

5.4.1.3 Closed Loop Transfer Functions

The overall response of the closed-loop system is characterized by a set of four transfer functions relating the reference and disturbance inputs to the process output $y$ and the control command $u$.

$$\begin{align*} y & = H_{yr}(s)r + H_{yd}(s)d \\ u & = H_{ur}(s)r + H_{ud}(s)d \end{align*} $$

The closed-loop transfer functions are given explicitly as

$$H_{yr} = \frac{G_pG_vG_r}{1 + G_pG_vG_yG_m}$$$$H_{yd} = \frac{G_d}{1 + G_pG_vG_yG_m}$$$$H_{ur} = \frac{G_r}{1 + G_yG_mG_pG_v}$$$$H_{ud} = -\frac{G_yG_mG_d}{1 + G_yG_mG_pG_v}$$

where the argument $s$ has been suppressed for brevity.

5.4.2 Example

We'll assume a process transfer function with time delay

$$G_p(s) = \frac{0.2}{s^2 + 1.5 s + 1}$$

and a disturbance response

$$G_d(s) = \frac{1}{s + 1}$$

and a measurement transfer function

$$G_m(s) = e^{-s}$$

We'll assume the dynamics of the actuator are negligible such that $G_v(s) = 1$.

The Python Control Systems Library does not provide a specific representation for time delay. It does, however, provide a function pade for creating Pade approximations to time delay systems.

5.4.2.1 Entering Process Transfer Functions

5.4.2.2 Finding Cross-Over Frequency and Gain at Cross-Over

5.4.2.3 Computing Ultimate Gain and Period

The conventional tuning rules for process control are written in terms of an ultimate gain $K_{cu}$ and ultimate period $P_u$. These are the values obtained by an experiment or calculation where the gain of a proportional only controller is increased until a steady closed-loop oscillation is first observed. The corresponding proportional gain is $K_{cu}$, and the period of oscillation is $P_u$.

These values may be computed from a Bode plot. The ultimate period corresponds to

$$P_u = \frac{2\pi}{\omega_c}$$

where $\omega_c$ is the cross-over frequency. The ultimate gain is then

$$K_{cu} = \frac{1}{G_p(\omega_c)}$$

where $G_p(\omega_c)$ is the open-loop process gain at the cross-over frequency.

5.4.3 Ziegler-Nichols Tuning Rules

Control $K_p$ $\tau_I$ $\tau_D$
P $0.5K_{cu}$ $-$ $-$
PI $0.45K_{cu}$ $\frac{P_u}{1.2}$ $-$
PID $0.6K_{cu}$ $\frac{P_u}{2}$ $\frac{P_u}{8}$

5.4.3.1 Interactive Tuning of a PID Controller

The following cell is initiated with the Ziegler-Nichols tuning for PID control. Interactive sliders can be adjusted to tune the controller for acceptable response.

< 5.3 Creating Bode Plots | Contents | Tag Index | 5.5 Baroreflex as a Linear Control System >

Open in Colab

Download