I AE S In t er na t io na l J o urna l o f   Art if icia l In t ellig ence   ( I J - AI )   Vo l.   15 ,   No .   3 ,  J u n e   20 26 ,   p p .   2325 ~ 2 3 3 6   I SS N:  2 2 5 2 - 8 9 3 8 ,   DOI : 1 0 . 1 1 5 9 1 /ijai.v 15 .i 3 . p p 2 3 2 5 - 2 3 3 6           2325     J o ur na l ho m ep a g e :  h ttp : //ij a i . ia esco r e. co m   Ya rn  inspec tion a nd so rting sy stem  using  robo tic  v isi o n and   ma chine learning       E m m a nu el  Ag un g   Nug ro ho 1 ,   J o g a   Dha rma   Set ia wa n 2 ,   D eni K urnia 1 ,   Na na ng   Ro ni Wibo wo 1   1 D e p a r t me n t   o f   M e c h a t r o n i c s E n g i n e e r i n g ,   P o l i t e k n i k   En j i n e r i n g   I n d o r a ma ,   P u r w a k a r t a ,   I n d o n e si a   2 D e p a r t me n t   o f   M e c h a n i c a l   E n g i n e e r i n g ,   F a c u l t y   o f   E n g i n e e r i n g ,   U n i v e r si t a s Di p o n e g o r o ,  S e m a r a n g ,   I n d o n e si a       Art icle  I nfo     AB S T RAC T   A r ticle  his to r y:   R ec eiv ed   J u l   18 ,  2 0 2 5   R ev is ed   J an   23 ,  2 0 2 6   Acc ep ted   Ap r   20 ,  2 0 2 6       Th e   i n c re a sin g   d e m a n d   fo r   a u t o m a ti o n   i n   th e   tex ti le   in d u str y ,   p a r ti c u larly   in   q u a li t y   i n sp e c ti o n   p ro c e ss e s,  u n d e rsc o re s  th e   n e e d   f o r  in telli g e n t   a n d   c o st - e ffe c ti v e   so lu ti o n s.  C o n v e n ti o n a l   m e th o d s  o f  y a r n   c las sifica ti o n   a n d   so rti n g   re m a in   lab o r - in ten siv e ,   ti m e - c o n su m in g ,   a n d   s u sc e p ti b le  t o   h u m a n   e rro r,   re su lt in g   in   i n c o n siste n t  q u a li t y   c o n tr o l.   T h is  stu d y   i n tr o d u c e s  a n   a u to m a ted   sy ste m   fo r  y a rn   i n sp e c ti o n   a n d   s o rti n g   t h a t  in teg ra tes   ro b o ti c   v isi o n ,   m a c h in e   lea rn in g ,   a n d   p o siti o n - b a se d   v isu a l  se rv o i n g   (P BVS)   fo r   re a l - ti m e   m o ti o n   c o n tro l.   T h e   p ro p o se d   s y ste m   c o m b in e s  Ra sp b e rry   P i - b a se d   m a c h in e   lea rn in g   wit h   c o m p u ter  v isi o n   u ti li z i n g   a   4 - d e g re e - of - fre e d o m   ( 4 - DOF )   ro b o ti c   m a n i p u lat o r  a n d   a   w e b c a m ,   e n a b li n g   p re c ise   p ic k - a n d - p lac e   o p e ra ti o n s  b a se d   o n   y a rn   c las sifica ti o n   in to   fo u r  c a teg o ries :  g o o d ,   strip e d ,   m o ld y ,   a n d   d irt y .   Ex p e rime n tal  re su lt s  v a li d a te  th e   sy ste m ’s  e ffe c ti v e n e ss ,   a c h iev in g   a n   a v e ra g e   d e v iati o n   o f  0 . 3 7 5   m m   a lo n g   t h e   x - a x is,  0 . 6 9   m m   a lo n g   th e   y - a x is,  a n d   0 . 6 7 5   m m   a lo n g   t h e   z - a x is,  re su lt i n g   in   a n   o v e ra ll   p o siti o n   e rr o r  o f   0 . 5 8   m m .   Th e se   re su lt s d e m o n stra te t h e   sy ste m ’s ro b u st n e ss   a n d   re li a b il i ty   i n   d y n a m ic  in d u strial  e n v iro n m e n ts.  T h e   n o v e lt y   o f  t h is   re se a rc h   li e s  in   lev e ra g in g   a   lo w - c o st  e m b e d d e d   a rc h it e c tu re   with   a d v a n c e d   v isu a l  se rv o in g   fo r  te x ti le  a u to m a ti o n ,   re d u c in g   o p e ra ti o n a l  e rro rs,   imp ro v i n g   e fficie n c y ,   a n d   s u p p o rt in g   i n d u str y   4 . 0   a d o p ti o n .   K ey w o r d s :   4 - DOF  m an ip u lato r   Ma ch in e  lear n in g   R asp b er r y   Pi   R o b o tic  v is io n   Yar n   in s p ec tio n   T h is i s  a n   o p e n   a c c e ss   a rticle   u n d e r th e   CC B Y - SA   li c e n se .     C o r r e s p o nd ing   A uth o r :   E m m an u el  Ag u n g   N u g r o h o   Dep ar tm en t o f   Me ch atr o n ics E n g in ee r in g ,   Po litek n ik   E n jin er in g   I n d o r a m a   Pu r wak ar ta  4 1 1 5 2 ,   W est J av a,   I n d o n esia   E m ail: e m m an u el. ag u n g @ p ei. ac . id       1.   I NT RO D UCT I O N   T h e  tex tile  in d u s tr y   is   u n d er g o in g   a  r ap id   tr an s f o r m atio n   d r iv en   b y   g lo b al  tr en d   to war d   i n d u s tr y   4 . 0 ,   wh er e  au to m atio n   an d   in tellig en t  s y s tem s   ar e  r esh ap in g   co n v en tio n al  m an u f ac t u r in g   p r o ce s s es  [ 1 ] .   Am o n g   th e  cr itical  ar ea s   r eq u ir in g   im p r o v em e n t  is   th e  in s p ec tio n   a n d   s o r tin g   o f   y ar n s ,   wh ich   p l ay s   a  v ital  r o le  in   d eter m in in g   p r o d u ct  q u ality   an d   p r o d u ctio n   ef f icien c y .   T r ad itio n ally ,   y ar n   i n s p ec tio n   an d   s o r tin g   ar e   p er f o r m ed   m an u ally   b y   h u m a n   o p er ato r s   b ased   o n   v is u al  ass ess m en t.  Ho wev er ,   th is   ap p r o ac h   is   o f ten   p r o n e  to   h u m a n   er r o r ,   in c o n s is ten t  ju d g m e n t,  h ig h   lab o r   co s ts ,   an d   s ig n if ican t  tim e  co n s u m p tio n ,   esp ec ially   wh en   d ea lin g   with   h ig h   p r o d u ctio n   v o lu m es a n d   co m p le x   d ef ec t  v ar iatio n s   [ 2 ] ,   [ 3 ] .   R ec en t  ad v an ce s   in   r o b o tics   an d   c o m p u ter   v is io n   tech n o lo g ies  h av e   en ab le d   th e   d e v elo p m en t   o f   co m p ac t  an d   ef f ec tiv e   s o lu tio n s   to   au to m ate  th ese  r e p etitiv e  task s .   I n   p ar ticu lar ,   th e  in te g r atio n   o f   r o b o tic   m an ip u lato r s   with   v is io n   s y s tem s   p o wer ed   b y   m ac h in e  lea r n in g   h as  em er g e d   as  a  p r o m is in g   ap p r o ac h   to   im p r o v e   p r ec is io n ,   co n s is ten cy ,   an d   d ec is io n - m ak in g   ca p a b ilit ies  in   m ater ial  h an d lin g   a p p licatio n s   [ 4 ] ,   [ 5 ] .  T h ese  s y s tem s   ar e  o f ten   s u p p o r ted   b y   l o w - co s t  p latf o r m s   s u ch   as  th e  R asp b er r y   Pi,  wh ich   p r o v id es  s u f f icien t   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 9 3 8   I n t J Ar tif   I n tell ,  Vo l.  15 ,   No .   3 ,  J u n e   20 26 :   2 3 2 5 - 2 3 3 6   2326   co m p u tin g   p o wer   f o r   r ea l - tim e  p r o ce s s in g   an d   co n tr o l,  m ak in g   th em   s u itab le  f o r   a u t o m atio n   in   s m all - to   m ed iu m - s ca le  in d u s tr ial  en v ir o n m en ts   [ 6 ] .   On e  o f   t h e  k ey   tech n iq u es  b r i d g in g   v is u al  p er ce p tio n   with   r o b o tic  co n tr o l  in   s u ch   s y s tem s   is   v is u al   s er v o in g .   Vis u al  s er v o in g   r ef e r s   to   th e  u s e  o f   ca m er a - b ased   v is u al  f ee d b ac k   to   c o n tr o l  th e   m o tio n   o f   r o b o tic  m an ip u lato r s   i n   r ea l - tim e.   T h is   tech n iq u e   is   g en e r ally   clas s if ied   in to   two   m ain   ty p es:  i m ag e - b ased   v is u al  s er v o in g   ( I B VS) ,   in   wh ich   c o n tr o l  laws  ar e  d er iv ed   d ir ec tly   f r o m   im ag e  c o o r d in ates,  an d   p o s itio n - b ased   v is u al  s er v o in g   ( PB VS) ,   wh ic h   u tili ze s   3 D   p o s itio n   esti m atio n   o f   o b jects  to   g u i d e  r o b o tic   m o v em en ts   [ 7 ] .   I n   th e  co n tex t  o f   y ar n   s o r tin g ,   v is u al  s er v o in g   allo ws  d y n a m ic  ad ju s tm en t  o f   t h e  en d - ef f ec to r ' s   p o s itio n   an d   o r ien tatio n   b ased   o n   co n tin u o u s ly   u p d ated   v is u al  in p u t,  lea d in g   to   h ig h e r   ac cu r ac y   an d   b etter   ad ap tab ilit y   co m p ar ed   to   co n v en tio n al  o p e n - lo o p   co n tr o l sy s tem s   [ 8 ] .   T h i s   s t u d y   f o cu s e s   o n   t h e   d ev e l o p m en t   an d   ev a lu a t i o n   o f   a   P B V S   s y s t e m   f o r   y a r n   s o r t in g ,   wh i ch   i n t e g r a t e s   a   4 - d eg r e e - of - f r e ed o m   ( 4 - D O F )   r o b o t i c   m a n ip u la t o r   co n tr o l l ed   b y   a   R a s p b er r y   P i   w i t h   a   v i s i o n - b a s e d   c la s s i f i c a t i o n   m o d u l e.   T h e   s y s t e m   i s   d e s i g n e d   to   d e t e c t   v a r io u s   y a r n   c a te g o r ie s   i n c l u d i n g   g o o d ,   s t r i p e d ,   m o ld y ,   an d   d ir t y   u s i n g   m a c h in e   le a r n i n g   a lg o r i t h m s   t r a i n e d   o n   a  d a ta s e t   o f   y ar n   i m ag e s .   B a s e d   o n   t h e   c l a s s i f i c a t io n   o u t p u t ,   t h e  r o b o t i c  m an i p u l a t o r   p er f o r m s   a  p i ck - a n d - p la c e  o p e r a t i o n   to   s o r t  e ac h   y ar n   s a m p l e   in t o   i t s   co r r e s p o n d in g   s t o r ag e   b i n   [ 9 ] ,   [ 1 0 ] .   T h e  n o v e l t y   o f   t h i s   r e s e ar c h   l i e s   in   th e   in t e g r a t i o n   o f   a  R a s p b e r r y   P i   p l a tf o r m   t o   co o r d in a t e  a  4 - D O F  r o b o t i c  m a n ip u l a to r   ( Do b o t  M a g ic i an )   f o r   au t o n o m o u s   o p er a t i o n   [ 8 ] ,   [ 1 1 ] .   I m p l e m en t a t i o n   o f   a   w e b ca m - b a s e d   im a g e   a cq u i s i t io n   s y s t em   s u p p o r te d   b y   m a c h in e  l e a r n in g   f o r   r e a l - t i m e   y a r n   q u a l i t y   c l a s s i f i c a t io n   [ 1 2 ] .   T h e   a p p l i ca t i o n   o f   v i s u a l   s er v o i n g   t o   e n ab l e   d y n a m i c  m a n ip u l a t io n   b a s ed   o n   v i s u a l   f e ed b a c k ,   a l lo w i n g   th e  r o b o t  t o   r e tr i e v e  o b j e c t s   f r o m   a   f i x ed   c o n v ey o r   e n d p o in t   an d   p l ac e   th e m   in t o   f o u r   d e s t in a t i o n   b i n s   [ 1 3 ] .   S y s t em   p e r f o r m an c e   i s   m e a s u r e d   t h r o u g h   p o s i t i o n a l  d ev i a t i o n   a n a ly s i s   t o   v a l i d a t e   p r ec i s i o n   an d   c o n s i s t e n c y ,   t ar g e t in g   an   a v er a g e  p l a c e m e n t  e r r o r   o f   l e s s   t h a n   1   m m   [ 1 4 ] .       2.   M E T H O D   V i s u al   s e r v o i n g   i s   cl o s e d - l o o p   c o n t r o l   m e t h o d   t h a t   u s e s   c a m er a - b a s e d   v i s u al   f e e d b a c k   t o   g u id e   r o b o t i c  a c t u a t o r s   w it h   p r e c is i o n ,   i n t e g r a t i n g   m a c h i n e   l e a r n i n g ,   i m a g e   p r o c e s s i n g ,   a n d   r o b o t i c  k i n e m a t i cs   [ 1 5 ] ,   [ 1 6 ] .  T h er e  ar e  two   p r im ar y   im p le m en tatio n s   o f   v is u al  s er v o in g :  PB VS  an d   I B VS.  T h is   s tu d y   ad o p ts   th e  PB VS  m eth o d ,   as illu s tr ated   in   Fig u r e  1 .           Fig u r e  1 .   Sch em atic  o f   th e  PB VS   ap p r o ac h       Fig u r e  1   s h o ws  th e  PB VS  co n tr o l  s tr ateg y ,   wh er e  r o b o t   m o ti o n   is   g u i d ed   b y   a   p r e d ef in ed   t ar g et  p o s e  f o r   o b ject  p lace m en t.  T h e  s y s tem   esti m ates  th e  o b ject’ s   3 D  p o s e  co m p r is in g   p o s itio n   an d   o r ien tatio n   f r o m   ca m er a - b ased   v is u al  class if icatio n   an d   g e n er ates  co n tr o l  s i g n als  to   m i n im ize  th e   er r o r   b etwe en   ac tu al  an d   r ef er en ce   p o s es.  T h e  ar c h itectu r e  co n s is ts   o f   th r ee   m ain   co m p o n en ts :   i)   C am er a:  ca p tu r es  r ea l - tim e  im ag es o f   th e  y ar n   a n d   ac q u ir es sam p le  d ata  f o r   v is u al  p r o ce s s in g   [ 1 7 ] .   ii)   R asp b er r y   Pi:   s er v es  as  th e  ce n tr al  co n tr o l  u n it  r esp o n s ib l e  f o r   im a g e  p r o ce s s in g ,   class if icatio n ,   an d   is s u in g   ac tu atio n   co m m a n d s   [ 1 8 ] .   iii)   Do b o t  Ma g ician :  4 - DOF  r o b o tic  m an ip u lato r   u s ed   to   p er f o r m   p ick - a n d - p lace   o p er atio n s   b ased   o n   th e   class if icatio n   r esu lts   [ 1 9 ] .   I m ag e  class if icatio n   u s es  Op en C V  an d   a  T e n s o r Flo w  m o d el  tr ain ed   v ia  Go o g le  T ea ch ab le  Ma ch in e   to   ca teg o r ize  y a r n   in to   g o o d ,   s tr ip ed ,   m o l d y ,   a n d   d ir ty .   T h e  PB VS  lo o p   co m p u tes  tr an s f o r m atio n   p a r am eter s   af ter   class if icatio n   an d   co m m a n d s   th e  m an ip u lato r   to   s o r t e a ch   y ar n   in to   its   d esig n ated   b in   [ 2 0 ] .     P o s e   D e s i r e d ( P x ,   P y ,   P z ) 3 D   P o s e   E r r o r C a r t e s i a n   C o n t r o l   L a w R o b o t   C o n t r o l l e r A   4 - D O F   M a n i p u l a t o r I m a g e   F e a t u r e   E x t r a c t i o n 3 D   P o s e   E s t i m a t i o n Y a r n R a s p b e r r y   P i C a m e r a Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J Ar tif   I n tell     I SS N:   2252 - 8 9 3 8       Ya r n   in s p ec tio n   a n d   s o r tin g   s ystem  u s in g   r o b o tic  visi o n   a n d   ma ch in e  lea r n in g   ( E mma n u el  A g u n g   N u g r o h o )   2327   2 . 1 .     Wo r k f lo w  a nd   im plem e nta t io n pro ce s s   I n   th is   s tu d y ,   lab eled   y ar n   d at asets   wer e  s to r ed   in   R asp b er r y   Pi  f o r   m o d el  tr ain in g .   Up o n   c ap tu r in g   a   n ew  im ag e,   t h e  s y s tem   class if ies  th e  y ar n   b y   co m p a r in g   it  with   th e  tr ain ed   m o d el  an d   s elec ts   th e  class   with   th e  h ig h est  co n f i d en ce .   Af ter   class if icatio n ,   R asp b er r y   Pi  s en d s   co m m an d s   to   t h e  4 - DOF  m an ip u lato r   f o r   s o r tin g .   Fig u r e  2   illu s tr ates  th e  PB VS - b ased   im ag e  p r o ce s s in g   an d   s o r tin g   m ec h a n is m   co n tr o lled   b y   R asp b er r y   Pi.           Fig u r e  2 .   Me ch a n is m   o f   th e  y a r n   s o r tin g   s y s tem   u s in g   PB VS   m eth o d       Fig u r e  2   illu s tr ates  th e  im p le m en tatio n   o f   th e   v is u al  s er v o in g   s y s tem   co n t r o lled   b y   R asp b er r y   Pi,   wh ich   m an ag es  v is u al  in p u t,   c lass if icatio n ,   an d   m an ip u lato r   ac tu atio n .   T h e   h ar d war e  s etu p   in clu d es  a  ca m e r a   f o r   im ag e  ca p tu r e,   R asp b er r y   Pi  f o r   p r o ce s s in g   an d   co n tr o l,  a  4 - DOF  Do b o t  Ma g ician   f o r   p ick - a n d - p lace   task s ,   an d   a  co n v ey o r   f o r   y ar n   tr an s p o r tatio n   to   th e  in s p ec tio n   ar ea .   T h e  im p lem e n tatio n   o f   th e  p r o p o s ed   y ar n   s o r tin g   s y s tem   f o llo ws a  s tr u ctu r ed   wo r k f lo w  c o n s is tin g   o f   f i v e  m ain   s tag es,  as d etailed   as  f o llo ws .   i)   I m ag e  ac q u is itio n :  th e   p r o ce s s   s tar ts   b y   ca p tu r in g   r ea l - tim e   y ar n   im a g es  o n   th e   co n v ey o r   with   a   f ix e d   ca m er a,   p r o v id in g   ess en tial v is u al  d ata  o n   p o s itio n ,   s h ap e,   a n d   tex tu r e   [ 2 1 ] .   ii)   I m a g e   p r o c e s s i n g   a n d   c l ass i f i ca t i o n   [ 2 2 ] :   p r o c e s s i n g   i m a g e s   v i a   O p e n C V   a n d   a   T e n s o r F l o w   L i t e   m o d el  t r a i n e d   w i t h   G o o g l e   T e a c h a b le   M a c h i n e   t o   c la s s i f y   y a r n   a s   g o o d ,   s t r i p e d ,   m o l d y ,   o r   d i r t y ,   w i t h   r e s u lts   i n d i c a t e d   t h r o u g h   l i g h t   e m it t i n g   d i o d e s   ( L E D s )   o n   R as p b e r r y   P i   g e n e r a l   p u r p o s e   i n p u t / o u t p u t  ( G P I O )   [ 2 3 ] .   iii)   Po s itio n   an d   o r ien tatio n   ca lcu latio n :  b ased   o n   th e  class if ica tio n   o u tp u t  an d   p ix el  co o r d in ates  f r o m   th e   ca m er a  f r a m e,   th e   s y s tem   co m p u tes  th e  d esire d   p o s itio n   an d   o r ien tatio n   o f   m an ip u lato r ’ s   e n d - ef f ec t o r   i n   wo r ld   co o r d in ates  [ 2 4 ] .   iv )   Ma n ip u lato r   co n t r o l:  R asp b er r y   Pi  g en er ates  co m m an d s   f o r   th e  4 - DOF  Do b o t  Ma g ician   to   p er f o r m   p ick - an d - p lace   o p er atio n s   [ 2 5 ] ,   [ 2 6 ] .   v)   Vis u al  f ee d b ac k   an d   v er if icati o n : a   f in al  im ag e  is   ca p tu r ed   a f ter   th e  ac tu atio n   to   v er if y   t h e  s u cc ess   o f   th e   p ick - an d - p lace   o p er atio n .   T h i s   f ee d b ac k   l o o p   e n s u r es  th at   th e  m an ip u lato r   r ea c h es  th e   co r r ec t  tar g et  lo ca tio n   an d   th at  th e  y a r n   h as b ee n   s o r ted   i n to   th e  c o r r ec t c a teg o r y   [ 2 7 ] .   T h e  s y s tem   wo r k f lo w  o f   a  4 - DOF  m an ip u lato r   co n tr o l  s y s tem   u s in g   R asp b er r y   Pi  is   s h o wn   in     Fig u r e  3 .   T h is   f ig u r e  o u tlin es   th e  v is u al  d ata  f lo w,   d ec is io n   lo g ic,   an d   m an ip u lato r   m o t io n   s eq u en ce   f r o m   im ag e  ac q u is itio n   to   f in al  o b j ec t  p lace m en t.  T h e  en tire   p r o ce s s   is   d esig n ed   f o r   h ig h   p r ec is io n   an d   r ea l - tim e  ex ec u tio n ,   e n ab lin g   ef f icien t a n d   ac cu r ate  y ar n   class if icatio n   in   in d u s tr ial  en v ir o n m e n t.       Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 9 3 8   I n t J Ar tif   I n tell ,  Vo l.  15 ,   No .   3 ,  J u n e   20 26 :   2 3 2 5 - 2 3 3 6   2328       Fig u r e  3 .   Flo wch ar t  o f   a  4 - DO F m an ip u lato r   c o n tr o l sy s tem   u s in g   R asp b er r y   Pi       2 . 2 .   H a rdwa re   s et up   a nd   inte rf a ce   des ig n   T h is   s ec tio n   ex p lain s   t h e  c o m m u n icatio n   in ter f ac e  b et wee n   R asp b er r y   Pi  4 B   an d   th e  Do b o t   Ma g ician   r o b o tic  a r m ,   f o cu s in g   o n   p r o g r am m in g   ar c h itectu r e,   GPI O  m a p p in g ,   a n d   s u p p o r tin g   lib r ar ies.   R asp b er r y   Pi  s er v es  a s   th e  ce n tr al  co n tr o ller ,   h an d lin g   im a g e  ca p tu r e,   class if icatio n ,   an d   ac tu atio n .   Py th o n   was  s elec ted   f o r   its   co m p atib ilit y   with   Op en C V  ( im ag e  p r o ce s s in g ) ,   T en s o r Flo w  ( o n - d ev ice  in f er en ce ) ,   a n d   Py Ser ial  ( USB - b ased   s er ial  c o m m u n icatio n   f o r   m o tio n   co m m an d s ) .   T a b le  1   s h o ws  th e  GPI O  co n f ig u r atio n   o n   R asp b er r y   Pi,  wh e r e  ea ch   p in   is   ass ig n ed   f o r   ac tu ato r   co n tr o l ( L E Ds,  b u zz e r )   o r   in p u t tr i g g er s .         T ab le1 .   GPI O  ad d r ess in g   f o r   y ar n   in s p ec tio n   s y s tem   No   G P I O   n u m b e r   F u n c t i o n   D e scri p t i o n   1   17   G o o d   y a r n   A c t i v a t e d   w h e n   a   g o o d - q u a l i t y   y a r n   i s   d e t e c t e d   2   18   S t r i p e d   y a r n   A c t i v a t e d   w h e n   s t r i p e d   y a r n   i s   d e t e c t e d   3   27   M o l d y   y a r n   A c t i v a t e d   w h e n   m o l d y   y a r n   i s   d e t e c t e d   4   22   D i r t y   y a r n   A c t i v a t e d   w h e n   d i r t y   y a r n   i s  d e t e c t e d   5   23   G r e e n   LED   R e ma i n s  o n   w h e n   t h e   p r o d u c t i o n   o u t p u t   i s  g o o d   6   24   R e d   LED   Tu r n s   o n   w h e n   a   d e f e c t   i s  d e t e c t e d   7   25   B u z z e r   A c t i v a t e s   e m e r g e n c y   a u d i o   a l e r t   8   26   P u sh   b u t t o n   st a r t   I n i t i a t e s   t h e   c l a ssi f i c a t i o n   a n d   s o r t i n g   p r o c e ss   9   19   P u sh   b u t t o n   st o p   Te r mi n a t e s  t h e   c u r r e n t   p r o c e ss  c y c l e       T h is   GPI O  co n f i g u r atio n   allo wed   th e  s y s tem   t o   p r o v i d e  im m ed iate  v is u al  a n d   a u d io   f ee d b ac k   d u r in g   th e  y ar n   i n s p ec tio n   p r o ce s s .   T h e  g r ee n   L E D  s ig n aled   s u cc ess f u l  class if icatio n   an d   s o r tin g   o f   ac ce p tab le  y ar n ,   wh ile  th e  r e d   L E D   an d   b u zz er   wer e  u s ed   to   aler t  t h e  p r e s en ce   o f   d ef ec tiv e   y ar n .   Fu r th er m o r e ,   th e   p u s h   b u tto n s   s er v ed   as u s er - co n tr o lled   tr ig g er s   to   s tar t o r   s to p   th e  au to m ated   p r o ce s s .     2 . 3 .   Do bo t   M a g icia n  co ntr o l   s y s t em   T h is   s ec t io n   e x p l ai n s   th e   i n te g r at io n   o f   R as p b e r r y   Pi   4 B   wit h   t h e   4 - DOF   D o b o t   Ma g ic ia n   r o b o tic   a r m   u s i n g   Py th o n   an d   t h e  p y d o b o t lib r a r y ,   d em o n s t r at in g   lo w - co s t  m i cr o co n t r o ll er   f ea s i b i lit y   f o r   i n t elli g e n t  r o b o ti c   ap p li ca ti o n s   i n v o lv in g   r ea l - t i m e   im a g e   cl ass i f ic ati o n   an d   a ctu ati o n .   R as p b e r r y   Pi   f u n c ti o n s   as  b o t h   th e  im ag e    S t a r t C a m e r a   r e a d s   t h e   f e a t u r e   o f   t h e   o b j e c t M a n i p u l a t o r   i s   m o v i n g   t o   P a l l e t e   1 F i n i s h i s   t h e   y a r n   c l a s s i f i c a t i o n   r e s u l t   g o o d ? i s   t h e   y a r n   c l a s s i f i c a t i o n   r e s u l t   s t r i p e d ? i s   t h e   y a r n   c l a s s i f i c a t i o n   r e s u l t   d i r t y ? i s   t h e   y a r n   c l a s s i f i c a t i o n   r e s u l t   m o l d y ? 1 1 Y e s Y e s Y e s Y e s N O N O N O N O R a s p b e r r y   i n s t r u c t e d   t h e   G P I O M a n i p u l a t o r   i s   m o v i n g   t o   P a l l e t e   2 M a n i p u l a t o r   i s   m o v i n g   t o   P a l l e t e   3 M a n i p u l a t o r   i s   m o v i n g   t o   P a l l e t e   4 T h e   m a n i p u l a t o r   m o v e s   f r o m   h o m e   t o   t h e   p i c k   c o o r d i n a t e     p o i n t Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J Ar tif   I n tell     I SS N:   2252 - 8 9 3 8       Ya r n   in s p ec tio n   a n d   s o r tin g   s ystem  u s in g   r o b o tic  visi o n   a n d   ma ch in e  lea r n in g   ( E mma n u el  A g u n g   N u g r o h o )   2329   in f e r e n c e  p r o ce s s o r   an d   c o m m a n d   ce n te r   f o r   r o b o t ic   c o n t r o l .   A   k e y   el em en t  is   t h e   c am er a_ th r e a d _ f u n cti o n ,   wh i ch   h a n d les  c o n ti n u o u s   i m a g e  ca p t u r e ,   c lass i f i ca t io n   in f er en ce ,   a n d   co r r es p o n d i n g   r o b o t ic  m o v e m en ts   [ 2 8 ] .  R ea l - ti m e   v is u al   d ata   is   a cq u ir e d   v ia   a n   O p en C V - b as ed   c am e r a  m o d u l e  ( c v 2 . V id e o C a p t u r e ) ,   at   6 4 0 × 4 8 0   r es o l u ti o n ,   b al a n ci n g   im ag e  q u alit y   a n d   p r o ce s s i n g   s p ee d   f o r   ef f ic ie n t   r ea l - t im e  o p e r a ti o n   [ 2 9 ] ,   [ 3 0 ] .   T ab le  2   s u m m ar izes  th e  in itializatio n   o f   ca m er a_ th r ea d _ f u n ctio n ,   wh ich   o p er ates  in   a  s ep ar ate  th r ea d   to   en a b le  co n tin u o u s   i m ag e  ca p tu r e  w h ile  ex ec u tin g   r o b o t  co n tr o l  task s .   T h e  u s e  o f   s to p _ ev e n t  allo ws  s af e  ter m in atio n   d u r i n g   s h u t d o wn ,   wh ile  lo c k   e n s u r es  th r e ad - s af e  ac ce s s   to   s h ar ed   r eso u r ce s   s u ch   as  th e   ca m er a  s tr ea m   an d   co n tr o l  s ig n als.  T h is   th r ea d e d   d esig n   en h an ce s   s y s tem   r esp o n s iv en ess   an d   s tab ilit y   d u r in g   au to n o m o u s   o p e r atio n .   T o   r esp o n d   ef f ec tiv el y   to   class if icatio n   r esu lts ,   th e  D o b o t  Ma g ician   r o b o tic  m an ip u lato r   is   p r o g r a m m ed   to   ex ec u te  p r ec is e  m o v em en ts   u s in g   s u ctio n   cu p   en d   ef f ec to r .   T wo   m ain   f u n c tio n s ,   m o v e_ d o b o t   an d   r u n _ m o v e m en ts ,   co n v er t   class if icatio n   lab els  in to   r o b o t  co m m a n d s .   T h e  m o v e _ d o b o t  f u n ctio n   h an d les   p o s itio n - b ased   m o tio n   a n d   s u c tio n   co n tr o l  b y   ac ce p tin g   ( x ,   y ,   z)   co o r d in ates  an d   a  B o o lean   f lag   f o r   ac tiv atin g   o r   d ea ctiv atin g   th e  s u ctio n .   I t  also   p r in ts   m o v em e n t statu s   to   th e  ter m in al  f o r   r ea l - tim e  m o n ito r in g .       T ab le  2 .   C am er a  in itializatio n   an d   im ag e  ca p tu r e  f u n ctio n ality   I n st r u c t i o n   D e scri p t i o n   d e f   c a m e r a _ t h r e a d _ f u n c t i o n   ( d o b o t ,   s t o p _ e v e n t ,   l o c k )   D e f i n e s  a   f u n c t i o n   t o   h a n d l e   i ma g e   c a p t u r e   a n d   r o b o t   c o n t r o l .   I t   t a k e s   t h r e e   p a r a m e t e r s:   d o b o t   ( r o b o t   o b j e c t ) ,   st o p _ e v e n t   ( t h r e a d   st o p   f l a g ) ,   a n d   l o c k   ( sy n c h r o n i z a t i o n   me c h a n i sm ) .   l o b a l   c a p   D e c l a r e s  c a p   a s   a   g l o b a l   v a r i a b l e   t o   a l l o w   a c c e ss  o u t s i d e   t h e   f u n c t i o n .   c a p   =   c v 2 . V i d e o C a p t u r e ( 0 )   I n i t i a l i z e s  v i d e o   c a p t u r e   f r o m   t h e   d e f a u l t   c a mer a   d e v i c e   ( i n d e x   0 ) .   c a p . se t   ( c v 2 . C A P _ P R O P _ F R A M E _ W I D TH ,   6 4 0 )   S e t s  t h e   v i d e o   f r a m e   w i d t h   t o   6 4 0   p i x e l s.   c a p . se t   ( c v 2 . C A P _ P R O P _ F R A M E _ H EI G H T,   4 8 0 )   S e t s  t h e   v i d e o   f r a m e   h e i g h t   t o   4 8 0   p i x e l s.       T ab le  3   s u m m ar izes  th e  co n tr o l  in s tr u ctio n s   f o r   th e  Do b o t  Ma g ician ’ s   m o v em en t  a n d   s u ctio n   cu p   o p er atio n .   T h e  m o v e_ d o b o t   f u n ctio n   h a n d les  p o s itio n - b ased   m o tio n   an d   s u ctio n   ac tiv atio n ,   p r o v id in g     r ea l - tim e  f ee d b ac k   v ia   s tatu s   m ess ag es.  I t  m o v es  th e   m an ip u lato r   to   s p ec if ied   ( x ,   y ,   z )   c o o r d in ates,  ac tiv ates   o r   d ea ctiv ates  s u ctio n   as  r eq u ir ed ,   an d   in t r o d u ce s   a  s h o r t  d elay   to   en s u r e  task   s tab ilit y .   Af ter   class if icatio n ,   th e  r u n _ m o v em en ts   f u n cti o n   m ap s   ea ch   p r ed icted   lab el  ( g o o d ,   s tr ip e,   m o ld y ,   d ir ty )   to   a   p r ed ef in ed   m o tio n   s eq u en ce   f o r   ac cu r ate  s o r tin g .       T ab le  3 .   Do b o t  m o v em en t a n d   s u ctio n   cu p   c o n tr o l in s tr u ctio n s   I n st r u c t i o n   D e scri p t i o n   d e f   m o v e _ d o b o t   ( d o b o t ,   x ,   y ,   z ,   su c t i o n )   D e f i n e s  a   f u n c t i o n   t o   m o v e   t h e   r o b o t   t o   s p e c i f i e d   c o o r d i n a t e s   a n d   c o n t r o l   t h e   s u c t i o n   c u p .   P r i n t   ( f " M o v i n g   t o :   ( { x },  { y },   {z})   w i t h   su c t i o n   {' O N ' i f   su c t i o n   e l s e   'O F F '} " )   D i sp l a y s a   st a t u s m e ssa g e   i n d i c a t i n g   t h e   mo v e m e n t   a n d   s u c t i o n   s t a t u s .   d o b o t . mo v e _ t o ( x ,   y ,   z ,   0 )   M o v e s  t h e   r o b o t   t o   t h e   d e si r e d   p o si t i o n .   Th e   f i n a l   p a r a met e r   ( 0 )   i s  t h e   j o i n t   o r i e n t a t i o n .   i f   su c t i o n   C h e c k s  w h e t h e r   su c t i o n   i s  n e e d e d .   I f   Tr u e ,   a c t i v a t e s  s u c t i o n ;   o t h e r w i se ,   d e a c t i v a t e s  i t .   d o b o t . su c k   ( Tr u e )   A c t i v a t e s   t h e   s u c t i o n   c u p   t o   g r a sp   t h e   o b j e c t .   d o b o t . su c k   ( F a l s e )   D e a c t i v a t e s  t h e   s u c t i o n   c u p   t o   r e l e a se   t h e   o b j e c t .   t i m e . sl e e p   ( 1 )   P a u se s t h e   p r o g r a m f o r   o n e   se c o n d   t o   e n s u r e   s t a b l e   e x e c u t i o n .       T ab le  4   p r esen ts   th e  r u n _ m o v em en ts   f u n ctio n ,   wh ich   m ap s   ea ch   class if icatio n   lab el  “GO OD ,   STRIPE ,   MO L DY,   DI R T Y”  to   a  s p ec if ic   m o tio n   r o u tin e   u s in g   th e   m o v e_ d o b o t   f u n cti o n .   E ac h   ca te g o r y   tr ig g er s   a  p r ed e f in ed   tr ajec to r y   an d   s u ctio n   c o n tr o l  s tr ateg y ,   en s u r in g   ac c u r ate  p lace m e n t  o r   r ejec tio n .   T h is   im p lem en tatio n   d em o n s tr ates  d y n am ic  m o tio n   g en er atio n   b ased   o n   v is u al  class if icatio n ,   r ed u cin g   m an u al  in s p ec tio n   an d   e n ab lin g   r ea l - ti m e  d ef ec t so r tin g   in   in d u s tr ial  en v ir o n m en ts .       T ab le  4 .   Do b o t  m o tio n   ex ec u tio n   b ased   o n   lab el  class if icatio n   I n st r u c t i o n   D e scri p t i o n   d e f   r u n _ m o v e me n t s   ( d o b o t ,   l a b e l )   D e f i n e s a   f u n c t i o n   t h a t   m a p s c l a ss i f i c a t i o n   l a b e l s t o   m o v e m e n t   r o u t i n e s .   i f   l a b e l   = =   '0   G O O D '   Ex e c u t e s   mo t i o n   s p e c i f i c   t o   'G O O D ' l a b e l .   e l i f   l a b e l   = =   ' 1   S TR I P E'   Ex e c u t e s   mo t i o n   s p e c i f i c   t o   'S TR I P E'  l a b e l .   e l i f   l a b e l   = =   ' 2   M O LD Y '   Ex e c u t e s   mo t i o n   s p e c i f i c   t o   'M O LD Y ' l a b e l .   e l i f   l a b e l   = =   ' 3   D I R TY '   Ex e c u t e s   mo t i o n   s p e c i f i c   t o   'D I R TY ' l a b e l .   mo v e _ d o b o t   ( d o b o t ,   x ,   y ,   z ,   s u c t i o n )   C a l l s  t h e   m o v e m e n t   f u n c t i o n   w i t h   d e f i n e d   p a r a me t e r s f o r   e a c h   l a b e l .   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 9 3 8   I n t J Ar tif   I n tell ,  Vo l.  15 ,   No .   3 ,  J u n e   20 26 :   2 3 2 5 - 2 3 3 6   2330   3.   RE SU L T S AN D  D I SCU SS I O N   T h is   s ec tio n   ev alu ates  th e  p er f o r m an ce   o f   th e  Do b o t  Ma g ici an   in   im p lem en tin g   v is io n - b as ed   m o tio n   co n tr o l  u s in g   R asp b er r y   Pi  as   th e  m ain   p r o ce s s in g   u n it.  T h e  s y s tem   lev er ag es  r ea l - tim e  v is u al  f ee d b ac k   to   o b tain   p o s itio n al  d ata,   en ab li n g   p r ec is e  an d   ad ap tiv e   m an i p u lato r   a d ju s tm en ts .   T h e   an al y s is   f o cu s es  o n   th e   Do b o t  Ma g ician ’ s   k in e m atics  an d   m o tio n   e x ec u tio n   p er f o r m an ce ,   e m p h asizin g   p o s itio n al  ac cu r ac y   an d   tr ajec to r y   p lan n in g .     3 . 1 .    K ine m a t ics  a na ly s is   o f   Do bo t   M a g icia n   3 . 1 . 1 .   Dena v it - H a rt enberg   a na ly s is   o f   t he  4 - deg re e - of - f re edo m   ma nip ula t o r   T o   estab lis h   an   ac cu r ate  k in e m atic  m o d el  o f   th e   Do b o t  Ma g ician   m an ip u lato r ,   a  Den av it - Har ten b er g   (D - H)   an aly s i s   w as   co n d u ct ed .   T h e  r o b o t  co m p r i s e s   f iv e  m a jo r   co m p o n en t s :  s ta ti c  b as e,   r o ta ti n g   b a s e ,   s h o u ld er ,   e lb o w,   an d   wr i s t .   E ac h   o f   th e s e  co m p o n en t s   wa s   m o d e led   in   au to d e s k   in v en to r   b a s ed   o n   th e   o r ig i n a l  p h y s ic al   d im en s io n s   an d   t h en   a s s em b l ed   in   ac co r d an ce   w it h   th e   co o r d in at e  f r am e   s tr u c tu r e   p r o v id e d   b y   th e   Do b o t  m an u f ac tu r er   [ 3 1 ] .   T h e  r e s u lt in g   a s s em b ly ,   in clu d in g   th e   jo in t  r ef er en ce   f r a m e s ,   i s   s h o wn   in   Fig u r e  4 .           Fig u r e  4 .   Stru ctu r e  an d   co o r d i n at  f r am e  o f   Do b o t M ag ician       B ased   o n   th is   s tr u ctu r al  lay o u t,  th e  D - H  p ar am eter   m o d elin g   f o r   th e   4 - DOF  co n f i g u r atio n   ex clu d es   th e  f if th   f r am e  c o r r esp o n d in g   to   th e   en d - ef f ec to r .   T h e  p ar am eter   s et  s u m m ar ized   in   T ab le  5   d ef in es  th e   r elativ e  tr an s f o r m atio n   b etwe en   ea ch   jo in t  u s in g   th e  s tan d a r d   f o u r   D - H  p ar am eter s :  lin k   len g th   ,   lin k   twis t     ,   lin k   o f f s et    an d   jo in t a n g le  .   T h ese  p ar am eter s   wer e  d ef in e d   f o r   ea ch   jo i n t o f   th e  4 - DOF  co n f ig u r atio n   o f   th e  Do b o t M ag ician ,   ex clu d in g   th e  en d - ef f ec t o r   at  th e  wr i s t.       T ab le  5 .   D - H   p a r am eter s   o f   th e  4 - DOF  Do b o t M ag ician   m an ip u lato r   F r a me  i               1   0   90 o   85   1 = 135    135   2   1 3 5   0 o   0   2 = 0    85   3   1 4 7   0 o   0   2 = 0    85   4   59   0 o   0   4 = 90    − 90   5   -   90 o   - 70   5 = 0       T h e  D - H  m eth o d   d e r iv es  a  h o m o g e n eo u s   m atr ix   f o r m u lati o n   r elativ e  to   ea ch   m an i p u lat o r   f r am e.   T h u s ,   f o r   a  4 - DOF  m an i p u lato r   s u ch   as Do b o t M a g ician ,   it y ield s   as in   ( 1 ) .     − 1 = [ −                   −       0 0   0           0     1 ]   ( 1 )     Fro m   th e  h o m o g e n eo u s   eq u ati o n ,   th e  m atr ix   co n n ec tin g   f r a m e  1   to   f r am e  5   is   o b tain ed   as  ( 2 ) .     5 0 = 1 0 . 2 1 . 3 2 . 4 3 . 5 4   ( 2 )     L 1 8 5   m m X 0 y 0 Z 0 L 1 L 2 L 4 L 3 Z 1 Z 2 Z 3 X 1 X 2 X 3 y 1 y 2 y 3 q 1 q 2 q 3 q 4 J 1 J 2 J 3 J 4 5 0   m m Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J Ar tif   I n tell     I SS N:   2252 - 8 9 3 8       Ya r n   in s p ec tio n   a n d   s o r tin g   s ystem  u s in g   r o b o tic  visi o n   a n d   ma ch in e  lea r n in g   ( E mma n u el  A g u n g   N u g r o h o )   2331   I n   th is   p r o v is io n ,   th e  k in em at ics  o f   Do b o t  M ag ician   is   f o r m ed   b y   s ettin g   th e  lin k   len g t h s   L 1   =8 5   m m ,   L 2   =1 3 5   m m ,   L 3   =1 4 7   m m ,   an d   L 4   =5 9   m m ,   with   j o in t  v a r iab les    d er iv ed   f r o m   th e  m an ip u lato r ’ s   ac tu atio n   b ased   o n   its   s lid er   i n p u t.  E ac h   tr an s f o r m atio n   m a tr ix   − 1   is   co n s tr u cted   b ased   o n   th e  r esp ec tiv e    D - H  p ar am eter s .   I n   th is   ca s e  th e  co n f i g u r atio n   o f   j o in t a n g le s :  1 = - 3 3 °,  2 = - 7 °,  3 = - 2 4 °,  an d   4 = - 4 3 °.   So ,   th e  tr an s f o r m atio n   m atr ices  f r o m   b ase  to   en d - ef f e cto r   ar e  co m p u ted   s tep - by - s tep .   T h e  h o m o g en eo u s   tr an s f o r m atio n   m atr ices d er iv ed   ar e   as f o llo w s :     1 = - 3 3 °,  C o s   1 =0 . 8 3 8 ,   Sin   1 = - 0 . 5 4 4     1 0 = [ 0 . 838 0 − 0 . 544 73 . 61 0 0 . 838 42 . 5 0 0 − 1 0       0           85 0           1 ]       2 = - 3 7 °,  C o s   2 =0 . 9 9 2 ,   Sin   2 = - 0 . 1 2 2     2 1 = [ 0 . 992 0 0 . 122 133 . 99 − 0 . 122 0 0 . 992 − 16 . 47 0 0 − 1 0 0                     0 0                     1 ]       3 = - 2 4 °,  C o s   3 =0 . 9 1 3 ,   Sin   3 = - 0 . 4 0 6     3 2 = [ 0 . 913 0 0 . 406 134 . 21 − 0 . 406 0 0 . 913 − 59 . 68 0 0 − 1 0 0                     0 0                     1 ]       4 = - 4 3 °,  C o s   4 =0 . 7 3 1 ,   Sin   4 = - 0 . 6 8 1     4 3 = [ 0 . 731 0 0 . 681 43 . 13 − 0 . 681 0 0 . 731 − 40 . 18 0 0 − 1 0 0                     0 0                     1 ]     5 4 = [ 1 0 0         0 0 0 − 1   0 0 0 1 0 0 − 70 0     1 ]     T h e  o v e r all  tr an s f o r m atio n   f r o m   b ase  to   wr is t is o b tain ed   b y :     5 0 = [ 0 . 231 − 0 . 544 − 0 . 806 269 . 82 − 0 . 150 − 0 . 838 0 . 523 − 91 . 76 − 0 . 961 0 0 0 − 0 . 275 − 63 . 88 0 1 ]       3 . 1 . 2 .   F o rwa rd  k inem a t ics a na ly s is   o f   t he  4 - deg re e - of - f re edo m   ma nip ula t o r   I n   th e   co n tex t  o f   a   4 - DOF  m a n ip u lato r ,   f o r war d   k in em atics  is   ess en tial  f o r   d eter m in in g   th e  p o s itio n   an d   o r ien tatio n   o f   th e  en d - ef f ec to r   b ased   o n   th e  jo in t  an g le s   o f   th e  m an ip u lato r   [ 3 2 ] .   T h is   p r o ce s s   in v o lv es  a  clo s ed - lo o p   v ec to r   a n aly s is   to   d er iv e  th e  p o s itio n   eq u atio n s .   T h e  n u m b er   o f   eq u atio n s   d e p e n d s   o n   th e   n u m b er   o f   jo in ts   an d   th e  len g t h   o f   ea c h   m an ip u lato r   lin k .   T h e  f o r war d   k in em atics e q u atio n   is   d ef in e d   as  in   ( 3 ) .     [ ] =   [ ( 1 ) . ( 2 ( 2 ) + 3   ( 2 + 3 ) + 4   ( 2 + 3 + 4 ) ) ( 1 ) . ( 2 ( 2 ) + 3   ( 2 + 3 ) + 4   ( 2 + 3 + 4 ) ) 1 +   ( 2 ( 2 ) + 3   ( 2 + 3 ) + 4   ( 2 + 3 + 4 ) ) ]   ( 3 )     T h e  r eq u ir ed   tr ig o n o m etr y   v al u es   ar e  ca lcu lated :      ( 2 + 3 ) = 0 . 857      ( 2 + 3 + 4 ) = 0 . 276      ( 2 + 3 ) = − 0 . 5151      ( 2 + 3 + 4 ) = − 0 . 961       Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 9 3 8   I n t J Ar tif   I n tell ,  Vo l.  15 ,   No .   3 ,  J u n e   20 26 :   2 3 2 5 - 2 3 3 6   2332   No w  ca lcu late  ea ch   co m p o n e n t o f   th e  p o s itio n   v ec to r   b ased   o n   th e  f o r war d   k in em atics e q u atio n :     = 0 . 838 × ( 135 × 0 , 992 + 147 × 0 . 857 + 59 × 0 . 276 )     = 0 . 838 × ( 133 . 92 + 125 . 88 + 16 . 28 )     = 0 . 838 × 276 . 08 = 231 . 25          = − 0 . 544 × ( 135 × 0 . 992 + 147 × 0 , 857 + 59 × 0 , 276 )     = − 0 . 544 × 276 . 08 = − 150 . 17          = 85 + 135 × ( − 0 . 122 ) + 147 × ( − 0 . 515 ) + 59 × ( − 0 . 961 )     = 85 − 16 . 47 − 75 . 71 − 56 . 70 = 63 . 88          So ,   th e  f in al  p o s itio n   o n   f o r wa r d   k in em atics is :     [ ] = [ 231 . 25 − 150 . 17 − 63 . 88 ]       3. 1 . 3 .   I nv er s e  k inem a t ics a n a ly s is   o f   t he  4 - deg re e - of - f re e do m   ma nip ula t o r   T h e  in v e r s e  k in em atics  an al y s is   is   u s ed   to   d eter m in e  th e   jo i n t  an g les  1 ,  2 ,  3 ,   an d   4   o f   a  4 - DOF   m an ip u lato r   [ 3 3 ] .   T h is   an al y s is   u s es  a  g eo m etr ic   an d   tr ig o n o m etr ic  a p p r o ac h .   Giv en   t h e   d esire d   p o s itio n   o f   th e  en d - e f f ec to r   ( ,  ,   an d   ):   i)   C alcu lated   o f   1   as d ef in ed   in   ( 4 ) .        1 =        1 = − 150 . 36 231 . 69 ≈ − 0 . 649     1 =  − 1 ( − 0 . 649 ) ≈ − 33°   ( 4 )     ii)   Pre p ar atio n   f o r   2 ,   an d   3 :     = √ 2 + 2   = √ ( 231 . 69 ) 2 + ( − 150 . 36 ) 2     ≈ 276 . 39        = −   1 = − 63 . 88 − 85 = 148 . 88          iii)   C alcu latio n   o f   3   as d ef in ed   in   ( 5 ) .      ( 3 ) = 2 + 2 − 2 2 − 3 2 2 2 3      ( 3 ) = ( 276 . 39 ) 2 + ( − 148 . 88 ) 2 − 135 2 − 147 2 2 × 135 × 147      ( 3 ) = 58733 3 96 90 ≈ 0 . 741      ( 3 ) = √ 1 − ( 0 . 741 ) 2 ≈ √ 0 . 451   ≈ 0 . 671     3 =  − 1 ( 0 . 671 0 . 741 )   ≈  − 1 ( 0 . 9069 ) ≈ 42 . 6°   ( 5 )     iv )   C alcu latio n   o f   2   as d ef in ed   in   ( 6 ) .     2 =  − 1 ( ) −    − 1 ( 3  ( 3 ) 2 + 3  ( 3 ) )     2 =  − 1 ( − 148 . 88 276 . 39 ) −    − 1 ( 147 × 0 . 671 135 + 147 × 0 . 741 )     2 =  − 1 ( − 0 . 5388 ) −    − 1 ( 0 . 4 )     2 ≈ − 28 . 2 −   21 . 8 = − 50°   ( 6 )     v)   C alcu latio n   o f   4 :   a s s u m in g   th e  m an ip u lato r   wr is t  m ain tain s   a  f lat  o r ien tatio n   ( ze r o   en d - e f f e cto r   p itch ) ,   th e  last   jo in t c o m p en s ates f o r   t h e  s u m   o f   t h e  p r e v io u s   an g les   as in   ( 7 ) .     Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J Ar tif   I n tell     I SS N:   2252 - 8 9 3 8       Ya r n   in s p ec tio n   a n d   s o r tin g   s ystem  u s in g   r o b o tic  visi o n   a n d   ma ch in e  lea r n in g   ( E mma n u el  A g u n g   N u g r o h o )   2333   4 = ( 2 + 3 )     4 = ( − 50° −   42 . 6° ) = − 7 . 4°   ( 7 )     T h e  s lig h t  d if f er en ce   b etwe e n   th e  i n v er s e  an d   f o r war d   v alu es  p ar ticu lar ly   in   4   m ay   r esu lt  f r o m   s im p lific atio n s   in   th e  in v er s e   k in em atics  m eth o d ,   wh ich   m ay   n o t  f u lly   ac c o u n t  f o r   t h e  en d - ef f ec to r ' s   o r ien tatio n ,   o r   d if f er en ce s   in   r ef er en ce   f r am e  co n v en tio n s   an d   an g u la r   d ec o m p o s itio n s .     3 . 2 .     P er f o r m a nce  a na ly s is   o f   Do bo t   M a g icia n m o v em ent   T h e  ex p e r im en t  ev alu ate d   p ic k - an d - p lace   task s   f o r   y ar n   s p o o ls   class if ied   in to   f o u r   ca teg o r ies  g o o d ,   s tr ip ed ,   m o ld y ,   an d   d ir ty ,   u s in g   a  v is io n   s y s tem   p o wer ed   b y   T ea ch ab le  Ma ch in e.   Ob jects  wer e  d etec ted   v ia  a  web ca m ,   class if ied   with   m a ch in e  lear n in g ,   a n d   p o s itio n ed   b y   th e  Do b o t  Ma g ician   at  p r ed ef in e d   tar g et  co o r d in ates.  T h e  p ick u p   p o in t  f o r   all  y ar n   ty p es  was  f ix ed   at  ( 3 1 5 ,   - 1 ,   an d   - 6 5 ) ,   wh il e  d esti n atio n   p o in ts   v ar ied   b y   ca teg o r y .   T a b le  6   co m p ar es p r o g r am m e d   an d   ac tu al  en d - ef f ec t o r   co o r d in ates.       T ab le  6 .   C o m p a r is o n   o f   in ten d ed   v s .   ac tu al  en d - ef f ec t o r   co o r d in ates   C a t e g o r y   ( y a r n )   I n i t i a l   c o o r d i n a t e   ( mm )   F i n a l   c o o r d i n a t e   ( p r o g r a mm e d )   ( mm )   F i n a l   c o o r d i n a t e   ( a c t u a l   ( mm ) )   G o o d   ( 3 1 5 ,   - 1 ,   - 6 5 )   ( 2 7 0 ,   - 9 0 ,   - 62)   ( 2 6 9 . 9 ,   - 9 0 . 2 ,   - 6 1 . 8 )   S t r i p e d   ( 3 1 5 ,   - 1 ,   - 6 5 )   ( 2 7 0 ,   9 0 ,   - 6 2 )   ( 2 7 0 . 1 ,   8 9 . 8 ,   - 6 1 . 9 )   M o l d y   ( 3 1 5 ,   - 1 ,   - 6 5 )   ( 1 7 0 ,   - 9 0 ,   - 62)   ( 1 7 0 . 1 ,   - 8 9 . 9 ,   - 6 0 . 8 )   D i r t y   ( 3 1 5 ,   - 1 ,   - 6 5 )   ( 1 7 0 ,   9 0 ,   - 6 2 )   ( 1 6 8 . 8 ,   9 1 . 3 ,   - 6 0 . 8 )       T h e   r e s u l ts   d e m o n s t r a t e  h i g h   p r e c i s i o n   i n   t h e   m a n i p u l a t o r ' s   p e r f o r m a n c e .   R es u l ts   s h o w  m i n i m a l  d e v i a t i o n   b e t w ee n   i n t e n d e d   a n d   a c t u a l   p o s it i o n s ,   c o n f i r m i n g   h i g h   a c c u r a c y   x - a x i s :   0 . 3 7 5   m m ,   y - a x i s :   0 . 6 9   m m ,   z - ax is :  0 . 6 7 5   m m ,   a n d   o v er all   m ea n   d ev iatio n :   ± 0 . 5 8   m m .   I n   a d d i t i o n   t o   e n d p o i n t   a c c u r a c y ,   a n   e v a l u a t i o n   o f   t h e   m a n i p u l a t o r ’ s   m o ti o n   t r a jec t o r y   w as   c o n d u c t e d   t o   o b s e r v e   m o v e m e n t   p a tt e r n s   d u r i n g   s o r t i n g   t as k s .   F i g u r e  5   p r esen ts   th e  tr ajec to r y   b eh av i o r   f o r   two   class if icatio n   ca s es:  Fig u r e  5 ( a)   s h o ws  th e  m o v em en t  p ath   wh en   h an d lin g   g o o d   y ar n ,   wh ile  Fig u r e  5 ( b )   illu s tr ates  th e  tr ajec to r y   g en er ate d   d u r i n g   th e  s o r t in g   o f   s tr ip ed   y ar n .   Dif f er en ce s   in   p lace m en t   co o r d in ates  alo n g   th e   x   an d   y   ax es   r esu lt  in   d is tin ct  p ath s   f o r   ea ch   ca teg o r y .   T h ese  m o v em en ts   r e q u ir e   co o r d in at ed   m u lti - ax is   c o n tr o l   in v o l v in g   o b ject  g r i p p in g ,   v e r tical  liftin g ,   h o r izo n tal   tr an s latio n ,   an d   c o n tr o lled   lo w er in g   to war d   th e  d esig n ate d   ta r g et  lo ca tio n .           ( a)   ( b )     Fig u r e  5 .   T r ajec to r y   o f   th e  m a n ip u lato r   m o v in g   o f   ( a)   g o o d   y ar n   an d   ( b )   s tr ip ed   y ar n       T r aj ec to r y   an a ly s i s   c o n f i r m s   t h a t  v ar ia tio n s   o cc u r   ac r o s s   c at eg o r ie s   d u e  to   x - y  p lac em en t   d if f e r en c e s .   T h e  co o r d in at ed   m o v em e n t s   g r ip p in g ,   lif t in g ,   h o r izo n ta l  d i s p l ac em en t,  an d   p r ec is e  lo w er in g   a s   s h o wn   in   F ig u r e   5 ,   v a lid at e  t h e  s y s t em ’ s   ca p ab i li ty   to   p er f o r m   d y n am ic,   r e al - t im e   o p er at io n s   wi th   v i s u a l   cla s s if i ca tio n .   T h es e  r e s u lt s   d em o n s tr at e  p r e ci s io n ,   r e s p o n s iv en es s ,   an d   ad ap tab il ity   f o r   in d u s tr ia l   au to m at io n   en v ir o n m en t s .   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 9 3 8   I n t J Ar tif   I n tell ,  Vo l.  15 ,   No .   3 ,  J u n e   20 26 :   2 3 2 5 - 2 3 3 6   2334   4.   CO NCLU SI O N   T h e  d e v elo p e d   y ar n   in s p ec tio n   an d   s o r tin g   s y s tem   s u cc ess f u lly   in teg r ates  r o b o tic  v is io n ,     m ac h in e  lear n in g ,   an d   PB VS   to   ac h iev e  r ea l - tim e  an d   p r ec i s e  o p er atio n .   E x p e r im en tal  r e s u lts   in d icate   h ig h   p o s itio n al  ac cu r ac y ,   with   an   o v er all  m ea n   d ev iatio n   o f   ± 0 . 5 8   m m   ( x - ax is :  0 . 3 7 5   m m ,   y - a x is :  0 . 6 9   m m ,     z - ax is :  0 . 6 7 5   m m ) ,   d em o n s tr atin g   r eliab le  p ick - an d - p lace   p er f o r m an ce   u s in g   a  4 - DOF  m an ip u lato r .   T h e   s y s tem   ac h iev ed   1 0 0 %  s u cc ess f u l  s o r tin g   ac r o s s   f o u r   y ar n   ca teg o r ies  ( g o o d ,   s tr ip ed ,   m o ld y ,   an d   d ir t y )   an d   ex ec u ted   class if icatio n   an d   a ctu atio n   cy cles  in   u n d er   2   s e co n d s   p er   o p er atio n ,   v alid ati n g   its   ef f icien cy   f o r   d y n am ic   in d u s tr ial  e n v ir o n m en ts .   T h ese  o u tco m es  c o n f ir m   th e  f ea s ib ilit y   o f   u s in g   l o w - co s t  em b e d d ed   p latf o r m s   f o r   in tellig en t q u ality   co n tr o l a n d   m ater ial  h an d lin g   in   i n d u s tr y   4 . 0   ap p licatio n s .       F UNDING   I NF O R M A T I O N   Au th o r s   s tate  n o   f u n d in g   in v o lv ed .       AUTHO R  CO NT RI B UT I O NS ST A T E M E N T   T h is   jo u r n al  u s es  th e  C o n tr ib u to r   R o les  T ax o n o m y   ( C R ed iT)   to   r ec o g n ize  in d iv id u al  au th o r   co n tr ib u tio n s ,   r ed u ce   au th o r s h ip   d is p u tes,  an d   f ac ilit ate  co llab o r atio n .     Na m e  o f   Aut ho r   C   M   So   Va   Fo   I   R   D   O   E   Vi   Su   P   Fu   E m m an u el  Ag u n g   Nu g r o h o   ✓   ✓   ✓   ✓   ✓   ✓     ✓   ✓   ✓       ✓   ✓   J o g a  Dh ar m a  Setiawan     ✓         ✓     ✓     ✓     ✓     ✓   Den i K u r n ia   ✓     ✓   ✓     ✓   ✓       ✓   ✓   ✓   ✓     Nan an g   R o n i Wi b o wo   ✓     ✓   ✓   ✓   ✓   ✓     ✓     ✓     ✓       C   :    C o n c e p t u a l i z a t i o n   M   :    M e t h o d o l o g y   So   :    So f t w a r e   Va   :    Va l i d a t i o n   Fo   :    Fo r mal   a n a l y s i s   I   :    I n v e s t i g a t i o n   R   :    R e so u r c e s   D   :   D a t a   C u r a t i o n   O   :   W r i t i n g   -   O r i g i n a l   D r a f t   E   :   W r i t i n g   -   R e v i e w   &   E d i t i n g   Vi   :    Vi su a l i z a t i o n   Su   :    Su p e r v i s i o n   P   :    P r o j e c t   a d mi n i st r a t i o n   Fu   :    Fu n d i n g   a c q u i si t i o n         CO NF L I C T   O F   I N T E R E S T   ST A T E M E NT   T h e  au t h o r s   d ec lar e   th at  th e y   h av e  n o   k n o wn   c o m p etin g   f in an cial  in ter ests   o r   p er s o n al  r el atio n s h ip s   th at  co u ld   h av e  ap p ea r ed   t o   in f lu en ce   th e  wo r k   r e p o r te d   in   t h is   p ap er .   Au th o r s   s tate  n o   co n f lict o f   in ter est.       I NF O RM E D  CO NS E N T   W e  h av e  o b tain ed   in f o r m ed   c o n s en t f r o m   all  in d iv id u als in c lu d ed   in   t h is   s tu d y .       E T H I CAL AP P RO V AL   T h e  r esear ch   r elate d   to   h u m a n   u s e  h as  b ee n   co m p lie d   with   all  th e  r elev an t  n atio n al  r eg u l atio n s   an d   in s titu tio n al  p o licies  in   ac co r d an ce   with   th e  te n ets  o f   t h e  He ls in k i  Dec lar atio n   an d   h as  b ee n   ap p r o v e d   b y   th e   au th o r s '   in s titu tio n al  r ev iew  b o ar d   o r   eq u i v alen t c o m m ittee.       DATA AV AI L AB I L I T Y   T h e  d ata   th at  s u p p o r t  t h e  f in d i n g s   o f   th is   s tu d y   ar e  a v ailab le   f r o m   th e   co r r esp o n d in g   a u th o r ,   [ E AN ] ,   u p o n   r ea s o n ab le  r eq u est.       RE F E R E NC E S   [ 1 ]   Ş .   Ç i ğ d e m ,   I .   M .   K a v a l i a u s k i e n e ,   a n d   B .   Y ı l d ı z ,   “ I n d u s t r y   4 . 0   a n d   i n d u st r i a l   r o b o t s:   a   st u d y   f r o m  t h e   p e r s p e c t i v e   o f   ma n u f a c t u r i n g   c o m p a n y   e m p l o y e e s, ”   L o g i st i c s ,   v o l .   7 ,   n o .   1 ,   M a r .   2 0 2 3 ,   d o i :   1 0 . 3 3 9 0 / l o g i st i c s 7 0 1 0 0 1 7 .   [ 2 ]   M .   M a o   a n d   M .   H o n g ,   “ Y O LO   o b j e c t   d e t e c t i o n   f o r   r e a l - t i me  f a b r i c   d e f e c t   i n sp e c t i o n   i n   t h e   t e x t i l e   i n d u st r y :   a   r e v i e w   o f   Y O LO v 1   t o   Y O LO v 1 1 , ”   S e n s o rs ,   v o l .   2 5 ,   n o .   7 ,   A p r .   2 0 2 5 ,   d o i :   1 0 . 3 3 9 0 / s 2 5 0 7 2 2 7 0 .   [ 3 ]   G .   Th i l a g a v a t h i   a n d   T .   K a r t h i k ,   Pro c e ss  c o n t ro l   a n d   y a r n   q u a l i t y   i n   s p i n n i n g ,   1 s t   e d .   N e w   Y o r k ,   U n i t e d   S t a t e s :   W P I   P u b l i s h i n g ,   2 0 1 6 ,  d o i :   1 0 . 1 2 0 1 / b 1 8 7 9 7 .   Evaluation Warning : The document was created with Spire.PDF for Python.