#### Abstract

Automated closed-loop insulin infusion therapy has been studied for many years. In closed-loop system, the control algorithm is the key technique of precise insulin infusion. The control algorithm needs to be designed and validated. In this paper, an improved PID algorithm based on insulin-on-board estimate is proposed and computer simulations are done using a combinational mathematical model of the dynamics of blood glucose-insulin regulation in the blood system. The simulation results demonstrate that the improved PID algorithm can perform well in different carbohydrate ingestion and different insulin sensitivity situations. Compared with the traditional PID algorithm, the control performance is improved obviously and hypoglycemia can be avoided. To verify the effectiveness of the proposed control algorithm, *in silico* testing is done using the UVa/Padova virtual patient software.

#### 1. Introduction

Diabetes, a disorder of endocrine metabolism, is an incurable disease. Diabetes affects millions of people in the world, and it is a disease with considerable complications including retinopathy, nephropathy, peripheral neuropathy, and blindness [1]. According to a prediction produced by the International Diabetes Federation in 2014, approximately 387 million people suffered from diabetes worldwide by 2014 and about 592 million patients by 2035 [2]. Thus, the maintenance of blood glucose concentration in a normal range is of critical importance for diabetic.

Type 1 diabetes is mainly due to the reason that the *β*-cell of pancreas cannot secrete insulin. They must rely on exogenous insulin to regulate blood glucose concentration. Currently, patients with type 1 diabetes are treated with either multiple daily injections (MDI) or continuous subcutaneous insulin infusion (CSII) delivering via an insulin pump [3]. The CSII has shown more advantages than MDI method because of the increasing flexibility of diet, exercise, convenience, and precision [4]. Various open-loop insulin pumps that are available in the market are programmable to deliver the required amount of insulin. However, a fully automated closed-loop insulin infusion system that can deliver appropriate amounts of insulin to patients without any manual interference is developing [5]. The closed-loop system contains three main components, which are continuous glucose monitoring (CGM), intelligent controller, and insulin pump.

For open-loop insulin pump, a bolus calculator is used to calculate bolus insulin doses that can help diabetic regulate the postprandial blood glucose concentration. The bolus calculator takes into account many factors, such as current blood glucose, target blood glucose, amount of carbohydrate ingested, insulin sensitivity, correction factor (CF), and insulin : carbohydrate ratio (I : C) as well as duration of insulin action (“insulin on board (IOB)”) [4].

For closed-loop insulin pump, the real-time CGM system is already commercially available and the control algorithm is the key technique of precise insulin infusion. The control algorithm requires high robustness and reliability. There are various control algorithms including PID control [6], model predictive control (MPC) [7, 8], optimal control [9], adaptive control [10], and sliding mode control [11]. Among those control algorithms, the PID controller is widely used in industrial control systems. The PID controller is attractive for blood glucose control based on the features of simple structure with few parameters, easy implementation, good adaptation, and robustness.

Many closed-loop control algorithms had not considered the IOB factor. A limitation of IOB can optimize the output of control algorithm and decrease the risk of hypoglycemia. As the open-loop insulin pump, the previous insulin administration may lead to hypoglycemia. So the IOB estimate is considered to limit the insulin infusion dose. In this paper, the improved PID control algorithm based on IOB estimate is introduced. Controller performance is evaluated in a simulation study under a physiological model and considered the carbohydrate ingestion and insulin sensitivity changed. Also, the UVa/Padova virtual patient software is used to verify the effectiveness of PID controller with IOB estimate.

The paper is organized as follows. In Section 2, a combinational complicated and detailed model of glucose-insulin kinetic is introduced, which is based on the Hovorka et al. and Dalla Man et al. model. The PID controller with IOB estimate is designed, and the performance is evaluated by simulation in Section 3. The* in silico* testing using ten virtual patients is discussed in Section 4. The final conclusion is located in Section 5.

#### 2. Glucose-Insulin Mathematical Model

Mathematical models of glucose-insulin interactions have been studied for over the past 50 years. Simple linear models were proposed by Ackerman et al. [12]. More complicated nonlinear models were proposed in later studies. In many of these models, compartmental modeling approach has been used. In this approach, the body is divided into compartments representing different organs or parts of the body and mass balance equations are derived for each compartment. The compartmental minimal model of Bergman et al. [13] has been widely used in many studies. More complicated compartmental models proposed by Cobelli and Mari [14], Hovorka et al. [15], and Dalla Man et al. [16] have considered more compartments for better understanding the behavior of different parts of the body. These models for glucose-insulin interactions have been widely used in studying the physiological behavior of diabetic patients.

In this paper, the glucose and insulin metabolic model refers to the model developed by Hovorka et al. [15] and Dalla Man et al. [16, 17]. The Hovorka model is a nonlinear compartmental model with three subsystems for glucose, insulin, and insulin action. The carbohydrate digestion and absorption model refers to Dalla Man’s model in this paper. The combinational model is close to a realistic patient model.

