None Notebook

This notebook contains material from cbe30338-2021; content is available on Github.

< 6.2 Simulation and Open-Loop Optimal Control | Contents | Tag Index | 6.4 Implementing Predictive Control >

Open in Colab

Download

6.3 Predictive Control

6.3.1 Model

We will use the two-state model for a single heater/sensor assembly for the calculations that follow.

\begin{align} C^H_p\frac{dT_{H,1}}{dt} & = U_a(T_{amb} - T_{H,1}) + U_b(T_{S,1} - T_{H,1}) + \alpha P_1 u_1\\ C^S_p\frac{dT_{S,1}}{dt} & = U_b(T_{H,1} - T_{S,1}) \end{align}

The model is recast into linear state space form as

\begin{align} \frac{dx}{dt} & = A x + B_u u + B_d d \\ y & = C x \end{align}

where

$$x = \begin{bmatrix} T_{H,1} \\ T_{S,1} \end{bmatrix} \qquad u = \begin{bmatrix} u_1 \end{bmatrix} \qquad d = \begin{bmatrix} T_{amb} \end{bmatrix} \qquad y = \begin{bmatrix} T_{S,1} \end{bmatrix}$$

and

$$A = \begin{bmatrix} -\frac{U_a+U_b}{C^H_p} & \frac{U_b}{C^H_p} \\ \frac{U_b}{C^S_p} & -\frac{U_b}{C^S_p} \end{bmatrix} \qquad B_u = \begin{bmatrix} \frac{\alpha P_1}{C^H_p} \\ 0 \end{bmatrix} \qquad B_d = \begin{bmatrix} \frac{U_a}{C_p^H} \\ 0 \end{bmatrix} \qquad C = \begin{bmatrix} 0 & 1 \end{bmatrix}$$

6.3.1 Feedforward Optimal Control

An optimal control policy minimizes the differences

\begin{align*} \min_{u} \int_{t_0}^{t_f} \|T_H^{SP}(t) - T_H(t)\|^2\,dt \\ \end{align*}

subject to constraints

\begin{align*} C_p^H \frac{dT_H}{dt} & = U_a (T_{amb} - T_H) + U_c (T_S - T_H) + P u(t) + d(t)\\ C_p^S \frac{dT_S}{dt} & = - U_c (T_S - T_H) \end{align*}

initial conditions

\begin{align*} T_H(t_0) & = T_{amb} \\ T_S(t_0) & = T_{amb} \end{align*}

and prior knowledge of $d(t)$.

6.3.2 Assumptions for Predictive Control

6.3.3 TCLab Event Loop

Borrowing from notebook 4.6.

6.3.4 What we need our predictive controller to do ...

What information do you need to compute the control policy $u(t)$?

Now write a function that computes a control policy given tstep, d, x, and SP

< 6.2 Simulation and Open-Loop Optimal Control | Contents | Tag Index | 6.4 Implementing Predictive Control >

Open in Colab

Download