ROYAL MELBOURNE INSTITUTE OF TECHNOLOGY
A Closed Loop PID Controller for Blood Glucose Level
Abstract— Diabetes mellitus is a life-threatening condition.
The Artificial Pancreas System has been commonly considered as
the ultimate cure for T1DM. An essential portion of the artificial
pancreas system is the simulation of the insulin-glucose
metabolism. This processes the initial blood glucose level measure
and generates a control signal to the insulin infusion system
however, types of physical activities are key influential aspects for
stabilizing fluctuating blood glucose levels. This paper presents a
new insulin-glucose metabolism model using a PID controller.
This applies a correction value based on; a continuous calculation
of error value as the difference between a desired set point and, a
measured process variable. The Bergaman et Al., Cobelli et. Al.
and Hovorka et Al. models are compared. The results of this
simulation based project is controlled via a client android
application that; transfers an input blood glucose level to the PID
controller server and displays the required insulin release to the
user in-conjunction with, specified physical activity mechanisms.
It can be concluded that the proposed simplified model can
describe the insulin-glucose metabolism process accurately as well
as can be easily implemented within the APS to make the APS
technology more mature and closer to clinical use.
I. INTRODUCTIO N
Statistical data from the World Health Organization
(WHO) states; the number of people with Diabetes Miletus
(DM) has risen from 108 million in 1980 to 422 million [1].
These figures are expected to increase by more than double by
2030 [2]. DM is a form. of disease characterized by high blood
glucose levels that results in the lack of insulin action or
production within the body. Type 1 Diabetes DM (T1DM) is a
form. of DM where T-cell mediate autoimmune destruction of
the insulin producing β-cells [3]. Without the secretion of
insulin, the body’s cells fail to transfer glucose sugar into
energy and thus, results in high blood glucose that may cause
severe bodily dysfunctions. Nevertheless, a secretion of
excessive insulin dosages may also result in dysfunctions such
as; retinopathy, strokes, cardiovascular diseases etc. [4] During
physical activity, the demand for energy increases depending
on its intensity. Generally, insulin receptors on muscle cells
allow glucose to pass from the bloodstream to the muscle once
insulin binds to the receptors. During exercise, these receptors
weaken as inhibitors and allow constant movement of glucose
without the need of an insulin hormone binding receptor [5]. In
this case, blood glucose levels may be reduced naturally.
The artificial pancreas system (APS) is currently known to
be the most effective cure for T1DM. An APS encompasses 3
significant compartments; a continuous glucose measurement
(CGM) system, a control algorithm based on glucose-insulin
modelling, and a continuous subcutaneous insulin infusion
(CSII) system [6]. CGM systems permit real time glucose
monitoring and a continuous stream of data. This data is
transferred to the glucose-insulin model to generate a precise
insulin dose to release through the CSII system [7].
Unlike the recent successes in CGM and CSII systems, the
development of a dependable, sufficient and efficient insulin-
glucose model is still lacking in expansion. Many glucose-
insulin interaction models have been proposed. Bergman et Al,
Cobelli et. Al and Hovorka et Al. are most commonly
developed models within the last century.
The minimal model developed by Bergman et Al, has been
widely discussed due to its simplicity. It includes 3 factors to
play an important role for blood glucose display; sensitivity,
glucose effectiveness and pancreatic responsiveness [8]. Its
ease is based on several assumptions and hence, overlooks the
importance of glucose-insulin interactions. Based on glucose-
insulin interactions as well as glucagon effects, a far more
complex model consisting of 12 nonlinear differential
equations and 18 algebraic equations with, 35 parameters was
built [9]. This complex model was developed by Cobelli et Al.
however, the model failed to determine the relationship of
glucose distribution within the body. In recent years, the
Hovorka et, Al. model was proposed encompassing 8
differential equations. These divide the operational range into 3
fragments of; glucose, insulin and insulin action subsystems
[10]. Due to its complexity, the advanced mathematical model
may not toil the nonlinearity of the general mathematical
modelling problems as it is endorsed to estimate the output
from multiple functions.
Reduction of complexity of parameter identification tasks
is required to integrate within the APS with ease. A simplified
substitute of equations by implementing a PID controller is
proposed in this paper. An android application is also
generated to monitor the glucose-insulin interactions. In the
following sections, the new insulin-glucose interaction model
of T1DM will be described first, then then simulation and
results of both the controller and the android application,
finally the performance of the proposed model will be
discussed and summarized.
II. METHODO LOGY
II.I INSULIN-GLUCOSE MODEL O F T1DM
As shown in Fig. 1, The PID controller functions in
accordance to both meal absorption and physical activity. From
Fig 1. Insulin-Glucose PID Model for T1DM
ROYAL MELBOURNE INSTITUTE OF TECHNOLOGY
the view of glucose metabolis m balance, elements which may
raise or reduce the concentration of plasma glucose are meal
absorption from the gut and renal excretions as well as the type
of physical activity [11]. The PID controller operates in
equivalence to β-cell infusion feedback and can perceive and
increase insulin secretion until the blood glucose level has
decreased to set point [2] [5]. The idea of a high-order system
by a low-order model is of immense significance within
controller design and system control examination. The output
of the PID controller is equal to the control input in the time
domain such that;
(1)
= tracking error, = proportional, = integral and = differential gain.
3 parameters were set according to Diabetes Australia such
that; a blood glucose set level of 80mg/dL and reading
between the ranges of 75mg/dL to 120mg/dL are normal [12].
Shown in Fig.2, MATLAB/ SIMULINK was used to develop
the model. Blood glucose level data of meal consumption and
physical aerobic activity (jogging) was acquired over 24 hours
from the Machine Learning Repository of UCI in 1994 [13].
An input level is sent to the PID controller to regulate the level
by determining the insulin secretion and setting the level back
to normal.
Categorizing the secretion of insulin with respect to blood
glucose levels is essential to determine the efficiency of the
PID controller. This was accomplished via equation (2) below.
(2)
determines insulin secretion to regulate blood
glucose levels. A ratio of 0-0.4 is required to stabilize the
specified blood glucose levels [14]. The insulin-glucose
parameters can be summarized in table 1.
Table 1. Insulin secretion according to specified blood glucose levels
Glucose Level
Insulin
Secretion
Glucose Level
Insulin
Secretion
4.4-6.7 0 12.2-13.9 6
6.8-7.7 1 14.0-16.9 7
7.8-8.7 2 17.0-17.9 8
8.8-9.9 3 18.0-19.9 9
10.0-11.0 4 20+ 10+
11.1-12.1 5
II.II GLUCOSTASIS ANDRO ID APPLICATIO N DEVELO PMENT
Developed on a free online software known as MIT App
Inventor [15], GlucoStasis plays the role of the client and
waits for an input blood glucose level. Android packages are
sent over a User Datagram Protocol (UDP) to the SIMULINK
server to process the data and calculate the desired insulin dose
required. The calculated error is then sent back to the
application to notify the user (See Fig.3.1/3.2). If there is a
difference between the manually calculated release and the
PID calculated release however, the blood glucose levels are
still within a normal range, the application will also notify the
user to perform. specific aerobic activities to assist with the
decline in blood glucose levels. Parameters must be set within
the application development such as;
- Invalid text data inputs
- Calculated insulin release according to the input
blood glucose level (Table 1).
- Average Specific blood glucose levels according to
age (Table 2).
- UDP connection to server and client (receiver/sender)
(Fig.3.1)
The basis of the user-friendly application is shown in Fig.4.
Fig. 2. SIMULINK PID control model.
ROYAL MELBOURNE INSTITUTE OF TECHNOLOGY
Specific normal blood glucose ranges are set according to the
age of the user (Diabetes Australia). Implementing this data
into the PID controller is significant to provide a reliable
model. This is summarized in table 2 below.
Table 2. Normal range of blood glucose level according to age
Age Normal Blood Glucose Level
5-25 4.1-6.9
26-35 4.5-7.1
36-50 4.5-7.5
51-102+ 4.5-7.8
III. RESULTS
III.I PID CONTRO L SIMULATED MO DEL
The results of the PID controlling model is shown in Fig.5.
In comparison of these figures, minimal effects of the PID
controller are required during aerobic exercise while a
continuous function is required during meal consumptions.
III.II APPLICATIO N PARAMETER EVALUATIO N
Fig. 6. shows different GlucoStasis application notifications
in accordance to its input data. (These are subjected to change
due to inconsistent UDP behavior).
Fig. 5. (Right) Effect of PID controller (green) on glucose levels during breakfast lunch and dinner (blue). (Left) Effect of a PID controller (green) on glucose levels
during exercise (blue). Final results of the regulated blood glucose levels can be seen in scattered blue.
Fig.6. GlucoStasis application screen notifications in accordance to its input
data. a) Invalid data notification when no data is input. b) Notification when
input level is high. c) Input level to send to PID controller. d) Once input is
received by server, a change in textbox colour is an indication.
a) b)
c) d)
Fig. 4. Main function of the GlucoStasis android application is
to transfer data from the application to the server to model the
specified value.
ROYAL MELBOURNE INSTITUTE OF TECHNOLOGY
IV. DISCUSSION
The PID controller functions accurately and effectively
over a 24-hour time frame. Figure 5 indicates the efficiency of
the model. As blood glucose levels increase, the PID
controller functions to release specific high doses of insulin.
As blood glucose levels decrease (due to physical activity), the
need for artificial insulin decreases and so, the PID controller
does not secrete inefficient doses of insulin within the body.
When observing the figures, a blood glucose reading of ~
300 mg/dL required ~9 of insulin whereas, a blood
glucose level of ~100mg/dL required ~1 . In
comparison to manual calculations (Table 1), 300mg/dL
(16.7mmol/L) was calculated to need ~7 meanwhile,
~100mg/dL (5.5mmol/L) is not expected to require any
insulin dosage. Although there is a difference between the
virtual world and exact value, the blood glucose levels become
stabilized, at safe levels, over the period of the functioning of
the PID controller. If the expected release is ever fewer than
the PID control release, the android application notifies the
client to perform. a form. of aerobic exercise such as simply
walking, jogging or running. It can be shown that the proposed
model has much fewer parameters than already expressed
models for meal absorption and physical glucose-insulin
activity interactions. Additionally, the simulation results
reveal that under the conditions that the model stability must
retain, PID controlling method has efficient performance and
is ideal to integrate in the APS.
The GlucoStasis application is used as a feedback/
monitoring mechanis m for the client to know exactly what is
happening within their body. Although a stable UDP
connection is yet to be finalized, this user-friendly application
will support all ages in a simple and reliable manner for the
monitoring of glucose-insulin interactions.
V. CONCLUSION
The establishment of a glucose-insulin metabolism model is
an essential aspect in the development of the artificial
pancreas system for T1DM patients. Successful simulations of
the PID controller play a significant role in modelling the
glucose-insulin interactions. This is a simple method with
simple implementation schemes to assist in saving lives of
patients with T1DM.
The future work of this project will focus mainly on
considering establishing a stable UDP connection between the
application and the server. In addition, as well as physical
activity, stress and emotions play a part in unbalanced blood
glucose levels. These will be analyzed and taken into account
in order to retain an extremely reliable insulin-glucose model.
Moreover, further simplification possibility will be explored
by considering more lower order models.
VI. ACKNOWLEDGEMENTS
Thanks given to RMIT for their continued support and
encouragement and to my supervisor Dr. John Q. Fang, who
provided insight and expertise that greatly assisted the
research.