# Dynamic Rule-Based Algorithm to Tune Insulin-on-Board Constraints for a Hybrid Artificial Pancreas System

Authors: Arthur Bertachi; Lyvia Biagi; Aleix Beneyto; Josep Vehí
Journal: Journal of Healthcare Engineering
 (2020)

---

## Abstract

The artificial pancreas (AP) is a system intended to control blood glucose levels through automated insulin infusion, reducing the burden of subjects with type 1 diabetes to manage their condition. To increase patients’ safety, some systems limit the allowed amount of insulin active in the body, known as insulin-on-board (IOB). The safety auxiliary feedback element (SAFE) layer has been designed previously to avoid overreaction of the controller and thus avoiding hypoglycemia. In this work, a new method, so-called “dynamic rule-based algorithm,” is presented in order to adjust the limits of IOB in real time. The algorithm is an extension of a previously designed method which aimed to adjust the limits of IOB for a meal with 60 grams of carbohydrates (CHO). The proposed method is intended to be applied on hybrid AP systems during 24 h operation. It has been designed by combining two different strategies to set IOB limits for different situations: (1) fasting periods and (2) postprandial periods, regardless of the size of the meal. The UVa/Padova simulator is considered to assess the performance of the method, considering challenging scenarios. In silico results showed that the method is able to reduce the time spent in hypoglycemic range, improving patients’ safety, which reveals the feasibility of the approach to be included in different control algorithms.


---

## Body

## 1. Introduction

Type 1 diabetes (T1D) is a chronic condition in which the pancreatic beta-cells either stop or reduce drastically the production of insulin. Insulin is a hormone whose function is to facilitate the glucose uptake from the bloodstream into the cells to be used or stored. Subjects with absence of insulin in the body face very high levels of blood glucose (BG) (hyperglycemia), which can lead to long-term micro- and macrovascular complications [1, 2]. Therefore, subjects living with T1D must inject insulin exogenously in order to regulate blood in a lifelong challenge [3], and intensive insulin therapy reduces the risk of long-term complications [4]. But maintaining blood glucose levels into near-normoglycemia is not a trivial task, and if insulin is overdosed, BG may fall to dangerously low levels (hypoglycemia), which can lead to serious hazards, such as diabetic coma or even death [5].Over the last years, researchers have been working towards a closed-loop system to control BG automatically [6]. This system, known as artificial pancreas (AP), is usually composed of a continuous glucose monitor (CGM), a control algorithm, and continuous subcutaneous insulin infusion through a pump. Insulin-only AP systems consider only insulin infusion to control BG, and dual-hormone AP systems also consider glucagon infusion to elevate BG to reduce the risk of hypoglycemia. AP systems can also be classified into two different categories based on the degree of automation: hybrid closed-loop system, in which subjects are involved in the control loop and must announce meals or other disturbances to anticipate their effects, and fully closed-loop systems, where no actions are required from the patients [7, 8].One of the main challenges of the AP system is achieving postprandial glucose control mainly because the insulin absorption through the subcutaneous tissue is slower than the appearance of glucose in the blood after a meal [9]. Due to this difference in dynamics of insulin action and carbohydrate (CHO) absorption, attempts to avoid hyperglycemic peaks are usually accompanied by hypoglycemic excursions [10]. Several approaches have been tested to overcome such issue [11–14], but while an ultrarapid insulin analogue is not available [15], postprandial control using subcutaneous route will continue to be a challenging situation for closed-loop systems. Diverse studies have included estimations of insulin concentration in the body to avoid excessive insulin stacking [16–19]; however, hypo- and hyperglycemia are still a hazard for AP systems, and novel approaches are still required.Revert and colleagues introduced a safety auxiliary feedback element, so-called SAFE layer [20], to limit excessive insulin in the subcutaneous tissue, i.e., insulin-on-board (IOB). This layer is based on the sliding mode reference conditioning technique [21] and acts on the glucose reference signal when a specific constraint, related with the maximum IOB allowed (IOB¯), is violated. Such technique has already been applied in different control schemes [22–25], but so far it is not clear the best methodology to tune IOB¯. The selection of the constraint IOB¯ is critical in the design of the closed-loop system. This parameter regulates insulin infusion based on an estimation of the IOB. As higher IOB¯, more insulin the controller will be allowed to deliver. Considering that once insulin is injected into the body, it cannot be removed, it will act naturally lowering BG levels.The Spanish Consortium on Artificial Pancreas and Diabetes Technology has been working over the last decade on the development of a new artificial pancreas system. In the first clinical trial, to evaluate the performance of the PD controller with the SAFE layer, an individualized constraintIOB¯ was designed to control postprandial BG levels after the consumption of a meal with 60 grams of CHO [26]. The closed-loop controller achieved better outcomes compared with the open-loop therapy, reducing significantly the time spent in hyperglycemia without increase the risk of hypoglycemia. However, a limitation of this study is that IOB¯ was tuned for this specific meal size. Therefore, novel approaches on how to select IOB¯ for meals of different sizes are required to cope with daily-life operation of an AP system. In this work, a novel approach to tune IOB¯ is presented. This new approach takes into account previous open-loop therapy to set IOB¯ for periods without meals and in case of the announcement of meals, IOB¯ can be raised to reduce hyperglycemia without leading to hypoglycemia in the late postprandial period. The proposal is evaluated in silico using the UVa/Padova simulator [27].


## 2. Materials and Methods

### 2.1. Control-Loop Scheme

In this section, the control scheme considered in this work is introduced. The control algorithm consists of two loops, as depicted by Figure1. The inner loop is composed by a proportional derivative (PD) controller with an insulin feedback (IFB) loop. The outer loop contains the SAFE layer [20], which is inspired on the sliding mode reference conditioning technique [21]. This SAFE layer applies a discontinuous signal generated by a switching law when estimations of IOB (IOB^) surpass a preset limit of IOB (IOB¯). Later, the discontinuous signal is filtered generating a smooth reference signal (Grf) to be applied into the controller. Therefore, this safety layer is able to maintain IOB inside desired bounds.Figure 1
Control scheme based on a PD controller with IFB and with the SAFE layer. PK, pharmacokinetic.The control action produced by the PD controller is presented as follows:(1)updt=KpGrft−Gt+TdG˙t,where Kp is the proportional gain, Td is the derivative time, Grf is the glucose reference filtered after the action of the SAFE layer, and Gt is the interstitial BG measurements provided by the CGM.Then, the control action computed by the PD is augmented by two feed-forward signals:ubolus and ubasal. The signal ubasal is the insulin obtained from patients’ daily basal profile. The term ubolus is an impulse signal in case of the announcement of meals to compensate the disturbance caused by the ingestion of CHO.The IFB algorithm [28] emulates the beta-cell physiology in healthy subjects, suppressing insulin secretion as plasma insulin concentration increases. The combination of the PD algorithm with both SAFE layer and IFB algorithm has already been investigated and shown to be more effective than when they are used separately [29]. The final control action signal provided to the insulin pump is(2)udt=updt+ubasalt+ubolus−γI^pt,where γ is gain parameter and I^p is the is the estimated deviation of plasma insulin from steady state conditions (basal levels).The termGrf in equation (1) is the conditioned reference due to the action of the SAFE layer to maintain IOB below IOB¯. Since the IOB is inaccessible, an insulin absorption model is considered to estimate IOB [30], through the following equation:(3)C˙1t=udt−KDIAC1t,C˙2t=KDIAC1t−C2t,IOB^t=C1t+C2t,where C1t and C2t are two compartments, KDIA is a constant related with the duration of insulin action (DIA), and IOB^ is the estimation of IOB. The SAFE layer has a software-based nature and consists of two main elements: a switching block responsible to generate a discontinuous signal to maintain IOB^ into the desired range and a first-order filter to smooth the discontinuous signal before being applied to the main controller.Consider the sliding functionσt defined by equation (4), the switching logic is defined as follows:(4)σt=IOB^t−IOB¯t+τIOB^˙t−IOB¯˙t,(5)ωt=W,ifσt>0,0,otherwise,with W > 0 mg/dl.Finally, the discontinuous signal is filtered by the following equation and generates smooth changes in the glucose reference signal:(6)G˙rft=−λGrft−Grt+ωt.Note that whenσt>0, IOB^ is greater than IOB¯. In order to drive IOB^ to the desired range, i.e., below IOB¯, ud must be decreased. The addition of W in equation (6) generates Grf greater than Gr, diminishing the insulin suggestion provided by the main controller and thus reducing IOB^. When IOB^ is below IOB¯, no further action is provided by the outer loop, letting the controller work freely.


