Design of Digital PID Controller for Blood-Glucose Monitoring System

DOI : 10.17577/IJERTV3IS120218

Download Full-Text PDF Cite this Publication

Text Only Version

Design of Digital PID Controller for Blood-Glucose Monitoring System

Anilkumar V1, Rekha Phadke2

1,2Department of Electronics and Communication Engineering, Nitte Meenakshi Institute of Technology Bangalore

Abstract – The objective of this paper is designing a digital PID controller based on Field Programmable Gate Array (FPGA) device for regulating blood glucose level of diabetic patients. The Zeiglers Nichol method is used to tune the controller as a diabetic patient model in MATLAB and Simulink environment. Since the speed of controller has effect on their performance and stability, Field Programmable Gate Array (FPGA) device is considered. A Simulink to FPGA flow is applied to the structure of PID controller with simple Simulink blocks and Xilinx blocks in Simulink/Matlab. The results of blood glucose of diabetic patient model are simulated. System Generator tools are used for generating the HDL (Verilog) code. Xilinx Integrated Software Environment (ISE) tool is used to check the device utilization and timing analysis of the controller.

Key Words:- Digital PID controller, diabetic patients, blood glucose, Sumulink/MATLAB.

  1. INTRODUCTION

    Diabetes mellitus is a metabolic disease in which the body does not produce or properly use insulin. The pancreatic hormones insulin and glucagon which are secreted from -cells and -cells respectively are responsible for keeping the blood glucose concentration level in a normal range. There are 3 types of diabetes: type I and type II and Gestational diabetes. Type-I diabetes mellitus (TIDM) is a disease characterized by absence or death of the -cells. High average glucose concentration (above 110mg/dL) is called Hyperglycaemia. Hypoglycaemia is a complication that occurs for TIDM when the blood glucose level is too low (less than 70 mg/dL). Since the -cells are responsible to produce insulin, external insulin injections in TIDM are required to regulate the blood glucose level.Type-II diabetes mellitus occurs when the body does not respond or cant use its own insulin. Gestational diabetes occurs in some pregnant women and is similar to type-II diabetes.

    The frequently used controller is the PID controller. The word PID stands for Proportional-Integral-Differential control. Each of these, the P, I and D are terms in a control algorithm, and each term has a specific purpose.Sometimes certain terms are not considered because they are not needed in the control design. This is possible to have just a P control, PI, PD or a PID control. It is very rare to have an ID control. A PID controller calculates an error values as the difference between the measured variable and the set

    point.The control objective of the glucose-insulin system is shown in table 1. Since the speed of the control system depends on the system performance, stability and complexity FPGAs are the good choice since they are fast and power efficient. The organisation of this paper is as follows: in section II. Related work III. Designing of the controllersIV. Implementation in Simulink/MATLAB and Xilinx ISE design tool V. Simulation Results.

  2. Related Work

    1. In this thesis all the basics necessary to understand the working of the PID controller is provided. The different tuning methods have been implemented. [1]

    2. In this paper, blood-glucose regulation controller using sliding mode techniques is presented. The robustness to the uncertainties makes this controller attractive in designing the insulin supplying pumps. [2]

    3. In this paper, the PID controller design using classical method and Genetic Algorithm is presented.[3]

    4. In this research, the blood glucose-insulin regulation model is designed based on Stolwijk and hardys dynamic model. [4]

    5. This paper gives the design and implementation of FPGA based on PID controller has focused on building a multi-channel PID controller by FPGAs. The main objective is to optimize the power consumption and delay due to PWM modulator and A/D. [5]

    6. This paper presents tuning of PID controller based on Fruit Fly optimization Algorithm and Genetic algorithm and compared. [6]

    7. In this paper, design and Implementation of Multiplierless digital PID controller. The proposed method is based on Distributed Arithmetic Architecture (DA). The architecture is implemented using SysGen and Implemented on to FPGA in VHDL. [7]

  3. DESIGNING OF THE CONTROLLERS The basic equation of the PID controller is given as:

    0

    U t = Kp e t + Ki + () (1) Where Kp = Proportional gain, Ki = Integral gain,

    Kd = Derivative gain, e: – Error = Setpoint Measured

    value, t= time, = variable of integration.

    Both the PI and PID controllers are designed. In the PI controller the derivative term is neglected. The transfer function of the controller is

    Gc s = Kp 1 + 1

    s Ti

    + s Td (2)

    b. PID controller

    Where Ti= integral time and Td= derivative time. Considering the system transfer function as in equation 3, we find the Kp and the timing constraints of both integral and differential systems using Routh array method. By using Zeiglers Nichols method we can find the Gain parameter values of the controller as shown in table 1.

    Similarly as PI controller we also find the parameter values for PID controller from the table 1. We adjust the parameter values until the system is stable. From step response, the Rise time (tr)= 0.35sec, Delay time (td) = 0.55sec, Settling time(ts)= 7.79sec.Thus from the step response analysis, the PID controller is suitable compared to

    Gc s = 1

    s s + 1 ( + 5)

    Thus the transfer function of the controller becomes:

    (3)

    PI controller.

    () = Kp

    (4)

    () s s + 1 s + 5 + Kp

    Controller

    Kp

    Ki

    Kd

    PI

    0.45 K0

    2K0/T0

    0

    PID

    0.6 K0

    2K0/T0

    K0T0/ 8

    Table 1: Zieglers-Nichol Tuning table

    From Routh array stability method the values of critical gain K0 and period of sustained oscillations T0are found. Using these values in the table 1 we can find all the parameters required for designing the controller.

    a. PI controller

    For this controller the differential part is neglected, thus Kd =0. From the above table the parameter values obtained are adjusted till the oscillations in the step response is decreased. From the step response for the obtained parameters, we can analyse the response of the system via the following parameters:Rise time (tr) =0.85sec, Delay time (td) = 1.3 sec, Settling time(ts) = 14.8sec .

    Figure 1:Step response of PIcontroller

    Figure 2: Step response of PID controller

    1. Using Simulink basic blocks

      From the obtained gain parameters using Simulink/MATLAB basic blocks we design the controller equation. The figure 3 shows PI controller designed using Simulink blocks. The figure 4 shows the design of PID controller. The control objectives of the blood glucose- insulin system are shown in table 2.

      From 70 to 99 mg/dL

      Normal glucose tolerance

      From 100 to 125 mg/dL

      Pre-diabetes

      More than 126 mg/dL

      Diabetes

      Table 2: Control objectives of the blood glucose-insulin system

    2. Using Xilinx blocks

      The controllers esigned using Simulink basic blocks are again designed using Xilinx blocks in Simulink. These blocks are used to generate the HDL code to simulate in Modelsim/Xilinx ISE tools to find the design summary and Timing analysis.

      The figure 5 and figure 6 shows the PI and PID controller depicted using Xilinx blocks. Insert the System Generator block in the designed model to generate the HDL code.

      Figure 3: PI controller using basic Simulink blocks

      Figure 4: PID controller using basic Simulink blocks

      Figure 5: PI controller depicted using Xilinx blocks

      Figure 6: PID controller depicted using Xilinx blocks

  4. SIMULATION RESULTS

      1. Simulink results

    For both the PI and PID controller the inputs are given from the Work space and the result is obtained in Workspace. The maximum input glucose value given for both the controllers is 128mg/dL. The figure 7a and figure 7b depicts the input exogenous glucose and exogenous insulin output of the PI controller. The figure 8a and 8b depicts the input and output of the PID controller.

    Figure 7a:PI controller input-glucoseand Figure 7b: PI controller output- insulin

    Figure 8a: PID controller input-glucose and Figure 8b: PID controller output-insulin

    1. Xilinx results

      Once we design the controller using Xilinx blocks then generate the HDL code using system generator for the required device implementation. The device considered is Virtex 2 pro FPGA and Verilog HDL code generated.

      Simulation results for both the PI and PID controllers are shown in figure 10 and Figure 11 respectively.

      Since the considered output is an unsigned 10 bit number the range is from -512 to 511. In the simulation results as the output exceeds the range, the value is represented in negative format as depicted in below figure 9 and 10 respectively.

      Figure 9: PI controller simulation

      Figure 10: PID controller simulation

      The simulation results obtained from Xilinx and the results obtained from the Simulink/Matlab are same. The device utilization of both the PI and PID controllers are compared in the table 3.

      Logic Utilization

      Used

      Available

      Utilization

      PI

      PID

      PI

      PID

      Number of Slices

      360

      558

      13,696

      3%

      4%

      Number of slices flip flops

      440

      600

      27,392

      1%

      2%

      Number of 4 inputs LUTs

      375

      527

      27392

      1%

      2%

      Number of bonded IOBs

      104

      150

      556

      18

      %

      27%

      Number of BUFGMUXs

      1

      2

      16

      6%

      12%

      Table 3: Synthesis report

  5. CONCLUSION

