## 3 Proportional-Integral-Derivative (PID) Algorithms  
PID algorithms are offshoots of proportional derivative (PD) systems. A PD system from the company Nikkiso, in Japan, is used in hospital settings with continuous glucose monitoring, in order to control glucose. [PERSON] and his colleagues have been instrumental in conceptualizing and testing PID algorithms for closed loop control. Before examining their data, it will be instructive to review the fundamentals of PID control, an engineering concept which has been widely used in industrial settings [18, 19]. Regarding closed loop treatment of diabetes, the PID control system has recently shown great success, especially when a portion of the estimated meal insulin is given before the meal. [PERSON] et al, in their recent publication, were able to show a significant difference in glycemic control between a fully-closed loop (FCL) insulin delivery system under PID control and a hybrid closed-loop (HCL) control system in which \(\sim\)25-50% of a calculated pre-meal insulin dose was given before meals under the same PID control (mean glucose levels: 135 \(\pm\) 45 mg/dl HCL vs 141 \(\pm\) 55 mg/l FCL; peak postprandial glucose levels averaged 194 \(\pm\) 47 mg/dl HCL vs 226 \(\pm\) 51 mg/dl FCL) [7]. It is important to understand the three elements of the PID system. In the setting of diabetes control, it can be easily appreciated that one needs to give more insulin as glucose concentration rises (and is further away from the target). In other words, the dose of insulin is directly related to the proportional error (current glucose minus target glucose). This element is termed the proportional factor. The derivative element is based on the rate of change. Assume that Patient A and Patient B have glucose values of 150 mg/dl (and the target is 100 mg/dl). Also, assume the Patient A's glucose level is rising at a rate of 1 mg/dl per minute and Patient B's glucose is rising at a rate of 2 mg/dl per minute. Despite the same proportional error, Patient B, with a rate of 2 mg/dl, should get a higher dose of insulin given the more rapid glucose rise. It should be noted that derivative elements are very susceptible to noise (e.g. artifactual spikes in the glucose data). For this reason, it is often preferable to use a low-pass filter for the raw data before putting it into the algorithm that computes insulin delivery based on derivative error. The integral change is perhaps more difficult to understand and is based on glucose concentration over a time duration. Assume that two patients have a current glucose concentration of 200 mg/dl and the rate of change over the last 10 minutes is zero. Thus, their proportional and derivative factors are identical. However, Patient A has been at 200 mg/dl for 3 hours and Patient B has been at 200 mg/dl for only 20 minutes (prior to this, B's glucose level was lower). One can see that, despite insulin delivery for many hours, Patient A's glucose has not changed, i.e. this patient is proving to be quite insulin resistant. If one integrates the glucose concentration over (say) the last 5 hours, it can be seen that the integrated area is much greater for A than B, thus requiring a larger insulin dose for A. This is the concept of the integral component. [PERSON] et al have argued quite convincingly that the pancreatic islet is also controlled by proportional, derivative, and integral factors [20]. Assume an abrupt step increase in glucose. The initial rapid rise in pancreatic insulin release (within the first 5-10 min) is termed the first phase response and is related primarily to the rapid rate of change (derivative component). The slower rise that persists for as long as glucose is elevated is termed the second phase response and is analogous to the proportional element (if the step change is held at 250 mg/dl, the second phase secretion will be greater than if the change is held at 150).