### 2.2. IOB Constraint Tuning

The selection of the constraintIOB¯ is a critical point in the design of the control system. In this work, a new tuning approach for IOB¯ is presented. In patients with T1D, insulin requirements vary during the day and also between days (intra- and interday variability). On traditional insulin pump therapy, physicians configure patients’ pump to deliver a steady flow of basal insulin to cope with intraday variability. In addition, insulin boluses are delivered when meals are informed by patients, to cover the disturbance caused on glycemic balance due to the ingestion of CHO [3].The artificial pancreas under development by our research group has been evaluated clinically, where 20 T1D subjects (age 40.7 ± 10.4 years, T1D duration 22.2 ± 9.9 years, and A1c 7.8 ± 0.7%) used the CL system in front of a mixed meal containing 60 grams of CHO [26]. In this trial, an individualized IOB¯ tune was considered in order the improve postprandial glycemic control when compared with standard open-loop therapy. For this specific trial, where a single meal with 60 grams of CHO was consumed, IOB¯ was adjusted based on parameters taken from patients’ open-loop therapy and computed in an offline procedure. The procedure to compute IOB¯ was as follows: considering that patients were in basal levels of IOB, IOB¯ was computed as the estimation of IOB levels 90 minutes after the administration of an augmented bolus, by equation (3), to compensate this 60 grams meal. This augmented bolus was computed by adding to the standard bolus the amount of basal insulin that would have been delivered in the next hour in the case of being in open-loop therapy. Therefore, knowing in advance the size of the meal and all the parameters necessary to compute this augmented bolus, it was possible to compute in an offline fashion what would be the estimation of IOB levels 90 minutes after the meal bolus. This single value was applied as IOB limit during in this clinical trial [26].Due to the huge amount of insulin in meal boluses,IOB^ violates IOB¯, and a high frequency discontinuous signal is generated by the SAFE layer in order to return IOB^ back to IOB¯ bounds. This action forces insulin delivery to zero for approximately 90 minutes, minimizing the effects of controller’s overcorrection. When σt≤0 (equation (4)), insulin infusion may be restored if the controller deems necessary.However, a single value ofIOB¯ may not be sufficient for 24-hour operation, especially due to the large intrapatient variability in T1D and to the different activities performed by subjects in their daily-life. The major problem observed in the strategy presented previously is that too high values of IOB¯ may cause that the SAFE layer be ineffective because it will act in very few conditions, e.g., only after a meal bolus. It is comprehensible having higher IOB¯ tuning during postprandial periods, especially because subjects tend to underestimate the CHO content in meals [31]. However, during late postprandial period, where the effects of meals have been covered either by the bolus or by the controller suggestions, such high values of IOB¯ may lead to excess of insulin in the body, increasing the risk of hypoglycemia.In this work, a new method to tuneIOB¯ to overcome the limitations presented by the former strategy is proposed. The new approach is called “dynamic rule-based” (DRB) algorithm and is intended to be used on hybrid artificial pancreas systems for 24-hour operation, where meals of any size are consumed. The proposed approach combines two different strategies to set IOB¯ for different situations: (1) fasting periods: where no big disturbance is expected, and the controller must deal mainly with intraday variability and (2) postprandial periods: where a substantial raise in BG levels is expected due to the consumption of a meal and insulin bolus may not be enough to compensate such disturbance. In summary, the DRB algorithm generates a time-varying IOB¯ based on patients’ basal insulin profile taken from open-loop therapy, and when a meal is announced, the algorithm evaluated in real-time if IOB¯ should be increased temporarily in order to reduce hyperglycemia. The following sections depict the algorithm, and a flowchart is also presented in Figure 2 to clarify the operation of the DRB algorithm.Figure 2
Flowchart describing how the proposed dynamic rule-based algorithm works.


#### 2.2.1. Fasting Periods

During fasting period (sleeping hours or daytime fasting periods), the absence of external disturbances makes the intraday variability the major challenge for the controller. The basal insulin profile from patients’ open-loop therapy is considered to create a baseline forIOB¯:(7)IOB¯blt=KIOB2⋅ubasalt60⋅KDIA,where IOB¯bl is the baseline for IOB¯ and KIOB is a gain that regulates the amplitude of IOB¯bl, with KIOB>0. In case of KIOB<1, IOB^ will not be allowed to be greater than it would have been during open-loop therapy. On the contrary, with KIOB>1, the insulin controller can suggest more insulin than what is programmed by the open-loop therapy. Thus, KIOB should be selected in order to protect patients from hypoglycemia but also allowing the control algorithm to suggest insulin above open-loop regimen when necessary. Thus, during fasting periods, IOB¯ is set to be equal to IOB¯bl. In this work, the parameter KIOB is set to 1.3 for daytime period (06:00–23:00) and to 1.1 for night-time period (23:00–06:00).Although this approach may be able to provide good glycemic control in front of intraday variability, patients in free-living conditions take CHO on several occasions during the day, requiring a greater amount of insulin for these periods. Therefore, the strategy ofIOB¯ during fasting periods is combined with another one, intended for postprandial periods, presented in the following section.


#### 2.2.2. Postprandial Periods

