More Related Content
Similar to Tuning of digital PID controller for blood glucose level of diabetic patient (20)
More from IRJET Journal (20)
Tuning of digital PID controller for blood glucose level of diabetic patient
- 1. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056
Volume: 04 Issue: 02 | Feb -2017 www.irjet.net p-ISSN: 2395-0072
© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 499
TUNING OF DIGITAL PID CONTROLLER FOR BLOOD GLUCOSE LEVEL OF
DIABETIC PATIENT
------------------------------------------------------------------***----------------------------------------------------------------------
Abstract – This paper is based on designing of digital
Proportional-integral derivative (PID) controller which
controls the blood glucose level of diabetic patient. The
main objective is to design a digital PID controller using
tuning rules like Ziegler-Nichols and Cohen-Coon method.
The responses are studied & parameters are compared.
Best response given by the PID is converted into Digital
PID. Different transformation methods are also studied to
convert the conventional PID into the digital PID
controller.
Key Words: Digital PID controller, Diabetic patients,
Blood Glucose, Ziegler-Nichols, Cohen-Coon, MATLAB
simulation.
1. INTRODUCTION
In present scenario, diabetes affects millions of people all
around the world. Because of diabetes most of the people
are facing a lots of problem like weakness, hypertension,
coronary heart disease, polyneureopathy, kidney
problem, increase chances of secondary infection,
blindness and so on.
Basically diabetes or diabetes mellitus is a systematic
disorder characterized by high blood glucose above
normal range (normal range is 60mg/dl to 120mg/dl).
Diagnostic criteria of diabetes mellitus is- a)oral glucose
tolerance test –more than 200mg/dl b)fast blood glucose
level-more than 126mg/dl c)random blood sugar –more
than 200mg/dl d)hbA1c-more than 6.8%, it is the best
parameter to know about diabetic control[1].
There are two types of diabetes are commonly occur
Type 1 diabetes and Type 2 diabetes. Type 1 diabetes
normally occurs to the below 40 years age of people.
Diabetes has autoimmune condition and this
autoimmune condition generates the antibodies .These
antibodies destroys the beta cell so that the insulin is not
produce in appropriate amount which body requires.
Due to insufficient production of insulin these type of
person suffer from type 1 diabetes. Hence we can
externally apply the insulin in the form of injection and
by using digital proportion-integral derivative (PID)
controller [1][3].
Type 2 diabetes generally occurs among people of 40
years above .It occurs due to the insulin receptors down
regulation so that resistance of insulin occur, it generally
happen in those person having heavy weight as body
weight is inversely proportional to the no. of
receptors[1].
Gestational diabetes generally occurs in pregnant
woman. During pregnancy hyperglycaemia increases so
that it affects the offspring (babies). Hyperglycemia is
another disease ,it is due to high blood glucose level
(above 180 mg/dl) on the other hand Hypoglycemia is
opposite to hyperglycemia it occur due to low blood
glucose level(less than 60 mg/dl)[2].
Digital PID controller which is used to externally apply
insulin in appropriate amount to diabetic patient.
Basically this digital PID controller is an automatic device
which can work according to the set point which is at
normal range of blood glucose level. If diabetic patient
has blood glucose level is above or below the set point so
that this digital PID controller first sense the blood
glucose level, if it is above or below blood glucose level
than it automatically controls the blood glucose level in
normal range by giving the appropriate amount of
external insulin.
Rishabh Jain1, Shweta Agrawal2, Rohit Sharma3
1Research Scholar, Department of Electronics and Communication Engineering SRCEM, Gwalior
2Asst. Professor, Departments of Electronics and Communication Engineering SRCEM, Gwalior
3Research Scholar, Departments of Electronics and Communication Engineering SRCEM, Gwalior
- 2. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056
Volume: 04 Issue: 02 | Feb -2017 www.irjet.net p-ISSN: 2395-0072
© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 500
2. MATHEMATICAL MODELING OF BLOOD
GLUCOSE LEVEL FROM DIFFERENTIAL
EQUATION
Consider the blood glucose equation by obtained of
differential equation. The differential equation of blood
glucose equation as given below [4]-
(1)
Now we convert this differential equation into Laplace
domain by using forward Laplace transform. This
transform can be applied as-
By applying above this substitution, we get
(2)
Simplifying this above equation in transfer function form,
we get-
(3)
This equation (3) shows the transfer function of blood
glucose level of diabetic patient. Simulating this equation
(3) in MATLAB, we get step response of blood glucose
level of diabetic patient as shown in figure 1.This figure
shows the blood glucose insulin system has taken more
settling time to settle down to steady state ,it means that
system takes more time to reach steady state of the
system is more also the steady state error value is high,
so we can use digital PID controller to overcome the
steady state error and we can also get accurate step
response with less rise time.
Fig-1: Input step response of blood glucose level of
diabetic patient.
We also seen the stability plot in figure (2) and bode plot
in figure (3) of blood glucose level of diabetic patient.
The stability plot shows the system is stable so we can
improvise the system performance so we can apply PID
controller with various tunning method like Ziegler-
Nichols and Cohen-Coon method.
Fig-2: Input step stability response of blood glucose
level of diabetic patient.
Fig-3: Bode plot of input step response of blood glucose
level of diabetic patient.
3. DESIGNING OF CONTROLLER
To designing the digital PID controller for determining
the error where the error is difference between glucose
sensors measured value and desired value of glucose.
The equation for PID controller is [4].
∫
Where, u(t) is output response, t is instantaneous time,
is the integration variable vary from 0 to t and e is the
error which is SP-MV where SP is set point of glucose and
MV is measured value of glucose.
Kp is proportional gain and it depends on the present
value of system.
0 5 10 15 20 25 30
0
1
2
3
4
5
6
Time [sec]
Amplitude
-5 -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
-300
-200
-100
0
100
Magnitude(dB)
10
-4
10
-2
10
0
10
2
10
4
-270
-225
-180
-135
-90
Phase(deg)
Bode Diagram
Frequency (rad/sec)
- 3. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056
Volume: 04 Issue: 02 | Feb -2017 www.irjet.net p-ISSN: 2395-0072
© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 501
Ki is integral gain and it depends on past accumulate
value of system.
Kd is derivative gain and it depends on future or expected
value.
For equation (4), the transfer function of PID controller
is-
( )
Where, Ti is integral time and Td is derivative time.
The approximate modeling blood glucose insulin system
by using PID controller equation (3) as shown in the
figure 4.
Fig-4: Block diagram of blood glucose insulin system
with Digital PID controller
For finding the gain parameters like KP, Ki and Kd, the
tuning methods like Ziegler –Nichols and Cohen-Coon
method are used than best response parameter
performance between them is compared.
3.1 ZIEGLER-NICHOLS METHOD
Ziegler-Nichols is the method which is based on
determines experimentally the marginal stability point.
This method is also used for determining the PID
controller parameters. For determining these parameter
in the year of 1940, we use two empirical methods are -
a) It was used non-first order plus dead time
situations.
b) It was involved in intense manual calculations.
Ziegler-Nichols tuning process for closed loop system or
feedback system. This method is used the ultimate gain
value Ku to determine the value of KP. These are following
procedure to determine the PID controller parameters.
a) For determining the value of k (proportional
gain) than we must set the integral time (Ti) at
999 or infinity and derivate time (Td) must be
zero.
b) Whenever changing the set point it create a
small disturbance in the feedback loop. Until the
oscillation have constant amplitude, we adjust
the value of proportional gain.
c) Finally we record the ultimate gain value ku and
ultimate period of oscillation Tu.
d) Put these values in closed loop equation of
Ziegler-Nichols for necessary setting of
controller [5][6].
TABLE-1: Closed Loop calculation of KP, Ti, Td
KP Ti Td
PI KU/2.2 PU/1.2
P KU/2
PID KU/1.7 PU/2 PU/8
Advantage of this tuning process is to determine
controller parameter by doing easy experiment ,in this
experiment we need to change the P controller and for
more accurate behaving of the system we include the
dynamics of complete process.
Disadvantage of this tuning process is to take more time
for doing experiment and system become uncontrollable
when it adventure into unstable region while testing the
P controller [5].
Ziegler Nichols tuning process for open loop system. This
process is also known as process reaction method .Using
this techniques we should follow some steps are-
a) To perform open loop test.
b) By using the process reaction curve, we should
calculate the dead time (τdead) or transportation
lag, time response, time cons an τ and for step
change of X0, we get ultimate value of system
response of steady state (Mu).
c) To determine the controller gain parameters,
put the reaction time and lag rate in the open
loop equation of Ziegler Nichols[5][6].
- 4. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056
Volume: 04 Issue: 02 | Feb -2017 www.irjet.net p-ISSN: 2395-0072
© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 502
TABLE-2: Closed Loop calculation of KP, Ti, Td
KP Ti Td
PI 0.9K0 3.3 τdead
P K0
PID 1.2K0 2 τdead 0.5 τdead
Advantage of this tuning process reaction method is easy
to implement in other method, least disruptive, robust
and very popular method. Disadvantage of this above
method is that it depend on pure proportional
measurement to estimate the I and D controller. The
tuning parameters of controller value is not accurate for
different system, it does not hold the D, I and PD
controller [5].
A. Tuning of PID controller by using Ziegler- Nichols
method
By using the above blood glucose equation (3) we apply
in the equation of PID controller by using the Ziegler-
Nichols tuning method we get the value of controller
parameters as given below
Kp=3.25316, Ki=0.882044, Kd=2.99957
Now we solve the equation (3) and equation (5) we get
the expression is-
Putting the value of Kp, Ki, Kd, we obtain the Ziegler-
Nichols equation for blood glucose level after that we
convert the equation into discrete domain by using
Triangle approximation (modified first order hold) with
sampling time is 0.1sec we get Gz (z) –
These parameter shows it improvise the settling time, it
also show the overshoot value is little bit large but the
performance of the system is efficient [6].
3.2 COHEN-COON METHOD
Cohen-Coon method is another tuning method of PID
controller where using this tuning method the steady
state response is minimum as given according to Ziegler
Nichols method. This method is exclusively for first order
system/model which having the time delay .Because of
time delay con olle doesn’ espond he disturbance in
the response. Cohen-Coon method is also referred as
offline method which means that it is steady state which
introduce the step change in the input .Based on time
constant and time delay the output response can be
determined. This output response decide the initial
controller parameters. For getting standard decay ratio
and minimum offset there are set of pre-determined
settings. This pre-determined setting are shown in table
3[6].
TABLE-3: Recommended equation used to optimize
Cohen-Coon predictions
KP Ti Td
PI (P/NL)*(0.9+
(R/12))
L*(30+3R)/(9+20R)
P (P/NL)*(1+(R/3))
PID (P/NL)*(1.33+(R/4)) L*(30+3R)/(9+20R) 4l/(11+2R)
Where, P is percentage change of input, N is percentage
change of output, L is dead time and R is the ratio of dead
time and τ.
Steps the process of Cohen- Coon method are-
a) First step - We should wait until the process
reaches steady state.
b) Second step - To preface the step change in
the input.
c) When the step change in input is introduced
an approximate first order process having
time delay which is based on output is
obtained.
d) Recording the time instance we obtain the
value of dead ime τdead and τ, time
instance are-T0= input step point time,
T2=half point reached time, T3=time at
reaches 63.4%.
e) To determine the process parameter kp .τ,
τdead by using the value of T0, T2, T3.
f) Finally determine the controller parameter
which is based on kp .τ, τdead [6].
Advantage of Cohen-Coon method is that it is used the
system having time delay and get fast response time.
- 5. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056
Volume: 04 Issue: 02 | Feb -2017 www.irjet.net p-ISSN: 2395-0072
© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 503
Whereas the disadvantage of this method is that it is
valid for first order system, another is offline method and
closed loop system which is unstable in this method [6].
B. Tuning of PID controller by using Cohen-Coon
method
By apply this Cohen-Coon tuning method on PID
controller equation (2) of blood glucose; we obtain the
controller parameters like kp, ki, kd. These parameter
values are- Kp =3.66987, Ki=0.798213, Kd=2.49714 Now
solve the equation (3) and equation (5) we get the
expression as shown below-
Putting the value of Kp, Ki, Kd, we obtain the Coohen-
Coon equation for blood glucose level,after that we
convert the equation into discrete domain by using
Triangle approximation (modified first order hold) with
sampling time is 0.1sec we get Gz(z) –
Finally we get accurate step response which has less
setting time and steady state time is also less by using
this tuning method. The step response is shown in figure
8. This figure shows the less time to settle down the
response, it is also show zero steady error and its show
quick output response for better performance of the
system.
4. RESULT
A. By using Ziegler-Nichols method results
Fig-5: Step response of blood glucose insulin system by
using Ziegler-Nichols method.
Fig-6: Open loop bode plot of blood glucose system by
using Ziegler-Nichols method.
Fig-7: Continuous- time approximation bode plot of
blood glucose insulin system by using Ziegler Nichols
method.
Fig-8: Discrete- time approximation bode plot of blood
glucose insulin system by using Ziegler Nichols method.
B. By using Cohen-Coon method results
Fig-9: Step response of blood glucose insulin system by
using Cohen-Coon method.
Fig-10: Open loop bode plot of blood glucose system by
using Cohen-Coon method.
0 10 20 30 40 50 60 70 80 90 100
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Time[sec]
Amplitude
-200
-100
0
100
200
Magnitude(dB)
10
-5
10
0
10
5
-180
-150
-120
-90
Phase(deg)
Bode Diagram
Frequency (rad/sec)
0
20
40
60
80
100
120
Magnitude(dB)
10
-5
10
0
10
5
-90
-45
0
45
90
Phase(deg)
Bode Diagram
Frequency (rad/sec)
10
15
20
25
30
35
40
Magnitude(dB)
10
-2
10
-1
10
0
-90
-45
0
45
90
Phase(deg)
Bode Diagram
Frequency (rad/sec)
0 10 20 30 40 50 60 70 80 90 100
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Time[sec]
Amplitude
-200
-100
0
100
200
Magnitude(dB)
10
-5
10
0
10
5
-180
-150
-120
Phase(deg)
Bode Diagram
Frequency (rad/sec)
- 6. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056
Volume: 04 Issue: 02 | Feb -2017 www.irjet.net p-ISSN: 2395-0072
© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 504
Fig-11: Continuous- time approximation bode plot of
blood glucose insulin system by using Cohen-Coon
method.
Fig-12: Discrete- time approximation bode plot of blood
glucose insulin system by using Cohen-Coon method.
5. DISCUSSION
We can deduce that the values of overshoot and settling
time when the conventional techniques was used, for
Ziegler-Nichols (ZN) is 26.67% and 17.9192 seconds and
for Cohen-Coon (CC) is 25.30% and 11.2416 seconds
respectively.
TABLE-4: Comparison between the outputs of Ziegler-
Nichols and Cohen-Coon tuning techniques parameters.
6. CONCLUSION
Thus the PID controller was tuned for Blood Glucose
level of Diabetic Patient using both Ziegler Nichols &
Cohen Coon method. The parameters value Kp =3.25316,
Ki=0.882044, Kd=2.99957 is tuned by Ziegler Nichols and
the Cohen-Coon method tuned parameters value is
Kp=3.66987, Ki=0.798213, Kd=2.49714. The traditional
Ziegler Nichols method caused a very high overshoot but
a very swift response. But the best response was
exhibited by PID which was tuned using Cohen Coon
method with a zero overshoot & a comparatively low
settling time. As the overshoot in insulin injection may
endanger the life of parent, therefore PID designed with
Cohen coon is implemented here & converted into digital
domain using various transformation techniques. It can
further be implemented on FPGA or any other
Programmable Logic Device.
REFERENCES
[1] Dan L.Longo, Anthony S. Fauci, Dennis L.
Kasper,StephenL.Hauser,J.LarryJamenson,Joseph
Loscalzo,“Ha ison’s p inciple of In e nal
Medicine”,18th Edition textbook.
[2] Kaveh Parisa, Shtessel Yuri, “Highe O de
Sliding Mode Control for Blood Glucose
Regula ion,”P oceedings of he 2006
International Workshop on Variable Structure
Systems, 2006, 12-16.
[3] Pinky Dua, Francis J .Doyle, and Pistikopoulos
,“Model-Based Blood Glucose Control for Type 1
Diabetes via Pa ame ic P og amming,”IEEE
Transactions on Biomedical Engineering, vol.53,
pp.1478-1491,August 2006.
[4] Anil Kumar, Rekha Phadke, “Design of digi al PID
con olle fo Blood Glucose moni o ing sys em”,
International Journal of Engineering Research
&Technology (IJERT), VOL.3 Issue 12,
December-2014.
[5] Article: Ziegler-Nichols’ open loop me hod, Finn
Haugen Tech Tech, 17th july 2010.
[6] Amit Kumar and K.K Garg, “Comparison of
Ziegler-Nichols, Cohen-Coon and fuzzy logic
controllers for heat exchanger model”,
International Journal of Science, Engineering and
Technology Research (IJSETR), Volume 4, Issue
6, June 2015.
0
20
40
60
80
100
120
Magnitude(dB)
10
-5
10
0
10
5
-90
-45
0
45
90
Phase(deg)
Bode Diagram
Frequency (rad/sec)
10
20
30
40
50
60
Magnitude(dB)
10
-2
10
-1
10
0
10
1
10
2
-90
-45
0
45
90
Phase(deg)
Bode Diagram
Frequency (rad/sec)
Parameters Ziegler-Nichols Cohen-Coon
Overshoot (in percent) 26.67 25.30
Settling time (in second) 17.9192 11.2416
Rise time(in second) 2.3229 2.1708