Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2018 Mar 19.
Published in final edited form as: Conf Proc IEEE Eng Med Biol Soc. 2016 Aug;2016:2270–2273. doi: 10.1109/EMBC.2016.7591182

Design of a Dual-Hormone Model Predictive Control for Artificial Pancreas with Exercise Model

Navid Resalat 1, Joseph El Youssef 1, Ravi Reddy 1, Peter G Jacobs 1
PMCID: PMC5858942  NIHMSID: NIHMS828129  PMID: 28324962

Abstract

The Artificial Pancreas (AP) is a new technology for helping people with type 1 diabetes to better control their glucose levels through automated delivery of insulin and optionally glucagon in response to sensed glucose levels. In a dual hormone AP, insulin and glucagon are delivered automatically to the body based on glucose sensor measurements using a control algorithm that calculates the amount of hormones to be infused. A dual-hormone MPC may deliver insulin continuously; however, it must avoid continuous delivery of glucagon because nausea can occur from too much glucagon. In this paper, we propose a novel dual-hormone (DH) switching model predictive control and compare it with a single-hormone (SH) MPC. We extended both MPCs by integrating an exercise model and compared performance with and without the exercise model included. Results were obtained on a virtual patient population undergoing a simulated exercise event using a mathematical glucoregulatory model that includes exercise. Time spent in hypoglycemia is significantly less with the DH-MPC than the SH-MPC (p=0.0022). Additionally, including the exercise model in the DH-MPC can help prevent hypoglycemia (p < 0.001).

I. Introduction

Diabetes mellitus is a physiological disorder where the body either is resistant to or does not sufficiently secrete insulin. Type 1 diabetes is the less prevalent but more challenging type of diabetes mellitus in which the pancreas fails to produce insulin for glucose regulation. Without insulin, glucose cannot be absorbed into tissues, and blood glucose (BG) levels increase, resulting in hyperglycemia (BG > 180 mg/dl). Difficulty controlling glucose is compounded by meals which require additional insulin. On the contrary, when glucose utilization is high, for example during physical activity, tissues absorb glucose more rapidly, and the BG can fall very steeply. The American Diabetes Association identifies a lower boundary of 70 mg/dl for the BG, below which is defined hypoglycemia, where severe symptoms may occur if untreated for even short periods [1]. The replacement of insulin in type 1 diabetes requires both basal insulin delivery, either with long-acting insulin or by continuous infusion of fast-acting insulin, and bolus insulin doses for meals with fast-acting insulin.

Insulin pump therapy (open-loop therapy) is a common method for people with type 1 diabetes to maintain euglycemia; the patient can use the insulin pump to infuse basal insulin and can also deliver boluses prior to meals [2]. For closed-loop insulin delivery, also known as the artificial pancreas (AP), insulin delivery is automatically adjusted based on sensed glucose levels and a control algorithm. In single hormone AP systems, only insulin is dosed whereas in dual hormone APs, glucagon is also dosed [3].

A number of closed loop algorithms utilize a proportional integral derivative controller [4, 5]. Our group has previously described variations of PID or PD AP control algorithm [6]. We also have described an exercise detection and dosing adjustment algorithm that can be incorporated [7]. Other groups have implemented model predictive control (MPC) to manage BG such as a SH MPC by Magni et al. [8], a DH MPC by Boiroux et al. [9], and a SH MPC by Hovorka et al. [10]. Boiroux et al. [9] used a switching controller that switches between insulin and glucagon SH MPC based on the patient’s glucose. When glucose levels are below a threshold (e.g. 85 mg/dl), the glucagon SH-MPC would be used, otherwise, insulin SH-MPC would be used. To the best of our knowledge, no prior groups have incorporated exercise directly into the process model of a DH-MPC.

In this paper, we introduce a DH-MPC approach that can switch between dual hormone and single hormone operation based on the sensed glucose level of the patient. Our DH-MPC algorithm includes a model for exercise, such that if exercise is detected or if a patient announces an exercise event to the controller, the algorithm can respond appropriately. We test the feasibility of the algorithm in the presence of moderate exercise. We also compared the performance when including exercise versus not including the exercise model in the MPC. We linearize the non-linear equations within the process model to reduce the processing time in the controller.

II. Material and Method

A. Process Model