The tuning ofIOB¯ during postprandial period is an extension to the method already validated clinically by Rossetti and colleagues [26]. Here, the method is generalized for meals with different amount of CHO and also includes a set of rules based on BG readings to modify IOB¯. This set of rules has been designed to determine if it is necessary to increase IOB¯, for cases which the bolus was not enough to drive BG to near-normoglycemia levels.The method works as follows: in case of the announcement of a meal, an insulin bolus is delivered as a feed-forward action. This bolus is an augmented version of the standard bolus computation, by adding a portion of the future basal delivery according to the size of the meal, as shown in the following equation:(8)ubolus=MCHOI2C+Gt−GrCF+∫tt+MCHOubasaltMCHO60,where MCHO is the content of CHO of the meal (in grams), I2C is the insulin-to-CHO ratio, Gr is the BG reference, and CF is the correction factor.After the bolus,IOB^ surpasses IOB¯, and then ufinal is forced to zero, while IOB^ is greater than IOB¯, due to the action of the SAFE layer. The parameter TIOB (in minutes, equation (9)) is introduced to regulate the starting time after the meal from when IOB¯ may be increased. After TIOB minutes, BG readings start to be evaluated in order to check whether IOB¯ needs to be increased, aiming to drive BG below a selected target (G¯). If in this moment, BG is greater than a threshold (G¯), a new IOB limit is computed to control postprandial BG, based on equation (10). This value is maintained as IOB¯, while BG is greater than G¯. Finally, when BG returns to values below G¯, IOB¯ returns to follow IOB¯bl. Note that the parameters G¯ and G¯ can be adjusted intuitively by physicians. For a more aggressive postprandial control, these parameters should be decreased as follows:(9)TIOB=1.5⋅MCHO,(10)IOB¯PP=maxIOB^t−1,IOB¯blt.The final tuning forIOB¯ is determined during a real-time procedure, based on the dynamic behavior of patients basal insulin profile and also in the set of rules activated after the announcement of meals, to increase IOB¯ during postprandial periods. Figure 2 depicts a flowchart of the proposed method to facilitate the understanding.The variables “PP_state” and “flag_PP” included in Figure2 were considered for implementation purposes. In the initialization of the system, both variables should be set to zero. “PP_state” indicates that a meal has been consumed, and that IOB¯ may be increased considering a set of rules to evaluated BG levels TIOB minutes after the announcement of the meal. The variable “flag_PP” guarantees that a single value of IOB¯PP is computed for each meal. Figure 3 depicts the application of the method in one representative virtual patient during a simulation, with a meal containing 45 g of CHO at 07:30 (represented by the green triangle in Figure 3(a)). Note that 67.5 minutes after the meal (computed by equation (9)), the limit of IOB has been increased because BG levels were above G¯. When IOB¯ was increased, the controller suggested more insulin in order to reduce the postprandial excursions since the insulin bolus was not enough for this specific meal. This period of time represents the first meal of a single patient during Scenario C, which is detailed in Section 2.3.3.Figure 3
Operation of the dynamic rule-based algorithm during a postprandial period. Note that, after the meal (consumed at 07:30 and represented by the green triangle), the algorithm deemed necessary to increaseIOB¯ because BG levels were above G¯. (a) BG measurements in mg/dl. (b) Insulin delivery. (c) The conditioned reference signal Grf. (d) Estimation of IOB levels and the constraint IOB¯.
(a)
(b)
(c)
(d)In summary, the DRB algorithm has been designed to make use of patients’ basal profile, which is an indicative of insulin requirements along the day, combined with a modified version of the approach already tested clinically with real patients, which achieved good results during postprandial control. In addition, BG measurements has been incorporated to setIOB¯, aiming to track glucose back to regular values safely. All the relevant parameters used in the simulations are listed in Table 1.Table 1
Parameters considered in this work for both inner and outer loops.
Parameter
Value
Unit
K
p
TDI
/
2250
U
/
min
T
d
90
min
G
r
100
md
/
dl
Γ
0.42
L
/
min
W
350
mg
/
dl
Τ
10
min
Λ
0.1
min
K
DIA
0.013
min
−
1
G
¯
150
mg
/
dl
G
¯
140
mg
/
dl
TDI, total daily insulin.


### 2.3. In Silico Evaluation

The proposed method is validated in the UVa/Padova simulator [27] on three challenging scenarios, including intrapatient variability in insulin sensitivity and in meal absorption rate [32].Circadian variability has been included to simulate different requirements of insulin during the day and follows a sinusoidal variation. The parametersVmx and kp3, which are related with the insulin sensitivity are modified as follows:(11)qt=q0+0.3⋅q0⋅sin2π24⋅60t+2π⋅rand,where qt is the corresponding time-varying parameter; q0 is the default individual parameter value (Vmx or kp3), and rand is a uniformly distributed random number between 0 and 1.Additionally, meal absorption rate and insulin absorption parameters (parameterskabs, kd, ka1, and ka2) assume different values (±30% around the standard value) after every single meal consumption. Further details about the aforementioned parameters are described elsewhere [27, 33].


#### 2.3.1. Scenario A

This scenario is considered to compare the performance of the DRB algorithm (IOB¯DRB) against the method already validated clinically, with a fixed value for IOB¯ (IOB¯F). In a 7-day scenario, the adult cohort consumed a single meal containing 60 grams of CHO per day, between 10:00 and 16:00, in order to assess the postprandial control under different intrapatient variability conditions. This amount of CHO has been selected to conduct a fairly comparison since the former strategy was clinically validated for this specific meal size.


#### 2.3.2. Scenario B

This scenario is considered to compare the performance of the DRB algorithm (IOB¯DRB) in front of meals with CHO content varying between 40 and 120 grams of CHO. In a 45-day scenario, the adult cohort consumed a single meal per day, between 08:00 and 19:00, in order to assess the postprandial control under different intrapatient variability conditions. It is considered just a single meal per day in order to avoid the accumulated effects of meals in the results.


#### 2.3.3. Scenario C

A 14-day scenario is considered to assess the performance of the proposed method intended to mimic real-life operation of the AP systems. A total of three meals, with different amounts of CHO, are consumed per day at 7:30 (45 grams), 13:00 (90 grams), and 18:30 (50 grams). An error of±15% on CHO counting has also been included to challenge the system. To apply meal absorption variability, the 10 mixed meal models from each patient were randomly assigned for each meal intake along with the simulation. A total of four different strategies are applied in this scenario: (1) the DRB algorithm to adjust IOB¯ (IOB¯DRB), (2) a fixed value of IOB¯ as used in Scenario A (IOB¯F), (3) IOB¯ is set to be equal to IOB¯bl, without the rules considered for postprandial period (IOB¯bl), and (4) the same insulin controller considered in other strategies, but without IOB¯.


## 2.1. Control-Loop Scheme

In this section, the control scheme considered in this work is introduced. The control algorithm consists of two loops, as depicted by Figure1. The inner loop is composed by a proportional derivative (PD) controller with an insulin feedback (IFB) loop. The outer loop contains the SAFE layer [20], which is inspired on the sliding mode reference conditioning technique [21]. This SAFE layer applies a discontinuous signal generated by a switching law when estimations of IOB (IOB^) surpass a preset limit of IOB (IOB¯). Later, the discontinuous signal is filtered generating a smooth reference signal (Grf) to be applied into the controller. Therefore, this safety layer is able to maintain IOB inside desired bounds.Figure 1
Control scheme based on a PD controller with IFB and with the SAFE layer. PK, pharmacokinetic.The control action produced by the PD controller is presented as follows:(1)updt=KpGrft−Gt+TdG˙t,where Kp is the proportional gain, Td is the derivative time, Grf is the glucose reference filtered after the action of the SAFE layer, and Gt is the interstitial BG measurements provided by the CGM.Then, the control action computed by the PD is augmented by two feed-forward signals:ubolus and ubasal. The signal ubasal is the insulin obtained from patients’ daily basal profile. The term ubolus is an impulse signal in case of the announcement of meals to compensate the disturbance caused by the ingestion of CHO.The IFB algorithm [28] emulates the beta-cell physiology in healthy subjects, suppressing insulin secretion as plasma insulin concentration increases. The combination of the PD algorithm with both SAFE layer and IFB algorithm has already been investigated and shown to be more effective than when they are used separately [29]. The final control action signal provided to the insulin pump is(2)udt=updt+ubasalt+ubolus−γI^pt,where γ is gain parameter and I^p is the is the estimated deviation of plasma insulin from steady state conditions (basal levels).The termGrf in equation (1) is the conditioned reference due to the action of the SAFE layer to maintain IOB below IOB¯. Since the IOB is inaccessible, an insulin absorption model is considered to estimate IOB [30], through the following equation:(3)C˙1t=udt−KDIAC1t,C˙2t=KDIAC1t−C2t,IOB^t=C1t+C2t,where C1t and C2t are two compartments, KDIA is a constant related with the duration of insulin action (DIA), and IOB^ is the estimation of IOB. The SAFE layer has a software-based nature and consists of two main elements: a switching block responsible to generate a discontinuous signal to maintain IOB^ into the desired range and a first-order filter to smooth the discontinuous signal before being applied to the main controller.Consider the sliding functionσt defined by equation (4), the switching logic is defined as follows:(4)σt=IOB^t−IOB¯t+τIOB^˙t−IOB¯˙t,(5)ωt=W,ifσt>0,0,otherwise,with W > 0 mg/dl.Finally, the discontinuous signal is filtered by the following equation and generates smooth changes in the glucose reference signal:(6)G˙rft=−λGrft−Grt+ωt.Note that whenσt>0, IOB^ is greater than IOB¯. In order to drive IOB^ to the desired range, i.e., below IOB¯, ud must be decreased. The addition of W in equation (6) generates Grf greater than Gr, diminishing the insulin suggestion provided by the main controller and thus reducing IOB^. When IOB^ is below IOB¯, no further action is provided by the outer loop, letting the controller work freely.