##### 2.1. Glucose Subsystem

The glucose subsystem is divided into two compartments: masses of glucose in the accessible compartment and masses of glucose in the nonaccessible compartment. The core model is a two-compartment representation of glucose kinetics. Considerwhere and are the masses of glucose in the accessible and nonaccessible compartments, respectively. is the transfer rate constant from the nonaccessible to the accessible compartment. is the distribution volume of the accessible compartment. is the glucose concentration. is the endogenous glucose production extrapolated to the zero insulin concentration. is the total insulin-independent glucose flux, corrected for the ambient glucose concentration. is the renal glucose clearance above the glucose threshold of 162 mg/dL. The gut absorption rate is introduced in Section 2.4 of carbohydrate digestion and absorption model.

##### 2.2. Insulin Subsystem

The insulin subsystem describes the insulin absorption and insulin action on glucose kinetics. The plasma insulin concentration is described bywhere is the fractional elimination rate and is the distribution volume.

##### 2.3. Insulin Action Subsystem

The three insulin actions on glucose kinetics are represented bywhere , , and are the effects of insulin on glucose distribution/transport, glucose disposal, and endogenous glucose production, respectively; , , and are the deactivation rate constants; , , and are the activation rate constants.

The insulin sensitivities of glucose distribution/transport and glucose intracellular disposal are represented individually as follows:

##### 2.4. Carbohydrate Digestion and Absorption

The carbohydrate digestion and absorption model consists of three-compartment nonlinear model, two for the glucose in the stomach solid and liquid and one for the glucose in the intestinal tract . Considerwhere is the amount of carbohydrate to be ingested, is the impulse function, is the rate of grinding coefficient in the stomach, is the rate of fractional coefficient with which the chyme enters the intestine, and is the rate constant of intestinal absorption.

#### 3. PID Controller with IOB Estimate

##### 3.1. Insulin-on-Board Estimate

The insulin on board is defined as the amount of administered insulin that is still active in the body. Some insulin pump estimates the IOB to correct the boluses in order to avoid hyper- or hypoglycemia [4]. The IOB estimate is based on the insulin action curves. Here the IOB estimation is represented by a two-compartment dynamical model:where and are the two compartments and is the insulin dose. The constant is tuned for each patient so model replicates the corresponding . Figure 1 shows the insulin activity curves obtained with model for typical value, while Table 1 shows the corresponding values for typical values [18]. The insulin action is different among each individual; there are many factors, such as exercise, stress, illness, and heat. The different insulin action curves are provided by insulin pump to calculate insulin bolus.

The insulin duration ranges from 2 h to 8 h; diabetes patient should choose a reasonable duration time. If patient sets the duration of insulin action time less than the actual time, it will increase the risk of hypoglycemia. The insulin pump indicates that there has been no longer active IOB and will infuse more insulin dose to consume blood glucose. On the other hand, if patient sets the duration of insulin action time longer than the actual time, it will increase the risk of hyperglycemia. The patient will take a smaller insulin dose than is necessary to regulate the blood glucose back to the set value.

##### 3.2. Design of PID Controller with IOB Estimate

The structure of the PID controller with IOB estimate is demonstrated in Figure 2, where is the real blood glucose concentration of diabetes patient, is the measured blood glucose by glucose sensor, is the target blood glucose concentration, and is the final insulin infusion rate.

The control law is as follows:where is the closed-loop control output. is the error of the target blood glucose and the measured blood glucose. is the basal insulin infusion rate. There are three adjustable parameters: proportional gain (), integral time (), and derivative ().

The control output of insulin infusion rate is based on the IOB estimate and the constraint output of insulin infusion. Figure 3 shows the inner structure of control algorithm. The output of controller iswhere the gain is obtained as the average value of and the value is set as .

The IOB estimate is based on the error of the (6) and limit. In [19], the author proposed a method to calculate the limit. The value is obtained at time: , where is the amount of carbohydrate intake. Although each meal is different for a patient, the corresponding limits are practically equal. For different duration of insulin action, the value of is different. The error is

Based on (6) and (9), the time evolution of is governed bythat is,from (11), after infusing the insulin, the IOB increases quickly surpassing the ; hence . The switching turns to 0. When IOB falls under the , becomes a positive value and switches to 1. Under the control mode, switches between 0 and 1. We calculate the value during each 10 min period, and the gain is the average value of . So the proposed control algorithm can decrease the insulin infusion rate and avoid the hypoglycemia event.

In this paper, the upper constraint output of PID controller is considered. The upper constraint is based on the IOB estimate, correction factor, and I : C ratio. The significance of upper constraint is to avoid overinfusion of insulin. It is calculated by the following condition: where is the maximum constraint output of insulin infusion rate and is the amount of insulin needed to compensate for a given meal and is calculated by where is the mass of a given meal and I : C ratio is that 1 unit of insulin can consume the amount of CHO. is the amount of insulin needed to correct for a positive deviation from the target glucose concentration and is calculated by the following condition: where and are the current measured and target blood glucose concentrations, respectively. is the correction factor.