The prediction of BG in our MPC algorithm is achieved using a glucoregulatory model, consisting of a glucose kinetics model, insulin kinetics and dynamics models, and glucagon kinetics and dynamics models. The model describes the relationship between subcutaneously delivered insulin and glucagon and blood glucose concentration. The glucose kinetics model [10] defines the effect of the insulin and glucagon actions on the blood glucose, as follows:

Q.1=x1Q1-F01c-FR+k12Q2+uG+EGP0(1-x3+Y+kg3Y.)Q.2=x1Q1-k12Q2-x2Q2 (1)

where Q1 and Q2 are the masses of glucose in the accessible and non-accessible compartments respectively, in mmol/L. F01c and FR represent non-insulin mediated glucose uptake and renal glucose clearance respectively, in mmol/L/min. uG represents gut absorption rate in mmol/L/min, which is considered zero in this study. EGP0 is the basal endogenous glucose production in mmol/L/min at a theoretical zero insulin concentration [10]. The source of non-linearity in these equations comes from the interactions between the effect of the insulin on EGP and the distribution and disposal within the measurable and non-measurable glucose compartments. These nonlinear equations are linearized based on a Taylor series expansion at each time point, where the higher order terms are excluded.

The insulin kinetics model (Eq. 2) represents the insulin absorption rate from the short-acting insulin dosing [11].

Q.1a=kuI-ka1Q1a-VmaxQ1akm+Q1aQ.1b=(1-k)uI-kia2Q1b-VmaxQ1bkm+Q1bQ.2=kia1Q1a-kia1Q2Q.3=kia1Q2+kia2Q1b-keQ3 (2)

where Q1a and Q2 represent the insulin mass through the slow absorption pathway, and Q1b represents a faster channel for insulin absorption. Q3 represents plasma insulin mass [11]. All insulin masses are in mU/kg. The sources of nonlinearity in these equations come from the local degradation of insulin at the injection site. These non-linear equations are linearized using a Taylor series. The insulin dynamics model is based on a study from Hovorka et al [10].

x.1=-ka1x1+kb1VdINQ3x.2=-ka2x2+kb2VdINQ3x.3=-ka3x3+kb3VdINQ3 (3)

where x1 (min−1), x2 (min−1) and x3 (unitless) represent the effect of insulin on glucose distribution, glucose disposal and suppression of endogenous glucose production, respectively and Vd_IN is the insulin distribution volume (L.kg-1) [10]. The glucagon kinetics model, which represents the absorption rate of subcutaneously injected glucagon, is reported in [12].

x.1g=-(kg1+kge1)x1g+ugx.2g=kg1x1g-kg2x2gx.3g=kg2x2g-kge2x3g (4)

where x1g and x2g represent subcutaneous glucagon mass compartments and x3g is plasma glucagon mass, all measured in mg/kg. The nominal values of the parameters for the glucagon kinetics model used in this study have been provided from Lv et al [12]. The glucagon dynamic model, which describes the interaction between the glucagon and the glucose concentration, was published by us previously [7].

Y.=106×kc×SfGGVdGGx3g-kcY=kgx3g-kcYY.=ZZ.=kgk2x2g-kgkc2x3g-kcZ (5)

Y represents the effect of glucagon on endogenous glucose production. Since the change on Y has an effect on EGP, we introduce a new variable Z as another state, which is used in the MPC algorithm. The values of the parameters of the glucagon kinetics are described previously [7]. These values change per subject and make a virtual patient population (see section 2.D).

B. Model Predictive Controller

Model predictive control is an optimization based control algorithm, which considers the dynamic model of the plant. Unlike PID controllers, MPC is able to predict the future outputs and optimize the inputs to the plant accordingly.

Figure 1 shows the structure of the MPC control methodology. The glucoregulatory model is the MPC process model. Typically, the plant would be the patient using the AP. The plant (or human) receives hormones as an insulin infusion rate (IIR) or glucagon infusion rate (GIR) and has a blood glucose level measured by a sensor (BG). For our simulations, the plant is approximated using the same glucoregulatory state equations described above. However, while the process model parameters are kept constant during the simulation and are set to the mean values from prior published studies [1013], the plant model parameters vary for each virtual patient tested during simulation.

Figure 1.

Figure 1

MPC Schematic

There are 13 state variables, which include two state variables from the glucose kinetics model, four from the insulin kinetics model, three from the insulin dynamic models, three from the glucagon kinetics model and two from the glucagon dynamic model. Since the derivative of the glucagon concentration also affects the glucose concentration (equation 1), we define the second glucagon dynamic model state variable (variable Z in equation 5) for this effect. The final linearized form of the MPC equations is as follows:

xm(k+1)=Amxm(k)+Bmu(k)+dm(k);y(k)=Cmxm(k); (6)

xm(k) is the state vector, u(k) is the 2-dimensional input vector (insulin and glucagon) and d(k) includes the constant terms resulting from the linearization. Since the controller requires a history of the output for future predictions, it is essential to relate the input vector to the output. We define a new vector as follows x (k) = [Δxm (k)T y (k)]T and the augmented state equations are re-arranged below:

[Δxm(k+1)y(k+1)]x(k+1)=[AmomTCmAm1]A[Δxm(k)y(k)]x(k)+[BmCmBm]BΔu(k)+[1Cm]DΔdm(k);y(k)=[om1]C[Δxm(k)y(k)]; (7)

The predicted outputs are calculated using equation 8.

YP=Fx(k)+ΦΔU+ΨΔD, (8)

where the matrices F, Φ and Ψ are presented in [14] and

YP=[y(k+1)y(k+2)y(k+Np)]T,ΔU=[Δu(k)Δu(k+1)Δu(k+Nc-1)]T,ΔD=[Δdm(k)Δdm(k+1)Δdm(k+Nc-1)]T,

We chose a 300-minute prediction horizon as the action of insulin is several hours [10]. We chose a 20-minute control horizon as the results did not change substantially with a longer horizon. The cost function is defined in equation 9, which includes the reference trajectory (Rs) and the predicted outputs, and the tuning control parameter ().

J=(Rs-YP)T(Rs-YP)+ΔUTR¯ΔU, (9)

We compute the output of the optimizer (future inputs) by setting the derivative of the cost function with respect to ΔU to zero and; after some calculations, the optimal ΔU is defined in equation 10.

ΔU=(ΦTΦ+R¯)-1ΦT(Rs-Fx(k)-ΨΔD), (10)

At the next step, we impose some constraints on the insulin and glucagon delivery. We set the maximum amount of insulin infusion rate (IIR) and glucagon infusion amount (GIR) to 15 units per hour and 50 microgram, respectively. In this paper, we show the performance of (1) a single hormone MPC algorithm (SH-MPC) in which the insulin is the only hormone used for blood glucose regulation, and (2) a dual hormone algorithm (DH-MPC). For the dual-hormone, we consider different ways of switching between single hormone and dual hormone operation. One option (DH-Thr) is to use a SH when glucose levels are greater than a threshold (85 mg/dl) and then use DH when glucose levels drop below this threshold. A second option (DH-Pred) is to use SH when glucose levels are predicted to rise above 70 mg/dl during the prediction horizon, otherwise switch to DH-MPC.

C. Exercise model

Exercise can have profound effects on glucose levels in a person with type 1 diabetes, causing hypoglycemia if dosing is not adjusted. We incorporated an exercise model described by Hernandez et al. [13] into our process model. The exercise model, which models aerobic exercise, affects the influence of insulin on glucose transport and disposal, and endogenous glucose production and causes increased insulin sensitivity by influencing equations 3 (kb1, kb2 and kb3) as follows:

kb1=MPGU×MPIU×kb1kb2=MPGU×MPIU×kb2kb3=MHGP×kb3 (11)

The model parameters (kb1, kb2 and kb3) are updated during the exercise period according to equation 12.

MPGU=1+ΓPGUA×PAMM35mg/min;MPIU=1+2.4×PAMM;MHGP=1+ΓHGPA×PAMM155mg/min; (12)

where ΓPGUA and ΓHGPA, which are related to the percent of maximum oxygen consumption (PVO2max), are calculated based on a dynamic model that is explained further in [13]. PAMM is the percent of active muscular mass.

D. Virtual patient population

We defined a virtual patient population for our in-silico simulations. We changed the most sensitive inter-subject parameters (EGP0, kb1, kb2, kb3, SfGG, kc and kg3) of the process model across each subject. First, we produced a normal distribution based on the information of each parameter, given prior studies [7, 10, 11], and then randomly selected samples, using a random number generator that is weighted by the parameter distribution, in order to generate the virtual population. Each parameter set was then subjected to a battery of tests to determine the physiologic feasibility. If a virtual subject did not pass each of the following 4 criteria, they were excluded from further testing. 1) Steady-state glucose levels – in the absence of insulin, this should be > 300 mg/dl. 2) Delivery of high-dose insulin (15 units/h) should result in a low steady-state glucose level < 100 mg/dl. 3) Delivery of high-dose glucagon (20 mcg/kg) should result in a significant rise in glucose within 2 hours of the dose > 50 mg/dl above the baseline steady state glucose. 4) Delivery of a small dose of glucagon (0.2 mcg/kg) should not result in a response > 100 mg/dl above baseline. A total of 163 out of 400 virtual subjects passed the above criteria and were selected for our in-silico simulations.