## 2.2. IOB Constraint Tuning

The selection of the constraintIOB¯ is a critical point in the design of the control system. In this work, a new tuning approach for IOB¯ is presented. In patients with T1D, insulin requirements vary during the day and also between days (intra- and interday variability). On traditional insulin pump therapy, physicians configure patients’ pump to deliver a steady flow of basal insulin to cope with intraday variability. In addition, insulin boluses are delivered when meals are informed by patients, to cover the disturbance caused on glycemic balance due to the ingestion of CHO [3].The artificial pancreas under development by our research group has been evaluated clinically, where 20 T1D subjects (age 40.7 ± 10.4 years, T1D duration 22.2 ± 9.9 years, and A1c 7.8 ± 0.7%) used the CL system in front of a mixed meal containing 60 grams of CHO [26]. In this trial, an individualized IOB¯ tune was considered in order the improve postprandial glycemic control when compared with standard open-loop therapy. For this specific trial, where a single meal with 60 grams of CHO was consumed, IOB¯ was adjusted based on parameters taken from patients’ open-loop therapy and computed in an offline procedure. The procedure to compute IOB¯ was as follows: considering that patients were in basal levels of IOB, IOB¯ was computed as the estimation of IOB levels 90 minutes after the administration of an augmented bolus, by equation (3), to compensate this 60 grams meal. This augmented bolus was computed by adding to the standard bolus the amount of basal insulin that would have been delivered in the next hour in the case of being in open-loop therapy. Therefore, knowing in advance the size of the meal and all the parameters necessary to compute this augmented bolus, it was possible to compute in an offline fashion what would be the estimation of IOB levels 90 minutes after the meal bolus. This single value was applied as IOB limit during in this clinical trial [26].Due to the huge amount of insulin in meal boluses,IOB^ violates IOB¯, and a high frequency discontinuous signal is generated by the SAFE layer in order to return IOB^ back to IOB¯ bounds. This action forces insulin delivery to zero for approximately 90 minutes, minimizing the effects of controller’s overcorrection. When σt≤0 (equation (4)), insulin infusion may be restored if the controller deems necessary.However, a single value ofIOB¯ may not be sufficient for 24-hour operation, especially due to the large intrapatient variability in T1D and to the different activities performed by subjects in their daily-life. The major problem observed in the strategy presented previously is that too high values of IOB¯ may cause that the SAFE layer be ineffective because it will act in very few conditions, e.g., only after a meal bolus. It is comprehensible having higher IOB¯ tuning during postprandial periods, especially because subjects tend to underestimate the CHO content in meals [31]. However, during late postprandial period, where the effects of meals have been covered either by the bolus or by the controller suggestions, such high values of IOB¯ may lead to excess of insulin in the body, increasing the risk of hypoglycemia.In this work, a new method to tuneIOB¯ to overcome the limitations presented by the former strategy is proposed. The new approach is called “dynamic rule-based” (DRB) algorithm and is intended to be used on hybrid artificial pancreas systems for 24-hour operation, where meals of any size are consumed. The proposed approach combines two different strategies to set IOB¯ for different situations: (1) fasting periods: where no big disturbance is expected, and the controller must deal mainly with intraday variability and (2) postprandial periods: where a substantial raise in BG levels is expected due to the consumption of a meal and insulin bolus may not be enough to compensate such disturbance. In summary, the DRB algorithm generates a time-varying IOB¯ based on patients’ basal insulin profile taken from open-loop therapy, and when a meal is announced, the algorithm evaluated in real-time if IOB¯ should be increased temporarily in order to reduce hyperglycemia. The following sections depict the algorithm, and a flowchart is also presented in Figure 2 to clarify the operation of the DRB algorithm.Figure 2
Flowchart describing how the proposed dynamic rule-based algorithm works.


### 2.2.1. Fasting Periods

During fasting period (sleeping hours or daytime fasting periods), the absence of external disturbances makes the intraday variability the major challenge for the controller. The basal insulin profile from patients’ open-loop therapy is considered to create a baseline forIOB¯:(7)IOB¯blt=KIOB2⋅ubasalt60⋅KDIA,where IOB¯bl is the baseline for IOB¯ and KIOB is a gain that regulates the amplitude of IOB¯bl, with KIOB>0. In case of KIOB<1, IOB^ will not be allowed to be greater than it would have been during open-loop therapy. On the contrary, with KIOB>1, the insulin controller can suggest more insulin than what is programmed by the open-loop therapy. Thus, KIOB should be selected in order to protect patients from hypoglycemia but also allowing the control algorithm to suggest insulin above open-loop regimen when necessary. Thus, during fasting periods, IOB¯ is set to be equal to IOB¯bl. In this work, the parameter KIOB is set to 1.3 for daytime period (06:00–23:00) and to 1.1 for night-time period (23:00–06:00).Although this approach may be able to provide good glycemic control in front of intraday variability, patients in free-living conditions take CHO on several occasions during the day, requiring a greater amount of insulin for these periods. Therefore, the strategy ofIOB¯ during fasting periods is combined with another one, intended for postprandial periods, presented in the following section.


### 2.2.2. Postprandial Periods

The tuning ofIOB¯ during postprandial period is an extension to the method already validated clinically by Rossetti and colleagues [26]. Here, the method is generalized for meals with different amount of CHO and also includes a set of rules based on BG readings to modify IOB¯. This set of rules has been designed to determine if it is necessary to increase IOB¯, for cases which the bolus was not enough to drive BG to near-normoglycemia levels.The method works as follows: in case of the announcement of a meal, an insulin bolus is delivered as a feed-forward action. This bolus is an augmented version of the standard bolus computation, by adding a portion of the future basal delivery according to the size of the meal, as shown in the following equation:(8)ubolus=MCHOI2C+Gt−GrCF+∫tt+MCHOubasaltMCHO60,where MCHO is the content of CHO of the meal (in grams), I2C is the insulin-to-CHO ratio, Gr is the BG reference, and CF is the correction factor.After the bolus,IOB^ surpasses IOB¯, and then ufinal is forced to zero, while IOB^ is greater than IOB¯, due to the action of the SAFE layer. The parameter TIOB (in minutes, equation (9)) is introduced to regulate the starting time after the meal from when IOB¯ may be increased. After TIOB minutes, BG readings start to be evaluated in order to check whether IOB¯ needs to be increased, aiming to drive BG below a selected target (G¯). If in this moment, BG is greater than a threshold (G¯), a new IOB limit is computed to control postprandial BG, based on equation (10). This value is maintained as IOB¯, while BG is greater than G¯. Finally, when BG returns to values below G¯, IOB¯ returns to follow IOB¯bl. Note that the parameters G¯ and G¯ can be adjusted intuitively by physicians. For a more aggressive postprandial control, these parameters should be decreased as follows:(9)TIOB=1.5⋅MCHO,(10)IOB¯PP=maxIOB^t−1,IOB¯blt.The final tuning forIOB¯ is determined during a real-time procedure, based on the dynamic behavior of patients basal insulin profile and also in the set of rules activated after the announcement of meals, to increase IOB¯ during postprandial periods. Figure 2 depicts a flowchart of the proposed method to facilitate the understanding.The variables “PP_state” and “flag_PP” included in Figure2 were considered for implementation purposes. In the initialization of the system, both variables should be set to zero. “PP_state” indicates that a meal has been consumed, and that IOB¯ may be increased considering a set of rules to evaluated BG levels TIOB minutes after the announcement of the meal. The variable “flag_PP” guarantees that a single value of IOB¯PP is computed for each meal. Figure 3 depicts the application of the method in one representative virtual patient during a simulation, with a meal containing 45 g of CHO at 07:30 (represented by the green triangle in Figure 3(a)). Note that 67.5 minutes after the meal (computed by equation (9)), the limit of IOB has been increased because BG levels were above G¯. When IOB¯ was increased, the controller suggested more insulin in order to reduce the postprandial excursions since the insulin bolus was not enough for this specific meal. This period of time represents the first meal of a single patient during Scenario C, which is detailed in Section 2.3.3.Figure 3
Operation of the dynamic rule-based algorithm during a postprandial period. Note that, after the meal (consumed at 07:30 and represented by the green triangle), the algorithm deemed necessary to increaseIOB¯ because BG levels were above G¯. (a) BG measurements in mg/dl. (b) Insulin delivery. (c) The conditioned reference signal Grf. (d) Estimation of IOB levels and the constraint IOB¯.
(a)
(b)
(c)
(d)In summary, the DRB algorithm has been designed to make use of patients’ basal profile, which is an indicative of insulin requirements along the day, combined with a modified version of the approach already tested clinically with real patients, which achieved good results during postprandial control. In addition, BG measurements has been incorporated to setIOB¯, aiming to track glucose back to regular values safely. All the relevant parameters used in the simulations are listed in Table 1.Table 1
Parameters considered in this work for both inner and outer loops.
Parameter
Value
Unit
K
p
TDI
/
2250
U
/
min
T
d
90
min
G
r
100
md
/
dl
Γ
0.42
L
/
min
W
350
mg
/
dl
Τ
10
min
Λ
0.1
min
K
DIA
0.013
min
−
1
G
¯
150
mg
/
dl
G
¯
140
mg
/
dl
TDI, total daily insulin.


