## 4 Closed Loop Administration of Insulin  
Current treatment methods such as SC injections and continuous delivery of insulin can result in frequent variations in the BG levels due to their open-loop nature [101]. In order to keep a stable basal glycemia with the continuous insulin infusion, we require a feedback system [102]. The main aim of the feedback system is to maintain a set point which is predefined. Variable transfer functions like proportional, integral or derivative terms are used to implement a feedback system [102]. The diabetes control and complications trial (DCCT) published in 1993 showed that it is very important to tightly control the BG in a human body [103]. The trial showed that there is an increased risk of hypoglycemia by combining the results of SC injections and insulin pumps [103]. A person with T1 DM has always a long-term risk related to hyperglycemia, and short-term risks of the hypoglycemia, so they need to have a tight BG control. However, the T2 DM patients' needs an insulin treatment when oral anti-diabetic agent and changing lifestyle do not provide glucose control [104]. A closed-loop AP system shown in Figure 7a,b requires three main things: (i) a glucose sensor or continuous glucose monitor (CGM), (ii) an insulin pump, and (iii) a control device that receives CGM values and uses a control algorithm to convey signal to the insulin pump for appropriate amount of insulin delivery [104].  
Figure 6: Overview of the tools used by T1 DM subjects for insulin dosing (adopted from [100]).  
Different control algorithms have been proposed in literature for closed loop administration of insulin so far, but two of the most commonly used algorithms are: (i) _proportional integral control (PID)-_ it regulates insulin by noticing variations from the target glucose levels, and (ii) _model predictive control (MPC)-_ it regulates the insulin by minimizing the difference of forecasted and target glucose levels [105]. The different control challenges which need to be considered for the APs [106] are: (i) in the closed loop system, insulin is delivered when there is only glucose deviation without consideration of information about the meal size, and timing; (ii) the hypoglycemia condition is risky as it can cause coma, seizures, and mental illness. Also, hyperglycemia is not good as it causes cardiovascular disease and other chronic diseases. Therefore, these conditions must be considered; (iii) different treatments for diabetes patients have different requirements. In some cases, rapid insulin delivery is required, and vice versa. Exercise can also create the hypoglycemia condition, so all of these physical factors are important to consider while designing an AP system; (iv) when creating a rapid insulin delivery control algorithm mostly the maximum BG lowering effect occur after up to 90-120 min. When designing control algorithm this time range should be considered. Furthermore, sometimes there occurs noise in the sensor measurements so different estimation techniques should be employed for compensating these noise values. Also, the self-calibration methods with self/auto correction ability are required for the success of the APs.