**3. Results**

A new hardware platform (see Figure 7) was developed, following the previously mentioned requirements, to create a new automatic insulin delivery system based on the patient's glycaemia and his specific parameters. Three system-on-chip ICs were included to support communications with Medtronic devices (Texas Instruments CC1110 [17]), Bluetooth Low Energy devices in Central Role mode (Texas Instruments CC2540 [18]) and, although it is not necessary right now, other 2.4 GHz devices for future developments (Texas Instruments CC2510 [19]). All three system-on-chips apart from the RF transceiver incorporate an 8051 processor and were used to implement, among other functionalities, the control loop algorithm (see Figures 7 and 8). All of them can enter really low power modes in which they reduce their consumption down to 0.3 μA (PM3 mode).

**Figure 8.** Designed platform—SoC interconnection.

As this module has to be wearable, a 680 mAh Lithium-Polymer battery with its regulation electronics were added (see U1 and U3 in Figure 9). This battery provides more than 24 h of operation enabling the patient to safely wear it during the day and recharge it during the night while still operating.

**Figure 9.** Designed platform—battery and power regulation.

In addition, this new platform was integrated into the Nightscout platform [8] for remote monitoring and with xDrip [16] as a mobile platform to control it and upload information to the cloud. Therefore, this platform (shown in Figure 10) can be connected with cloud solutions to share and analyze information.

**Figure 10.** Hardware platform developed for the closed-loop insulin delivery system. (**a**) Device picture, (**b**) PCB. Top layer.

Using Nightscout, the user can control the performance of the loop and receive alarms when needed. Nightscout, as a platform, is a perfect way to adjust parameters as it enables the patient to log the information for meals, boluses, exercise, etc., and use this information for later analysis. Endocrinologists can benefit from this tool to make better adjustments as more information can be easily analyzed.

Figure 11 shows the typical Nightscout webpage a patient would see in normal operation. The big green number on the top right corner (item number 1) shows the current glycaemia and an arrow showing the trend. The dotted line (item number 7) shows the patient's glycaemia in real time. In this case, the target range (green) is set to be 90–140 mg/dL. The bottom line (item number 8) shows two days of data while the middle one can show a configurable period of time (last 3, 6, 12 or 24 h) using selector number 6. The blue graph on top of the glycaemia line (item number 9) shows how the insulin infusion has been performed. Other parameters that can be monitored are:

• Current time (item number 3)


**Figure 11.** Nightscout.

The proposed control algorithm will obtain good results as long as the user configures the parameters that match his/her needs (active insulin time, basal profile, and insulin sensibility factors) [20]. To test this control algorithm, an open-source simulator named simglucose [11] was used. This simulator is a python implementation of the FDA-approved UVa/Padova Simulator [21] for research purpose only that includes 30 virtual patients: 10 adolescents, 10 adults, and 10 children.

The patients' configuration for the simulated insulin pump were set following standard methods and, as the parameters that vary from patient to patient are included in this configuration and their calculation is out of the scope of this article, it is assumed that results should not significantly vary among other possible patients. The algorithm should take the same decisions that the patient would normally take if he/she would be doing it manually every 5 min.

Three batches of simulations were run: one of them in open-loop mode without any intervention from the patient, one in open-loop mode but simulating the correction action from the patient administering correction boluses 2 h after every meal, and the other in closed-loop mode. All simulations used the same set of parameters and, although they differ from patient to patient, they were not modified from simulation to simulation. The following meal scenario was used:


To evaluate results coming from these simulations, the "Time In Range" (TIR) parameter was used. "Time in Range" refers to the percentage of time a patient spends within his/her target glucose range, typically from 70 to 180 mg/dL. The most time the patient stays inside this range, the less likely he/she is to su ffer from long-term complications in the future.

In open-loop mode without interaction from the patient, as can been seen in Figures 12 and 13, most patients su ffer from hyperglycemia more than 40% of the time. Figure 13 shows how glucose levels start rising with time and correction boluses would be necessary to put the patient back in range (70–180 mg/dL). Meal absorption is shown in terms of CHO (grams). CHO stands for Carbohydrates (Carbon Hydrogen Oxygen) and, in these simulations, the rate of absorption was set to 5 g per minute. Since the simulation step is 5 min, CHO is equivalent to the grams of the meal divided by five. This simulation obtained the following average TIR values: general 40.52%, adolescent 52.45%, adult 37.71%, child 31.41%.

In an attempt to simulate part of what a patient would do to correct hyperglycemias, a simulation in open-loop mode but allowing correction boluses was executed. These correction boluses occur 2 h after every meal only if hyperglycemia exists. As can be seen in Figures 14 and 15 results improved, reaching a global average TIR percentage of 65.75%. The average TIRs per groups were: adolescent 77.78%, adult 67.23%, child 52.25%.

In closed-loop mode, simulating the same patients with the same meal scenario, TIR improves considerably as can be seen in Figure 16. Figure 17 shows how glucose levels are kept in range most of the time, and some patients su ffer from small post-prandial hyperglycemic episodes. These episodes could be minimized applying pre-bolusing techniques (dosing insulin some time prior to the meal) but this simulator does not support it directly. This simulation obtained the following average TIR values: general 93.69%, adolescent 93.11%, adult 97.99%, child 89.96%. One really important thing to point out is that using a closed-loop system not only improves TIR but also reduces the burden the patient su ffers. The system operates autonomously, and the patient does not need to spend so much time trying to keep his/her glucose levels in range.

**Figure 12.** Open-loop simulation–Time In Range.

**Figure 13.** Open-loop simulation—mean results.

**Figure 14.** Open-loop with corrections—Time In Range.

**Figure 15.** Open-loop with corrections—mean values.

**Figure 16.** Closed-loop simulation—Time In Range.

**Figure 17.** Closed-loop simulation—mean results.

## **4. Discussion**

The typical recommendation when using a controller like this one is to stay in open loop mode for at least two weeks fine tuning these parameters before activating the closed-loop control. Unfortunately, setting these parameters correctly is not an easy task. Even with a controller perfectly configured, there are situations that will temporarily modify these parameters and that are not under the patient's control: incorrectly estimated food intakes, illness, exercise, stress, hormonal disorders, and many others.

As these parameters can vary easily (even for one single patient) it seems reasonable to think that new models are needed so that these parameters can be estimated and that, in this way, any controller could do a better job. This is a good opportunity for the scientific community to use open platforms and obtain better control algorithms.

This controller offers a real solution that allows the patient to keep his glycaemia under control while being, at the same time, almost transparent and unnoticeable. Therefore, the proposal described in this work provides a new approach to improve the life of patients with this disease taking advantage of a glucose sensor, an ad-hoc processing unit, and a set of wireless channels of communication.

**Author Contributions:** Conceptualization, J.B. and S.H.; Methodology, I.B., A.G. and J.L.L.; Software, J.B. and S.H.; Validation, J.B. and I.B.; Investigation, J.B.; Writing—original draft preparation, J.B.; Writing—review and editing, I.B, A.G. and J.L.L.

**Funding:** This research received no external funding.

**Acknowledgments:** This system was created using other modules as a base: Nightscout was used for remote monitoring and visual control, xDrip Android App was modified to support this new platform and to upload glucose and control information in Nightscout. The insulin pump and the glucose sensor used were developed by Medtronic.

**Conflicts of Interest:** The authors declare no conflict of interest. The founding sponsors had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, and in the decision to publish the results.
