# Commuted PD Controller for Nonlinear Systems: Glucose-Insulin Regulatory Case
## 2 Materials and Methods
### Commuted PD Control  
The control objective is to stabilize the glucose blood concentration around the nominal value \(G_{b}\). First, we deal with the following PD control law:  
\[u_{PD}(t)=k_{1}(x_{1}(t)-G_{b})+k_{2}\dot{x}_{1}(t)\, \tag{8}\]  
where control parameters \(k_{1}\) and \(k_{2}\) must be tuned off-line. As is well known, the PD control compares the measured variable with a reference value and tries to converge to the desired set point. In our case, the physiologic meaning of this control is to reach the glucose blood concentration reference \(G_{b}\) with minimal delay and overshoot. Once we have determined their nominal values, we have to implement the combined strategy to face hypo- and hyperglycemia states. The purpose is to reduce the time that the patient suffers from these unhealthy states. In this section, we do not consider the integrator term of the classical PID controller. As mentioned in [13], the integral action can be neglected in front of the proportional and derivative ones. But to obtain a more complete study, we deal with a PID version in Section 3.4. Also, from simulation experiments, we notice that strong hypoglycemia occurs during a long time period of PID control action. To mitigate the strong effect of insulin, we propose to administrate a slight dose of glucose. The control action must be present in glucose dynamics (5) and in insulin dynamics (7) too. To identify when the patient is in a critical situation, we test if the glucose blood concentration \(x_{1}(t)\) is in a healthy range 60-110 mg/dL. In fact, from the literature, this range can be larger, such as 50-120 mg/dL [4]. The idea of the switched strategy is as follows:  
* _Hyperglycemia_: to decrease the glucose blood concentration, an insulin injection is needed, in terms of the PD controller. In system Equation (7), the control \(u(t)\) is: \[u(t)=\left\{ \begin{array}{ll}u_{PD}(t)&x_{1}(t)>x_{1_{H}}\\ 0&\text{otherwise.}\end{array} \right.\] (9) This administration has to be always positive. The control designer has to decide when this control is activated, in terms of critical glucose blood concentration value \(x_{1_{H}}\). * _Hypoglycemia_: to increment the glucose blood concentration, ingestion is necessary. In System Equation (5), the control \(u_{g}(t)\) is: \[u_{g}(t)=\left\{ \begin{array}{ll}-u_{PD}(t)&x_{1}(t)<x_{1_{h}}\\ 0&\text{otherwise.}\end{array} \right.\] (10) Due to the dynamic of glucose blood concentration (5), the control law tries to increment the velocity of glucose blood absorption. The control designer has to decide when this control is activated, in terms of critical blood glucose concentration value \(x_{1_{h}}\). We will call this control strategy the commuted PD controller. This is because we combine insulin and glucose administration following a switched decision rule. The design parameters \(x_{1_{H}}\) and \(x_{1_{h}}\) can be off-line determined to ensure the activation when hypoglycemia occurs (we do not have \(x_{3}(t)\) measurements to obtain an adjusted running of this value). In our case, we set \(x_{1_{H}}=110\) and \(x_{1_{h}}=60\) to meet the given healthy range. We now discuss why a combined strategy is desirable. First, a PD controller was considered, but simulations show that the insulin infusion rate is greater than its basal value leading to hypoglycemia during a long period of time of control activation. To improve the controller performance, and if possible to not fall into hypoglycemia, one option is to tune the controller's parameters. Additionally, we decide to restrict the action of insulin administration only when hyperglycemia is really happening. In this case, with control laws \(\{u=u_{PD},u_{g}=0\}\), the controlled artificial pancreas will try to minimize the error between the measured glucose blood concentration \(x_{1}(t)\) and the basal concentration \(G_{b}\). Then, when the glucose blood concentration of the patient is in a healthy range, no control action is required \(\{u=0,u_{g}=0\}\).