There can be vast differences produced by different tuning procedures. The step response of PID controller is better than the PI controller.Since we had considered only Hyperglycaemia, the exogenous blood glucose should reduce as early as possible, thus the PID controller injects better Insulin dosage compared to PI controller.From the design summary and Timing analysis PI controller is good compared to PID controller, but by using PID controller we can achieve better speed and better performance. The results show that implementation of PID controller on FPGA device in ISE tool is compact, high speed and this promotes the designer to evaluate and implement different designs easy and simple.

Future work:-The same controller can be designed by different algorithms such as Genetic algorithm, Fruit-fly optimization technique, Ant-colony.The complete closed- loop system can be considered and designed for real-time glucose values.The number of bits used in Xilinx blocks can be increased.

REFERENCES

    1. RobertA.Paz, The Design of PID Controller, Klipsch school of Electrical and Computer Engineering, June 12, 2001.

    2. Parisakaveh, Yuri B.Shtessel, Blood Glucose regulation in Diabetics using sliding mode control Techniques ,proceedings of the 38th Southeastern Symposium on System theory Tennessee Technological University, Cookeville, TN, USA, March 5-7, 2006.

    3. Saifudin Bin Moahmed Ibrahim, The PID Controller Design using Genetic Algorithm, Faculty of Engineering and Surveying, University of Southern Queensland, October 27, 2005.

    4. Dr.Jameel Ahmed, Dr. Bilal A.Alvi, Zeeshan Ali khan, Blood Glucose-Insulin Regulation and Management System Using Matlab/Simulink, International conference on Emerging technologies IEEE-ICET, October 18-19, 2008.

    5. Rajesh Nema, Rajeev Thakur, Ruchi Gupta, Design & Implementation of FPGA Based On PID Controller, International Journal of Inventive Engineering and Science(IJIES),ISSn:2319-9598,volume-1, Issue-2, January- 2013.

    6. Jiuqi Han, Pen Wang, Xin Yang, Tuning of PID Controller Based on Fruit Fly Optimization Algorithm, International Conference on Mechatronics and Automation, proceedings of 2012 IEEE, August 5-8,2012.

    7. Prof. Vikas Gupta, Dr Kavita Khare, Dr R.P. Singh, Efficient FPGA Design and Implementation of Digital PID Controllers in Simulink, International Journal of recent Trends in Engineering, Vol 2, No. 6, November 2009.

AUTHORS PROFILE:

Anilkumar Vreceived his Bachelor of Engineering degree from Sai Vidya Institute of Technology, Bangalore, in the year 2012. He is currently pursuing Master of Technology in Nitte Meenakshi Institute of Technolgy, Bangalore, affiliated to VTU, Belgaum.

Ms. Rekha Phadkegraduated from Vishweshwaraiah Technological University in 2003. She has completed her

M. Tech. in 2005 from Vishweshwaraiah Technological University,currently working as an Asst. Professor in ECE Dept, Nitte Meenakshi Institute of Technology, Yelahanka Bangalore.

Leave a Reply