I nte rna t io na l J o urna l o f   E lect rica l a nd   Co m p ute E ng in ee ring   ( I J E CE )   Vo l.   7 ,   No .   2 A p r il   201 7 ,   p p .   775 ~ 7 8 3   I SS N:  2088 - 8708 DOI : 1 0 . 1 1 5 9 1 / i j ec e . v 7 i 2 . p p 7 7 5 - 7 8 3     775       J o ur na ho m ep a g e h ttp : //ia e s jo u r n a l.c o m/o n lin e/in d ex . p h p /I JE C E   I m ple m e ntatio n o Alg o rith m   for  V ehicle A nti - Co llisi o n Alert   Sy ste m  in  FP G A       Ai m a Z a k w a n J idi n L i m   S ia u L i,  Ah m a d F a uza n K a d m i n   F a c u lt y   o f   En g in e e rin g   T e c h n o lo g y ,   Un iv e rsiti   T e k n ik a l   M a la y si a   M e lak a ,   M a la y sia       Art icle  I nfo     AB ST RAC T     A r ticle  his to r y:   R ec eiv ed   J u n   9 ,   2 0 1 6   R ev i s ed   No v   2 0 ,   2 0 1 6   A cc ep ted   Dec   1 1 ,   2 0 1 6       V e h icle   sa f e t y   h a b e c o m in g   o n e   o f   th e   im p o rtan issu e n o w a d a y s,   d u e   to   th e   f a c th e   n u m b e o f   ro a d   a c c i d e n ts,   w h ich   c a u se   in j u ries ,   d e a t h a n d   a lso   d a m a g e s,  k e e p o n   in c re a sin g .   O n e   o f   th e   m a in   f a c to rs  w h ich   c o n tri b u te  to   th e se   a c c id e n ts  a re   h u m a n ' lac k   o f   a wa re n e ss   a n d   a lso   c a re les s n e ss .   T h is  p a p e p re se n ts  t h e   d e v e lo p m e n a n d   im p lem e n tatio n   o f   a n   a lg o ri th m   to   b e   u ti li z e d   f o v e h icle   a n ti - c o ll isio n   a lert  s y ste m ,   w h ich   m a y   b e   u se f u to   re d u c e   th e   o c c u rre n c e   o f   a c c id e n ts.   T h is  a lg o rit h m ,   w h ich   is  to   b e   d e p lo y e d   w it h   th e   f ro n se n so rs  o f   th e   v e h icle ,   is   c a p a b le  o f   a lert in g   a n y   o c c u rre n c e   o f   su d d e n   slo w in g   o sta ti c   v e h icle a h e a d ,   b y   se n sin g   th e   ra te  o f   d istan c e   c h a n g e .   F u rth e rm o re ,   it   a lso   tri g g e rs  a n   a lert  if   th e   d riv e is  b re a c h in g   th e   sa f e   d istan c e   f ro m   th e   v e h icle   a h e a d .   T h is  a lg o rit h m   h a b e e n   su c c e ss f u ll y   im p le m e n ted   in   A lt e ra   DE0   F P GA   a n d   it f u n c ti o n a li ty   w a v a li d a ted   v ia  h a rd w a re   e x p e rime n tal  tes ts .   K ey w o r d :   An ti - co llis io n   Fas t a l g o r ith m   FP GA   R an g s e n s o r   Veh icle  s a f et y   Co p y rig h ©   2 0 1 In stit u te o A d v a n c e d   E n g i n e e rin g   a n d   S c ien c e   Al rig h ts  re se rv e d .   C o r r e s p o nd ing   A uth o r :   A i m a n   Z ak w a n   J id in ,     Facu lt y   o f   E n g i n ee r i n g   T ec h n o lo g y ,   Un i v er s iti T ek n ik al  Ma la y s ia  Me lak a,   Han g   T u ah   J a y a,   7 6 1 0 0   Du r ian   T u n g g al,   Me la k a,   Ma la y s ia.   E m ail: a i m a n za k w a n @ u te m . e d u . m y       1.   I NT RO D UCT I O N   No w ad a y s ,   w h av s ee n   a n   in cr ea s in   t h n u m b er   o f   tr af f ic  ac cid en ts .   Fo r   ex a m p le,   in   Ma la y s ia ,   t h er w er ab o u 6 5 , 8 8 3   ac cid en ca s es  o n   Ma la y s ia n   r o ad s   in v o lv i n g   ca r   d r iv er s   an d   m o to r cy cli s ts   w h ic h   w er r ec o r d ed   in   2 0 1 4 .   T h is   n u m b er   is   in   f ac 5 . 4   p er ce n h i g h er   th a n   th e   6 2 , 5 1 9   ca s es  r ec o r d ed   in   th e   p r ev io u s   y ea r   [ 1 ] .   T r af f ic  ac cid en ts   o cc u r   d u to   s ev er al  r ea s o n s ,   s u c h   as  th h ea v y   tr af f ic  an d   w ea t h er   co n d itio n s ,   v eh ic le  an d   r o ad   c o n d itio n s ,   a n d   n o tab l y   t h h u m an   er r o r   [ 2 ]   A cc o r d in g   to   an   ar ticle  in   [ 3 ] ,   t h er w er 9 0 o f   r o ad   ac cid en ts   w er ca u s ed   b y   b ad   d r iv in g   b eh av io r   li k d r iv i n g   to o   f as t   an d   r ec k le s s l y ,   d r iv i n g   u n d e r   alco h o in f l u en ce ,   c h a n g i n g   th la n es  w it h o u s ig n ali n g ,   an d   b r ea ch i n g   t h s af d is tan ce   b et w ee n   t w o   v eh icles.  T h latter   m a y   ca u s e   s ev er ac cid en t   esp ec iall y   w h e n   v e h icle  a h ea d   b r ak s u d d en l y ,   w h er t h d r iv er   u n ab le  to   b r ak in   ti m e   a n d   t h u s ,   t h e   co llis io n   m a y   b in e v itab le.   B esid es,  m a n y   ac cid e n ts   also   o cc u r   d u to   th e   d r iv er s   f ail u r to   r ec o g n ize  th e   d an g er .   Fo r   e x a m p le,   t h e y   m a y   n o n o tice  w h e n   a   v e h icle   in   f r o n t   o f   t h e m   is   s u d d en l y   b r a k in g   o r   ch a n g in g   to   th eir   lan e s .   So m eti m es,   t h eir   d r iv in g   a w ar en e s s   m a y   b d eg r ad ed   w h en   t h e y   h a v b ee n   d r iv in g   f o r   to o   lo n g   f o r   th e ir   j o u r n e y ,   d u to   s lee p in ess   a n d   f ati g u f ac to r s .   T h er ef o r e,   an   aler s y s te m   i s   r eq u ir ed   to   aler th e   d r iv er   w i th   w ar n i n g   w h e n   t h s y s te m   d etec t s   t h at  t h er i s   p o s s ib ilit y   o f   co ll is io n   an d   also   to   r e m in d   t h e   d r iv er   to   k ee p   s af d is ta n ce   w it h   t h v e h icle  a h ea d .   T h er w er m an y   id ea s   an d   r esear ch es  wh ic h   h a v b ee n   p r o p o s ed   to   r ed u ce   th o cc u r r en ce   o f   r o ad   ac cid en ts   esp ec ial l y   ac cid e n ts   ca u s ed   b y   h u m a n   er r o r ,   s u c h   as   an   a n ti - co llis io n   s y s te m   w i th   B L I NDE R   la s er   d etec to r   [ 4 ] ,   an   an ti - co lli s io n   an d   in ter co m m u n icatio n   s y s te m   u s in g   co m m u n icatio n   p r o to co [ 5 ]   an d   an   an ti - co llis io n   s y s te m   u s in g   elec tr o m a g n et  an d   u ltra s o n ic  s e n s o r   [ 6 ].   W h ile  th ar ticle  in   [ 7 ]   p r o p o s ed   th i m p le m en ta tio n   o f   v eh icle  f r o n s e n s o r   s y s te m ,   w h ich   is   b ased   o n   A r d u i n ,   b y   u s in g   t h u ltra s o n ic  s en s o r .   Evaluation Warning : The document was created with Spire.PDF for Python.
I J E C E   I SS N:  2 0 8 8 - 8708     I mp leme n ta tio n   o A lg o r ith fo r   V eh icle  A n ti - C o llis io n   A lert   S ystem  in   F P GA   ( A ima n   Za kwa n   Jid in )   776   M o s o f   t h ese   an t i - co lli s io n   s y s te m s   w er co n tr o lled   b y   u s i n g   th e   m icr o co n tr o ller .   Ho w e v er ,   f o r   a n   ap p licatio n   o r   s y s te m   w h ic h   n ee d   v er y   h ig h   p r o ce s s i n g   s p ee d ,   th m icr o co n tr o ller   ca n   b r ep lace d   b y   a   h ig h er   p er f o r m an ce   d e v ice  li k FP GA ,   d u to   t h f o r m er s   i n ab ilit y   to   p er f o r m   v er y   f ast   c o m p u tatio n s   s i n ce   all  o f   th i n s tr u ctio n s   ar ex ec u ted   s eq u e n tiall y   i n s id t h m i cr o co n tr o ller s   [ 8 ] ,   [ 9 ] .   Field   p r o g r am m ab le  g ate   ar r ay   ( FP G A i s   a   d ig i tal  i n te g r at ed   cir cu it   th at   i s   d esi g n ed   to   p er f o r m   a   v ar iet y   o f   tas k s   s u c h   as  co m b in atio n a f u n ctio n s ,   o r   s i m p l y   lo g ic.   I ca n   b co n f ig u r ed   o r   r ep r o g r am m ed   b y   cu s to m er s   o r   d esig n er   en g in e er s   af ter   m an u f ac t u r in g   [ 10 ] .   FP GA   h ar d w ar d esig n   is   in c r ea s in g l y   p o p u lar   in   ap p licatio n s   li k g r ap h ic  p r o ce s s i n g   [ 1 1 ] ,   d ig ital  s ig n al  f ilte r in g   [ 1 2 ] ,   cr y p to g r ap h y   [ 1 3 ] ,   an d   al s o   th e   elec tr ic   m o to r   d r iv es  [ 8 ] ,   [ 9 ] .   T h is   is   o w i n g   to   it s   f lex ib il it y ,   v er y   f a s co m p u tat io n   ti m w it h   lo w   l aten c y ,   lo w   p o w er   co n s u m p tio n   an d   its   co n tin u al  i m p r o v e m en t o f   th tec h n o lo g y ,   w h ic h   m ak it e v e n   b etter   in   th f u tu r e.   T h n ee d   f o r   v er y   f ast  co m p u tat io n   is   e s s e n tial  f o r   th i s   s y s te m   b ec au s th s lo w er   th s y s te m   d etec ts   p o s s ib le  co llis io n ,   th later   th d r iv er   w ill  r ea ct  an d   th u s ,   th e f f ec o f   co llis io n   w il b m o r s ev er e.   Fo r   ex a m p le,   i f   t w o   ca r s ,   wh ich   ar i n itia ll y   3 0   m   f r o m   ea ch   o th er ,   ar m o v in g   f ast   at  1 0 0   k m /h   o n   a   h ig h w a y .   T h en ,   i m a g in i f   th ca r   at   th f r o n s u d d en l y   s l o w s   d o w n   to   7 0   k m / h .   W ith i n   o n s ec o n d ,   if   th e   d r iv er   o f   th s ec o n d   ca r   d o esn t a p p l y   an y   b r ak i n g ,   h ca n   f i n d   h i m s el f   j u s t 3   m   b e h i n d   th e   ca r   at  th f r o n t.    T h is   p ap er   p r esen ts   t h d e v e lo p m e n o f   a n   al g o r ith m   f o r   th v e h icle  a n ti - co lli s io n   al er s y s te m ,   w h ic h   i s   i m p le m en ted   in   FP G A .   T h p r o p o s ed   s y s te m   i s   ab le  to   d etec p o s s ib ilit y   o f   co llis io n   b y   d etec t in g   th r ate  o f   ch a n g o f   d i s tan ce   b et w ee n   t w o   v eh ic les  a n d   t h u s ,   tr ig g er i n g   t h aler t.  F u r th er m o r e,   it a ls o   ca p ab le   o f   aler tin g   th d r iv er   in   th c ase  w h er th s a f d is tan ce   h as  b ee n   b r ea ch ed .   T h p r o ce s s   o f   d etec tio n   an d   n o tific atio n   i s   d o n w it h i n   v er y   s h o r ti m e,   o w i n g   to   FP GA   h ar d w ar ab ilit y   to   p er f o r m   v er y   f a s t   co m p u tatio n .   Fo r   th s y s te m   t est  p u r p o s e,   an   u ltra s o n ic  r a n g s en s o r   is   u ti lized   in   o r d er   to   d etec th d is tan c e   b et w ee n   t w o   v e h icles.       2.   RE S E ARCH   M E T H O D   2 . 1 .   Sy s t em   Arc hite ct ure   Fig u r 1   s h o w s   t h b lo ck   d iag r a m   o f   th e   s y s te m   d e v elo p ed .   As  ca n   b s ee n   f r o m   t h is   f i g u r e,   i t   co n s is ts   o f   t w o   m ai n   s u b co m p o n en ts :   d etec to r   an d   co m p ar ato r .   T h d etec to r   in itiates   t h d etec tio n   o f   t h e   ex is te n ce   o f   a n y   o b j ec ts   ah ea d ,   w h er ea s   t h co m p ar ato r   w il u s t h d ata  r ec eiv ed   f r o m   t h d etec to r   in   o r d er   to   d eter m i n i f   t h er ar an y   o cc u r r en ce   o f   s lo w i n g   v e h ic les  o r   s tatic  o b j ec ts   ah ea d ,   o r   th s a f d is ta n ce   b et w ee n   t w o   v e h icles  h as b ee n   b r ea ch ed .             Fig u r 1 .   T h b lo ck   d iag r am   o f   th p r o p o s ed   v eh icle  a n ti - co l lis io n   aler t s y s te m       I n   t h is   r esear ch ,   f o r   te s ti n g   p u r p o s e,   th d etec to r   d ep lo y ed   th u ltra s o n ic  s en s o r   r an g d etec tio n   m ec h a n i s m .   An   u ltra s o n ic  s en s o r   s en d s   o u t   s o n ic   b u r s t   at  4 0   KHz   an d   its   v elo cit y   is   th e   s a m a s   t h s p ee d   o f   s o u n d ,   w h ic h   is   ap p r o x i m a tel y   3 4 0   m s - 1 .   T h is   s ig n al   w ill   b r ef lecte d   b ac k   b y   t h o b j ec ah ea d   a n d   t h u s ,   th s i g n a tr av eli n g   ti m e,   w h i ch   is   th t i m i n ter v a b et w ee n   th tr i g g er   s i g n al  is   s e n an d   th ec h o   s ig n al  i s   r ec eiv ed ,   is   ca lc u lated .   T h er ef o r e,   th d is tan ce   ( i n   m eter )   b etw ee n   t w o   o b j ec ts   ca n   b d eter m i n ed   b y   u s i n g   th e   f o ll o w in g   f o r m u la:     d is tan ce   tr av el lin g   ti m *   3 4 0   / 2     I n   t h ca lc u latio n ,   t h tr a v eli n g   ti m e   n ee d s   to   b d i v id ed   b y   2 ,   s i n ce   t h tr a v eli n g   ti m in clu d es  t h e   ti m it  to o k   f r o m   t h u ltra s o n ic  s e n s o r   to   r ea ch   th o b j ec ah ea d   an d   al s o   t h ti m t h ec h o   s i g n al   n ee d ed   to   r ea ch   b ac k   at  th s e n s o r .   Evaluation Warning : The document was created with Spire.PDF for Python.
      I SS N : 2088 - 8708   I J E C E   Vo l.  7 ,   No .   2 A p r il 2 0 1 7   :   7 7 5 783   777   2 . 2   Det ec t io n a nd   Co m pa ri s o n P ro ce s s   T h s tates  m ac h in i n   Fi g u r 2   illu s tr ates  t h d etec tio n   m ec h an i s m   w h ic h   h as  b ee n   o p er ated   b y   th e   d etec to r .   I c o n s is ts   o f   f i v d if f er en s tate s I D L E ,   I NI T ,   W A I T ,   R E C E I VE ,   an d   ST O P .   I n   I DL E   s tate,   th e   m ac h in is   w a iti n g   f o r   t h co m p ar ato r   to   b r ea d y   to   ac q u i r n e w   co m p ar i s o n   f ir s t,  w h ich   i s   i n d icate d   b y   t he  co m pa re _ do ne   f la g .   Ne x t,  i n   I NI T   s tate,   th d etec t o r   w ill  s en d   h i g h - le v el  tr ig g er   s ig n al  to   th e   u ltra s o n ic  s e n s o r ,   i n   o r d er   to   in itiate  th s o n ic   b u r s t.  T h is   tr i g g er   s i g n al   is   m ai n tai n ed   at  h i g h   lev el   f o r   at  least   1 0   µs.  Af ter   th e   W A I T   s tate,   th s o n ic   b u r s t   s h o u ld   b r ea d y   an d   tr an s m it ted .   Du r i n g   t h R E C E I VE   s tate,   th er is   co u n ter   i n s id t h d etec to r   w h ic h   co u n ts   th e   n u m b er   o f   clo ck   c y cles  b et w ee n   t h m o m e n t   th e   s o n ic   b u r s is   tr a n s m itted   an d   t h t i m w h en   t h s e n s o r   r ec eiv e s   th ec h o   ( w h en   ec ho   f la g   is   b ec o m in g   lo w ) .   Ho w e v er ,   in   t h ca s e   o f   th e   in ex is te n ce   o f   a n y   o b j ec ts   ah ea d ,   it  w ill  d ir ec tl y   tr an s it  to   t h e   ST OP   s tate  b u n o   co m p ar is o n   w ill b p er f o r m ed   af ter w ar d .   Fin all y ,   d u r in g   t h ST OP   s tate,   th co u n ter   v al u is   s en to   t h co m p ar ato r   to g et h er   w i th   a   cnt _ do ne   f la g ,   i n d icatin g   th at   t h co u n ti n g   p r o ce s s   i s   co m p le ted   a n d   t h co m p ar is o n   ca n   b c o m m e n ce d .   B ef o r e   r etu r n i n g   b ac k   to   t h I D L E   s tate,   th e   d etec to r   w ill   s ta y   in   th s a m s tate  u n til   th e   end_ 6 0 m s   f lag   is   h ig h ,   s ig n ali n g   th a th d etec to r   h as  r ea ch ed   its   co m p lete  m e asu r e m en t   c y cle,   w h ic h   is   s et  at  6 0   m s .   T h is   m ea s u r e m e n c y cle  p er io d ,   w h ic h   is   t h ti m i n ter v al  b et w ee n   t w o   co n s ec u ti v tr ig g er   s ig n al,   h ad   b ee n   r ec o m m e n d ed   b y   t h s e n s o r   m an u f ac t u r er ,   in   o r d er   to   p r ev en t tr ig g er   s ig n al  to   th ec h o   s i g n al  [ 1 4 ] .         Fig u r 2 .   States   m ac h i n w h ic h   r ep r esen t t h d etec to r s   o p er atio n       Fig u r 3   s h o w s   t h s ta tes  m ac h in w h ic h   r ep r esen t s   th o p er atio n s   ex ec u ted   b y   t h c o m p ar ato r .   I n itiall y ,   it  r e m ain s   i n   th I D L E   s ta te  u n til  i r ec eiv e s   h i g h - le v el  cnt _ do ne   f la g ,   w h ic h   in d icate s   t h at  t h e   d etec tio n   p r o ce s s   is   d o n in   th d etec to r .   Nex t,  in   th R E A D   s tate,   th n e w   d is ta n ce   v al u co u n ted   in s id th e   d etec to r   is   u p d ated   in s id th co m p ar ato r .   A t h is   s tag e,   t h is   n e w l y   u p d ated   v alu is   co m p ar ed   to   th d is tan ce   v alu f r o m   th p r ev io u s   m ea s u r e m e n c y cle.   A t h C OM P AR E   s tate,   i w ill  d ec id to   p er f o r m   o n o f   th e   f o llo w in g   ac tio n s :   a.   I f   th d i f f er en ce   b et w ee n   t h n e w   d is ta n ce   v alu a n d   t h p r ev io u s   d i s tan ce   v al u i s   s i g n if ica n t,  t h en   i t   w il l tr an s it to   T R I GGE R _ C O L L   in   o r d er   to   ac tiv ate  th co ll is io n   aler t   b.   I f   th d i f f er en ce   b et w ee n   t h n e w   d is ta n ce   v alu a n d   t h p r ev io u s   d is ta n ce   v al u is   s m al an d   t h co llis io n   a ler i s   c u r r en tl y   ac tiv ated ,   t h e n   it   w ill   tr an s m it  to   UNT R I G_ C OL L   s ta te  to   d ea ctiv ate  t h e   co llis io n   aler t   c.   I f   th e   n e w   d i s ta n ce   v al u i s   g r ea ter   th a n   t h s a f d i s ta n ce   t h r esh o ld ,   t h en   it  w ill   t r an s m it  to   t h T R I GGE R _ P R OX  s tate  in   o r d er   to   ac tiv ate  th s a f d is ta n ce   aler t   d.   I f   t h n e w   d is tan ce   v al u is   le s s er   t h an   t h s a f e   d is ta n ce   t h r esh o ld   a n d   th e   s a f d i s tan ce   a ler is   c u r r en tl y   ac tiv ated ,   th e n   it  w il l tr an s it to   th UNT R I G_ P R OX  s tate  to   d ea ctiv ate  th s af d is tan ce   al er t   e.   I f   n o n o f   t h ab o v ca s e s ,   it  w il l d ir ec tl y   tr an s it to   th W AI T   s tate.     Af ter   t h W A I T   s tate,   it   w ill   r etu r n   b ac k   to   th e   I D L E   s tat e.   At  t h is   s ta g e,   t h co m p ar ato r   s en d s   a   co m p ar e_ d o n f lag   to   t h d ete cto r ,   in   o r d er   to   in d icate   th la tter   th at  t h co m p ar i s o n   i s   co m p le ted   an d   it  m a y   n o w   p r o ce ed   w it h   t h n e w   d et ec tio n .   Evaluation Warning : The document was created with Spire.PDF for Python.
I J E C E   I SS N:  2 0 8 8 - 8708     I mp leme n ta tio n   o A lg o r ith fo r   V eh icle  A n ti - C o llis io n   A lert   S ystem  in   F P GA   ( A ima n   Za kwa n   Jid in )   778     Fig u r 3 .   States   m ac h i n w h ic h   r ep r esen t t h co m p ar ato r ' s   o p er atio n       2 . 3   P a ra m et er s   Set t ing   As t h m atter   o f   f ac t,  t h er ar e   s ev er al   p ar a m eter s   w h ich   n ee d   to   b s et  f o r   th i s   s y s te m .   Fo r   ex a m p le,   in   th d etec to r ,   p ar am eter   ca lled   MA X_ C NT   is   u s ed   to   s et  th m a x i m u m   co u n v al u b y   th co u n ter ;   b ey o n d   th is   v alu e,   w ca n   as s u m th at  t h er ar n o   o b j ec ts   o r   v eh icles  w h ic h   ex is in   f r o n o f   u s .   I f   t h e   m ax i m u m   d etec tio n   i s   s et   at  d   ( in   m eter ) ,   th e   M A X_ C NT   s h all  b s et  eq u al  to   2 ( 3 4 0   *   T cl k ) ,   w h er T clk   is   th p er io d   o f   th clo ck   u t ilized   f o r   th co u n ter .   Fo r   ex a m p le,   if   d   1 0   m   a n d   T cl k   2 0   n s ,   th en :     MA X_ C NT   ( 2 * 1 0 )   / ( 3 4 0   *   2 0 x 1 0 - 9 )     2 9 4 1 1 7 6 .     I n   th co m p ar ato r ,   th er ar t w o   p ar am eter s   t h at  n ee d   to   b d eter m i n ed ,   w h ic h   ar S A FE_ DI ST A N C E _ T HOL an d   DI FF _ DI ST A N C E _ T HOL D.   T h f o r m er   i s   t h s a f d i s tan ce   th r es h o ld   f o r   th co u n ted   d is tan ce   v al u e;  i f   th co u n ted   v alu is   le s s er   th a n   th th r e s h o ld ,   it  i n d icate s   t h at  th s af d is ta n ce   is   b r ea ch ed .   W h ile  th latter   is   th m in i m u m   d i f f er en ce   b et w ee n   th c u r r en d is ta n ce   v al u an d   th p r ev io u s   v alu e.   I f   th eir   d i f f er e n ce s   ar b ig g er   t h an   t h t h r esh o ld   v a lu e,   th en   t h s y s te m   w il l tr ig g er   th co llis io n   aler t.   B o th   o f   t h e s p ar a m eter s   c an   b d eter m in ed   b y   u s i n g   th e   s a m f o r m u la  a s   t h MA X_ C NT   d eter m in at io n .   Fo r   ex a m p le,   i f   th s a f d is ta n ce   is   f ix ed   at  2   m ,   th e n     S A FE_ DI ST A N C E _ T HOL ( 2 * 2 )   / ( 3 4 0   *   2 0 x 1 0 - 9 )     5 8 8 2 3 5 .     Me an w h ile,   if   t h m i n i m u m   d i s tan ce   co u n t d i f f er e n ce   is   s e t a t 0 . 5   m   ev er y   m ea s u r e m e n t c y cle,   th en     DI FF _ DI ST A NC E _ T HOL ( 0 . 5 * 2 )   / ( 3 4 0   *   2 0 x 1 0 - 9 )     1 4 7 0 5 9       3.   RE SU L T A ND  AN AL Y SI S   T h p r o p o s ed   alg o r ith m   w as  s u cc e s s f u ll y   i m p le m e n ted   o n   A lter DE 0   Dev elo p m e n B o ar d ,   w h ic h   eq u ip p ed   w i th   C y clo n I I I   FP GA   De v ice.   I h ad   b ee n   d esig n ed   b y   u s i n g   Ver ilo g   HD L   co d e.   Fig u r 4   s h o ws   th p r o p o s ed   s y s te m s   h ar d w a r test   s etu p .   I t   ca n   b s ee n   t h at  th e   d esi g n ed   s y s te m   i n   FP GA  is   co n n ec ted   to   th H C - S R 0 4   u l tr aso n ic   s e n s o r   v ia   in p u t - o u tp u t p o r ts .   Mo r e o v er ,   r u ler   is   p u t   at  th e   s e n s o r ,   in   o r d er   to   ea s il y   f i x   th d is ta n ce   b et w ee n   th s e n s o r   an d   th o b s tacle   d u r i n g   t h test .   Evaluation Warning : The document was created with Spire.PDF for Python.
      I SS N : 2088 - 8708   I J E C E   Vo l.  7 ,   No .   2 A p r il 2 0 1 7   :   7 7 5 783   779       Fig u r 4 .   FP GA   h ar d w ar test   s etu p       Fo r   th test   in   t h lab o r ato r y   p u r p o s e,   th s af d i s ta n ce   th r es h o ld   is   5   c m   w h i le  th d is tan ce   d if f er e n ce   th r e s h o ld   is   s et  to   2   c m .   T h er ef o r e,   SA FE_ DI ST A N C E _ T HOL an d   DI FF _ D I ST A NC E _ T HOL D   ar f ix ed   at  1 4 7 0 0   an d   5 8 8 2 ,   r esp ec tiv el y .   Me an w h i le,   th m a x i m u m   d etec t io n   r an g is   s et  at  3 0   c m   ( MA X_ C NT   8 8 2 3 5 ) .     3 . 1   H a rdwa re   E x peri m e nta l R esu lt s     Fig u r 5   s h o w s   a n   o b s tac le,   w h ic h   r ep r esen ts   v e h icle  i n   f r o n t,  is   s et  at  d is tan ce   o f   7   cm   f r o m   t h e   s en s o r .   T h r esu lt   o f   t h d etec tio n   i n   FP GA  is   o b s er v ed   i n   t h S ig n alT ap   I I   w i n d o w ,   a s   s h o w n   i n   F ig u r 6 .   I n   th is   ca s e,   th d etec to r   co u n ted   v alu eq u al  to   2 0 5 2 0 ,   w h ic h   is   co r r esp o n d in g   to   7   c m ,   ap p r o x i m ate l y .   As ca n   b s ee n   h er e,   t h a lert _ pro x   s ig n al  r e m a in s   L OW ,   as  ex p ec ted   s in ce   t h d is ta n ce   is   g r ea ter   th an   t h s a f e   d is tan ce   s et.           Fig u r 5 .   An   o b s tacle   is   s et  at  7   cm   f r o m   t h s e n s o r           Fig u r 6 .   W av ef o r m s   o b s er v e d   in   Sig n alT ap   I I   w i n d o w   w h e n   an   o b s tacle   is   s et  at  7   c m   f r o m   th s en s o r   Evaluation Warning : The document was created with Spire.PDF for Python.
I J E C E   I SS N:  2 0 8 8 - 8708     I mp leme n ta tio n   o A lg o r ith fo r   V eh icle  A n ti - C o llis io n   A lert   S ystem  in   F P GA   ( A ima n   Za kwa n   Jid in )   780   Me an w h ile,   Fi g u r 7   s h o w s   t h at  th o b s tacle   h ad   b ee n   m o v e d   clo s er   to   th s en s o r ,   w ith in   d is tan c e   o f   4 . 5   c m .   T h co u n ter   v a lu e   p r o d u ce d   in s id t h d etec to r   is   1 3 4 3 2 ,   w h ic h   i s   co r r esp o n d in g   to   d i s tan c e   eq u al  to   4 . 5   cm ,   ap p r o x i m atel y .   I n   t h is   ca s e,   s i n ce   t h d is ta n ce   is   s m aller   th a n   t h s a f d i s tan ce   s et,   th e n   t h e   a lert _ pro x   s ig n al  is   s et  to   HI GH,   as c an   b o b s er v ed   in   Fi g u r 8 .           Fig u r 7 .   An   o b s tacle   is   s et  at  4 . 5   cm   f r o m   th s en s o r           Fig u r 8 .   W av ef o r m s   o b s er v e d   in   Sig n alT ap   I I   w i n d o w   w h e n   an   o b s tacle   is   s et  at  4 . 5   c m   f r o m   t h s e n s o r       Fig u r 9   s h o w s   th e   r esu lts   o b s er v ed   in   th e   Si g n a lT ap   w in d o w   w h en   th e   o b s tacle   a h ea d   h ad   b ee n   m o v ed   v er y   q u ick l y   a n d   t h u s ,   its   d is tan ce   f r o m   th e   s e n s o r   w a s   d r asti ca ll y   c h an g ed   b et wee n   t w o   co n s ec u tiv e   m ea s u r e m e n t s .   A s   ca n   b s ee n   f r o m   t h r esu lts   s h o w n ,   t h d is tan ce   w a s   r ed u ce d   f r o m   9 . 6   c m   ( co r r esp o n d in g   to   cn t_ v al  =2 8 3 4 8 )   to   6 . 7   c m   ( co r r esp o n d in g   to   cn t_ v al  =1 9 9 0 7 ) .   I m ea n s   th at  t h d is tan ce   b et w ee n   t h o b s tacle   an d   th s e n s o r   w a s   r ed u ce d   b y   2 . 9   c m   w it h i n   t wo   co n s ec u ti v m ea s u r e m e n t s .   C o n s eq u en t l y ,   t h e   a lert _ co l   s ig n al  is   s et  to   HI GH  in   o r d er   to   tr ig g er   th an t i - c o llis io n   aler t.           Fig u r 9 .   W av ef o r m s   o b s er v e d   in   Sig n alT ap   I I   w i n d o w   w h e n   th d is tan ce   b et w ee n   th s en s o r   an d   t h o b s tacle   ch an g ed   d r asti ca ll y     Evaluation Warning : The document was created with Spire.PDF for Python.
      I SS N : 2088 - 8708   I J E C E   Vo l.  7 ,   No .   2 A p r il 2 0 1 7   :   7 7 5 783   781   I n   Fig u r 1 0 ,   it  s h o w s   t h at  th e   s y s te m   to o k   o n l y   5   clo ck   c y c les  f r o m   t h r ec ep tio n   o f   th ec h o   s ig n a l   h as   b ee n   co m p leted   to   t h ale r t_ co s ig n al  i s   tr i g g er ed .   Si n ce   th e   5 0   MH clo c k   i s   u s ed   f o r   th is   test   ( clo ck   p er io d   is   eq u al  to   2 0   n s ) ,   th ti m tak e n   f o r   th is   d etec tio n   is   1 0 0   n s .           Fig u r 1 0 .   W av ef o r m s   o b s er v ed   in   Sig n alT ap   I I   w i n d o w   s h o w i n g   t h n u m b er   o f   clo ck   c y cles it  to o k   to   tr ig g er   t h co llis io n   aler t       W h en   co m p ar i n g   th p er f o r m an ce   o f   t h p r o p o s ed   s y s te m   w i th   th p er f o r m an c o f   th e   m icr o co n tr o ller - b ased   s y s te m   [ 7 ] ,   it  clea r ly   s h o w s   t h at  t h e   d etec tio n   o f   t h p r o p o s ed   s y s te m   is   al m o s t   4 0 0   ti m f aster   th a n   t h d etec tio n   o f   th lat ter ,   w h ich   w a s   m ea s u r ed   at   4 0   u s .   T h is   p e r f o r m an ce   ca n   b s ig n i f ica n tl y   i m p r o v ed   i f   t h u s a g o f   t h u ltra s o n ic  s e n s o r   is   r ep lace d   b y   t h la s er   r an g e   d etec to r   d u to   th g r ea ter   s p ee d   o f   lig h t,  as p r o p o s ed   in   [ 4 ] .     3. 2   Desig n P er f o rm a nce  An a ly s is   T ab le  1   s h o w s   t h h ar d w ar r eso u r ce s   u tili za tio n   a n d   al s o   th e   an al y s is   o n   th e   ti m i n g   a n d   p o w er   co n s u m p tio n   o f   t h i m p le m en ted   al g o r ith m   in   FP G A .   T h ese  d ata  ar o b tain ed   f r o m   t h e   Qu ar t u s   I I   co m p ila tio n   r ep o r t,  w h ile  th ti m in g   p er f o r m a n ce   a n d   t h p o w er   d is s ip atio n   ar e   e x tr ac ted   f r o m   t h e   T im eQ u est ti m i n g   an al y s is   r e p o r t a n d   Po w er P la y   An al y ze r   r ep o r t,  r esp ec tiv el y .       T ab le  1 .   T h o v er all  p er f o r m a n ce   o f   t h i m p le m e n ted   s y s te m   in   FP GA   L o g i c   El e me n t s   F max   ( M H z )   P o w e r   D i ssi p a t i o n   ( mW )   1 3 9 9   7 2 . 4   1 2 8 . 9 3       B ased   o n   t h f ig u r es   in   T ab le  1 ,   th w h o le  s y s te m   o n l y   co n s u m ed   1 3 9 9   f r o m   t h to tal   1 5 4 0 8   lo g ic  ele m e n ts   w h ich   ar a v ailab le   in   th e   FP G A   u s ed .   I n   ter m s   o f   t h ti m i n g   p er f o r m a n ce ,   t h m ax i m u m   clo c k   f r eq u en c y   w h ic h   ca n   b u s ed   t o   o p er ate   th is   s y s te m   is   7 2 . 4   MH z.   T h u s ,   th co m p u tatio n   t i m o f   t h p r o p o s ed   s y s te m   ca n   b i m p r o v ed   b y   r ep lacin g   th 5 0   MH clo c k   w it h   f a s ter   clo ck ,   w h ic h   f r eq u en c y   is   u p   to   t h e   s tated   F m a x .   I n   f ac t,  t h p o w er   co n s u m p tio n   is   n o th m ai n   f o c u s   o f   th i s   p ap er .   Ho w ev er ,   it  ca n   b i m p r o v ed   in   th f u t u r b y   i m p le m e n ti n g   s e v er al  p o w er   m an a g e m en t   tec h n iq u e s   s u c h   a s   t h clo c k   g ati n g ,   o r   b y   ch a n g in g   th p o w er - o p ti m ized   s ta te  m a ch in e n co d in g   li k Gr a y   e n co d in g   i n s tead   o f   B i n ar y   en co d i n g .       4.   CO NCLU SI O N   T h is   p ap er   h as  p r esen ted   an   i m p le m e n tat io n   o f   t h e   al g o r ith m   f o r   v e h icle  a n ti - co lli s io n   al er s y s te m ,   w h ic h   h ad   b ee n   s u cc e s s f u ll y   i m p le m en ted   in   A l ter DE 0   FP GA   B o ar d .   T h p r o p o s ed   s y s te m   i s   ca p ab le  o f   d etec tin g   d ec eler atin g   o r   ev en   s tatic  o b j ec ah ea d   an d   t h u s ,   aler ti n g   a   p o s s ib le  co llis i o n .   B esid es,  it  al s o   h as  t h ab ilit y   to   r e m in d   d r iv er s   to   k ee p   t h d is tan ce   b et w ee n   t w o   v e h icle s   w it h i n   s af r an g e.   T h e   ex p er i m e n tal  tes ts   w er p er f o r m ed   b y   u s i n g   t h tar g e ted   FP GA   h ar d w ar e,   an d   th r es u lt s   f r o m   t h ese   te s ts   h ad   v alid ated   th f u n ctio n al it y   o f   th p r o p o s ed   s y s te m .   F u r th er m o r e,   t h d ata  f r o m   th an al y s is   s h o w s   th a it  ca n   p er f o r m   v er y   f ast   d etec tio n   w h ile  co n s u m in g   lo w   h ar d w ar r eso u r ce s .   T h i s   r es u lt   m a y   co n tr ib u to   Evaluation Warning : The document was created with Spire.PDF for Python.
I J E C E   I SS N:  2 0 8 8 - 8708     I mp leme n ta tio n   o A lg o r ith fo r   V eh icle  A n ti - C o llis io n   A lert   S ystem  in   F P GA   ( A ima n   Za kwa n   Jid in )   782   i m p r o v i n g   t h p er f o r m a n ce   o f   s y s te m s   w h ich   ar co n s id er ed   as  ti m e - cr itical  s y te m s   a n d   w h ic h   r eq u ir v er y   h ig h - s p ee d   ex ec u tio n   a n d   v er y   lo w   co m p u tin g   ti m e.       ACK NO WL E D G E M E NT S   T h au th o r s   w i s h   to   ac k n o w l ed g Un i v er s it T ek n i k al  Ma l a y s ia  Me la k ( UT eM )   f o r   th e   f i n an cia f u n d i n g   u n d er   Gr an No .   P J P / 2 0 1 5 /F T K( 2 8 D) /S0 1 4 5 2   an d   p r o v id in g   i n s tr u m en tatio n   d e v ices  s u p p o r f o r   th is   p r o j ec t.       RE F E R E NC E S   [1 ]   W il l y   A .   5   c o m m o n   c a u se s   o f   ro a d   a c c id e n ts  in   M a la y sia ,   [ In tern e t] .   M o to rm e   -   M a la y sia   C a rs Bi k e T ru c k On e   S to p   A u to m o ti v e   W e b site.  2 0 1 5 .   Av a il a b le  f r o m h tt p :/ /www . m o to rm e . m y /5 - c o m m o n - c a u se s - of - ro a d - a c c id e n ts - in - m a la y si a /   [2 ]   S .   G o th a n e   a n d   M .   V .   S a r o d e ,   " A n a lyz in g   F a c to rs ,   C o n str u c ti o n   o f   Da ta se t,   Esti ma ti n g   Imp o rta n c e   o F a c to r,  a n d   Ge n e ra ti o n   o Asso c ia ti o n   Ru les   fo In d i a n   Ro a d   Acc id e n t " ,   2 0 1 6   I EE 6 th   In tern a ti o n a Co n f e re n c e   o n   A d v a n c e d   Co m p u ti n g   (IA CC) ,   Bh im a v a ra m ,   2 0 1 6 ,   p p .   1 5 - 1 8 .   [3 ]   Hu m a n   Err o A c c o u n ts  F o 9 0 %   Of   Ro a d   A c c id e n ts” [ I n tern e t]   In tern a t io n a Ne w s.   2011 A v a il a b le:  h tt p : // c h a n n e l. sta g in g . a lertd riv in g . c o m /h o m e / f le e t - a lert - m a g a z in e /i n tern a ti o n a l/ h u m a n - e rro r - a c c o u n t s - 90 - ro a d - a c c id e n ts   [4 ]   Ku m a r   A ,   Ja i s w a A ,   Ja is wa N,   S h a rm a   R.   V e h icle A n ti - c o ll isio n   S y ste m .   In ter n a ti o n a J o u rn a o Co mp u te r   Ap p li c a ti o n s .   2 0 1 4 ;   9 9 (1 9 ):   7 - 9.   [5 ]   T riv e n S h in d e   a n d   P ro f .   B. V .   P a wa r.   C a A n ti - Co ll isio n   a n d   In terc o m m u n ica ti o n   S y ste m   u sin g   Co m m u n ica ti o n   P r o to c o (A   P r o to ty p e   M o d e l)” .   In ter n a ti o n a J o u rn a o E n g i n e e rin g   S c ien c e &   Res e a rc h   T e c h n o l o g y ,   2 (8 ):     25 - 3 2 ,   2 0 1 3 .   [6 ]   S h iv a Du b e y   a n d   A b d u W a h id   A n sa ri.   De sig n   a n d   De v e lo p m e n o f   V e h icle   a n ti - c o ll isi o n   S y ste m   u sin g   El e c tro m a g n e a n d   Ultras o n ic  S e n so rs” .   In ter n a ti o n a J o u rn a o n   T h e o re ti c a a n d   Ap p li e d   Res e a rc h   in   M e c h a n ic a l   En g i n e e rin g   ( IJ T AR M E),   V o lu m e   2 ,   Iss u e   1 ,   2 0 1 3 .   [7 ]   Zu lk if li   A S A rd u in o   Ba se d   A u to m o b il e   F ro n t   S e n so r ,   Un iv e rsiti   T e k n ik a M a la y sia   M e la k a ,   2015 .   [8 ]   S u ti k n o   T ,   Id ris  NR,   Jid i n   A Z,   Ji d in   A .   A   M o d e o f   F P GA - b a se d   Dire c T o rq u e   Co n tro ll e r.   In d o n e sia n   J o u rn a o f   El e c trica En g in e e rin g   a n d   Co m p u ter   S c ien c e .   2 0 1 3   F e b   1 ;   1 1 (2 ):   7 4 7 - 53.   [9 ]   M . A .   Ka c o u ,   F .   G h a ff a ri,   O.  Ro m a in   a n d   B.   Co n d a m in ,   " In fl u e n c e   o h ig h - p o we e lec tric  mo to o n   a n   FP GA  u se d   in   t h e   d riv e   sy ste o e lec tric  c a r " ,   I ECON  2 0 1 6   -   4 2 n d   A n n u a Co n f e re n c e   o f   th e   IEE In d u st rial  El e c tro n ics   S o c iety ,   F lo re n c e ,   Italy ,   2 0 1 6 ,   p p .   4 7 9 6 - 4 8 0 1 .   [1 0 ]   M a x f i e ld   C.   F P G A s.  1 st ed .   Am st e rd a m Ne w n e s; 2 0 0 8 .   [1 1 ]   D.  Ch e n   a n d   D.  S in g h ,   " Pa ra ll e li zin g   FP GA  T e c h n o lo g y   M a p p i n g   Us in g   Gr a p h ics   Pro c e ss in g   Un it s   ( GPUs ) " ,   2 0 1 0   In tern a ti o n a C o n f e re n c e   o n   F ield   P ro g ra m m a b le  L o g ic  a n d   A p p li c a ti o n s ,   M il a n o ,   2 0 1 0 ,     pp.   1 2 5 - 1 3 2 .   [1 2 ]   C.   Zh a o   a n d   Z.   Zh a n g ,   " Di g it a l   fi lt e d e si g n   a n d   p e rfo rm a n c e   a n a lys is  o f   d y n a mic   tem p e ra t u re   sig n a d e n o ise   b a se d   o n   FP GA " ,   2 0 1 6   1 0 t h   In t e rn a ti o n a C o n f e re n c e   o n   S e n si n g   T e c h n o lo g y   (ICS T ) ,   Na n ji n g ,   Ch in a ,   2 0 1 6 ,     p p .   1 - 7.   [1 3 ]   G .   Wern e r,   S .   F a rris,   A .   Ka m in sk y ,   M .   Ku rd z iel,   M .   L u k o w iak   a n d   S .   Ra d z isz o w sk i,   " Imp lem e n ti n g   a u t h e n ti c a ted   en c ry p ti o n   a l g o rit h M K - 3   o n   FP GA " ,   M IL COM  2 0 1 6   -   2 0 1 6   IEE M il it a ry   Co m m u n ica ti o n Co n f e re n c e ,   Ba lt im o re ,   M D,  USA ,   2 0 1 6 ,   p p .   1 2 2 5 - 1 2 3 0 .   [1 4 ]   Ultras o n ic Ra n g in g   M o d u le HC  -   S R0 4   [In tern e t ].   A v a il a b le f ro m h tt p : // ww w . m icro p ik . c o m /P DF/ HCSR0 4 . p d f         B I O G RAP H I E S   O F   AUTH O RS       Ai m a n   Z a k w a n   J id in   o b tain e d   h is  M En g   in   El e c tro n ic  a n d   M icro e lec tro n ic  S y ste m   En g in e e rin g   f ro m   ES IEE   En g in e e rin g   P a ris  F ra n c e   in   2 0 1 1 .   He   h a 2   y e a rs  o f   w o r k in g   e x p e rien c e   in   d e sig n in g   d ig it a I a n d   d ig it a s y ste m   in   F P G A   a t   A lt e r a   Co rp o ra ti o n   M a lay sia   (n o w   p a rt  o f   In tel),   b e f o re   jo in i n g   Un iv e rsiti   Tek n ik a M a la y sia   M e lak a   (U T e M a l e c tu re a n d   re se a rc h e r,   in   El e c tro n ics   a n d   Co m p u ter  En g in e e rin g .   His  re s e a rc h   in tere sts  in c lu d e   F P GA   De sig n   a n d   Dig it a S y ste m   De sig n .       Evaluation Warning : The document was created with Spire.PDF for Python.
      I SS N : 2088 - 8708   I J E C E   Vo l.  7 ,   No .   2 A p r il 2 0 1 7   :   7 7 5 783   783     Li m   S ia u   Li   is  c u rre n tl y   a   f in a y e a stu d e n o f   Ba c h e lo o f   Co m p u ter   E n g in e e rin g   T e c h n o l o g y   (Co m p u ter  S y st e m s a Un iv e rs it T e c h n ica M a la y sia   M e la k a   (UT e M ),   M a la y sia .   S h e   h a d   re c e n tl y   c o m p lete d   h e f in a y e a p ro jec o n   d e v e lo p i n g   th e   a lg o rit h m   f o th e   v e h icle   a n ti - c o ll isio n   a lert  sy ste m   b y   u sin g   F P GA   a n d   A lt e r a   Qu a rtu I so f t w a re .   S h e   is  c u rre n tl y   u n d e rg o i n g   a n   e n g in e e ri n g   in tern sh ip   a I n tel  M icro e lec tro n ics   ( M )   S d n .   Bh d .             Ahm a d   Fa u z a n   B .   K a d m in   h a o v e 1 3   y e a rs  o f   e x p e rien c e   in   c o m p u ter  &   c o m m u n ica ti o n   e n g in e e rin g   f ield   w it h   tec h n ica e x p e rt  in   m o b il e   c o m p u ti n g   a n d   w irele ss   c o m m u n ica ti o n   s y ste m .   He   G ra d u a ted   w it h   M En g   in   Co m p u ter  &   c o m m u n ica ti o n   En g in e e rin g   f ro m   Un iv e r siti   Ke b a n g sa a n   M a la y si a .     P re v io u sl y ,   h e   w o rk e d   a a n   En g in e e r   w it h   M e g a ste e S d n .   Bh d . ,   S a m su n g   S DI(M S d n .   Bh d .   a n d   Ag e n si  A n g k a sa   Ne g a ra .   Cu rre n tl y   a tt a c h e d   w it h   U T e M   a s   lec tu re r.     Evaluation Warning : The document was created with Spire.PDF for Python.