1. Introduction
Diabetes (diabetes mellitus) is a chronic disease that affects millions of persons worldwide (see, for instance [
1,
2,
3,
4]). This disease is characterized by inadequate control of the blood glucose concentration in the body, leading to complications such as limb loss, blindness, ischemic heart disease, and end-stage renal disease [
3]. Moreover, for diabetic patients with insulin-dependent diabetes, the glucose–insulin regulatory system can be viewed as a feedback-control example where the blood glucose levels are frequently measured to control it (see, for instance [
2,
5,
6,
7,
8]). Additionally, according to the Diabetes Control and Complications Trial (DCCT), the blood glucose concentration should be within the range of 50–120 mg/dL [
4]. In [
9], the range from 60 mg/dL to 110 mg/dL is considered the normal blood glucose concentration level in humans. Therefore, by correctly applying insulin, this glucose level can be correctly (healthy) manipulated. For reference values, above 120 mg/dL, the state of the patient is known as
hyperglycemia, and below 50 mg/dL, the state is known as
hypoglycemia. Both states are harmful to diabetic patients [
4].
Exogenous factors that can affect glucose include food intake, rate of digestion, exercise, and reproductive state, among others [
2,
4]. Hence, for control performance evaluation, it is also important that the designed controller be robust in front of any real kind of internal or external perturbations.
Figure 1 shows the block diagram of a closed-loop controlled system of diabetic patients using insulin pumps [
4,
6]. In this scheme, the glucose sensor can be embedded under the skin, and the insulin pump can be implanted in the abdomen. So, the control objective consists to keep regulating the glucose level in the body. In this scenario, the patient is said to be under metabolic control. The pump injects insulin through a catheter. The system shown in
Figure 1 can be referred to as an
artificial pancreas because this closed-loop system replaces, in some way, the pancreas activity in controlling the glucose level of the body of a healthy person [
2].
In literature, several approaches have been used to design artificial pancreas. For instance, a robust controller using a higher-order sliding mode control was studied in [
6]. Using optimal H
control theory, an insulin injection control was analyzed in [
5]. And employing a parametric programming approach for the control design was considered in [
4]. On the other hand, in [
10], control algorithms using standard linear control techniques, like the proportional-derivative controller, were studied, as in [
11,
12,
13]. In this paper, the feedback measurement signal was assumed to be available at discrete-time moments which resulted in an interesting and useful technological fact for an artificial pancreas design. In contrast, we claim that no significant benefit is obtained from using a nonlinear model-based control design strategy. For instance, in [
14], an impulsive model predictive control is presented, but the mathematical model has to be linear, and in [
15], miss undertaken internal dynamics. On the other hand, PID controllers in the artificial pancreas have been studied in [
16], but only for hyperglycemic conditions, and in [
17] a PID robust control is presented for the hypoglycemic situation, but both conditions are not studied simultaneously, as in the present work. However, the nonlinear techniques can offer new ways of control implementation that can face some nonlinearities ignored in by the linear controller tools. Some of these nonlinear control design strategies involve sliding mode control [
6,
18], delay control [
19], optimal control [
20], switched LPV control [
21], sub-optimal control [
22], model predictive control [
23], fuzzy control [
24], reinforcement learning [
25], etc. Therefore, the use of these control design tools allows us to innovate new developments for artificial pancreas approaches. Our proposal aims to act upon the control part of an insulin-dependent diabetic system to develop an effective and simple solution to avoid nondesired clinical problems.
The main objective of the present work is to design a robust control for an artificial pancreas to minimize the effect of extreme situations such as hyperglycemia or hypoglycemia. Additionally, we evaluate our artificial pancreas performance under different scenarios. Our control strategy uses a novel switched strategy: when a peak value on glucose blood concentration is detected, the controller tries to minimize its level by injecting insulin into the system, and when the glucose blood concentration is lower than a healthy level, glucose ingestion is administrated by the controller. The objective is to maintain a healthy level of glucose. The control strategy is based on a proportional-derivative (PD) theory, where the input signal is the detected peak value of the blood glucose concentration. The PD controller format is considered due to its simple and easy realization [
11], as pointed out by [
12,
20]. We avoid using the PID controller because its integral action may be useless [
13]. This is also evidenced, in our numerical experiments, noticing that strong hypoglycemia occurs during a long period of time when the integral part is considered. But, in order to complete the study of the proposed switched strategy, a reset integral part is considered, defining a commuted proportional integral derivative (PID) controller. This approach is based on Clegg integrator [
26], where a reset signal is introduced to face the overshoots produced by the integral part of the controller as suggested in [
27,
28].
The rest of the paper is organized as follows. First, the nonlinear mathematical model and the proposed controller are presented in
Section 2. Then,
Section 3 shows the performance of the combined PD controller in different scenarios: with decaying disturbance; with external additive perturbation; and in the presence of dynamical plant changes. Also, in this section, a resetting PID is evaluated to see the undesired chattering effect due to the integral part of the control architecture. Finally,
Section 4 discusses the obtained results, and conclusions are stated in
Section 5.
3. Results
Simulation experiments of our controlled pancreatic model are carried out here, and for different patients shown in
Table 1 [
6] (the value
in Patient 3 denotes a modified value to obtain a notable hyperglycemia case). The total simulation time is over 800 min, and the sample time is set to 2 min, as in [
11]. Although blood glucose uptake presents slow dynamics [
34], we set a sampling time of 2 min to capture the dynamics of the glucose–insulin system without incurring excessive computational overhead. The control parameter values are stated as
and
[
11]. Note that these values verify the stability conditions, as shown in
Appendix A. In [
35], algorithms to tune PD control parameters are presented. Our purpose is to test the switched strategy, not to find the best PD control parameters.
To test the effectiveness of our switched control strategy, different scenarios are considered: commuted controller (
9) and (
10) are compared to the uncontrolled situation, and to system (
1)–(
3) with the classic PD controller
defined in [
11,
13]:
where the control is defined by:
Also, decaying and additive disturbance are considered, all for each patient in
Table 1 [
6].
Figure 2,
Figure 3,
Figure 4,
Figure 5,
Figure 6,
Figure 7,
Figure 8 and
Figure 9 present different scenarios that reinforce our proposal (each one in a different subsection):
Decaying exponential disturbance
(
4): open-loop and closed-loop with commuted PD controller (
Figure 2,
Figure 3 and
Figure 4);
Change in the dynamic Equation (
5), proving the efficiency of our control algorithm against slight modification on glucose assimilation (
Figure 7);
Finally, a reset-PID controller is implemented, showing that despite the rise time being reduced, the control law presents chattering, a nondesired effect for a pancreatic system (
Figure 8 and
Figure 9).
The physiologic meaning of these situations are as follows: the term
D(
t) represents the glucose absorption’s rate; the additive disturbance simulates a nonprogrammed ingestion; the change on the dynamic assimilation smooths the control term; the integral part takes into account the past glucose concentrations. Each figure of glucose blood concentration displays the healthy range 60–110 [
9] to measure the duration of hypo- and hyperglycemia episodes. For each patient, we compute the glucose and insulin blood concentration
and
, respectively, and the control actions
and
(verifying in this case that they are both positive). The simulation results of patients are obtained using the data in
Table 1, with
[
18]. Note that in [
6],
is used. We decided to use a different value of it to be more realistic taking the exogenous factor into account. Also, the pump dynamics have been ignored (for a justification, see [
6]).
3.1. Decaying Exponential Disturbance Simulations
As mentioned previously, the term
(
4) represents the rate at which glucose enters the blood from intestinal absorption following a meal. In oral glucose tests with normal subjects, the aim is for the model to produce the desired effect of the plasma glucose level rising quite rapidly (from the rest level) to a maximum in less than 30 min and then falling to the base level after 2–3 h [
20]. There is some evidence to suggest that the exact form of
for nondiabetics is not important provided the previously stated aim is met. The exponential function adequately models this situation.
Figure 2a pictures the open-loop system response (
1)–(
4) with
.
Figure 2b presents the signal output of the closed-loop system (
2)–(
5) with the commuted PD controls (
9) and (
10) showing the effectiveness of the proposed commuted PD controller. Also, a comparison is presented in
Figure 3, where the behavior of classic PD control [
11] does not perform better than the proposed control strategy. Furthermore, the commuted PD controller stabilizes the blood glucose concentration at the basal value
in the three cases. As
Figure 3 shows, no hypoglycemia is attained when commuted PD control (
9) and (
10) is chosen. That is not the case when
(
10) is not considered, as
behavior shows. In
Figure 3c, considering commuted controller, in just a few minutes, hypoglycemia occurs. Then, the blood glucose concentration is normalized, but the basal glucose concentration is not reached.
Figure 2.
From (
a), we notice that Patient 2 presents strong hypoglycemia (reaching 30 mg/dL), and Patient 3 hyperglycemia (reaching 120 mg/dL). From the closed-loop system (
b), only Patient 3 presents hypoglycemia for one hour approximately, reaching the lowest glucose level 52 mg/dL (considered healthy in [
4]). (
a) Open-loop system (
1)–(
4). (
b) Closed-loop system (
2)–(
5), with control (
9) and (
10).
Figure 2.
From (
a), we notice that Patient 2 presents strong hypoglycemia (reaching 30 mg/dL), and Patient 3 hyperglycemia (reaching 120 mg/dL). From the closed-loop system (
b), only Patient 3 presents hypoglycemia for one hour approximately, reaching the lowest glucose level 52 mg/dL (considered healthy in [
4]). (
a) Open-loop system (
1)–(
4). (
b) Closed-loop system (
2)–(
5), with control (
9) and (
10).
Figure 3.
Closed-loop simulations. Classic model (
16)–(
18) with
(
19) from [
11], is compared to proposed system (
2)–(
5) with commuted PD controller (
9) and (
10). It shows how under the commuted PD controller (
9) and (
10) the glucose blood concentration is stabilized at
. (
a) Patient 1. (
b) Patient 2. (
c) Patient 3.
Figure 3.
Closed-loop simulations. Classic model (
16)–(
18) with
(
19) from [
11], is compared to proposed system (
2)–(
5) with commuted PD controller (
9) and (
10). It shows how under the commuted PD controller (
9) and (
10) the glucose blood concentration is stabilized at
. (
a) Patient 1. (
b) Patient 2. (
c) Patient 3.
Figure 4.
Control input
(
9) and
(
10), with
defined in (
4), for each patient under study. To prevent hypoglycemia, after a few minutes of the end of its injection, glucose ingestion is needed. (
a) Patient 1. (
b) Patient 2. (
c) Patient 3.
Figure 4.
Control input
(
9) and
(
10), with
defined in (
4), for each patient under study. To prevent hypoglycemia, after a few minutes of the end of its injection, glucose ingestion is needed. (
a) Patient 1. (
b) Patient 2. (
c) Patient 3.
Analysing
Figure 4, we see how commuted PD controller works. We comment on the Patient 1 case. During the first minutes after meal ingestion, when
is biggest, the system needs insulin injection to reduce the glucose concentration (graphic of
in
Figure 4a). To normalize its level, glucose ingestion is needed an hour after (graphic of
in
Figure 4a). This is a common situation difficult to deal with. This might indicate that the insulin administration could be too strong for a pancreatic system. To mitigate this effect, we suggest ingesting some controlled quantity of glucose. This is done by
(
10) action. The same can be seen for Patients 2 and 3 given in
Figure 4b and
Figure 4c, respectively.
3.2. External Noise Perturbation
Now, an ingestion is considered an external disturbance. So, an intake meal at 230 min is introduced, after the controller is activated. It corresponds to the case of additive perturbation on (
1) or (
5), and defined as:
where the function
is the well-known Heaviside expression:
Due to the additional glucose ingestion, an additional rate of glucose absorption has to be considered (exponential function in (
20)). Hence, the classic mathematical model of the pancreatic system is given by [
11]:
which, modified to our controlled system, results in:
with
defined in (
9) and
in (
10).
Figure 5 and
Figure 6 present the simulations of Patients 1, 2, and 3 under the commuted PD controller action. In these cases, the commuted PD controller has a good performance, because no hypoglycemia range is attained. Hyperglycemia is attained only during ingestion, as expected.
Figure 5.
Simulations of closed-loop system with external perturbation (
20). The proposed control strategy performs better than PD control
[
11], noticing that glucose ingestion is needed to prevent hypoglycemia episodes. (
a) System (
24)–(
26) with the commuted PD controller (
9) and (
10). (
b) System (
21)–(
23) with the PD controller
(
19) in [
11].
Figure 5.
Simulations of closed-loop system with external perturbation (
20). The proposed control strategy performs better than PD control
[
11], noticing that glucose ingestion is needed to prevent hypoglycemia episodes. (
a) System (
24)–(
26) with the commuted PD controller (
9) and (
10). (
b) System (
21)–(
23) with the PD controller
(
19) in [
11].
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 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.
3.3. Changes on Glucose Assimilation
Consider a more general case to system in (
5), where the dynamic of
is modified using an auxiliary variable
with an stable dynamic (
27) and (
28):
The change on the dynamic assimilation smooths the control term, that is, we consider now that the insulin administration is slowed down, but the total level administration does not change. We set
.
Figure 7 presents the simulations, where it can be noticed that its behavior is similar to (
5). So, we can conclude that our control algorithm is robust against changes in patient dynamics for glucose assimilation.
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
and (
b) under external perturbation (
20). The behavior is similar to commuted model (
5), as
Figure 2b and
Figure 5a show. (
a) Unperturbed modified system (
27) and (
28). (
b) Perturbed modified system (
27) and (
28) with
(
20).
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
and (
b) under external perturbation (
20). The behavior is similar to commuted model (
5), as
Figure 2b and
Figure 5a show. (
a) Unperturbed modified system (
27) and (
28). (
b) Perturbed modified system (
27) and (
28) with
(
20).
3.4. 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:
That is, control (
8) is now modified by the integral part with parameter
. This term accounts for past values of the error between the desired glucose concentration
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 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 and the nominal value .
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 is found by the trial and error method.
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
, we obtain the commuted PD controller (
9) and (
10). As a resetting signal, we use a sinusoidal function
, and zero initial condition.
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
, we obtain the commuted PD controller (
9) and (
10). As a resetting signal, we use a sinusoidal function
, and zero initial condition.
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 9b as an example), and the insulin injection rate is increased.
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) Commuted PID—External Perturbation
(
20). (
b) Commuted PID controller (
9) and (
10) using (
29), for Patient 1.
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) Commuted PID—External Perturbation
(
20). (
b) Commuted PID controller (
9) and (
10) using (
29), for Patient 1.
4. Discussion of Results
A closed-loop artificial pancreas would measure glucose blood concentration, determine the expected time course following insulin administration, and dispense the optimal dose [
36,
37,
38,
39]. Our proposal seeks to do so by designing a commuted linear control able to keep the blood sugar concentration in a healthy region in terms of reducing the error between the actual glucose concentration and the desired one. To compare our strategy, we consider the reference [
11] due to its similarity. As was remarked in the introduction, there are many results on the insulin–glucose regulation system, and we choose the Bergman model because is commonly used for diabetic systems. As was presented in
Section 3, our approach shows better performance, surely due to two main reasons: (a) the glucose level alerts when hypoglycemia occurs (not considered in [
11] or [
16], for instance); (b) and the error between the glucose level and the desired setting is reduced. In fact, despite this, our control approach can be considered as an applied mathematics study, where its application is easy to understand. Additionally, the proportional factor in our control design tries to reduce the error signal, but the parameter
in (
8) must be tuned carefully. But once it is set, the controller must be able to face different patients’ biological uncertainties. On the other hand, the derivative factor of the controller regulates the rate of the changing error signal, which is mainly governed by parameter
in (
8). That is, it governs the future value of glucose concentration in terms of the present measurement (anticipatory control). Furthermore, if a white noise is present in the blood glucose measurement, our control strategy maintains healthy behavior, but the rise time is increased (see
Figure 10). Only for the case of persistent hypoglycemia (Patient 2) the controller does not accomplish its purpose. In this case, the strategy must be different, maybe by considering a saturation effect on the insulin administration to avoid hypoglycemic episodes.
5. Conclusions and Future Work
This paper proposes a new strategy to control the blood glucose concentration in a pancreatic system, and with the control objective to reduce the error between this concentration with respect to the basal one. As is well-known, the main idea is to administrate insulin to prevent hyperglycemia. But this insulin dose could be too strong, falling into the hypoglycemia region. To mitigate this effect, we suggest ingesting some controlled quantity of glucose. The method used to define the controllers is the proportional-derivative one, which is able to stabilize the glucose concentration around its basal value. The key feature is to avoid an unhealthy glucose concentration range, combining insulin injection with glucose administration. Then, two control actions are defined: one to modify the insulin dynamics (and prevent hyperglycemia), and the other one to improve the performance of the glucose dynamics (and prevent hypoglycemia).
The simulations test the closed-loop performance on four different human behaviors. Moreover, external perturbations are considered meal ingestion. The results are comparable or improved with respect to other works. The purpose of this work is to study the behavior of this novel strategy, and opens the possibility of testing this switched strategy on another type of controller. Also, as theoretical future work, discontinuities of state variables can be considered by working with a piecewise smooth differential system. Moreover, the time delays in insulin administration can be also an interesting case to study [
40].
Finally, two complementary studies are presented. One is based on modifying the glucose absorption dynamic, to test the robustness of the commuted PD controller. The other study was to include an integral part of our controller approach, defining a PID with a resetting integrator action, showing that despite the rise-time of closed-loop dynamics being reduced, chattering on the controller appears inevitably.