## 2.2.1. Fasting Periods

During fasting period (sleeping hours or daytime fasting periods), the absence of external disturbances makes the intraday variability the major challenge for the controller. The basal insulin profile from patients’ open-loop therapy is considered to create a baseline forIOB¯:(7)IOB¯blt=KIOB2⋅ubasalt60⋅KDIA,where IOB¯bl is the baseline for IOB¯ and KIOB is a gain that regulates the amplitude of IOB¯bl, with KIOB>0. In case of KIOB<1, IOB^ will not be allowed to be greater than it would have been during open-loop therapy. On the contrary, with KIOB>1, the insulin controller can suggest more insulin than what is programmed by the open-loop therapy. Thus, KIOB should be selected in order to protect patients from hypoglycemia but also allowing the control algorithm to suggest insulin above open-loop regimen when necessary. Thus, during fasting periods, IOB¯ is set to be equal to IOB¯bl. In this work, the parameter KIOB is set to 1.3 for daytime period (06:00–23:00) and to 1.1 for night-time period (23:00–06:00).Although this approach may be able to provide good glycemic control in front of intraday variability, patients in free-living conditions take CHO on several occasions during the day, requiring a greater amount of insulin for these periods. Therefore, the strategy ofIOB¯ during fasting periods is combined with another one, intended for postprandial periods, presented in the following section.


## 2.2.2. Postprandial Periods

The tuning ofIOB¯ during postprandial period is an extension to the method already validated clinically by Rossetti and colleagues [26]. Here, the method is generalized for meals with different amount of CHO and also includes a set of rules based on BG readings to modify IOB¯. This set of rules has been designed to determine if it is necessary to increase IOB¯, for cases which the bolus was not enough to drive BG to near-normoglycemia levels.The method works as follows: in case of the announcement of a meal, an insulin bolus is delivered as a feed-forward action. This bolus is an augmented version of the standard bolus computation, by adding a portion of the future basal delivery according to the size of the meal, as shown in the following equation:(8)ubolus=MCHOI2C+Gt−GrCF+∫tt+MCHOubasaltMCHO60,where MCHO is the content of CHO of the meal (in grams), I2C is the insulin-to-CHO ratio, Gr is the BG reference, and CF is the correction factor.After the bolus,IOB^ surpasses IOB¯, and then ufinal is forced to zero, while IOB^ is greater than IOB¯, due to the action of the SAFE layer. The parameter TIOB (in minutes, equation (9)) is introduced to regulate the starting time after the meal from when IOB¯ may be increased. After TIOB minutes, BG readings start to be evaluated in order to check whether IOB¯ needs to be increased, aiming to drive BG below a selected target (G¯). If in this moment, BG is greater than a threshold (G¯), a new IOB limit is computed to control postprandial BG, based on equation (10). This value is maintained as IOB¯, while BG is greater than G¯. Finally, when BG returns to values below G¯, IOB¯ returns to follow IOB¯bl. Note that the parameters G¯ and G¯ can be adjusted intuitively by physicians. For a more aggressive postprandial control, these parameters should be decreased as follows:(9)TIOB=1.5⋅MCHO,(10)IOB¯PP=maxIOB^t−1,IOB¯blt.The final tuning forIOB¯ is determined during a real-time procedure, based on the dynamic behavior of patients basal insulin profile and also in the set of rules activated after the announcement of meals, to increase IOB¯ during postprandial periods. Figure 2 depicts a flowchart of the proposed method to facilitate the understanding.The variables “PP_state” and “flag_PP” included in Figure2 were considered for implementation purposes. In the initialization of the system, both variables should be set to zero. “PP_state” indicates that a meal has been consumed, and that IOB¯ may be increased considering a set of rules to evaluated BG levels TIOB minutes after the announcement of the meal. The variable “flag_PP” guarantees that a single value of IOB¯PP is computed for each meal. Figure 3 depicts the application of the method in one representative virtual patient during a simulation, with a meal containing 45 g of CHO at 07:30 (represented by the green triangle in Figure 3(a)). Note that 67.5 minutes after the meal (computed by equation (9)), the limit of IOB has been increased because BG levels were above G¯. When IOB¯ was increased, the controller suggested more insulin in order to reduce the postprandial excursions since the insulin bolus was not enough for this specific meal. This period of time represents the first meal of a single patient during Scenario C, which is detailed in Section 2.3.3.Figure 3
Operation of the dynamic rule-based algorithm during a postprandial period. Note that, after the meal (consumed at 07:30 and represented by the green triangle), the algorithm deemed necessary to increaseIOB¯ because BG levels were above G¯. (a) BG measurements in mg/dl. (b) Insulin delivery. (c) The conditioned reference signal Grf. (d) Estimation of IOB levels and the constraint IOB¯.
(a)
(b)
(c)
(d)In summary, the DRB algorithm has been designed to make use of patients’ basal profile, which is an indicative of insulin requirements along the day, combined with a modified version of the approach already tested clinically with real patients, which achieved good results during postprandial control. In addition, BG measurements has been incorporated to setIOB¯, aiming to track glucose back to regular values safely. All the relevant parameters used in the simulations are listed in Table 1.Table 1
Parameters considered in this work for both inner and outer loops.
Parameter
Value
Unit
K
p
TDI
/
2250
U
/
min
T
d
90
min
G
r
100
md
/
dl
Γ
0.42
L
/
min
W
350
mg
/
dl
Τ
10
min
Λ
0.1
min
K
DIA
0.013
min
−
1
G
¯
150
mg
/
dl
G
¯
140
mg
/
dl
TDI, total daily insulin.


## 2.3. In Silico Evaluation

The proposed method is validated in the UVa/Padova simulator [27] on three challenging scenarios, including intrapatient variability in insulin sensitivity and in meal absorption rate [32].Circadian variability has been included to simulate different requirements of insulin during the day and follows a sinusoidal variation. The parametersVmx and kp3, which are related with the insulin sensitivity are modified as follows:(11)qt=q0+0.3⋅q0⋅sin2π24⋅60t+2π⋅rand,where qt is the corresponding time-varying parameter; q0 is the default individual parameter value (Vmx or kp3), and rand is a uniformly distributed random number between 0 and 1.Additionally, meal absorption rate and insulin absorption parameters (parameterskabs, kd, ka1, and ka2) assume different values (±30% around the standard value) after every single meal consumption. Further details about the aforementioned parameters are described elsewhere [27, 33].


