Internati o nal  Journal of Ele c trical   and Computer  Engineering  (IJE CE)  Vol.  5, No. 6, Decem ber  2015, pp. 1372~ 1 380  I S SN : 208 8-8 7 0 8           1 372     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  Optimized PID Controller with  Bacterial Foraging Algorithm      Seiyed Mohammad  Mirz ae i*,  Mohammad H o ssein  Moattar **  * Is lam i c  Azad   Univers i t y ,  F e rd ows  Branch,  F e r dows ,  Iran   ** Departmen t  o f  Software Engineering ,  Mashhad  Branch , Is l a m i c Azad  Univers i t y ,  M a s hhad ,  Ir an       Article Info    A B STRAC T Article histo r y:  Received  May 8, 2015  Rev i sed  Ju l 27 20 15  Accepte d Aug 9, 2015      Fish robot precis i on depends on a variet y  of factor s including th e p r ecision of   m o tion sensors,  m obilit y  of l i nk s, elasti cit y  of f i sh robot actuat o rs sy stem and the precision of controllers. Am ong  these factors, precision and   efficiency  of con t rollers play   a key  role  in fish robot precision .  In the presen paper, a robot fish has been  desi gned with  d y n a mics and  swimming   mechanism of a  real f i sh. Accord ing to eq u a tions of motion, th is fish robot is  designed with 3  hinged links. Subsequent ly , its  control s y stem  was defined   based on the same equations. I n  this pa per, an  approach is suggested to   control  fish robo t tr aje c tor y   using  optim ized  PID controller throug Bacterial  Foraging a l gorit hm , so as to   adjust  the g a in s. Then this  c ontrolle r is   com p ared to th e powerful F u z z y   control l er  an d optim ized P I D controlle through PSO algorithm when apply i ng step an d sine inputs. The resear ch   findings revealed that optimized  PI D controller  through Bacterial Foragin g   Algorithm had  better p e rfor m ance th an other appro ach es in terms of  decreasing  of th settling time, re duction of  the maxi mum overshoot and  desired stead y   state error in r e spons e to step  input. Eff i cien cy  of  the  suggested metho d  has been  analyzed b y  MA TLA B software.  Keyword:  Bacterial foraging al gorithm  Fish  r obo Fuzzy c ont roll er    PID con t ro ller    PSO algorithm     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 Seiyed Mohammad Mirzaei,    Islamic Azad  Uni v ersity,  Ferdows B r anc h Ferdows ,   B o j n ou rd , No rt h Kh or asan , Ir an.   Em a il: M. mirzaie9 0@yaho o.co m       1.   INTRODUCTION  Ro bo ts are th e m a n i festatio n  o f  th e m o st ex citin g   a d vanc ed technology in  prese n t e r a ,  especially  t hose t h at  are  i n spi r e d  by  t h e surr o u n d i ng  nat u re. C r a w l y , ru nni n g , fl y i ng a nd s w i m mi ng r o b o t s  at t r act  t h at t e nt i on o f  al m o st  any one. I n  spi t e  o f  t ech nol ogi cal  ad va nces i n  t h e c o nst r uct i on  o f  m obi l e  rob o t s  suc h  a s   hum anoid, res c ue, s o ccer  pla y er, wa rrior, a nd sc out robo t s , etc., not enough re searc h es  have  bee n  done on  u n d e rwater robo ts  p a rticu l arly  on   fish-lik e rob o t s yet [1 ].  Usu a lly fo r linear and   no n-lin ear  syst e m s, classic cont roll ers are  us ed   due to their sim p le structure  an d   po werfu l  p e rform a n ce in  in du strial con t ro lling  pr o c edu r es. Sev e ral qu an titativ e m e t h od h a v e   b e en  u s ed  suc h  as Fuzzy  Logi cal  C o nt rol  w h i c h i s  a cont r o l l i ng  method base d on the fuzzy  logic, as well as PID  cont rol l e r  [ 5 ] .   PID  c ont r o l l e i s  a m echani s m  wi t h  a cl ose d -l oo feed bac k Desi gni ng  s u ch  a c o nt rol   r e qui res   t uni n g  o f  t h ree  val u es, p r op o r t i onal  gai n  (K p ), Inte gral gai n  (K i ) an d de r i vat i v e gai n  ( K d ). T h e goal of the   co n t ro ller is to  m i n i mize sig n a l error, rise ti me, o v e rshoo t an d  settling  time th ro ugh  tun i ng  th e inpu t in  th co n t ro pro cess. Rise tim e is  th e tim e it ta k e for t h e syste m  respo n s e to  step  inpu t to reach   1 0 -9 0 %  of it stable val u e.  Settling ti m e  refers t o  the  ti me it takes  for the system  step response  t o   reach a ce rtain  range   aroun d  its fi n a l v a lu e for th e first ti m e , also  to   rem a in  co n s tan t . Th is ran g e  is  often   stated  as an  ab so l u te  perce n t a ge  o f  t h e a b s o l u t e   val u (2 -5 %)  [ 17] A  lo of  r e search es  h a v e  inv e stig ated  f i sh   ro bo ts. In   1 994, th f i r s r obotic f i sh   n a m e d  Rob o T un was produced at  MIT [6].  It was  s u ccess f ully devel ope d i n to an 8-link R o boT u na  whic h m a y be the  fi rst free- Evaluation Warning : The document was created with Spire.PDF for Python.
I J ECE   I S SN 208 8-8 7 0 8       Op timized  PID Con t ro ller with  Ba cteria l Fora g i ng  Algo rit h m (S eiyed Moh a mmad  Mirzaei )   1 373 swi m m i ng ro b o t i c  fi sh i n  t h e  wo rl d [ 7 ] .   I n spi r e d  by  t h i s   st udy , t h Dra p er La b o rat o ry  devel ope d u n d ersea   vehi cl e w h i c i s  nam e d VC UU V. Si nce t h i s  ve hi cl e co ul d a voi d o b st acl es, and i t  i s  capabl e  o f  u p - d o w n   m o ti on;  i t  i s  t h m o st  kno wn  ro b o t i c  fi sh [7] - [ 9 ] .  Aft e r i t s  d e vel o pm ent ,  researche r s de ve l ope d m a ny  kinds  of  robo tic fish es. As an  instan ce, in   Na goya  Uni v ersity, Ja pan, a sm all robot fis h  was  designe d  usi n g ICPF   act uat o rs [ 8 ] - [ 10] . A  ki nd o f   ro b o t i c   fi sh na m e l y   G9  (9. G e n erat i o n) was devel ope i n  E ssex Uni v ersi t y   whi c h   h a d th b e st swi mmin g  ab ility and   n o w, it is  ex h i b itin g  i n  Lo ndo n Coun ty Hal Aqu a ri u m   [8 ].  A m a th e m a tic al  m o d e l fo robo tic fish  in  term s o f  p r o p e lling  and   an gu lar in cli n atio n  of fish  m ovem e nt  i s  p r esent e d i n  t h e   wo rk of  Hy ou ng  Se ok  Ki m  and  hi s  col l eag u e s ( 2 0 0 7 )  an Pi chet  S u e b sai p r o m   and  hi s col l e a gue s ( 2 0 1 2 ).  K o r k m az et  al . (20 1 1 has i n ve stigated the re sistant speed  c ont rol o f  fis h  r o b o ts.   Afolayan Matthew Olatunde  pres en ted d e sig n  of a stab le co n t ro ller i n   robo tic fish.  The pat h  control of a t h ree - wheel  ro b o t  has  been i nvest i g at ed usi ng  o p t i m i zed PI D co nt r o l l e r wi t h   PSO al go ri t h m  by  Tu rki   Y.  Ab dal l a  an d hi s col l eag ue ( 2 01 2 ) . I n  t h i s  s t udy , a P I D c ont rol l e was  use d  t o   co n t ro l two   featu r es  o f  th robo t in clud ing  speed  co n t ro l and  co n t ro lling  th e turn i n g ang l e o f  th wheels. PSO  alg o rith m  was u s ed  to find  t h e op ti m a l co efficien ts o f  th e co n t ro ller.  Pie-Jun Lee and his colleag ue s (2 01 2) i n t r o d u ces an ap pl i c at i on  of Fuzzy  logic in the design of an  in tellig en t fish  ro bo t with  m u ltip le act u a tors. Th is  ro bo t is cap able o f  swimmi n g  easily and actin g   inde pende n tly in the  face  of  a n y haza rd in water.    M a no j Kus h w a h   and hi c o l l eague ( 2 0 1 4 c o m p ared t h di f f ere n t  m e t hods of  a d j u st i n t h e   param e t e rs of   PID  co nt r o l l e r  usi n g s o ft  co m put i ng t ech n i ques  suc h  as   Genet i c s,  PS O  an d F u zzy   i n   DC  m o to r. Th resu lts ind i cate the priv ileg e  of  ev o l u tio n a ry  al gorithm s  to classical m e thods suc h  as Zie g ler or  Nichols. They  also indicated a pr i v ilege of Fuzzy techniques to PI D controller. Howe ve r, the Fuzzy   co n t ro ller is m o re co m p licate d  in   stru ct u r an d co stly as com p ared  to  th PID con t ro ller. If  PID co n t ro l l er is   ad ju sted  to enhan ce its  p e rforman ce, it wou l d   b e  m o re  bene ficial than t h Fuzzy c ont roll er.  Prior  to   t h e p r esen stud y, n o  p r ev iou s  research   h a b een  con d u c ted, reg a rd ing  co n t ro lling  rob o t   fish  usi n opt i m i z ed P I co nt r o l l e rs  based  o n  e vol ut i ona ry  al go rith m s ; th u s  t h is stud y seems so  si g n i fican t  in  th is  p o i n t  th at it app lies evo l u tionary algo rith m  o n  th ro bo t fish   The  prese n t  re search  at t e m p t s  t o  de vel op a   ro b o t  fi sh m a d e  u p  o f   3 pa rt s  an d 2 act uat o r  l i nks.  Thi s   fish  co nsists of th ree  p a rts: a h ead, a flex ib le p a rt  and  a rear tail. Th e co n t ro lling  p a rts of th e syst e m  are  applied to the flexible part  of the robot. In the followi ng se ction, th e suggested  m e thod  whic h is the use of an  o p tim ized  PID con t ro ller  v i a th b acterial fo rag i ng  alg o rith m  is in trod u c ed  for  co n t ro lling  fish  rob o t   trajectory.   Di ffe re nt  sect ions  of t h i s  pa p e r are or ga ni ze d as fol l o ws. S ect i on 2 i n vest i g at es t h e fi sh r o b o t  m odel .   In S ect i on  3, t h e de si g n  o f  P I D c o nt roller i s  elaborated. Sec t i on 4  desc ri bes t h bact eri a l  fora gi n g  al g o ri t h m .   Ex peri m e nt al  resul t s  are  pres ent e d i n   sect i o n 5 i n  o r der t o   anal y ze t h e su gge st ed m e t hod. E v e n t u al l y , sect i o n   6 prese n t s   t h e concl u si ve   rem a rks .       2 .  T H E PROPOSED  METHOD    2. 1. Fi sh Ro bo S y ste m  Mo d e l i n In  ge ner a l ,  a  f i sh s w i m s i n  wat e by  t w ki n d of  b o d y  an d/ o r  ca udal  fi n  (B C F -st y l e or  m e di an  and/ or  pai r e d   f i n (M P F -st y l e ) .  I n  fact , a fi s h   pr o v i d es  its  p r o p u l siv e   fo rce  in  th ese t w o ways. Similarly, in  th desi g n   of  fi sh   ro b o t s we t r y   t o  p r o d u ce t h e   pr o pul si ve  f o rc e by  t h d o rsal  fi n a n d t h e  an al  fi or t h fl exi b l e   p a r t   o f  th ro bo t bod y wh ich  h a s t h e ro le  o f   th e br aw n m u scles o f  f i sh   [ 19].     2. 1. 1. Fi sh Ro bot   D y n a mi cs and   Ki nem a ti cs  Kin e m a tics is  th e scien ce  o f   m o t i o n  reg a rd l e ss of th e cau s es o f  t h at m o ti o n . Th is science, in  fact deals wit h  s p a ce, vel o city, accelerati on a n all highe r-orde r de rivative s Dyna m i cs is an e x tended bra n ch of  me c h a n i c s   w h ic h  l o o k s  in t o  th forces a n d c a uses m o tion.  Fi gu re  1 an 2  i ndi cat e t h e st ruct ure  of  a fi s h  r o bot  a n d i t s  4 sect i o ns  [1] .   As i t  can  be  ob serve d ,  t h e   robo t con s ists  o f  3 lin ks.  Three servo - m o to rs with en cod e rs are lo cated at th e fi rst, secon d  and th ird  li n k  of  f l ex ib le bod y p a r t  of  th e f i sh  r obo t, r e sp ectiv ely. I n  th e p r esen t research, th e first an d  seco nd  lin k s  are  actuators  while the thi r d is  stable. T h fourth piece is t h e tail whic h is  use d  as a  propeller  to produce a  gentle   m ove m e nt similar to that  of a  real fis h  a n d is  attached  t o  th th ird lin k.  Here, th ere are th e th ree m a in  p a rt s:  1)   Head  ( r o b o t  ri gi pa rt )   2)   Flex ib le p a rts  3)   Th e ch ip h a ng in g fro m  th e flex ib le  p a rts  (fish  tail)    Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 088 -87 08  IJECE   Vol. 5, No. 6, D ecem ber  2015 :   1372 –  1380  1 374       Figure 1.  Struc t ures of  fish  robot with 4 pieces  and  3 l i n ks  [1]   Figure 2.  Struc t ures of  fish  robot with 4 pieces  and  3 l i n ks       Fish   r obo t m e c h an ical con s tr ain t s ar e show n in   Figu r e  3 and  th k i n e m a ti c p a r a m e ter s  of  f i sh   ro bo t   dynam i m odel are indicated in Fi g u re 4. I n   these fig u res ,   T and T are  respectively the input t o rques for  ro tating  th 1 st  and  2 nd  l i nks I i l i , and  a i  are  resp ectiv ely mo m e n t s o f  in ertia o f  th e i th  l i nk, i th  lin k  leng t h  and  the dista n ce  be tween t h body  center and t h i th  j o in t [1 ].         Fi gu re  3.  Fi sh   R o b o t  M echa n i cal  C onst r ai nt Fi gu re  4.  B a si c M o d e l  o f  t h e   Fi sh R o b o t  M O TI O N                         F F  and  F C  i n di cat ed i n  fi gu re  5 re pre s ent  t h e pr o pul si on  force a n d lift force  pr odu ced  as a r e su lt of  t h e m ovem e nt  of  t h 3 rd  joi n t  cause d by   a hy dra u l i c   i n t e ract i on [ 3 ] .       Fi gu re 5.   F and F of Tai l   Fi n [3]       Our assu m p tio n  is th at th e i n ertia force an d   th ru st fo rce app l y th e tail fin .  Th erefo r e, F is app lied  on  th e who l e tail fin  and   F C   on  the tail f i n .   Th e dyn amic eq u a tion   f o r  each   r obot lin k  is stated  i n   r e latio n   ( 1 )   [3 ].               G G G  τ τ τ                           (1)     Param e ters H 11  to  H 33  and G 1  to  G 3  as well  as T 1  to  T 3  i n  thi s  eq uat i on ar m e nt i oned i n  [3] ,  [1 7] - [1 8] .   In ca se the  fish robot is consi d ere d  as a  ri gid body , t h pr op ul si o n  eq uat i o n  of  t h ro b o t  ca be st at ed   (2 ) [3] :      F F                                    (2)     Evaluation Warning : The document was created with Spire.PDF for Python.
I J ECE   I S SN 208 8-8 7 0 8       Op timized  PID Con t ro ller with  Ba cteria l Fora g i ng  Algo rit h m (S eiyed Moh a mmad  Mirzaei )   1 375 Wh ere, M is m a ss of th bo d y is th po sitio n of th e cen t er of  b o d y ’s m a ss, and   F F  and  F D  are the  thrust and  th to tal d r ag  fo r ces , respecti v ely.  2. 2.  Fluid F o r ce Model   If we c onsi d er  a fi sh ro bot  i n  a fl ui d wi t h  a con s t a nt  fl o w  of  U m , th en  the in ertial fo rce an d  th e lift   force on  its tail  fin  can  b e   ob tain ed In  th is case, th e th ru st fo rce (F F ) an d l a teral force  (F C ) com pone nt s c a n be  calcu lated  [20 ] .  Fig u r 6  in dicates th e in ertial flu i d  fo rce  wh ile Figu re 7 sh ows th e lift  force on  th e tail fin .   Here U  is th e relativ e v e lo city at  th e cen tre of th e tail fin  and   α  is t h e attack angl e of the  robot, i.e.,  swi m m i ng st ar t  angl of t h e c a udal   fi n i n  t h e ro b o t .  Al s o 2C  i s  t h e c h or d l e n g t h   ge ner a t e d by  t h e  t a i l  of t h e   fish  i n   water, L is th e sp an   o f  tail fin ,  and   ρ  is th d e nsity o f   water  [3 ].  A s  it can  be ob serv ed  in f i gu r e   6, F V  is  force  p r o portio nal to  th e acc eleration acted i n  the  opposit e   d i rection   o f  t h e fish  tail, an F  is th e lift fo rce in  th p e rp end i cu lar  d i rection  of ca udal fin  whic h is estimated  in  Eq u a tion   (3 ) [4 ].             Fi gu re 6.   I n ert i al   Fl ui d Fo rce [3]   Fi gu re 7.   Li ft  For ce  [ 4 ]                                              F J  is stated i n   Euation (3):    F 2   .                  ( 3 )     There f ore, F F  an d F C  ca be st at ed i n   Eq uat i o (4 ) a n d  ( 5 )  [ 4 ] .           .s i n    .s i n                  (4)          . cos    . cos                    (5)     2. 2. 1.  M o ti on  E qua ti on  o f  F i sh R o b o t   If we as sum e  that the fish  robot m oves in  x -d irection ,  th en   th e relativ e v e l o city at th m a ss cen tre  o f   th e tail fin  i n   y -d irection  is esti m a ted  th rou g h  Equ a tio n (6 [4 ].       cos  .   cos   .         (6)     Whe r U m  is co n s tan t  flow,  u is relativ e v e lo city at th e cen ter of th fish tail in   Y m  direction. T h ere f ore, the  relativ e v e l o city ( U ) is stated  as (7):                                                  (7)     Fin a lly, If Eq uatio n   (3) an d (7 ) are i n serted   in  (1 ), m o tio n   eq u a tion   of th e fish rob o t  is  ob tain ed as  fo ll o w s:                N N N                                   (8)     In th is  relatio n ,  M 11  to  M 33  and  N 1  to N 3  a r m e nt i oned  i n  r e fere nce[ 3] .   The  SIM U LI N K   bl oc di ag ra m  of t h e fi s h   r o b o t  m o t i on m odel  i s  p r ese n t e d i n  Fi g u r 8.   Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 088 -87 08  IJECE   Vol. 5, No. 6, D ecem ber  2015 :   1372 –  1380  1 376     Fi gu re  8.  SIM U LI N K  B l oc Di ag ram  of t h e  Fi sh R o bot  M o t i o n  M o del   U s i n g  PI D C ont r o l l e r       2.3. PID  Controller  PID  co nt r o l l e i s  am ong t h m o st  preval ent  i n st ances  o f  fe edbac k  c o nt rol l ers use d  i n  a v a st   m a jori t y   of c ont r o l  p r o cesses suc h  as  cont r o l l i ng  D C   m o t o r vel o c i t y , pressu re c ont rol ,  t e m p erat ure co nt r o l ,   et c. The  goal  o f  usi ng  PID al g o r i t h m  i n  t h e cl osed- l oo p co nt r o l  i s  t h e preci se an d fast  co nt rol l i ng  of sy st em   out put   un de r va ri o u ci rcum st ances and  wi t h out  a  det a i l e d k n o w l e dge  of  sy st em  behavi or i n  resp o n se t o  t h e i n p u t .   PID c o nt rol l e r  i s  co m p ri sed  of  3 di st i n ct  p a rt s:  pr op ort i o n al , i n t e g r al  and  deri vat i v e.  Each w o ul d t a ke t h e   sig n a l error as  th e in pu t and  pro cess it. Fin a lly, th eir o u t put s are summ ed  up. The  outp ut  of t h i s  sy st em   whi c h   is th e sam e  as PID ou tpu t  is  sen t  to  t h e system  fo r error co rrectio n.  PID con t ro ller  o u t p u t  is estimated  in   Equ a tion   (9):    u(t ) =                                             (9)     Varia b le  e  sta n d s   for th e track i ng  error which  is th e d i ffe rence  of the target val u e (r) and the  real   v a lu o f  ou tpu t  (y).  Th e error  sig n a l en ters t h e con t ro ller and  th e d e riv a tive and  in teg r al  v a lu es are esti mated .   The n  t h e cont r o l  si gnal   u  is estim a ted using a coefficient of error signal (K p ), a coe ffi cient of error integral  (K i ) a n d a c o efficient of e r ror  deri vative  (K d ).    B a sed o n  t h abo v e - m e nt i oned i ssue s , i t  can be  r ealized that a control  syste m  requires tuning.  Gen e rally sp eak i ng , wh at is esti m a ted  in  th e d e sign  ph ase  sh ou l d  no t lead  u s  to  ex p e ct th e sam e  fin d i n g s  i n   practice. Tuning is a significant issue.  PID co efficien t n eeds to  b e  altered  so  m a n y   ti mes  th at th e resu lts o f   an  opt i m i zed resp ons e are o b t a i n ed . The r e exi s t s  a vari et y  of m e t hods  fo t uni n g One s u ch m e t h o d  i s  usi n evol ut i ona ry  al go ri t h m s .     2 . 4 .  PID  Co ntro ller  fo r Contro lling  Fish Robot Motion  In t h i s  sect i o n,  a PI D c o nt rol l er i s   desi g n ed   fo r t h e  fi s h  m o t i on.  In  t h i s   de si gn , 4  pa rt s a r e co nt ri ve of  f o r t h fi sh  ro b o t .  Fi gu re  9  sh ow s t h e  st r u ct ure,  di rect i o n  an d c ont rol   of  t h e fi s h   ro b o t   m o ti on  usi n g a  PI D   cont rol l e r.  Fi g u re  1 0  s h ows  S I M U L I N K   bl o c di ag ram  of f i sh r o bot   usi n g  PI D c ont rol l e r s           Fi gu re  9.  St r u c t ure,  Di rect i o an d Con t ro l of   th e Fish   Ro bo Using  PID C o n t ro ller  Fi gu re  1 0 SIM U LI N K  B l oc Di ag ram  of Fi s h  R o b o t   Using  PID Con t ro llers      In   o r d e r to  tune PID con t ro ller p a ram e ters i n  th is stud y, t w o  al g o rith m s   were sug g e sted  wh ich   were  b o t h   b a sed   o n   swarm  in tellig en ce: b a cterial forag i n g  algo ri th m ,  an d  PSO  alg o rith m .   Evaluation Warning : The document was created with Spire.PDF for Python.
I J ECE   I S SN 208 8-8 7 0 8       Op timized  PID Con t ro ller with  Ba cteria l Fora g i ng  Algo rit h m (S eiyed Moh a mmad  Mirzaei )   1 377 2. 5.  B a cteri al  For agi n g  Al g o r i t hm   Bacterial forag i ng  algorithm   is a  g l ob al  op ti m i zatio n  alg o rith m  su gg ested in   [1 3 ] . Th e id ea of  b acterial fo rag i n g  algo rith m  is b a sed   o n  th fact th at in   n a ture, liv e creatures with   po o r er   fo ragi ng  strate gy  are  m o re pro n e t o  ext i n ct i on t h a n  t h o s e wi t h  a  successf ul  f o r a gi n g  st rat e gy .  Aft e r a m u l t itude  of  gene rat i ons ,   creature s  with poorer fora ging  strate gies are  either e x tinct  or t r ans cen de d  t o  m o re de vel ope d s p eci es.   E-coi l   bact eri u m  whi c h d w el l s  i n  hum an i n t e st i n es has a  3-st age f o ra gi n g   m e t hod:  chem ot axi s  (t um bl ing a n d   swi m m i ng),  re pr o duct i o n,  an d el i m i n at i on- d i spersal .     Chem ot a x is : In  th is stag e, the b acteri u m  b e g i n s  to  t u m b le  and  swim  d e pen d i n g  on  t h ro tation   of  bact eri a ’s t a i l .  If t h e am ount  of f o o d  i s   m o re al o n g  t h e new  di rect i o n,  bact eri a  cont i nue s t o   m ove i n  t h at   di rect i o n ( s wi m m i ng).   No w s u p p o se  that we wa nt t o  fi nd t h e m i n i m u m  of J( Ɵ ) w h er Ɵ   ϵ R r Ɵ  is th p o s i tio n  of the  bacterium .  J( Ɵ ) i s  i n di cat i v of t h e am ount   of  fo o d  i n  t h e l o cat i o n  o f   Ɵ . J ( Ɵ )>0 , j( Ɵ )= 0,J ( Ɵ )<0 m eans t h at the   bact eri u m  i s  r e spect i v el y  wi t h  s u f f i c i e nt neut ral  an d  i n suf f i c i e nt  am ount  o f   fo o d  i n  l o cat i o Ɵ . Fo r the  tum b le to take place, a  vector  in the ra ndom  direction ca lled Ø(i)  whose e l e m ents lie in [-1, 1] is create d . T h is   vect o r   i s  use d  fo r defi ni n g   t h ne w di rect i o n of   t u m b le for th e b a cteriu m on ce it is  started .   Th e new po siti on  of  t h bact eri u m   i s  defi ne as  rel a t i o n  ( 1 1 ) :     Ɵ ( j +1,k,l)  = Ɵ ( j ,k,l)  + C( i)  Ø(i)                      (11)     Here Ɵ i  (j,k,l) indicates the i th   bact eri u m  posi t i on i n  t h e j th  chem otactic, th e k th  re pr od uct i on a nd t h e   l th  el i m in atio n  an d  d i sp ersal. C(i)  is  th size  of t h e bacteri u m tu m b le in the dir ection  of  Ø(i). If th e size o f  J(I,  j ,   k ,  l) in  Ɵ i   (j+1 ,k ,l) is sm al l e r th an  its size in   Ɵ i  (j ,k ,l), then  a  furth e r tum b le is  mad e  in  th e size of C ( i) and  in  th d i rection o f  Ø(i).  Th en   th e b acteriu m  wou l d b e g i n to  swim  in  th e d i rectio n of  Ø(i). As l o ng  as th e size   of J( Ɵ ) i s  bei n decrease d ,  a n d  u p  t o  t h e m a xi m u m  num b e r o f  s w i m m i ng al l o wed  ( N s ) t h i s   swi m m i ng   w oul co n tinu e . Th is in d i cates t h at  th b acteri u m con tinu e s its  d i rection   u n til it find s a b e t t er env i ron m e n t fo fo ragi ng .   Repr oduc tion : The least hea lthy bacteria ev ent u ally die while each  of th e healthie r ba cteria (Thos e   yield i n g   lower v a lu e of  th e obj ectiv e fun c tion )   asexu a lly  split in to  two b a cteria, wh ich   are th en p l aced  i n  th sam e   lo catio n .  Th is k eep s the   swarm  size constant.  Elimina t io n and  dispersi o n :  The l i f e o f  a  po p u l a t i on  of  bact eri a  i s  g r a dual l y  al t e red t h r o ug h f o od  co nsu m p tio n  or  su dd en ly  thro ugh  o t h e r facto r s.  Ev en ts   can  cau s e th e b acteria to   be k illed   or  d i sp ersed .   Although, initi ally this  m i ght disrupt  t h e foraging  sta g e,  it can have   a pos itive effect as  well. That is  because  bact eri a  di spe r si on   co ul d  kee p   t h em  close to s p ots  whe r an a b unda nce  o f  fo od is av ailed .  Th e eli m i n ation  and dis p ersi on  stage would  prevent t h bacteria to  be tra p pe d in the l o cal  optim i zed poi nt. In each elim ination  an d d i sp ersion stag e, th pro b a b ility o f  eli m in atio n  and d i sp ersi o n  for an y resi d i ng b acteri u m  in  th e   p opu latio n  is P ed . In  or der t o  kee p  t h e n u m ber of bact e r i a  c onsta nt, if a bacterium   is eliminated, a new  bacterium  is ra ndom ly replaced in the  searc h ing z one     3.   RESULTS  A N D  DI SC US S I ON   Fi gu re 1 1  i ndi cat es t h e st ruct ure o f  t h e st u d i ed fi sh r o b o t  com p ri si ng o f  3 l i nks. Li nk  1  and l i nk  2   have  m o t o r a n d e n co de r re sp ect i v el y  and  m o t o rs  gene rat e   T 1 and T 2 H o weve r,  Li n k   3  has n ’t  act uat o r a n d   enco de r. T h p a ram e t e rs of si m u l a t i on are  s h o w by  Ta bl e 1.       Fi gu re 1 1 . St ru ct ure of   Fi s h   R o b o t  [3]             Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 088 -87 08  IJECE   Vol. 5, No. 6, D ecem ber  2015 :   1372 –  1380  1 378 Tabl e 1. Param e t e rs  f o r   Si m u lat i on [3]   1.23 1 0     1.6    0.35   0.175   M o m e nt of I n er tia  Mass  L e ngth  Center  of Gr avity  L i nk 1  3.7 10     1    0.115   0.0575   M o m e nt of I n er tia  Mass  L e ngth  Center  of Gr avity  L i nk 2  6.75 1 0     0.33    0.062   0.031   M o m e nt of I n er tia  Mass  L e ngth  Center  of Gr avity  L i nk 3  998    0 . 5 Wate r Densit drag Coef f i cient   Fluid  Force       In the e xpe riments, PID c ont roller coefficients  are estim a ted running  the PSO algorithm .  The  obtaine d c o e ffi cients are:                         = 5 . 45 10     0 . 1210    =  1 . 51 50    Also   PID con t ro ller co efficients u s ing  t h e Bacterial Fo rag i ng  algorith m  is as fo llo ws:  = 6.33 20      0 . 1210                                                                                                                  = 1.82 87    MATLAB/SIMULINK is used  to  co m p are th e o p tim iz e d  PID tho ugh  Bacterial Fo rag i ng  algo rith m   an d Fu zzy co ntro ller  [1 ] and   yet with  th e op ti m i zed  PI D t h r o ug PS O al go ri t h m  [1 6] A c ont rol   sy st em  i s   d e sirab l e wh en u pon  th e en tran ce  o f  an  inpu t, it m a n a g e s to  track  it  with th e fewest erro r and  in  m a x i m u length  of ti m e . The less overshoot and settling ti m e  for  the output, and the soone r th e final state  is reached,  the better perform ance the cont rol system   will have. In  this study, two inputs ha ve been applied on the   syste m . O n e is  th e step stand a r d  inp u t  and  ano t h e r  is th e sine stand a rd  input.   Fi gu re  1 2  s h o w s t h desi re d  m easured  p o s i t i on o f   fi sh  r o bot ’s  1 st  link  ( Ɵ 1 u s i n g 3 con t ro llers: an  o p tim ized  PI D th r oug h  t h e Bacter ial Fo r a g i n g  al g o r ith m ,   Fu zzy con t ro ller  and  th o p t i m ized  PI D  through  PSO algo rith m  with  app l yin g   step  inpu t.     Fi gu re 1 3   s h o w t h e desi re d m easured   p o si t i on o f   fi s h  ro b o t s 2 nd  link   ( Ɵ 2 )  w ith app l ying  step  inpu t.          Fig u r e   12 . Resp on se to  t h e St ep   I npu t in  R o b o t s   1 s t   Link ( Ɵ 1 )   Fig u r e   13 . Resp on se to  t h e St ep   I npu t in  R o b o t s   2 n d   Link ( Ɵ 2 )       The n  t h e si ne i n p u t  ent e red t h e sy st em . The reaso n   was t h e  qua si -si n e m ovem e nt  of fi s h .  Fi gu re   1 4   sh ows of t h desired m easu r ed  p o sitio of fish  robo t’s  1 st  lin k ( Ɵ 1 ) us ing  th e  th r e e c o n t rolle r s  wh en  ap plyin g   sin e  in pu t.  A l so , Figur e 15  sh ow s th d e sired  m easu r ed  po sitio n   o f   f i sh   r obo t’ s 2 nd  link  ( Ɵ 2 ) using  the th ree  cont rollers  with applying si ne  input.  While the sine input was used,  still  the optim ized PI D controller through  bact eri a l  fo ra g i ng al g o ri t h m  sho w e d  t o  ha v e  a bet t e r per f o rm ance t h an i t s t w o co unt e r part bot h i n  t r acki n g   the input t r ajec tory a n m i nim i zi ng si g n al  e r r o r .   0 2 4 6 8 10 12 14 16 18 20 -0 . 5 0 0. 5 1 1. 5 2 2. 5 3 3. 5 4     In pu t  Re fr e n c e f u z zy co n t r o l l e r O p t i m i z ed P I D c ont r o l l e r  w i t h  P S O O p t i m i z ed P I D c ont r o l l e r  w i t h  B F 0 2 4 6 8 10 12 14 16 18 20 -0 . 5 0 0. 5 1 1. 5 2 2. 5     I npu t  R e f r e n c e f u zz y c o n t r o l l e r O p t i m i z e d P I D   c ont rol l e r  w i t h  P S O O p t i m i z e d P I D   c ont rol l e r  w i t h  B F Evaluation Warning : The document was created with Spire.PDF for Python.
I J ECE   I S SN 208 8-8 7 0 8       Op timized  PID Con t ro ller with  Ba cteria l Fora g i ng  Algo rit h m (S eiyed Moh a mmad  Mirzaei )   1 379       Fig u r e   14 . Resp on se to  t h e si n e  inpu t in   ro bo t’ 1 s t   l i nk ( Ɵ 1 ),   Fig u r e   15 . Resp on se to  t h e Si n e   I npu t in  R o b o t s   2 n d   Link ( Ɵ 2     Table 2 i ndica tes the analytic feature s  of  th e respo n s e to step  in pu t in   ro bo t’s  1 st  l i nk  ( Ɵ 1 ) a n d 2 nd   l i nk ( Ɵ 2 ). Th is tab l e p r ov es th at th e op tim i zed  PID con t ro ller th rou g h  t h e Bacterial Fo rag i ng  algo rit h m  h a s   had a  bet t e r p e rf orm a nce i n  t h e 1 st  l i nk ( Ɵ 1 ) co m p ared to  th e Fu zzy  co n t ro ller and  th e op tim iz ed  PID  co n t ro ller t h rou g h  PSO al g o rith m .  However, a similar resp on se is  o b serv ed   on  th 2 nd  lin k   wh en  eith er t h BF algo rith m  o r  PSO al go rithm   is u s ed.      Tab l 2 .   An alysis o f  Resp on se to  Step   I npu Over shoot    Rise Ti m e (sec )    Settling Ti m e (sec )    Lin k   Lin k   30%    2    4. 5    Fuzzy   L i nk 1   10%    1. 5    2. 5    PID PS O    5%    1. 5    2    PID BF    E r r a tic Undulations    1    4. 5    Fuzzy   L i nk 2  0%    1. 75    2    PID PS O    0%    1. 75    2    PID BF        Table 3 is indi cative of the  mean -squa r ed error  si gnals between  th e i n pu t and  ou tpu t  for th e sine  in pu t in  th e 1 st  j o in t ( Ɵ 1 ) a n d  2 nd  j o in t ( Ɵ 2 ). Th is tab l e p r ov es th at th e PID con t ro ller op ti m i zed  th roug h  th bact eri a l  f o ra g i ng al g o r i t h m   has  had a  bet t er f unct i oni ng com p ared to  the Fuzzy a nd the PID c ont roller  o p tim ized  th rou g h   PSO algorith m .       Tabl 3.  A n al y s i s  of  R e s p o n s e  t o  Si ne  In p u t   M ean Squar e   Signal E r r o r    Lin k   Lin k   0. 1101    Fuzzy controller   L i nk 1   0. 0198    PID PS O    0. 0140    PID BF    0. 0017    Fuzzy controller   L i nk 2  0. 0001 676    PID PS O    0. 0001 073    PID BF        Am ong t h e rea s on s o f   why  t h e fi n d i n gs  of  B F  al go ri t h m   are cl ose r  t o   r eal   m i nim a  com p ared wi t h   ot he r ap pr oach es such as PS O, i t  can be  m e nt i one d t h at  t h e searc h i n g m e t hod i n  B F  al go ri t h m  fol l o ws l o ca l   search. Bacteri a  searc h  in a  parallel and i n depende n way, an d th ere is no  in terch a n g e   a m o n g  th b a cteria.  Ho we ver ,  i n  P S O al g o r i t h m ,   al l  part i c l e m ove  o n l y  t o wa r d one  best   par t i c l e  (gbest ) ,  a nd a r not  a ffe ct ed b y   any  of t h e ot he r part i c l e s. Eve n  i f  a part i c l e  st ands as t h e se con d  best  am ong al l ,  i t  poses  no ef fect  o n  de ci si on  mak i n g   o f  o t her p a rticles. Nev e rt h e less, con d ition s  are d i fferen t  in BF.  A t  th reproductio n  lev e l,  h a l f  of th bact eri a  a r o m i t t e d. T h ot h e hal f   pl ay s an  eq ual l y  si gni fi cant  r o l e  i n  p r o duci n g  p r ospec t i v e res p o n ses .   Also , in BF al g o rith m  th e num b e r o f  iteratio n of ev e r y  pa rt  i s  est i m at ed i nde pen d e n t l y  fr om  ot hers .   Ho we ver ,  i n  P S O al g o r i t h m ,   t h e n u m b er o f   i t e rat i on f o r t h e ent i r e al g o ri t h m  shoul d be  defi ned al l  at  once ,   wh ich  wou l d   resu lt in  flex ib i lity red u c tio n.  Bacterial Fo rag i ng  algo rith m ,  th oug h   h a v i ng  sim p ler n a ture, is  found to  be m o re efficient a n d precise in  res p ons es.        Evaluation Warning : The document was created with Spire.PDF for Python.
                        I S SN 2 088 -87 08  IJECE   Vol. 5, No. 6, D ecem ber  2015 :   1372 –  1380  1 380 4.   CO NCL USI O N   As m e nt i oned  i n  t h e p r evi o us sect i o ns, t h e preci si o n   of  a fi sh r o bot   depe n d s o n  se veral  fact or s   in clu d i n g  t h p r ecision   o f   m o t i o n  sensors, lin k  m o b ilit y, elasticit y o f  fish  rob o t  dri v ing  system , a n d  t h p r ecision of con t ro llers.  Th m o st sig n i fican o f  all is  the  precision  and efficiency  o f  c ont rol l e rs . T h e r ef ore ,   we ha ve  use d  PID c o nt r o l l e r,  t h at  i s  one  of  t h e m o st  preva l ent  and  p o we r f ul  c ont r o l l e rs  use d  i n  i n d u st r y , t o   cont rol  t h di re ct i on  of  t h e  fi s h   ro b o t .  T w o e vol ut i ona ry  al g o ri t h m s  were  s u g g est e d i n  t h i s  resea r ch  f o r t uni ng   PID   p a ram e ters fo r con t ro lling  th e fish   robot traj ecto r y.  These tw o  w e re th e b acterial fo rag i ng  alg o rithm an d   PSO  algo rithm .  Th en  th e su gg ested  PID  co n t ro ller co mp ared  to th po werfu l  Fu zzy  controller. For thi s   pu r pose ,  a fi s h  ro bot   was de s i gne d wi t h   h i nge d-l i n ks a n d t h e n  dy nam i m odel  was  d e t e rm i n ed, t h m o ti on   equation  of t h e robot is im ple m ente d by SIMULINK. Fi nally, each of th e pre v iously-mentioned controllers  was a p pl i e d i n  t h i s  m odel .  T h r o ug h a p pl y i ng  st ep  an d si ne i n p u t s   whi c h a r e t h e  st an d a rd  i n put s i n  c ont rol   syste m s, th e ou tpu t  d i r ection w a o b s erv e d. Test r e su lts ind i cated  th at the o p tim ized  PI D  con t ro ller  thr ough  the Bacterial F o ra ging algorithm  could  track step  an d  sin e  in pu ts with  th fewest errors an d  in  th e m a x i m u tim e  as com p ared to Fuzzy controllers a n d op ti m i zed  PID co n t ro llers th rou g h   PSO.    Op tim ized  PID throug h th e Bacterial Forag i ng  al g o r i t h m  can be a  us eful  m e t hod  o f  co nt r o l l i ng a  fish  ro bo t m o t i o n .  It can  as  well b e  u s ed  i n  con t ro lling  fish  robo ts with  m o re j o in ts o r  tho s e m o v i n g  in  pat h way s   whi c have  o b st acl es. S u c h  i n vest i g at i ons  can  be  ap peal i n g  t o pi cs o f   fu rt he r re search       REFERE NC ES  [1]   Rahmat-Allah H ooshmand, Ali  Akbar Na siri,  an d Mohammad Ataei, “Trajector y Angle Control  of Fish-like Rob o Motion b y  Usin g Fuzz y Con t roll er”,   Internationa l Journal of Rob o tics and  Autom a tion , Vol. 27, No. 2 ,  2012 [2]   Pei-Jun Lee, Meng-Shiue L e e, and  Ruei-Ch a n Wang, “A Fuzzy  Contro l B a sed Roboti c  Fish with Multip le  Actuators”,   In ter national Journal  of Fuzzy  Systems , Vol. 14, No. 1 ,  2012 [3]   H y oung Seok K i m, B y ungR y o n g  Lee, and  RakJ in Kim, “A  Stud y  on  the Motio n Mechanism of  Articulated  Fish   Robot”,  International Conference on  M echa t ronics and Au tomation , Harbin , Ch in a, 2007 [4]   Pichet Suebs a ipr o m, Chun-Liang  L, “F ish-Tail  Modeling for  Fish Robot”,  Inter national S y mposium on Computer Consumer and Control , 2012 [5]   Y. John and  R.  Langar i , “Fuzzy   Logic Intellig en ce”,  Con t rol and  Information , NJ: Prentice Hall, 1 998.  [6]   K.  Streitlen, G.   S.  Triantaf y llo u, M.  S.  Trian t af y llou ,  “Efficient Foil Propulsion Through Vortex Control”, AIAA  Journal,  Vol. 34 , pp . 2315-2319 , 1996   [7]   J. Yu, S. Wang  and M. Tan,  “A  Simplified  Pro pulsive  Model   of Biomim etic   Robot  Fish  and   Its  Realization   Robotica , Vol.    23,   pp. 101-107 , 2005 [8]   H.  Hu,   “Biologically   Inspired   Design   of    Autonomous   Rob o tic  Fish  at Essex”,   Pr oceed in gs   of   the  IEEE     SMC  UK-RI  Ch apter Conference on  Advan ces   in  Cyber n e tic  Sys t ems , pp. 1-8, 20 06.  [9]   J. Liu  and H. Hu,  “A  3D  Simulato r  fo r  Autono mous  Robotic   Fish”,  Internatio nal  Journal  of   Automation   and     Computing  1   Vol. 1 ,  No. 1, pp . 42-50 , 2004 [10]   X. Ye, Y. Su, S. Guo, L. Wang,  “Desi gn and Realization of  a R e mote Control   Centimeter-Scale    Robotic  Fish ”,    Pr oceed ings   of   th e I EEE /ASM E  In ter nationa l   Conf er enc e   o n   Ad vanc ed   In tell igent  Me chat r onics , pp. 25-3 0 2008.  [11]   D. Korkmaz, G .  OzmenKoca,  and  Z. H. Akp o lat, “Robust Forward Sp eed  Control of  a R obotic Fish”,  6th   International Ad vanced  Techno lo gies Symposium  ( I ATS’11 ) , Ela z ı ğ , Turk ey , 2011.  [12]   Afolay an Matth ew Olatunde, “Stability  of th e C ontrol Scheme of a Design  of a Robotic Fish”,  Scholar lin Research Institute Journals , 2013 [13]   K.  Pa ssi no,  “Biomi mi c r y  of ba cter ial foraging   for distribut ed o p tim izat ion  and  control ,   IEEE Control Systems  Magazine,  Vol.  22, No. 3, pp. 52 –67, 2002 [14]   K e nned y , J ., Eb erhart , R., " Pro ceed ings of IEE E  International   Conferenc e  on Neural Network s ". pp.  1942–19 48,   1995.  [15]   Turki Y. Abdalla, Abdulkareem. A.  A., ”PSO-based Optimum Design of  PID Controller  for Mobile R obot  Traj ector y Tr ack ing”.   Internation a l Journal of  Co mputer Applications . Vol. 47, No. 23 , 2012 .   [16]   Manoj Kushwah  and Prof. As his Patra,   ”Tun ing PID Controller fo r Speed C ontrol of  DC  Motor Using Soft  Computing Techniques-A Review”,  Advan ce  in  Electronic and  Electric Engin e ering , Vol. 4 ,  No . 2, pp. 141-148 2014.  [17]   J. Yu, L.  Liu, an d L. Wang, “D y n amics and  control of tu rning m a neuve r  for b i o m imetic robotic  fish”,  In t. Conf.  on  Intelligen t Robo ts and Systems , B e ijing ,  Ch ina, 54 00–5405, 2006 [18]   F.M. Sun, X.S. Xu, and Z.H.  Qi, “Non-linear vibration and d y n a mic char act eris tic of fish-lik e r obot controlled  b y   GMM a c t ua tor” Journal o f  In telligent Materia l  S y stem and S t ructures , Vol. 20, No. 12 , pp . 1503– 1513, 2009 [19]   J .  E .  Colg at e a nd K.M .   L y nch ,  ”M echan ic and contro l of  swimming: A review”,  IEEE Jo urnal of Ocean i Engineering , Vol. 29 , No . 3 ,  pp 660–673, 2004   [20]   M.  Sfa k iota kis,   D.  M.  La ne , a n d J.  B.  C.  Da vie s R eview of fish  swimm ing m o des for aqua tic  lo com o tion”,   IE EE  Journal of Ocea nic Engineering , Vol. 24, No. 2 ,   pp. 237–252 , 19 99.   Evaluation Warning : The document was created with Spire.PDF for Python.