Professional Documents
Culture Documents
An Algorithm Mimicking Pancreas
An Algorithm Mimicking Pancreas
research-article2021
JAO0010.1177/03913988211027176The International Journal of Artificial OrgansCocha et al.
Abstract
Background: Artificial pancreas design using subcutaneous insulin infusion without pre-meal feed-forward boluses
often induces an over-response leading to hypoglycemia due to the increase of blood insulin concentration sustained in
time. The objective of this work was to create an algorithm for controlling the function of insulin pumps in closed-loop
systems to improve blood glucose management in type 1 diabetic patients by mimicking the pulsatile behaviour of the
pancreas.
Methods: A controller tuned in a pulsatile way promotes damped oscillations of blood insulin concentration injected
through an insulin pump. We tested it in a simulated environment, using nine ‘in silica’ subjects. The control algorithm
is founded on feedback linearization where through a change of variables, the nonlinear system turns into an equivalent
linear system, suitable for implementing through a PID controller. We compared the results obtained ‘in silica’ with the
volume injected by an insulin pump controlled by this algorithm.
Results: The use of this algorithm resulted in a pulsatile control of postprandial blood glucose concentration, avoiding
hypoglycaemic episodes. The results obtained ‘in silica’ were replicated in a real pump ‘in vitro’.
Conclusions: With this proposed linear system, an appropriate control input can be designed. The controller works
with a damped pulsatile pattern making the insulin infusion from the pump and blood insulin concentration pulsatile. This
operational would improve the performance of an artificial pancreas.
Keywords
Bergman minimal model, artificial pancreas, type 1 diabetes, control algorithm, closed-loop control
of efficient software algorithms would make these devices For testing the algorithm performance in the control of
more independent from the user, and it will help to over- a real insulin pump, we build a simple insulin pump with a
come these disadvantages. Such devices include a CSIIP, a controller governed by this algorithm. The rate of insulin
CGM, and a software algorithm for the automatic determi- delivery changes according to different loads of glucose
nation of insulin dose. In a closed-loop fashion, mimicking given to an ‘in silica’ individual. We simulate blood glu-
a biological pancreas is the most promissory tool to pre- cose values through a computer and compared the meas-
vent further complications triggered by diabetes.6 ured output of the pump with the simulation obtained with
Nevertheless, several aspects of security must be consid- the ‘silica model’. We understand that the validation of the
ered, particularly hypoglycaemic events.7,8 In 2016, a algorithm using a real device strengthens its applicability.
device got FDA approval, but it still requires user instruc-
tions for food intake compensation.9 This device, like Methods
many others in development, uses the subcutaneous route
for providing insulin. After a meal, blood glucose should Mathematical model
be bringing back to basal values within 50–90 min. In
Mathematically, a set of first-order nonlinear differential
usual operation, the controller ‘reads’ the blood glucose
equations in a space state domain describes the insulin-
and it delivers an amount of insulin enough to bring glu-
glucose dynamic system. The present algorithm is based
cose back to the basal value. If the physiological parame-
on the Bergman Minimal Model (BMM), a compartmental
ters, for instance, metabolic demands, change from their
physiological model used for developing several control
calibration values, the controller could turn dysfunctional,
algorithms.13–18
resulting in an incorrect blood insulin concentration. This
The Bergman Minimal Model (BMM) is a compart-
is particularly relevant in a group of diabetics that have a
mental mathematical model, initially designed for the esti-
severely unstable form of diabetes called labile or brittle
mation of pancreatic responsiveness and insulin sensitivity,
diabetes.10 Despite intensive insulin therapy these patients
that satisfies this requirement.
do not reach adequate blood glucose control and have fre-
This model was modified for representing a type 1 dia-
quent hypoglycaemic episodes.
betic. It includes three state variables and describes their
Blood glucose concentration is a function of the rate of
behavior. The model also assumes that insulin (u) is
glucose entering the circulation balanced by the rate of glu-
infused exogenously, therefore modeling an insulin-
cose removal from it. From the point of view of control,
dependent diabetic patient. The injected insulin is distrib-
glycaemia dynamics can be considered as a nonlinear sys-
uted into the circulatory system (x3) and reaches the
tem. In nonlinear systems, the controller action that pro-
interstitial tissue. The remote insulin effect (x2) promotes
duces the accurate response at one operating point might
the uptake of glucose (x1) into the hepatic and extrahepatic
not produce a satisfactory response at another different
tissues acting like the inverse of a putative impedance to
operating point. Because of this nonlinear feature, it is rela-
glucose transfer across the plasma membranes of insulin-
tively easy to reduce glucose values when are high, but it
sensitive cells (representing the insulin sensitivity).
takes proportionally more insulin if glucose is low. This is
a consequence of insulin saturation effects.11,12 Another
aspect of nonlinear characteristics of the glucose regulatory Bergman minimal model equations (*)I
system is that the insulin action profile differs from person
to person and, even in the same person, along the day. x1 = − P1 x1 − x 2( x1 + Gb ) + D ( t ) (1)
Variable rates of absorption, glucose consumption due to
x 2 = − P2 x 2 + P3 x3 (2)
physical activity, stress, and so on, will lead to variable and
unpredictable peaks in insulin action and could cause unex- u (t )
pected both hypoglycaemic or hyperglycaemic events.12 x 3 = − n ( x3 + I b ) + (3)
V
We developed an algorithm for controlling an artificial
pancreas to deal with those above-mentioned aspects where:
resulting from the particular nonlinear glucose-insulin x1 = basal value of blood glucose concentration
dynamics behaviour. Particularly with the harmful effect x2 = insulin action on hepatic glucose and periphery tar-
of hypoglycaemic events, which are a dangerous by-prod- get tissues
uct of the artificial pancreas design. By developing this x3 = insulin concentration
algorithm, we intended to improve the functioning of an P1 = rate of glucose uptake from the extracellular space,
artificial pancreas, under the assumption that mimicking independently of the influence of insulin [1/min].
the pulsatile behaviour of the natural pancreas would result P2 = fractional rate of insulin appearance in the active
in improved performance of the device. The algorithm compartment;
relies on feedback linearization, a technique designed to P3 = fractional removal of insulin from active
find appropriate compensations that make a given nonlin- compartment;
ear system behave linearly. Gb = basal blood glucose concentration
Cocha et al. 3
Ib = basal blood insulin concentration. Table 1. Sets of parameters obtained from Neatpisarnvanit
u(t) = infusion of external insulin. and Boston.24
n = rate constant that represents clearance of extracel- Subject# p1 [1/min] p2 [1/min] p3[(min)-1 n [1/min]
lular insulin. (µU/ml)-1]
t = time.
V = extracellular volume (12 L). 1 2.27E-02 2.65E-02 1.20E-05 2.40E-01
D(t) = meal disturbance 2 5.87E-02 1.30E-02 6.58E-06 1.82E-01
3 3.32E-04 2.85E-01 5.09E-06 1.92E-01
As equations (1), (2), and (3) show, BMM is a nonlinear
4 2.85E-07 1.78E-01 6.43E-05 1.51E-01
system.
5 6.38E-02 1.18E-02 4.23E-06 2.00E-01
6 2.00E-03 9.53E-02 3.48E-05 2.42E-01
Feedback linearization based control 7 2.47E-03 1.00E-01 1.47E-05 1.26E-01
8 1.38E-02 3.45E-01 3.74E-04 1.64E-01
Bergman Minimal Model (BMM) is nonlinear and allows 9 8.66E-02 2.02E-02 2.63E-05 3.14E-01
exact linearization.19,20 Nonlinear differential geometric
control is a theory developed in the 1980s for dealing with Values of cases 4 and 5 are from obese people. The numbers eight and
nonlinear systems using the know-how and experience nine were dogs.
obtained with linear systems. In feedback linearization
(FL), a change of coordinates eliminates the nonlinearities
de ( t )
of the process, and it lets find suitable compensations mak- D = kD (7)
ing a given nonlinear system behave like a linear one. The dt
nonlinear change of coordinates allows us to see the origi-
Where k C , k I and k D are the gains.
nal nonlinear system as a linear one and the nonlinear
The validity of FL theory depends on the supposition
observer permits the reconstruction of the non-measurable
that the model represents exactly an actual system.
variables. After the change of coordinates, the system per-
Sensitivity to parameter variability makes it susceptible to
forms like a linear one, and the linear control theory is
lose the exact cancellation of nonlinearities resulting in a
applicable. Thus, the nonlinear transformation allows us
less robust control technique. That is why currently, this
for looking at the system as a linear and controllable one.
technique does not suit well for biological control pur-
Thus, a linear closed-loop controller can be imple-
poses. In this work, the robustness of the feedback lineari-
mented on the augmented system using blood glucose as
zation control strategy is achieved by the pulsatile
the feedback variable and insulin as the acting variable.
behaviour of the PID component. It is obtained via the
(For further details see Appendix)
transient dumped pulsatile of insulin supply.
PID control
The mechanical device
Linear controllers such as PID, an acronym for the math-
The mathematical model used for the simulation in silica
ematical terms Proportional, Integral, and Derivative, can-
was adapted for its use on a PC. Case # 4 (Table 1) was
not deal appropriately with nonlinear systems behavior
picked up for the assay and, from it, the data for simulation
and, in the case of blood glucose control, it requires an
was collected. The arrangement of the prototype consisted
additional pre-meal bolus of insulin.21
of four blocks: first, the oscillatory control; second, the
The PID controller is the most used algorithm in pro-
simulated experimental case; third, the collection of input
cess control. The output of the PID algorithm is the insu-
and output data (data-logger); and fourth, the transfer of
lin delivery rate as a function of the deviation of
data and analysis. A scheme of the implemented device is
measured blood glucose from its desired set-points. This
shown in Figure 1.
deviation or difference is the error e(t). Equation of PID
For transferring commands, a UART port of the com-
is given by
puter was used to drive the controller by a serial device
USB-UART converter CP2102. The data sent and magni-
1
t
de ( t )
v ( t ) = kce ( t ) + ∫ e ( t ) dt + k D (4) tude and signs respected.
ki 0 dt
Where: Hardware
P = k c e ( t ) (5) The speed of the insulin volume to inject is low in compari-
son with the processing speed of a standard microcontroller.
t The used board (Mbed LC1768) has a processing velocity
1
e ( t ) dt (6)
k I ∫0
I= of 100 MHz, enough for the present development and the
library Mbed OS V5 facilitates the control of the motor for
4 The International Journal of Artificial Organs 00(0)
Figure 2. The loop is closed in only one of the patients and the rest run in an open-loop mode founded on the input of that
patient: (a) The controller tuned with Cohen-Coon method, (a.a) insulin delivered to the set of patients, (a.b) the blood glucose
concentration in each one of the virtual patients. (b) Blood glucose changes with oscillatory insulin infusion, (b.a) The pattern
of insulin delivered to the set of patients, (b.b) The blood glucose concentration in each subject. The arrow indicates when the
hypoglycaemic event was induced.
glucose plasma level in the vicinity of normal glycaemia. supports the view that the controller can be satisfactorily
The volume injected by the real pump copies the oscillatory employed on a real insulin pump.
insulin pattern, induced by the algorithm.
Figure 5(c) shows the numerical values obtained by
Discussion
simulation with the output of the pump. The volume
injected by the pump was measured by weight. The slope Algorithms for the control of insulin secretion by the artifi-
was 1.02 with a correlation coefficient of 0.68. This result cial pancreas are a cornerstone in the development of
6 The International Journal of Artificial Organs 00(0)
Figure 3. Blood insulin concentration of the set of patients when exogenous insulin infusion is delivered in an oscillatory mode.
Figure 4. Controller response (insulin delivered) and blood glucose level originated by a change of parameters on a single
individual. The controller adjusts insulin dose, faced with each change in glucose concentration.
efficient devices for the treatment of type 1 diabetes. Lately, pulses enhances glucose regulation and enables inter-islet
some useful algorithms were developed, able to deal with synchronization.32–34 Glucose induces insulin release from
an important issue of AP, that is, hypoglycaemia.17,28 the β-cell by repetitive oscillations of the membrane poten-
Insulin secretion during a meal has a pulsatile nature tial. The duration and frequency of each burst of electrical
and involves a series of pulses with amplitude and fre- activity are a function of glucose concentration.29,35 This
quency modulated by glucose.29–31 Insulin discharging in a pulsatile electrical activity evokes the pancreas to generate
pulsatile mode requires the electrical coordination of the pulses of insulin at a stable frequency, responding to
secretory activity between β-cells in parallel with oscilla- increased glucose loads by increasing the amplitude of the
tion of intracellular Ca2+. Phase modulation of insulin pulses.29,36 The insulin released from the β-cells results in
Cocha et al. 7
Although the benefit of insulin pulsatile delivery is 6. Bally L, Thabit H and Hovorka R. Closed-loop for type 1
dated from some time ago,41 this work is, to our knowl- diabetes. An introduction and appraisal for the generalist.
edge, the first report showing the potential relevance of BMC Med 2017; 15: 14–19.
insulin delivery mimicking the natural-occurring pattern. 7. Blauw H, Keith-Hynes P, Koops R, et al. A review of safety
and design requirements of the artificial pancreas. Ann
We consider that this procedure of insulin delivery could
Biomed Eng 2016; 44: 3158–3172.
result, eventually, in the great benefit of insulin-dependent
8. O’Keeffe D, Maraka S, Basu A, et al. Cybersecurity in arti-
diabetic patients. In conclusion, we present a controller ficial pancreas experiments. Diabetes Technol Ther 2015;
that improves the classical controller of blood glucose by 17: 664–666.
closed-loop systems and tests it with a real pump. 9. DeVries JH, Snoek F, Kostense P, et al. The artificial pan-
creas-ready for prime time? Lancet Diabetes Endocrinol
Author’s Note 2017; 5: 238–239.
Carlos D’Attellis Centro de Matemática Aplicada, ECyT, 10. Benbow SJ, Walsh A and Gill G. Brittle diabetes in the
UNSAM, Argentina. elderly. J R Soc Med 2001; 94: 578–580.
11. Bergman RN, Phillips LS and Cobelli C. Physiologic
evaluation of factors controlling glucose tolerance in man:
Declaration of conflicting interests
measurement of insulin sensitivity and beta-cell glucose
The author(s) declared no potential conflicts of interest with sensitivity from the response to intravenous glucose. J Clin
respect to the research, authorship, and/or publication of this Invest 1981; 68: 1456–1467.
article. 12. Heinemann L XII. Variability of insulin absorption and
insulin action. Diabetes Technol Ther 2002; 4: 673–682.
Funding 13. Bergman RN XIII. Minimal model: perspective from 2005.
The author(s) disclosed receipt of the following financial sup- Horm Res Paediatr 2005; 64: 8–15.
port for the research, authorship, and/or publication of this arti- 14. Bergman RN, Ider YZ, Bowden CR, et al. Quantitative
cle: This work has been supported by CONICET (PIP No. estimation of insulin sensitivity. Am J Physiol 1979; 236:
11220110100730CO) and FUNDACION UNSAM INNOVA. E667–E677.
We thanks UTN for its aid (ICIPNLP4975). 15. Bequette BW. Analysis of algorithms for intensive care
unit blood glucose control. J Diabetes Sci Technol 2007; 1:
813–824.
ORCID iD
16. Breton M, Man C and Cobelli C. In silico preclinical trials:
Carlos Amorena https://orcid.org/0000-0001-6744-8465 a proof of concept in closed-loop control of type 1 diabetes.
J Diabetes Sci Technol 2009; 3: 44–55.
Notes 17. Colmegna PH, Sánchez-Peña RS, Gondhalekar R, et al.
Reducing glucose variability due to meals and postprandial
I. For practical purposes, to simplify modelling, glucose
exercise in T1DM using switched LPV control: in silico
and insulin concentration in blood and interstitial fluid are
studies. J Diabetes Sci Technol 2016; 10: 744–753.
considered at instantaneous equilibrium without consider-
18. Turksoy K, Samadi S, Feng J, et al. Meal-detection in
ing delays due to insulin distribution and transfer across
patients with type 1 diabetes: a new module for the multi-
endothelial barriers. We are aware that the use of this model,
variable adaptive artificial pancreas control system. IEEE J
in real conditions, transit times must be taken into account.
Biomed Health Inform 2016; 20: 47–54.
II. An exhaustive description of the procedure is detailed by
19. Isidori A. Nonlinear control systems. London: Springer
Isidori19 and D’Attellis.20
Verlag, 1995.
20. D’Attellis CE. Introducción a los sistemas no lineales de
References control y sus aplicaciones. Argentina, BA: Asociación
1. Nathan D and Edic D. The diabetes control and complications Argentina de Control Automático, 1992.
trial/epidemiology of diabetes interventions and complications 21. Marchetti G, Barolo M, Jovanovic L, et al. An improved
study at 30 years: overview. Diabetes Care 2014; 37: 9–16. PID switching control strategy for type 1 diabetes. IEEE
2. Srinivasan A, Lee J, Dassau E, et al. Novel insulin delivery Trans Biomed Eng 2008; 55: 857–865.
profiles for mixed meals for sensor-augmented pump and 22. Mathworks. Introduction to automatic PID tuning in
closed-loop artificial pancreas therapy for type 1 diabetes Simulink – MATLAB®; Simulink. https://www.mathworks.
mellitus. J Diabetes Sci Technol 2014; 8: 957–968. com/help/slcontrol/ug/introduction-to-automatic-pid-tun-
3. Klonoff D. Continuous glucose monitoring: roadmap for ing.html (accessed 13 July 2017).
21st century diabetes therapy. Diabetes Care 2005; 28: 23. Lynch S and Bequette B. Model predictive control of
1231–1239. blood glucose in type I diabetics using subcutaneous glu-
4. Heinemann L, Fleming G, Petrie J, et al. Insulin pump risks cose measurements. In: Proceedings of the 2002 American
and benefits: a clinical appraisal of pump safety standards, control conference (IEEE Cat. No.CH37301), Anchorage,
adverse event reporting, and research needs. Diabetes Care AK, 8–10 May 2002, vol. 5, pp.4039–4043. New York:
2015; 38: 716–722. IEEE.
5. Pettus J, Price DA and Edelman SV. How patients with type 1 24. Neatpisarnvanit C and Boston JR. Estimation of plasma
diabetes translate continuous glucose monitoring data into dia- insulin from plasma glucose. IEEE Trans Biomed Eng 2002;
betes management decisions. Endocr Pract 2015; 21: 613–620. 49(11): 1253–1259.
Cocha et al. 9