##### 3.3. Simulation Results

The proposed control algorithm is evaluated under the glucose-insulin mathematical model mentioned in Section 2. Table 2 shows the simulation conditions.

Figure 4(a) shows the glucose responses using the proposed PID controller with and without limitation under the conditions. It can avoid the hypoglycemia event after three different meals ingested. When the estimated IOB reaches the limitation constraint, the switching law begins to take effect. The IOB dose falls below its limitation. Figure 4(b) shows the IOB dose responses with and without limitation.

**(a)**

**(b)**

Figure 5 shows the glucose responses under the h, and h, conditions. Under different duration of insulin action, the value of limitation needs to be calculated again. The simulation results indicate that the PID control with IOB estimate is effective and stabile for blood glucose control.

**(a)**

**(b)**

We all know that the insulin sensitivity (IS) is varied during a 24-hour period. The IS is employed for each of the three insulin sensitivity parameters in the Hovorka model. There are three values: , , and . The maximum and minimum values of varied randomly on a daily basis following uniform distributions. is equal to . is equal to [3]. In our simulations, increases during 0–1000 min, and decreases after 1000 min. To an extent, it can test the performance of controller. Figure 6 compares the glucose responses for insulin sensitivity changes under the proposed controller. It can avoid the hyperglycemia or hypoglycemia.

In order to evaluate the performance of control algorithm, the blood glucose index (BGI) and standard deviation (SD) are adopted. The BGI is a metric proposed by Kovatchev et al. [20], to evaluate the risk for hypoglycemia and hyperglycemia. BGI is equal to LBGI + HBGI, where LBGI and HBGI are low and high BG readings, respectively. SD is the standard deviation of glucose concentration. The statistical results are given in Table 3. Both PID controller and PID controller with IOB estimate are analyzed under the different insulin sensitivity. In all situations, the proposed controller has smaller BGI and SD values compared with PID controller. It demonstrates that the improved controller performs well.

#### 4. *In Silico* Test on Virtual Patient

In order to evaluate the performance of the proposed PID controller, the test is performed on ten virtual subjects using the UVa/Padova virtual patient software. The patients are assumed to have three meals in a day. The multiple meals are 30 g CHO at 7 a.m., 50 g at 12 p.m., and 40 g at 6 p.m.

In the simulation, the control-variability grid analysis (CVGA) provides a summary of the quality of glucose regulation for a virtual subject [21]. CVGA plays an important role in the tuning of closed-loop glucose control algorithms and also in the comparison of their performance. Each subject presents by one data point for any given observation period. There are nine rectangular zones that are defined as follows: A-zone means accurate control, Lower B-zone means benign deviations into hypoglycemia, Upper B-zone means benign deviations into hyperglycemia, B-zone means benign control deviations, Lower C means overcorrection of hyperglycemia, Upper C means overcorrection of hypoglycemia, Lower D means failure to deal with hypoglycemia, Upper D means failure to deal with hyperglycemia, and E means erroneous control. Considering the sensor noise, the - coordinates of CVGA would be the 95% confidence bound of a virtual patient’s data.

The results indicate that 30% of virtual subjects are within A-zone and 70% of virtual subjects are within B-zone under the traditional PID controller as shown in Figure 7(a) and 80% of virtual subjects are within A-zone and 20% of virtual subjects are within B-zone under the PID controller with IOB estimate as shown in Figure 7(b). The results indicate that the PID controller with IOB estimate is effective and robust. The blood glucose can be regulated more accurately than the traditional PID controller. It is excellent performance in tight blood glucose control and avoiding the hypoglycemic.

**(a)**

**(b)**

#### 5. Conclusions

An improved PID algorithm for blood glucose control is presented. The features of the proposed control algorithm are that the PID controller is based on the IOB estimate and the upper constraint. The control algorithm is evaluated using a combinational glucose-insulin mathematical model. The simulation results have demonstrated that the hypoglycemic events can be avoided and the glucose responses in a reasonable range under multimeal ingested and insulin sensitivity changed. The statistical results also indicate that the BGI and SD values are smaller compared with the traditional PID control. Based on the* in silico* test, the CVGA indicates that the proposed PID controller can regulate glucose in an accurate control range and reduce the risk of hypoglycemic. It is demonstrated to be very robust and effective. The simulations of this paper will provide useful theoretical basis for blood glucose control.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

#### Acknowledgments

This work was supported by the Fundamental Research Funds for the Central Universities, (Grant no. HIT. IBRSEM. 201307) and the program for Harbin City Science and Technology Innovation Talents of Special Fund Project (Grant no. 2014RFXXJ065).