E. Test scenario and statistical analysis

All virtual subjects completed the following scenario. First, their glucose levels were brought to a steady state value of 160 mg/dl at time t=0. Next, subjects completed the equivalent of 45 minutes of exercise starting at time t=10 minutes at 60% PVO2max and 80% PAMM. We compared the control algorithms and assessed performance in terms of the average time spent in hypo/hyperglycemia and the average blood glucose across the virtual subjects. We used the Student’s t-test and the Wilcoxon rank-sum test to compare the average blood glucose and the time spent in hypo-/hyperglycemia, respectively, across different process model configurations. The significance level was 95%.

III. Results and Discussion

Figure 2 shows the benefit of using DH compared with SH. Some subjects within the 25%–75% interquartile range using the SH process model crossed the hypoglycemia threshold interquartile range, whereas subjects using the DH model generally did not go hypoglycemic (only the lower 2.5% of subjects went hypoglycemic under DH). The time the virtual subjects spent in hypoglycemia was significantly less for the DH (p-value = 0.0022). In DH, the glucagon delivery not only prevented more subjects from becoming hypoglycemic, but also increased the median blood glucose across the subjects. Preventing hypoglycemia and reducing time spent in hypoglycemia can prevent symptoms related to hypoglycemia including nervousness, shakiness, dizziness and nausea. It is important to note that both the SH and DH process models included exercise in these results.

Figure 2.

Figure 2

Interquartile range along with the 95% intervals of the blood glucose across the virtual subjects are shown for DH-Thr (red line) and SH (blue line) methods with the exercise model included.

Figure 3 shows the importance of including the exercise model in the process model. When the exercise model is not included, hypoglycemia occurs, whereas when it is included, hypoglycemia is generally avoided. When the exercise model is not included, the algorithm cannot anticipate forthcoming exercise-induced hypoglycemia and thereby turn off insulin and increase glucagon dosing as shown in the insulin and glucagon delivery panels of Figure 3. The time spent in hypoglycemia was significantly less when exercise was included (p-value < 0.001). This makes intuitive sense. Aerobic exercise can cause rapid drops in glucose levels because of increased glucose uptake during exercise. If the process model is not aware of this change and dosing is not adjusted, then hypoglycemia results.

Figure 3.

Figure 3

Interquartile ranges along with the 95% intervals of the blood glucose across the virtual subjects are shown for the DH-Thr with exercise model (red line) and DH-Thr without exercise model (cyan line).

There was a difference in performance when the process model switched between DH and SH based on a fixed glucose threshold (DH-Thr) compared with a predicted drop below 70 mg/dl (DH-Pred). DH-Pred resulted in some post-exercise hyperglycemia. While time spent in hypoglycemia with the DH-Pred approach did not change significantly in comparison to the DH-Thr approach (p-value = 0.011), the time spent in hyperglycemia, as well as the median blood glucose, were significantly higher for DH-Pred (p-value < 0.001). Results here indicate that DH-Thr is optimal for controlling glucose during exercise.

A limitation of this study is that the exercise model only models the effect of aerobic exercise on the glucoregulatory system. Anaerobic exercise can result in a less significant drop in glucose compared with aerobic exercise [15]. Furthermore, the exercise model was static for all subjects, whereas different people can respond differently to exercise. In the future, we plan to integrate anaerobic exercise and high intensity interval training into the exercise model.

In conclusion, the threshold-based dual-hormone MPC with exercise in the process model outperformed the other controlling approaches. It was critical to include exercise in the controller process model so that the time spent in hypoglycemia would be reduced. In the future, we plan to include a meal model to the process model (uG would not be zero in equation 1) and evaluate in human subjects.

Acknowledgments

This research was supported in part by grant DP3DK101044-01, from the National Institute for Health. The content is solely the responsibility of the authors and does not necessarily represent the official views of NIH.

Footnotes

Dr. Jacobs has a financial interest in Pacific Diabetes Technologies, a company that may have a commercial interest in the results of this research and technology. This potential conflict of interest has been reviewed and managed by OHSU.

