Internati o nal  Journal of Ele c trical   and Computer  Engineering  (IJE CE)  Vol .   5 ,  No . 3,  J une   2 0 1 5 ,  pp . 43 6~ 44 2   I S SN : 208 8-8 7 0 8           4 36     Jo urn a l  h o me pa ge : h ttp ://iaesjo u r na l.com/ o n lin e/ind e x.ph p / IJECE  PID Controller Design for Two  Tanks Liquid Level Control  System using Matlab      Mo st af a A.   Fe l l a ni  * ,  A b o uba k er  M .  Ga baj **  * Control Engin eering  Depar t ment, Faculty   of  Electron i c Technolog y ,   Ben i -Walid Lib y Em ail:  alf e ll ani   @gm a il.com   ** Computer Department, Facu lty   of Edu c a tion, Tripoli  Univer sity , T r i pol i Li by Em ail:  kgaba ja @gm a il.com       Article Info    A B STRAC T Article histo r y:  Received Oct 30, 2014  Rev i sed  Ap 22 , 20 15  Accepte May 8, 2015      The industrial application   of C oupled  Tank S y stem (CTS) is  widely  used   es peci all y  in ch e m ical proces s  in dus trie s. The co ntrol of liquid level in tanks   and flow between tanks is a prob lem in  the process technologies.  The process   techno logies req u ire liqu i ds to be pum ped, stored in tanks, and then pumped  to anoth e r tan k  s y s t em ati c a l l y .  Th is pap e r  presents development of   Proportional-In tegral-Der ivative (PID) c ontroller for con t rolling  the d e sired   liquid level of  the CTS. Var i o u s c onvention a l techn i ques of  PID tuning   m e thod will be tested in order  to  obtain th e PID controller  param e ters Simulation is  conducted with in MA TLAB environment to  verif y  th perform ances  of  the  s y s t em  in  t e rm s  of  Rise   Time  (Ts),   Se ttl in g Tim e   (Ts),   Stead y  State Err o r (SSE) and Overshoot  (OS). The trial and  erro r method of  tunning will b e  i m p lem e nted and  all th e perform ance resul t s will  be anal y z ed   us ing M A TLAB. It h a s  been d e m ons trated tha t   perform ances  of  CTS  can b e   improved with  appropriate techn i que of PID  tunin g  methods.   Keyword:  Co up led tank  syste m   PI D con t ro ller  PID tun i ng  m e th od     Water lev e l con t ro l   Copyright ©  201 5 Institut e  o f   Ad vanced  Engin eer ing and S c i e nce.  All rights re se rve d Co rresp ond i ng  Autho r Ab o uba ke r M .   Gaba j   C o m put er De p a rt m e nt , Facul t y  of  Ed uca tion ,  Tripo li Un iversity, Tripo li Lib y Em a il:k g a b a j a @g m a il.co m       1.   INTRODUCTION  Propo rtion a l Integ r al Deriv a ti v e  (PID) con t ro llers ar wid e ly u s ed  in  i n dustrial p r actice sin ce last six   decade .  T h e invention  of  PID control  is in 1910 (largely  owi ng t o  Elme r Sperry’s s h ip aut opil o t) and the   st rai ght fo rwa r Zi e g l e r- Ni c h ol s (Z- N ) t u ni ng r u l e  i n  19 4 2  [1] .  T oday ,   PID i s  use d  i n   m o re t h an 90 % of  pract i cal  co nt r o l  sy st em s, ran g i n g f r om  cons um er el ect roni cs suc h  as cameras to industri al processes s u ch as  ch em ical p r o cesses. Th e PID con t ro ller  help s to   g e ou r o u t p u t   (v el o c ity, te m p eratu r e, po sitio n)  wh ere  we  want it, in a short tim e , with m i nim a l overs hoot, and wit h  little error  [2].  It also the m o s t  adopte d  controllers   i n  t h e i n d u st ry  due t o  t h g o od c o st  a nd  gi ven  be nefi t s  t o  t h e i n d u st ry   [ 3 ] .  M a ny  n o n l i n ear  pr ocesse s  can be  co n t r o lled usin g th e w e ll  k now n and in du str i ally pr ove PI D c o nt r o l l e r [ 4 ] .   A c o n s i d e r abl e  di rec t   perform a nce increase  (fina n ci al  gai n )  i s  d e m a nded  w h e n  r e pl aci n g  a   con v e n t i onal  c ont rol  sy st em  wi t h  a n   adva nce d  o n [ 4 ] .  The m a i n t e nance c o st of  an i n a d eq uat e   con v e n t i onal  c ont rol  s o l u t i o m a y  be l e ss ob vi o u s.  Th e trick y  p a rt o f  con t ro ller desig n  is to  figure ou t j u st how  m u ch  o f  a correctiv e effort th e con t ro ller sh ou ld  appl y  t o  t h pr ocess i n  eac h c a se. Som e  si t u at i on re qui res t i ght er c ont rol   of t h pr ocess  vari a b l e  t h an  On -O ff   cont rol  ca pr o v i d e.   Proportional c ont rol  provide s  bette r c o ntrol because its output op e r ate linearly any w here betwee fu lly ON an d   fu lly OFF [5 ]. As its n a m e  i m p l ies, its  out put  c h an ges  pr op o r t i onal l y  t o  t h e i n p u t  err o r si gn al Propo rtion a l co n t ro ller  sim p l y   m u ltip lies th e error  b y  a con s tan t  t o  co m p u t e its n e x t   o u t p u t In  1 9 30s  t h e  co nt r o l  en gi neers  di sc overed that t h e e r ror could  be  elim inated altogethe r   by   au to m a tical ly resettin g  th e set  po in t to an arti ficially h i g h   v a lu e [3 ]-[6 ].  Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 088 -87 08  IJEC E V o l .  5, No . 3,  J u ne 2 0 1 5   :    43 6 – 4 4 2   43 7 Th e PID  con t ro llers fun c tio n is to  m a in tain  th e ou tpu t  at a lev e l th at there is no   d i fferen ce  (error)  b e tween  th e pro cess  v a riab le  an d th set po i n t in  as fast resp on se as  p o ssib l e.      Th ob j e ctiv o f  t h e co n t ro ller in  t h e lev e l co n t ro l is t o  m a int a i n  a l e vel  se t  poi nt  at  a gi v e val u e a n d b e  abl e   to accept  ne w s e t poi nt val u es  dynam i cally.  Thi s   pap e r c o nsi d e r s t h d e si gni ng  o f   P I D  C o nt r o l l e r  t o  c o nt rol   c o u p l e d  t a n k  s y st em  usi ng  M A TLAB s o ft ware . This so ftware is use d  to  create th e sim u l i nk m odel  fo r PI D C ont rol l er an d per f o rm ance   fo r eac pa ram e t e r f o r  P I D  C ont rol l e r  has   b een si m u l a t e d.  The  pe rf orm a nces o f   PI D C o nt r o l l e r ar e e v a l uat e in term s  of ove r shoot, rise ti me and steady st ate error.  Then, the gain for each pa ram e ter  will also be tuned i n   th is software an d th v a lid ity  for each   p a ram e ter will b e  com p ared  u s i n g th referen c e v a lu e (set  po in t).        2.   MODELING  OF THE  COUPLED T ANK SYSTEM  C onsi d er t h e p r oces s co nsi s t i ng  o f  t w o i n t e r act i ng  liqu i d tan k s  i n  th Figure 1. Th vo lumetric flo w   in to  tank1  is  q in (cm 3 / m in ), the vo lu m e tric flo w  rate fro m  t a n k 1  t o  tank2   is q 1 (cm 3 /min ), and  th vo lumetric   flo w  rate fr om  tank 2 is q o (c m 3 /min ). Th h e igh t  o f  t h e liq u i d  lev e l is h (cm )  i n  t a nk1  and  h 2  in  tank2  (cm ) Bo th  tan k s  h a v e  th e sam e  cro ss section a l  area deno tes the area  o f  tank1  is  A (cm 2 ) and area  of ta nk2 is   A 2 (cm 2 ).          Fi gu re  1.  The   bl oc di ag ram   of  t w o i n t e ract i n g  l i qui d   t a nks       For tank 1           (1 )      Ass u m i m g  lin ear re sistance t o   flow we  have      (2 )     An d           (3 )             (4 )     Taki n g  La pl ac e t r ans f orm  on  bot h si des  of  e quat i o ( 4 ) t h e n :            (5 )     Or        1     (6 )   Evaluation Warning : The document was created with Spire.PDF for Python.
I J ECE   I S SN 208 8-8 7 0 8     PID Controller  Desi gn for  Tw o Tanks Li qu id Level Control  System usi n Matlab   (Abo uba ker M.  G aba j)  43 8 For tank 2          (7 )     Ass u m i ng linear re sistance t o  flow  we  ha ve:       (8 )          (9 )          (1 0)     Taki n g  La pl ac e t r ans f orm  on  bot h si des  of  e quat i o ( 1 0 )   w e  ha ve:           (1 1)       . 1    (1 2)     To  ob tain         ,  w e  ha ve to ca nce l  h 1 ( s )  in equ a tio n s  (5 ) & (1 0)         . 1   1  1  0         1            1          1           1   (1 3)     Using  th v a lues o f  t h Parameters  sh ow n i n  t a bl 1 we  d r i v e d  t h fi nal  t r ans f er  fu nct i on  o f  t h e sy st em  as  fo llows:        0.0 1 6.25 7 . 5 1   (1 4)       Tabl e 1.   Param e ters val u es  fo r  two  tan k   Para m e ters  Value  Unit   A 1 250  cm 2   A 2 250  cm 2   R 1 0. 01  C m 2 / s ec  R 2 0. 01  C m 2 / s ec  H 1 30  cm   H 2 15  cm       3.   SIMULATION RESULT    By n a tu re, liq uid  lev e l co n t rol syste m  d e sig n  is v e ry  m a th e m atical ly  o r ien t ated  and  with ou t th e u s of com put er as si st ance  m o st  desi g n  p r o b l e m s  are very  t e di o u s an d bec o m e  qui t e  l e ngt hy . C o m put er pr o g ram ,   suc h  as M a t l a b  ha ve  becom e  an i n val u a b l e  t ool  i n  a n  e ngi n eeri n g e nvi r o n m ent .   To  sh ow th e co nv en ien ce  o f   u s ing  MATLAB/SIMUL INK software  package as a tool t o  sim u late   and a n al y ze t h e beha vi o r  o f  t w o t a nks l i q ui d l e vel  co nt r o l  sy st em , t h e sim u l a t i ons are c o n d u ct ed st ep  by  st ep.   Th e system  is si m u lated  and  t h resu lts are sh own  in th fo llo wing   sub s ect io n .   Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 088 -87 08  IJEC E V o l .  5, No . 3,  J u ne 2 0 1 5   :    43 6 – 4 4 2   43 9 3. 1.  Si mul a ti o n  Res u l t  w i th out  C o n t r o l l er  It  m a y b e  o b s erv e  th at fro m  fig u re 2 ,  t h e liq u i d  will con s tan tly o v e rfl o w . Th is situ atio n  h a p p en  because of this  system  runni ng wit hout controller to c o ntrol the Pum p  sp e e d, s o  the P u m p  will continuously   p u m p  th e li q u i d   o u t   fro m  th e tan k   un til it o v erflow. PID con t ro ller m u st be add e d to  con t ro l t h e liqu i d  lev e l.          Fi gu re  2.  The   per f o r m a nce of  t h e c o u p l e d  t a nk  sy st em  wi t hout  c o nt r o l l e r       a.   Simula ti o n  Result  with PID Contro ller:  In  th is secti o n th e sim u lat i o n  resu lt with  t h e PID C o n t ro llers h a s b e en  shown  and  th e con t ro ller  t u n n i n g m e t hode. Fi gu re  3 sh ows t h e pe r f o r m a nce of t h e s y st em  wi t h  pro p o r t i o nal  co nt r o l l e r. T h e set  p o i n t  i s   set eq u a l to  1  an d  t h e propo rtio n a g a in  is set 2 0 .   Th pl ot  s h o w s t h at   pr op ort i o nal  co nt r o l l e r red u ced  b o t h t h e   rise tim e  and the steady state error.  Propo rt io n a l con t ro ller also  in crea se d t h e o v ers h oo t  and dec r ease d  t h e   settlin g  ti m e  b y  sm a ll a m o u n t.    Evaluation Warning : The document was created with Spire.PDF for Python.
I J ECE   I S SN 208 8-8 7 0 8     PID Controller  Desi gn for  Tw o Tanks Li qu id Level Control  System usi n Matlab   (Abo uba ker M.  G aba j)  44 0     Fi gu re  3.  The   per f o r m a nce of  t h e c o u p l e d   tan k  system  with  propo rtion a l co n t ro ller       Fig u r e  4  sh ows th e p e rf or m a n ce of  th e syste m  w ith  p r opor tio n a l p l u s  d e r i v a tiv e con t roller .  Th e set po in t is  set eq u a l to  1.  Th e pro p o r tional g a in  is set eq u a l to   2 0  and  d e ri v a tiv e g a i n  is set eq u a l to  1 0 . Th is  p l o t  sh ows  th at th e d e riv a t i v e  co n t ro ller red u c ed  bo th  the o v e rshoo t and  th e settlin g  time b u t  h a d  small effect o n  the rise  tim e  and the  steady state error.            Fi gu re  4.  The   per f o r m a nce of  t h e c o u p l e d  t a nk  sy stem  with  propo rtion a l Plu s  in teg r al con t ro ller.      Fi gu re  5 sh o w s t h e pe rf orm a nce o f   pr op o r t i onal - i n t e g r al  cont rol l e r .  Th e set  poi nt  i s  set  equal  t o   1.  Th e   p r op ortio n a gain  is set eq u a l to  2 0  an d  in teg r al g a i n  is set eq u a l to   1 2 . The p l o t  sho w s that in teg r al con t ro ller  Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 088 -87 08  IJEC E V o l .  5, No . 3,  J u ne 2 0 1 5   :    43 6 – 4 4 2   44 1 also reduce d the rise tim e  increase d  the  overs h oot sam e  as the proporti onal controll er does. T h e integral  cont roller also eliminated  the   steady state error.            Fi gu re 5.   The   per f o r m a nce of  t h e c o u p l e d  t a nk  sy st em  wi t h  p r o p o rt i o nal  P l us  deri vat i ve c ont rol l e r       Fig u re  6  sh ows th p e rform a n ce  o f  t h e syste m  with  PID  Co n t ro ller. The set po in t is  set eq u a l t o   1 .  The  p r op ortio n a l  gain  is set equ a l to 12 , i n tegral g a in is se t equ a l to   4 and   deriv a tiv g a in  is set equ a l to 7  t o   p r ov id e th d e sired   respon se. Th p l o t  shows th at th e ou tpu t  ach ieves th e set p o i n t  v a lue at ti m e  eq u a l to  12  seco nd . T h ou t put   have  sl i g h t l y  overs h oot   b e fo re st a b i l i ze at  t i m e  equal  t o   20  sec o n d .           Fi gu re  6.  The   per f o r m a nce of  t h e c o u p l e d  t a nk  sy st em  wi t h  p r o p o rt i o nal  P l us  deri vat i ve  Pl us i n t e gral   cont rol l e r   Evaluation Warning : The document was created with Spire.PDF for Python.
I J ECE   I S SN 208 8-8 7 0 8     PID Controller  Desi gn for  Tw o Tanks Li qu id Level Control  System usi n Matlab   (Abo uba ker M.  G aba j)  44 2     Fi gu re  7.  The   per f o r m a nce of  t h e c o u p l e d  t a nk  sy st em  wi t h  f o u r  t y pes  o f  c ont rol l e rs .       From  t h e sim u l a t i on  resul t s  sho w n i n  fi g u re  (2 , 3 ,  4,  5 ,  6 &  7) i t  m a y  be co ncl u d e d t h at  PI D c ont rol l e r   eli m in ates th e o f fset o f  th p r o portio n a l m o d e  and  still p r ov id es fast respo n s e. Th is can  b e  u s ed  fo r v i rtu a lly   an y pro c ess con d ition  in cl u d i n g  t h is liqu i d  l e v e l con t ro l.  Th e PID con t ro ller is on e of the m o st p o w erfu l bu t   com p l e x co nt r o l l e r m ode o p e r at i ons c o m b i n es t h e p r op ort i onal ,  i n t e g r al and  de ri vat i v m odes. Thi s  s y st e m   can be  use d  f o r any  p r o cess  con d i t i on i n cl udi ng c o nt r o l l i ng  wat e r l e vel  i n  a t a nk.  Th e wat e r l e vel   can be   co n t ro lled  co ntin u o u s ly witho u t  m a n u a l ad ju sting  of  the v a lv e. Th e PID al g o rith ms will au to m a tically   response t o  the  syste m  so that  the sy stem  is stab ilized  n e ar t h e set  po in t.        4.   CO NCL USI O N   Thi s  pa per  pr esent s  a sim u l a t e d l e vel  cont r o l  of l i qui d i n  t w o t a n k  sy st em  wi th a di ffe re nt   cont rol l e r' s su ch as Pro p o rt i onal - I n t e g r al - D eri v at i v e (P I D ).  Vari ous c o n v e n t i onal  t echni que s of P I D t uni ng  m e t hod  wer e   t e st ed i n   or de r t o   o b t a i n  t h e PI D c ont r o l l er pa ram e t e rs. Si m u l a ti on  w a s co nd uct e wi t h i n   MATLAB environ m en t to  verify th p e rform a n ces o f  t h e syste m  in  term s o f  Rise Ti m e , Settlin g  Ti m e ,   Steady State E r ror a n d Ove r s h oot. T h e liqui d level syst em  i s  cont rol l e usi n g a si m p l e  P, P I , P D  a n d  PI cont roller.   Hen c e it m a y b e  con c lud e d  that th e PID con t ro ller is th e m o st effectiv e contro ller t h at elimin ates th o f fset of th p r o portio n a l m o d e  and  still p r ov id es  fast  respo n s e. Th at is wh y PID con t ro ller h a b e en   ch osen.  It m a y be further stated that  because   of the  a c tion  of Proportional  param e t e r, t h plot  result will respond to a   step  ch an g e   v e ry q u i ck ly. Due to  th e actio n  o f  In tegral p a ra m e ter, th e syste m  was ab le t o  return ed  to  t h e set  poi nt  val u e.       REFERE NC ES   [1]   J.  Swde r,  G. Wszoe k ,  W. Ca rva l ho,  Progr ammable controller design Electropn eu ma tic S y s t ems, Journal of   Mater i al  Processing Tech nolog y  164-165 5 (2005) 14659- 1465    [2]   Aurelio Piazzi  and Antonio Visioli, A  Noncausal Approach  for  PID control, Jo urnalof Process  Control, 4 Mar c 2006.   [3]   Carl Knopse, Gu est Ed itor, PID  Control, IE EE C ontrol S y s t em M a gazine, Febru a r y   2006.  [4]   S. Bennett, “Dev elopment of  th PID  controller,”  IEEE Contr .  S y s t Mag . , vol. 13 Dec.  1993, pp. 5 8–65.  [5]   S. Song, L.   Xie and Wen-Ji m Cai, “Auto-tun i ng  of Cascad e Con t rol S y stems” IEEE Proceedings  of the 4th  world  Congress on Int e lligen t Con t rol  and Autom a tion,  June  10-14, 200 2, Shanghai, P.R .  Chin a, pp 3339 -3343.  [6]   K. Passino, “To w ards bridging the perc eiv e d gap between  con v ention a l and i n tell igent  contro l”, in Int e ll igen t   Control: Theor y   and  Applicati ons, IEEE Press, 19 96, ch . 1 ,  pp . 1– 27. G upta, M . M. and Sinh a, N.K. editors.    [7]   K. Passino, “Bridging the gap  b e tween  conv enti onal  and in tel lig ent  control ,  Speci al Issue on  In tell igent   Con t ro l,   IEEE Control S y stems Magazin e , vol. 13, June   1 993, pp . 12–16   Evaluation Warning : The document was created with Spire.PDF for Python.