### 2.3.1. Scenario A

This scenario is considered to compare the performance of the DRB algorithm (IOB¯DRB) against the method already validated clinically, with a fixed value for IOB¯ (IOB¯F). In a 7-day scenario, the adult cohort consumed a single meal containing 60 grams of CHO per day, between 10:00 and 16:00, in order to assess the postprandial control under different intrapatient variability conditions. This amount of CHO has been selected to conduct a fairly comparison since the former strategy was clinically validated for this specific meal size.


### 2.3.2. Scenario B

This scenario is considered to compare the performance of the DRB algorithm (IOB¯DRB) in front of meals with CHO content varying between 40 and 120 grams of CHO. In a 45-day scenario, the adult cohort consumed a single meal per day, between 08:00 and 19:00, in order to assess the postprandial control under different intrapatient variability conditions. It is considered just a single meal per day in order to avoid the accumulated effects of meals in the results.


### 2.3.3. Scenario C

A 14-day scenario is considered to assess the performance of the proposed method intended to mimic real-life operation of the AP systems. A total of three meals, with different amounts of CHO, are consumed per day at 7:30 (45 grams), 13:00 (90 grams), and 18:30 (50 grams). An error of±15% on CHO counting has also been included to challenge the system. To apply meal absorption variability, the 10 mixed meal models from each patient were randomly assigned for each meal intake along with the simulation. A total of four different strategies are applied in this scenario: (1) the DRB algorithm to adjust IOB¯ (IOB¯DRB), (2) a fixed value of IOB¯ as used in Scenario A (IOB¯F), (3) IOB¯ is set to be equal to IOB¯bl, without the rules considered for postprandial period (IOB¯bl), and (4) the same insulin controller considered in other strategies, but without IOB¯.


## 2.3.1. Scenario A

This scenario is considered to compare the performance of the DRB algorithm (IOB¯DRB) against the method already validated clinically, with a fixed value for IOB¯ (IOB¯F). In a 7-day scenario, the adult cohort consumed a single meal containing 60 grams of CHO per day, between 10:00 and 16:00, in order to assess the postprandial control under different intrapatient variability conditions. This amount of CHO has been selected to conduct a fairly comparison since the former strategy was clinically validated for this specific meal size.


## 2.3.2. Scenario B

This scenario is considered to compare the performance of the DRB algorithm (IOB¯DRB) in front of meals with CHO content varying between 40 and 120 grams of CHO. In a 45-day scenario, the adult cohort consumed a single meal per day, between 08:00 and 19:00, in order to assess the postprandial control under different intrapatient variability conditions. It is considered just a single meal per day in order to avoid the accumulated effects of meals in the results.


## 2.3.3. Scenario C

A 14-day scenario is considered to assess the performance of the proposed method intended to mimic real-life operation of the AP systems. A total of three meals, with different amounts of CHO, are consumed per day at 7:30 (45 grams), 13:00 (90 grams), and 18:30 (50 grams). An error of±15% on CHO counting has also been included to challenge the system. To apply meal absorption variability, the 10 mixed meal models from each patient were randomly assigned for each meal intake along with the simulation. A total of four different strategies are applied in this scenario: (1) the DRB algorithm to adjust IOB¯ (IOB¯DRB), (2) a fixed value of IOB¯ as used in Scenario A (IOB¯F), (3) IOB¯ is set to be equal to IOB¯bl, without the rules considered for postprandial period (IOB¯bl), and (4) the same insulin controller considered in other strategies, but without IOB¯.


## 3. Results and Discussion

In this section, glycemic outcomes are presented for all the scenarios previously described. The performance of different methods to adjustIOB¯ is evaluated according the time spent into different glycemic ranges [34]. Results are computed based on CGM measurements. Individual metrics for the adult cohort from the simulator are computed, and then the results are presented as the median (25th–75th percentile) among the cohort. Additionally, the occurrence of hypoglycemic episodes (defined as at least 15 consecutive minutes with glucose below 70 mg/dl) is also analyzed.


### 3.1. Scenario A

Table2 shows the metrics for Scenario A. These metrics assess the performance of IOB¯DRB and IOB¯F during postprandial period (i.e., 4 hours following the meal), once the last has been designed for such purpose. The metrics used for this evaluation are: average BG levels, percentage of time spent in different glycemic ranges, glycemic excursion (defined as the difference between the maximum BG level and the premeal BG level), and the total insulin delivered by the controller after the meal bolus.Table 2
Population metrics for postprandial glycemic control in scenario A.
Mean glucose
Percentage of time spent in
Excursion (mg/dl)
Total basal (U)
(mg/dl)
70–140
70–180
>180
<70
IOB
¯
DRB
141.48
46.58
96.13
3.87
0.00
62.00
3.56
(136.4–153.0)
(24.7–56.5)
(93.8–100.0)
(0.0–6.3)
(0.0–0.0)
(55.9–67.3)
(3.0–4.0)
IOB
¯
F
141.40
47.77
96.43
3.57
0.00
63.36
3.78
(136.7–150.8)
(25.6–53.6)
(94.0–100.0)
(0.0–6.0)
(0.0–0.0)
(53.6–68.7)
(3.1–4.1)Note that both strategies achieved similar results. AlthoughIOB¯F obtained numerical results slightly superior than the proposed method, no significant difference was observed in any of the metrics. The new strategy (IOB¯DRB), besides being applicable for meals of any size, achieved equivalent outcomes when compared with the former strategy, which was designed for meals with 60 grams of CHO and achieved good results in real patients.However, analyzing the whole simulation period (7-days), the new strategy was able to eliminate the occurrence of hypoglycemic events, while five events were observed forIOB¯F. This fact reinforces the hypothesis that modifying IOB¯ over the day increases patients safety.


### 3.2. Scenario B

Table3 shows the metrics during postprandial period in Scenario B for the two methods applied in this Scenario B.Table 3
Population metrics for postprandial glycemic control in scenario B.
Mean glucose
Percentage of time spent in
Excursion (mg/dl)
Total basal (U)
(mg/dl)
70–140
70–180
>180
<70
IOB
¯
DRB
146.79
41.52
85.86
14.14
0.00
71.79
3.19
(144.7–154.7)
(35.4–48.5)
(77.7–90.2)
(9.8–20.8)
(0.0–0.0)
(66.1–74.7)
(2.1–3.6)
IOB
¯
F
148.96
38.10
84.38
15.63
0.00
75.43
3.43
(147.0–156.2)
(25.3–47.3)
(77.1–86.3)
(13.7–22.9)
(0.0–0.0)
(69.0–79.4)
(2.6–4.1)Different from Scenario A, in Scenario B, meals from different sizes were considered to evaluate the postprandial performance of the controller, which is more realistic. Results showed a slight superiority of theIOB¯DRB against the IOB¯F in all the glycemic metrics analyzed. Notice that the percentage of time spent in tight glycemic range increased from 38.1% to 41.52%, while the percentage of time spent in hyperglycemia reduces at the same time, from 15.63% to 14.14%. This analysis shows that the previous tuning of IOB¯ may not be sufficient for varied size of meals.


### 3.3. Scenario C