References

  • 1.American Diabetes Association. Defining and reporting hypoglycemia in diabetes: a report from the American Diabetes Association Workgroup on Hypoglycemia. Diabetes Care. 2005;28(5):1245–1249. doi: 10.2337/diacare.28.5.1245. [DOI] [PubMed] [Google Scholar]
  • 2.Bergenstal R, Tamborlane W, Ahmann A, et al. Effectiveness of Sensor-Augmented Insulin-Pump Therapy in Type 1 Diabetes. N Engl J Med. 2010;363(4):311–320. doi: 10.1056/NEJMoa1002853. [DOI] [PubMed] [Google Scholar]
  • 3.Haidar A, Legault L, Messier V, et al. Comparison of dual-hormone artificial pancreas, single-hormone artificial pancreas, and conventional insulin pump therapy for glycemic control in patients with type 1 diabetes: an open-label randomized controlled crossover trial. Lancet Diabetes Endocrinol. 2015;3(1):17–26. doi: 10.1016/S2213-8587(14)70226-8. [DOI] [PubMed] [Google Scholar]
  • 4.Huyett LM, Dassau E, Zisser HC, Doyle FJ. Design and Evaluation of a Robust PID Controller for a Fully Implantable Artificial Pancreas. Ind Eng Chem Res. 2015;54(42):10311–21. doi: 10.1021/acs.iecr.5b01237. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Ramprasad Y, Rangaiah GP, Lakshminarayanan S. Robust PID Controller for Blood Glucose Regulation in Type I Diabetics. Industrial & Engineering Chemistry Research. 2004;43(26):8257–8268. [Google Scholar]
  • 6.Jacobs PG, El Youssef J, Castle J, et al. Automated control of an adaptive bihormonal, dual-sensor artificial pancreas and evaluation during inpatient studies. IEEE Trans Biomed Eng. 2014;61(10):2569–2581. doi: 10.1109/TBME.2014.2323248. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Jacobs PG, Resalat N, El Youssef J, et al. Incorporating an Exercise Detection, Grading, and Hormone Dosing Algorithm Into the Artificial Pancreas Using Accelerometry and Heart Rate. J Diabetes Sci Technol. 2015;9(6):1175–1184. doi: 10.1177/1932296815609371. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Magni L, Raimondo DM, Bossi L, et al. Model predictive control of type 1 diabetes: an in silico trial. J Diabetes Sci Technol. 2007;1(6):804–812. doi: 10.1177/193229680700100603. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Boiroux D, Batora V, Hagdrup M, et al. Comparison of Prediction Models for a Dual-Hormone Artificial Pancreas. IFAC-PapersOnLine. 2015;48(20):7–12. [Google Scholar]
  • 10.Hovorka R, Canonic V, Chassin LJ, et al. Nonlinear model predictive control of glucose concentration in subjects with type 1 diabetes. Physiol Meas. 2004;25(4):905–920. doi: 10.1088/0967-3334/25/4/010. [DOI] [PubMed] [Google Scholar]
  • 11.Wilinska ME, Chassin LJ, Schaller HC, et al. Insulin kinetics in type-I diabetes: continuous and bolus delivery of rapid acting insulin. IEEE Trans Biomed Eng. 52(1):3–12. doi: 10.1109/TBME.2004.839639. [DOI] [PubMed] [Google Scholar]
  • 12.Lv D, Breton MD, Farhy LS. Pharmacokinetics modeling of exogenous glucagon in type 1 diabetes mellitus patients. Diabetes Technol Ther. 2013;15(11):935–941. doi: 10.1089/dia.2013.0150. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Hernández-Ordoñez M, Campos-Delgado DU. An extension to the compartmental model of type 1 diabetic patients to reproduce exercise periods with glycogen depletion and replenishment. J Biomech. 2008;41(4):744–752. doi: 10.1016/j.jbiomech.2007.11.028. [DOI] [PubMed] [Google Scholar]
  • 14.Wang L. Advances in Industrial Control. Vol. 1. Springer; 2009. Model Predictove Control System Design and Implementation Using Matlab; pp. 1–39. [Google Scholar]
  • 15.Yardley JE, Kenny GP, Perkins BA, et al. Resistance versus aerobic exercise: acute effects on glycemia in type 1 diabetes. Diabetes Care. 36(3):537–42. doi: 10.2337/dc12-0963. [DOI] [PMC free article] [PubMed] [Google Scholar]

RESOURCES