## 5 Proportional Integral Derivative (PID) Controller  
The proportional integral derivative (PID) controller is one of the most widely used controllers in industrial applications. In T1 DM treatment and control, it is used to emulate \(\beta\)-cell's insulin secretion in the body in response to the glucose, and it is also called external physiological insulin delivery (e-PID) [107, 108]. The insulin is rapidly secreted by the \(\beta\) -cells in the bolus during the first phase in response to the increased BG (proportional component), and in the second phase (integral component), it is released slowly, called basal insulin, to account for the insulin required in between meals to keep BG at a normal level [108, 109]. In order to reduce the hypoglycemic cases, that is, to reduce over delivery of the insulin, insulin feedback was included to make the controller more robust [107, 110, 111]. For critically ill patients, [PERSON] et al. [112] developed a rule-based PID controller. [PERSON] et al. [113] developed a switching PID controller using the Hovorka model. The developed controller works in such a way that the controller is turned on only after meals and is off before the meal bolus. Various schemes for tuning the hybrid-PID and PID controller parameters to obtain significantly optimized results are developed using soft computing techniques such as the cuckoo search algorithm [114], genetic algorithm [115], and fire-fly algorithm [116]. [PERSON] et al. [117] conducted experiments in silico for inter-peritoneal (IP; deliver in or administer through the abdominal cavity or peritoneum) insulin delivery and IP glucose sensing (IP-IP) for  
Figure 7: Example of the closed loop insulin delivery system using artificial pancreas (AP) [104]. (a) Abstract overview of AP system components. (b) Detailed overview of the AP system. an implantable AP [118; 119]. The working mechanism of the PID controller is shown in Figure 8. The brief overview of the PID working is summarized as: the PID controller utilizes proportional, integral and derivative gain to control a process variable (system/process output). They obtained input from the process output and compared it with a set point value to calculate error signal or deviations. Error/deviation value was processed using the proportional, derivative and integration controllers. This input from the PID controller was used to control the process variable. To stabilize a PID controller is very challenging because it requires the proper understanding of the proportional, integral, and derivative gain values. There exist plenty of methods for PID controller tuning. PID control algorithms are the simplest way to design a robust control system for the T1 DM treatment and control. [PERSON] et al. [120] presented a comprehensive review about the adaptive control techniques and their use in the AP systems. [PERSON] et al. [121] summarized the most recent advances in the closed-loop systems in adolescents and children with T1 DM, using both single- and dual-hormone closed-loop systems. [PERSON] et al. [122] proposed a new insulin controller from a complementary metal oxide semiconductor microprocessor (CMOS) which works on wake-up cycle; each cycle occurs after 2.86 ms. The CMOS operational amplifier and direct current (DC) driver provide voltage to motor from 0 to 7.5 volt in 29.41 mV. A feedback loop is used having three parts as outlined in Section 4. The input of the system is output of glucose sensor, and output of the system is the input to the insulin pump. [PERSON] et al. [123] developed a model and controller design for concentration of glucose, the system instructs the insulin pump how much insulin is required to be injected. A PID controller is constructed by computer-aided design (CAD) tools, and 81 mg/dL is taken as a normal glycemia set point. Strategies are implemented in a discrete manner. The device has three major parts: (i) mechanical pump, (ii) in vivo glucose sensor, and (iii) a mathematical algorithm. The pump is driven using the readings of a sensor.