Table4 shows the results for the 14-day scenario comparing the system with the DRB algorithm (IOB¯DRB) against the other strategies. It displays the mean glucose, percentage of time spent in different glycemic ranges and the number of hypoglycemic events for the entire cohort.Table 4
Population metrics comparing the performance of the system with the dynamic rule-based algorithm (IOB¯DRB) against other strategies, in scenario C.
IOB
¯
DRB
IOB
¯
F
IOB
¯
bl
WithoutIOB¯
Daytime (06:00–23:00)
Mean glucose
140.30 (134.2–143.5)
135.57 (133.0–140.3)
142.72 (134.7–145.3)
116.92 (114.0–121.6)
% of time spent in
70–140
56.58 (49.3–66.3)
60.17 (56.1–65.4)
53.43 (46.3–64.6)
71.53 (67.4–79.4)
70–180
92.10 (85.5–95.3)
92.70 (85.9–96.6)
90.91 (85.2–95.0)
90.88 (83.5–93.7)
>180
7.90 (4.7–14.5)
7.30 (3.4–14.1)
9.09 (5.0–14.8)
5.25 (3.0–8.4)
<70
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
5.27 (0.4–9.9)
<54
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
1.61 (0.0–6.3)
# Hypoglycemic events
3
4
4
112
Night-time (06:00–23:00)
Mean glucose
114.61 (112.1–118.8)
106.51 (104.0–107.2)
114.81 (112.9–126.1)
102.37 (100.1–103.9)
% of time spent in
70–140
98.09 (94.3–99.1)
99.36 (96.0–100.0)
97.75 (87.2–99.2)
98.04 (96.0–99.3)
70–180
100.00 (100.0–100.0)
100.00 (100.0–100.0)
100.00 (100.0–100.0)
98.13 (97.1–99.4)
>180
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
<70
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
1.87 (0.6–2.9)
<54
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.13 (0.0–0.9)
# Hypoglycemic events
0
4
0
11The results display the solid performance of the strategies using the SAFE layer when compared with the insulin controller without IOB limitation, mainly to avoid hypoglycemia. The arm with theIOB¯DRB strategy achieved the lowest amount of hypoglycemic events when compared with the other methods. The IOB¯F strategy is the one with the lowest mean glucose values during daytime, but the fixed value of IOB¯ is not enough to avoid hypoglycemic events, especially during night-time. On the contrary, the IOB¯bl arm considered only the adjustment for IOB¯ presented in Section 2.2.1. Such approach did not consider the rule-based algorithm to increase IOB¯ during postprandial periods, and this is reflected in the slightly worse outcomes for this strategy when compared with IOB¯DRB, during daytime. The IOB¯DRB arm achieved lower mean glucose values and spent less time in the hyperglycemic range, when compared with the IOB¯bl arm.Also during daytime, it can be observed thatIOB¯DRB achieved higher mean glucose values when compared with the insulin controller without IOB¯, considerably above the Gr. Although these values are higher than in healthy people, they are still acceptable considering the recommendations of the American Diabetes Association (ADA) [35], which is A1C <7% for nonpregnant adults. The median GMI (glucose management indicator) achieved by the proposed method during daytime is 6.7%, which gives the approximate A1C levels based on CGM measurements [36]. During night-time, IOB¯DRB was able to lower mean glucose, without any hypoglycemic event. Considering 24-hour period for the entire scenario, the proposed method achieved a median GMI of 6.5%, within the limits recommendable by the ADA.The control-variability grid-analysis (CVGA) [37], in Figure 4, allows a graphical visualization regarding the glycemic variability within an observational period of 24 hours. Note that the IOB¯DRB approach achieved the highest percentage of points falling either in Zone A or Zone B, with 97.85%. Additionally, Figure 5 shows the dynamics of BG and insulin delivery for a single day, comparing IOB¯DRB with the arm without IOB limits, to better illustrate the influence of the IOB¯ in the control action.Figure 4
Control-variability grid-analysis for different arms evaluated in scenario C: (a)IOB¯DRB, (b) IOB¯F, (c) IOB¯bl, and (d) without IOB¯.
(a)
(b)
(c)
(d)Figure 5
Comparison of the dynamics of BG and insulin delivery between the controller with the DRB algorithm and withoutIOB¯ for a single patient in scenario C: (a) BG readings; (b) insulin delivery.
(a)
(b)Observing the results in Table4 and Figure 4 it is possible to note that the action of the SAFE layer avoids the overreaction of the insulin controller due to the rise of glucose, caused by the meals. Although the results obtained by the DRB algorithm are only slightly better when compared with the other strategies which included the SAFE layer, it was observed a reduction on the occurrence of hypoglycemic events without leading to excessive hyperglycemia. All the three hypoglycemic events observed in the IOB¯DRB arm were caused by the meal bolus and not by any insulin suggested by the controller after the meal. Therefore, the hypoglycemic episodes were very likely caused by overestimation of CHO content to compute the bolus.The starting point of the proposed method was another strategy which has already been extensively tested both in silico and clinically, making the task of achieving better results even more difficult. Nevertheless, it has been possible to improve slightly the performance of the AP system in this in silico study, being able to apply different limits of IOB according to the CHO content of meals and by applying a lowerIOB¯ during night-time. Any improvement in postprandial glycemic control can reflect in a reduction on the risks associated with long-term complications, given its correlation with A1C levels [38], and the avoidance of nocturnal hypoglycemia is a major concern in T1D treatment. In addition, it also allows modification on the parameters of the proposed algorithm to be performed intuitively by physicians, if they deem necessary to further improvements on glycemic control. However, clinical trials involving real patients must be conducted to assess the performance of the proposed algorithm under real-life operation, in which patients may forget to announce meals, and the performance of the DRB algorithm may not be suitable to avoid hyperglycemia. Furthermore, the DRB algorithm may not be applicable in fully automatic AP systems, in which patients do not need to announce meals. Finally, the adjustments of IOB¯ is a major task for AP systems which considers the SAFE layer, and the proper adjustment of this constraint also plays an important role even during physical activity [39, 40], by reducing the amount of injected insulin during and after exercise.


## 3.1. Scenario A

Table2 shows the metrics for Scenario A. These metrics assess the performance of IOB¯DRB and IOB¯F during postprandial period (i.e., 4 hours following the meal), once the last has been designed for such purpose. The metrics used for this evaluation are: average BG levels, percentage of time spent in different glycemic ranges, glycemic excursion (defined as the difference between the maximum BG level and the premeal BG level), and the total insulin delivered by the controller after the meal bolus.Table 2
Population metrics for postprandial glycemic control in scenario A.
Mean glucose
Percentage of time spent in
Excursion (mg/dl)
Total basal (U)
(mg/dl)
70–140
70–180
>180
<70
IOB
¯
DRB
141.48
46.58
96.13
3.87
0.00
62.00
3.56
(136.4–153.0)
(24.7–56.5)
(93.8–100.0)
(0.0–6.3)
(0.0–0.0)
(55.9–67.3)
(3.0–4.0)
IOB
¯
F
141.40
47.77
96.43
3.57
0.00
63.36
3.78
(136.7–150.8)
(25.6–53.6)
(94.0–100.0)
(0.0–6.0)
(0.0–0.0)
(53.6–68.7)
(3.1–4.1)Note that both strategies achieved similar results. AlthoughIOB¯F obtained numerical results slightly superior than the proposed method, no significant difference was observed in any of the metrics. The new strategy (IOB¯DRB), besides being applicable for meals of any size, achieved equivalent outcomes when compared with the former strategy, which was designed for meals with 60 grams of CHO and achieved good results in real patients.However, analyzing the whole simulation period (7-days), the new strategy was able to eliminate the occurrence of hypoglycemic events, while five events were observed forIOB¯F. This fact reinforces the hypothesis that modifying IOB¯ over the day increases patients safety.


## 3.2. Scenario B

