# Commuted PD Controller for Nonlinear Systems: Glucose-Insulin Regulatory Case
## 3 Results
### PID Using Reset Integrator  
As was mentioned in the introduction, we noticed from simulations that strong hypoglycemia occurs during a long period of time when the integral part of the PD controller is considered. In order to complete the study of the proposed switched strategy, we consider now a reset integral part. Hence, defining a commuted PID controller as:  
\[u_{PID}(t)=k_{1}(x_{1}(t)-G_{b})+k_{2}\dot{x}_{1}(t)+k_{3}\int_{0}^{t}(x_{1}( \tau)-G_{b})d\tau. \tag{29}\]  
That is, control (8) is now modified by the integral part with parameter \(k_{3}\). This term accounts for past values of the error between the desired glucose concentration \(G_{b}\) and the actual glucose blood level. The limitations of the linear integrator can be faced using a reset integrator, also named as Clegg integrator [26]. This integrator resets its output  
Figure 6: Commuted PD controller (9) and (10), under external perturbation (20). Notice that the glucose ingestion suggested is small compared with the glucose blood concentration. (**a**) Patient 1. (**b**) Patient 2. (**c**) Patient 3.  
Figure 7: Simulations of closed-loop system with commuted PD controller (9) and (10) when dynamical changes on the glucose assimilation are considered (27) and (28). Two comparative situations: (**a**) with \(w(t)=0\) and (**b**) under external perturbation (20). The behavior is similar to commuted model (5), as Figures 2b and 5a show. (**a**) Unperturbed modified system (27) and (28). (**b**) Perturbed modified system (27) and (28) with \(w(t)\
eq 0\) (20).  
to zero whenever its input and output have different signs [27; 28]. Due to this resetting condition, the transient response of the controller can be arranged. Figure 8 captures the Matlab Simulink model used to compute the numerical simulation experiments. Based on Clegg integrator [26], we define a reset integrator block by taking into account that we need to integrate the error and to vanish it. Then, from Figure 8, we set:  
* Clegg integrator input. The error between glucose blood concentration \(x_{1}(t)\) and the nominal value \(G_{\text{b}}\).
* Clegg integrator initial condition. After each reset to the Clegg integrator, an initial condition is needed to integrate each resetting action. We use the zero initial condition setting.
* Clegg integrator resetting actions. The block can reset its state to the specified initial condition based on an external signal. We choose to reset the integrator when the sinus function changes its sign.
* Clegg integrator gain. The parameter \(k_{3}=0.1\) is found by the trial and error method.  
Figure 9 shows the behavior of the commuted PID controller (29), where the rise time is reduced to 10 min approximately. But the controller presents chattering in all cases (we picture Patient 1 in Figure 9 as an example), and the insulin injection rate is increased.  
Figure 8: Matlab Simulink diagram block model used to study the behavior of the proposed control strategy to our pancreatic plant, considering reset integrator (29). When \(k_{3}=0\), we obtain the commuted PD controller (9) and (10). As a resetting signal, we use a sinusoidal function \(r(t)=\sin(t)\), and zero initial condition.  
Figure 9: Simulations of closed-loop system with external perturbation (20), using PID with reset integrator (29). The rise time is reduced to 10 min approximately compared to Figure 5a, but the control laws present chattering. (**a**) Commented PID—External Perturbation \(w(t)\) (20). (**b**) Commented PID controller (9) and (10) using (29), for Patient 1.