Blood Glucose Regulation Using Labview

Diabetes mellitus (DM), commonly referred to as diabetes, is a group of metabolic diseases in which there are high blood sugar levels over a prolonged period. If not regulate the glucose level then it will cause the serious damage to heart, kidneys, eyes, and nerves. The pancreas produces insulin to absorb the glucose. In type I diabetes the pancreas does not secrete insulin to compensate this artificial pancreas will be used. The artificial pancreas will mimic the function of pancreas it consists of a sensor, controller and insulin pump. The sensor continuously monitors glucose, the amount of insulin required will be calculated using a controller then injected using insulin pump this is the function of the artificial pancreas. The food we take is converted into glucose. So, meal intake will greatly affect the glucose levels, in this paper a closed loop model is developed based on Bergman's minimal model and meal intake is introduced as a disturbance then the control action is performed using Fuzzy and PID controller using LABVIEW software.  So, from this, if the glucose concentration exceeds/decreases, above/below a certain point necessary control action will be taken.


Introduction
Diabetes is a serious complex condition which can affect the entire body. Diabetes requires daily self-care and if complications develop, diabetes can have a significant impact on quality of life and can reduce life expectancy. There are different types of diabetes all types are complex and serious. The three main types of diabetes are Type 1, Type 2 and Gestational diabetes. When human body consumes meal then the glucose level raises from basal value and the pancreatic β cells produce insulin to regulate the glucose level but in diabetic patients, the insulin will not be produced. In open loop system the glucose level is measured and based on the value a predetermined insulin dose will be taken which is not based on the instantaneous change of glucose but in closed loop control the sensor monitors the glucose level continuously based on that the controller will suggest the amount of insulin so that the glucose level will be regulated.

Research Method
The closed-loop insulin delivery system is composed of three essential components a stable glucose sensor for measuring the glucose concentration, a control system regulating external insulin infusion based on the glucoseinsulin system and a safe and stable insulin pump. In this closed-loop control, a feedback is taken from the body by placing the sensor which senses the glucose level. The output of the sensor is given to the controller and based on the error the controller pumps the required amount of insulin to the body as shown in figure 1. The closed-loop method of insulin delivery system is called an artificial pancreas. From 1961 many mathematical models were derived (Cobelli et al., 1982;Santiago et al., 1978;Ackerman et al., 1965;Bergman et al., 1981;Cobelli & Ruggeri, 1983;Parker & Doyle, 2001) which describes the relation of glucose-insulin dynamics. In Puckett & Lightfoot (1995) the model developed was based on the patient's data. Based on these mathematical models many control algorithms were developed to control blood glucose (Li & Hu, 2007;Chee et al., 2003;Lam et al., 2002;Kienitz & Yoneyama, 1993). This paper takes Bergman's minimal model and includes a meal as disturbance then the controller will be simulated using PID and Fuzzy Logic Controller. The paper is organized as follows section II describes the mathematical modeling. Section III describes simulation using LABVIEW. Section IV includes results and discussion finally conclusion and future scope.

Mathematical Modeling for Glucose Insulin Regulation System
The input is the measured plasma insulin concentration y(t) following the intravenous glucose injection, while the output is corresponding measured glucose concentration x(t). The insulin concentration y(t) acts through a remote compartment so that effective Insulin concentration (t) is given by, Where k2 and k3 represent the fractional rate parameter for insulin transport into and elimination in the remote compartment. This compartment is not directly measurable. The rate of change of glucose in blood plasma is given by / = (Net rate of glucose production by livethe r -Rate of glucose utilization by other tissues) The net rate of glucose production by the liver = 0 − 5 ( ) − 6 ( ) ( ) The rate of glucose utilization by other tissues = 0 + 3 ( ) + 4 ( ) ( ) In the equation, B0 represents the rate of glucose production by the liver. It is assumed to be proportional to an insulin-independent component ( Where 1 = ( 1 + 5 ), 2 = 3 , 3 = 2 ( 4 + 6 ), 4 = 0 − 0 Meal disturbance 3 The unknown parameter values are taken from (Nalini et al., 2018). An optimization algorithm is used for calculating other four unknown parameters. The estimated values of unknown parameters using m-file are P1= 0.049, P2= 0.091, P3= 8.96x10 -5 and P4= 4.42.

Software Realization Using Labview
In Labview software simulation loop, integrator block, signal generator block, PID block and Fuzzy blocks are available in control design and simulation toolkit. In the front panel of LABVIEW, the meal disturbance, glucose concentration, insulin concentration and regulated insulin graphs are visualized using graphs and in the block diagram, the modeling equations developed for diabetic persons are implemented. Here the simulation using two logics are performed and they are PID and Fuzzy logic.

Pid Logic Implementation
The glucose value changes every time according to the consumption of food this disturbance was added to the process as a random signal. Every time the glucose value is measured and corrective insulin was injected into the body and this insulin was controlled by PID controller. The figure 2. shows the PID implementation.

Figure 2. PID Implementation
After simulation, the outputs were shown in graphs as PID output which gives the insulin rate but the response has some delay which is because of controller action and sensor delay. Thus whenever the glucose changes the insulin will also change accordingly. Figure 3 shows the output graphs consists of meal disturbance, measure glucose, insulin chart before without PID controller, insulin chart with PID controller.

Fuzzy Implementation
The controller used here is a FUZZY controller (Mamdhani type). The Linguistic variables are measured glucose and insulin. The membership functions were defined for the linguistic variables then the rules formed. The figure 4. shows the simulation using a FUZZY controller.

Results and Analysis
When glucose falls below a certain level i.e 70 mg/dl then it is called hypoglycemia and when it exceeds 130 mg/dl then it is called hyperglycemia. In this simulation both the extremes do not occur. Table 4.1 will give the comparison between PID and Fuzzy output. Table 1 Comparison between PID and Fuzzy output

Conclusion
This paper developed the PID and a Fuzzy controller for the artificial pancreas. It is inferred from the results that the fuzzy controller has better performance than PID controller. Another advantage of fuzzy controller is by increasing the membership functions and rules the performance can be improved. The future work includes the addition of other dynamics in glucose-insulin models can improve the performance and other controllers also can be included. This is an offline analysis and the online analysis can also be tried.

Acknowledgments
The author would like to thank the editor for their valuable time and advice.