Table3 shows the metrics during postprandial period in Scenario B for the two methods applied in this Scenario B.Table 3
Population metrics for postprandial glycemic control in scenario B.
Mean glucose
Percentage of time spent in
Excursion (mg/dl)
Total basal (U)
(mg/dl)
70–140
70–180
>180
<70
IOB
¯
DRB
146.79
41.52
85.86
14.14
0.00
71.79
3.19
(144.7–154.7)
(35.4–48.5)
(77.7–90.2)
(9.8–20.8)
(0.0–0.0)
(66.1–74.7)
(2.1–3.6)
IOB
¯
F
148.96
38.10
84.38
15.63
0.00
75.43
3.43
(147.0–156.2)
(25.3–47.3)
(77.1–86.3)
(13.7–22.9)
(0.0–0.0)
(69.0–79.4)
(2.6–4.1)Different from Scenario A, in Scenario B, meals from different sizes were considered to evaluate the postprandial performance of the controller, which is more realistic. Results showed a slight superiority of theIOB¯DRB against the IOB¯F in all the glycemic metrics analyzed. Notice that the percentage of time spent in tight glycemic range increased from 38.1% to 41.52%, while the percentage of time spent in hyperglycemia reduces at the same time, from 15.63% to 14.14%. This analysis shows that the previous tuning of IOB¯ may not be sufficient for varied size of meals.


## 3.3. Scenario C

Table4 shows the results for the 14-day scenario comparing the system with the DRB algorithm (IOB¯DRB) against the other strategies. It displays the mean glucose, percentage of time spent in different glycemic ranges and the number of hypoglycemic events for the entire cohort.Table 4
Population metrics comparing the performance of the system with the dynamic rule-based algorithm (IOB¯DRB) against other strategies, in scenario C.
IOB
¯
DRB
IOB
¯
F
IOB
¯
bl
WithoutIOB¯
Daytime (06:00–23:00)
Mean glucose
140.30 (134.2–143.5)
135.57 (133.0–140.3)
142.72 (134.7–145.3)
116.92 (114.0–121.6)
% of time spent in
70–140
56.58 (49.3–66.3)
60.17 (56.1–65.4)
53.43 (46.3–64.6)
71.53 (67.4–79.4)
70–180
92.10 (85.5–95.3)
92.70 (85.9–96.6)
90.91 (85.2–95.0)
90.88 (83.5–93.7)
>180
7.90 (4.7–14.5)
7.30 (3.4–14.1)
9.09 (5.0–14.8)
5.25 (3.0–8.4)
<70
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
5.27 (0.4–9.9)
<54
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
1.61 (0.0–6.3)
# Hypoglycemic events
3
4
4
112
Night-time (06:00–23:00)
Mean glucose
114.61 (112.1–118.8)
106.51 (104.0–107.2)
114.81 (112.9–126.1)
102.37 (100.1–103.9)
% of time spent in
70–140
98.09 (94.3–99.1)
99.36 (96.0–100.0)
97.75 (87.2–99.2)
98.04 (96.0–99.3)
70–180
100.00 (100.0–100.0)
100.00 (100.0–100.0)
100.00 (100.0–100.0)
98.13 (97.1–99.4)
>180
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
<70
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
1.87 (0.6–2.9)
<54
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.00 (0.0–0.0)
0.13 (0.0–0.9)
# Hypoglycemic events
0
4
0
11The results display the solid performance of the strategies using the SAFE layer when compared with the insulin controller without IOB limitation, mainly to avoid hypoglycemia. The arm with theIOB¯DRB strategy achieved the lowest amount of hypoglycemic events when compared with the other methods. The IOB¯F strategy is the one with the lowest mean glucose values during daytime, but the fixed value of IOB¯ is not enough to avoid hypoglycemic events, especially during night-time. On the contrary, the IOB¯bl arm considered only the adjustment for IOB¯ presented in Section 2.2.1. Such approach did not consider the rule-based algorithm to increase IOB¯ during postprandial periods, and this is reflected in the slightly worse outcomes for this strategy when compared with IOB¯DRB, during daytime. The IOB¯DRB arm achieved lower mean glucose values and spent less time in the hyperglycemic range, when compared with the IOB¯bl arm.Also during daytime, it can be observed thatIOB¯DRB achieved higher mean glucose values when compared with the insulin controller without IOB¯, considerably above the Gr. Although these values are higher than in healthy people, they are still acceptable considering the recommendations of the American Diabetes Association (ADA) [35], which is A1C <7% for nonpregnant adults. The median GMI (glucose management indicator) achieved by the proposed method during daytime is 6.7%, which gives the approximate A1C levels based on CGM measurements [36]. During night-time, IOB¯DRB was able to lower mean glucose, without any hypoglycemic event. Considering 24-hour period for the entire scenario, the proposed method achieved a median GMI of 6.5%, within the limits recommendable by the ADA.The control-variability grid-analysis (CVGA) [37], in Figure 4, allows a graphical visualization regarding the glycemic variability within an observational period of 24 hours. Note that the IOB¯DRB approach achieved the highest percentage of points falling either in Zone A or Zone B, with 97.85%. Additionally, Figure 5 shows the dynamics of BG and insulin delivery for a single day, comparing IOB¯DRB with the arm without IOB limits, to better illustrate the influence of the IOB¯ in the control action.Figure 4
Control-variability grid-analysis for different arms evaluated in scenario C: (a)IOB¯DRB, (b) IOB¯F, (c) IOB¯bl, and (d) without IOB¯.
(a)
(b)
(c)
(d)Figure 5
Comparison of the dynamics of BG and insulin delivery between the controller with the DRB algorithm and withoutIOB¯ for a single patient in scenario C: (a) BG readings; (b) insulin delivery.
(a)
(b)Observing the results in Table4 and Figure 4 it is possible to note that the action of the SAFE layer avoids the overreaction of the insulin controller due to the rise of glucose, caused by the meals. Although the results obtained by the DRB algorithm are only slightly better when compared with the other strategies which included the SAFE layer, it was observed a reduction on the occurrence of hypoglycemic events without leading to excessive hyperglycemia. All the three hypoglycemic events observed in the IOB¯DRB arm were caused by the meal bolus and not by any insulin suggested by the controller after the meal. Therefore, the hypoglycemic episodes were very likely caused by overestimation of CHO content to compute the bolus.The starting point of the proposed method was another strategy which has already been extensively tested both in silico and clinically, making the task of achieving better results even more difficult. Nevertheless, it has been possible to improve slightly the performance of the AP system in this in silico study, being able to apply different limits of IOB according to the CHO content of meals and by applying a lowerIOB¯ during night-time. Any improvement in postprandial glycemic control can reflect in a reduction on the risks associated with long-term complications, given its correlation with A1C levels [38], and the avoidance of nocturnal hypoglycemia is a major concern in T1D treatment. In addition, it also allows modification on the parameters of the proposed algorithm to be performed intuitively by physicians, if they deem necessary to further improvements on glycemic control. However, clinical trials involving real patients must be conducted to assess the performance of the proposed algorithm under real-life operation, in which patients may forget to announce meals, and the performance of the DRB algorithm may not be suitable to avoid hyperglycemia. Furthermore, the DRB algorithm may not be applicable in fully automatic AP systems, in which patients do not need to announce meals. Finally, the adjustments of IOB¯ is a major task for AP systems which considers the SAFE layer, and the proper adjustment of this constraint also plays an important role even during physical activity [39, 40], by reducing the amount of injected insulin during and after exercise.


## 4. Conclusions

The dynamic rule-based algorithm proposed in this work has been designed to tune in real-time limiting of IOB to safely control BG levels. This algorithm is intended for 24-hour operation, which includes postprandial and fasting periods. During postprandial periods, it allows the increase of IOB limits when more insulin is required to have a more aggressive controller but yet safe. The strategy has been evaluated in silico under challenging conditions and achieved satisfactory performance, with emphasis on the reduction of hypoglycemic events during nocturnal period and without excessive hyperglycemia during postprandial period for meals with different CHO contents. Although, in this paper, the proposed strategy has been applied and evaluated in a PD controller, such approach could also be used by other algorithms, since the SAFE layer can be added to control algorithms of any nature.



---

*Source: 1414597-2020-01-11.xml*