## 1 Introduction  
Type 1 Diabetes Mellitus (T1 DM) is a metabolic disease caused by the autoimmune destruction of insulin-producing beta cells in the pancreas [1]. The role of insulin is to utilize and transport glucose [2]. T1 DM patients need life-long external insulin therapy to regulate their blood glucose concentrations. Without insulin, T1 DM patients suffer from chronic high blood glucose levels (hyperglycemia) and, conversely, too much insulin causes hazardous low blood glucose levels (hypoglycemia). In fact, fear of hypoglycemia is a major limiting factor of glucose regulation in T1 DM [3]. Treatment of T1 DM mainly consists of either multiple daily insulin injections (MDI), or through a pump providing a continuous insulin infusion (CSII) [4]. MDI therapy consists of a basal-bolus insulin regimen, where patients take a basal long-acting insulin dose approximately once a day to regulate fasting blood glucose levels, and short-acting insulin boluses around mealtimes to quickly reduce the impact of carbohydrate intake. Bolus insulin is also used for minor adjustments during the day when the blood glucose level is too high. CSII treatment is a different strategy where the patient instead has an insulin pump that continuously infuses insulin. The pump delivers both basal and bolus doses, where the basal rate consists of regularly infused short-acting insulin doses, while the boluses are activated by the user together with meal intakes and to account for hyperglycemia. In both cases, the insulin is administered subcutaneously, i.e., in the fatty tissue just below the skin. In combination with this, the blood sugar levels have to be monitored. This is either done several times per day via manual finger-prick measurements, or via a continuous glucose monitor (CGM) embedded in the subcutaneous tissue [5]. Finally, in collaboration with a physician, the T1 DM patient will design a treatment plan based on their individual needs and self-administer insulin according to the plan and self-measured blood glucose concentrations. The goal of the insulin treatment strategy is to keep the blood glucose levels within the normoglycemic range between 70 and 180 mg/dL [6; 7]. Due to the demands of everyday life and the fact that patients to a large degree are responsible for treating themselves, the decisions related to the insulin treatment are thus based partly on hard calculations, personal and medical experience, rules of thumb, and, in some cases, just pure guesswork. Although this results in effective treatment when done correctly, it is extremely time-consuming and a constant burden for the patients. With the improvement of modern treatment equipment, the combination of an insulin pump and CGM invites the addition of a third element, namely a control algorithm to substitute the operation of beta cells in the healthy pancreas. These three elements constitute the artificial pancreas [8; 9]. A pump delivers the insulin subcutaneously, which causes delay in the insulin's action compared to normal insulin secretion where the pancreas releases it to the liver via the portal vein. A simple reactive controller based on momentary blood glucose change cannot thus keep up with the delay to avoid high glucose levels after meals. There exists also a delay associated to the subcutaneous blood glucose measurements from the CGM. Besides the insulin action and CGM delays, there are also dynamic factors that cause variation in the patient-specific parameters and complicate the automation of the control process. The effect of exercise on the blood glucose and insulin dynamics is particularly difficult to model and it is a major source of hypoglycemia [10].. The only commercial available artificial pancreas system, the Medtronic 670G [11], as well as several do-it-yourself systems, see e.g., [12] and academic systems, e.g., [13] are all hybrid closed loop systems. A hybrid system means that the patient has to provide information to the system about the number of carbohydrates ingested during a meal.