In traditional industry, the process of electroplating parts relies on manual labor, including hanging objects on racks and sending them into the electroplating tank for treatment. After electroplating, personnel need to check the completeness of each electroplated piece one by one. Such operations require a large amount of manpower, resulting in significant costs in the long run. In addition, personnel easily feel fatigued, and when inspection standards are inconsistent, significant variations in quality control may occur, which can lead to human errors and frequent mistakes. Therefore, this study uses traditional machine vision technology combined with deep learning algorithms to integrate a four-axis robotic arm and develop an automated defect detection and classification system, hoping to improve the problems faced by manual inspection.
This study utilized a four-axis robotic arm (THL700) manufactured by Toshiba Corporation in Japan, and an automated equipment controlled by LabVIEW. LabVIEW acted as the main control center to integrate various functions, while the robotic arm served as the hand to execute motion sequences. Vision Assistant was responsible for traditional automated optical inspection (AOI) and acted as the "eyes" of the system. Python was used to construct a neural network model with deep learning techniques, simulating the human brain's neuron system, to achieve object detection using the YOLOv5 (You Only Look Once version 5) algorithm for training. The program development and UI design were completed by linking with LabVIEW. The program architecture separated the brain, eyes, and hand into three separate programs, significantly enhancing the convenience of debugging and modification. For signal transmission, the system utilized hard I/O, connecting the robotic arm and LabVIEW I/O card through relays. This approach not only improved efficiency and stability but also facilitated maintenance and updates compared to conventional devices.
This study utilized PyTorch, an open-source machine learning library in Python, to apply YOLOv5 deep learning algorithm for object detection. For model training, 990 images of electroplated nuts were used, and 90 images were used for evaluation during model testing. The results showed an average precision (MAP) of 93% for each category.
Keywords: machine vision, Deep learning, four-axis robotic arm, automated optical inspection, object detection, electroplated nuts.
摘要............................................i
ABSTRACT.......................................ii
誌謝............................................iv
目錄.............................................v
表目錄..........................................ix
圖目錄...........................................x
符號說明 ......................................xvii
第1章 緒論........................................1
1.1 前言..........................................1
1.2 研究動機與目的.................................1
1.3 研究方法......................................2
1.4 文獻回顧......................................3
1.4.1機器視覺應用.................................3
1.4.2影像辨識之深度學習............................5
1.5論文架構.......................................7
第2章 機械手臂基礎運動學原理........................8
2.1機械手臂各軸關節與坐標系.........................8
2.1.1 機械手臂之運動學概論.........................11
2.1.2 機械手臂之運動學.............................12
第3章 深度學習基礎理論..............................16
3.1 深度學習概論...................................16
3.1.1 深度學習簡介.................................17
3.1.2 機器學習之分類...............................18
3.1.3 權重與偏差(Weight and Bias)................20
3.1.4 激活函數(Activation Function)..............21
3.1.5 損失函數(Loss Function)....................25
3.1.6優化器(Optimizer)...........................26
3.2卷積神經網路(Convolutional Neural Network, CNN)28
3.2.1卷積層(Convolutional Layer).................29
3.2.2池化層(Pooling Layer).......................33
3.2.3全連接層(Fully Connected Layer).............33
3.3 YOLOv5模型介紹.................................35
3.4模型評估........................................39
第4章 機器視覺基礎理論與方法.........................42
4.1 機器視覺簡介....................................42
4.2機器視覺基礎演算法................................42
4.2.1 色彩平面提取(Color Plane Extraction).........42
4.2.2 模板匹配(Pattern Matching)...................43
4.2.3 遮罩(Mask)...................................45
4.2.4 二值化(Binarization).........................46
4.2.5 形態學(Morphology)...........................49
第5章 實驗架構與機電整合技術...........................52
5.1 伺服馬達硬體架構與軟體架構.........................52
5.1.1 MELSEC可程式控制器..............................53
5.1.2 PRO-FACE人機...................................55
5.1.3 伺服驅動器......................................56
5.1.4 伺服馬達........................................57
5.1.5 氣壓缸..........................................58
5.2 電鍍螺帽掛架機台之機構設計..........................59
5.3 機械手臂硬體架構與軟體架構..........................61
5.3.1 四軸機械手臂.....................................63
5.3.2 控制器...........................................65
5.3.3 工業相機.........................................66
5.3.4 工業鏡頭.........................................67
5.3.5 氣立夾爪.........................................69
5.3.6 結合LED光源、相機和鏡頭之治具式夾爪機構設計.........70
5.4拍攝焦距測試之系統架構...............................71
5.5 LabVIEW I/O卡應用..................................73
第6章 實驗結果與討論....................................74
6.1 伺服馬達電控系統整合................................74
6.2 PLC程序處理作業....................................78
6.2.1 程式架構之設計...................................80
6.2.2 PLC I/O表規劃....................................84
6.2.3 HMI與PLC的通訊連結...............................85
6.3 伺服馬達與移送平台控制流程..........................88
6.4 機械手臂電控系統整合................................91
6.5深度學習之資料庫建立.................................94
6.6模型訓練............................................97
6.6.1 模型訓練情況與評估................................99
6.6.2 模型測試.........................................101
6.7影像處理作業........................................101
6.7.1 機器視覺檢測.....................................102
6.7.2 色彩平面提取(Color Plane Extraction)...........103
6.7.3 模板匹配(Pattern Matching)....................104
6.7.4 遮罩(Mask)....................................105
6.7.5 二值化(Binarization)..........................106
6.7.6 形態學(Morphology)............................106
6.7.7 粒子濾波(Particle Filter).....................107
6.7.8 粒子分析(Particle Analysis)...................108
6.8動作流程處理作業....................................111
6.8.1 SCARA手臂程式架構之設計..........................112
6.8.2 機械手臂 I/O表規劃...............................114
6.8.3 機械手臂程式編寫軟體..............................115
6.9邏輯判斷處理作業.....................................115
6.9.1 LabVIEW I/O表規劃................................117
6.9.2 LabVIEW程式架構之設計.............................118
6.9.3 LabVIEW影像辨識之程式.............................122
第7章 結論.............................................124
參考文獻...............................................125
[1]H.-D. Lin and S. W. Chiu, Flaw detection of domed surfaces in LED packages by machine vision system, Expert Systems with Applications, Vol. 38, No. 12, pp. 15208-15216, 2011.
[2]R. Manish, A. Venkatesh, and S. Denis Ashok, Machine vision based image processing techniques for surface finish and defect inspection in a grinding process, Materials Today: Proceedings, Vol. 5, No. 5, Part 2, pp. 12792-12802, 2018.
[3]Y.-C. Chiou and W.-C. Li, Flaw detection of cylindrical surfaces in PU-packing by using machine vision technique, Measurement, Vol. 42, No. 7, pp. 989-1000, 2009.
[4]W. Liu et al., Binocular-vision-based error detection system and identification method for PIGEs of rotary axis in five-axis machine tool, Precision Engineering, Vol. 51, pp. 208-222, 2018.
[5]M. Dowlati, M. de la Guardia, M. Dowlati, and S. S. Mohtasebi, Application of machine-vision techniques to fish-quality assessment, TrAC Trends in Analytical Chemistry, Vol. 40, pp. 168-179, 2012.
[6]L. Panahi and V. Ghods, Human fall detection using machine vision techniques on RGB–D images, Biomedical Signal Processing and Control, Vol. 44, pp. 146-153, 2018.
[7]L. Ying-Jie and Y. Fu-Cheng, Postmark date recognition based on machine vision, physics procedia, Vol. 33, pp. 819-826, 2012.
[8]J. Zheng, Y. Zhao, M. Ge, W. Bi, and P. Ge, Machine vision-based transverse vibration measurement of diamond wire, Precision Engineering, Vol. 80, pp. 115-126, 2023.
[9]Y. D. Chethan, H. V. Ravindra, and Y. T. Krishne gowda, Machined surface monitoring in turning using histogram analysis by machine vision, Materials Today: Proceedings, Vol. 5, No. 2, Part 2, pp. 7775-7781, 2018.
[10]T. Yuan-yuan, L. Si-yang, and T. Qing-chang, Application of detecting part's size online based on machine vision, Energy Procedia, Vol. 16, pp. 1948-1956, 2012.
[11]S. Palei, S. K. Behera, and P. K. Sethy, A systematic review of citrus disease perceptions and fruit grading using machine vision, Procedia Computer Science, Vol. 218, pp. 2504-2519, 2023.
[12]W. He et al., A review: The detection of cancer cells in histopathology based on machine vision, Computers in Biology and Medicine, Vol. 146, p. 105636, 2022.
[13]S. Kaushik, A. Jain, T. Chaudhary, and N. R. Chauhan, Machine vision based automated inspection approach for clutch friction disc (CFD), Materials Today: Proceedings, Vol. 62, pp. 151-157, 2022.
[14]Z. Yan et al., Machine vision-based tomato plug tray missed seeding detection and empty cell replanting, Computers and Electronics in Agriculture, Vol. 208, p. 107800, 2023.
[15]S. Jin, Z. Yang, G. Królczykg, X. Liu, P. Gardoni, and Z. Li, Garbage detection and classification using a new deep learning-based machine vision system as a tool for sustainable waste recycling, Waste Management, Vol. 162, pp. 123-130, 2023.
[16]R. Azadnia, A. Jahanbakhshi, S. Rashidi, M. khajehzadeh, and P. Bazyar, Developing an automated monitoring system for fast and accurate prediction of soil texture using an image-based deep learning network and machine vision system, Measurement, Vol. 190, p. 110669, 2022.
[17]D. Rong, H. Wang, L. Xie, Y. Ying, and Y. Zhang, Impurity detection of juglans using deep learning and machine vision, Computers and Electronics in Agriculture, Vol. 178, p. 105764, 2020.
[18]R. Hadipour-Rokni, E. Askari Asli-Ardeh, A. Jahanbakhshi, I. Esmaili paeen-Afrakoti, and S. Sabzi, Intelligent detection of citrus fruit pests using machine vision system and convolutional neural network through transfer learning technique, Computers in Biology and Medicine, Vol. 155, p. 106611, 2023.
[19]B. Xiao, Q. Lin, and Y. Chen, A vision-based method for automatic tracking of construction machines at nighttime based on deep learning illumination enhancement, Automation in Construction, Vol. 127, p. 103721, 2021.
[20]B. Jiang et al., Fusion of machine vision technology and AlexNet-CNNs deep learning network for the detection of postharvest apple pesticide residues, Artificial Intelligence in Agriculture, Vol. 1, pp. 1-8, 2019.
[21]譚孟桓,機械視覺應用於四軸機械手臂之定向夾取,龍華科技大學 機械工程系,碩士論文,2014年。
[22]蔡浚騰,五軸機械手臂機構設計,吳鳳科技大學 光機電暨材料研究所,碩士論文,2012年。
[23]陳漢雄,機械手臂混合位置/阻抗控制之研究,國立臺灣科技大學 自動化及控制研究所,碩士論文,2010年。
[24]簡經倫,開發新型移動式輪胎文字動態辨識系統,國立雲林科技大學 機械工程系,碩士論文,2022年。
[25]S.-C. Wang, "Artificial Neural Network," in Interdisciplinary Computing in Java Programming, S.-C. Wang, Ed. Boston, MA: Springer US, 2003, pp. 81-100.
[26]伍俊嘉,基於深度卷積神經網路於熔模鑄件噴砂缺陷檢測之研究,國立雲林科技大學 機械工程系,碩士論文,2021年。
[27]曾書瀚,基於YoLoV5即時行人交通號誌燈識別,元智大學 電機工程學系,碩士倫文,2022年
[28]梁家瑋,結合深度學習與機器視覺於口罩缺陷檢測之研究,國立雲林科技大學 機械工程系,碩士論文,2022年。
[29]葉家瑋,結合深度學習與機器視覺於巨量電鍍組件之自動掛載系統開發,國立雲林科技大學 機械工程系,碩士論文,2022年。
[30]Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner, Gradient-based learning applied to document recognition, Proceedings of the IEEE, Vol. 86, No. 11, pp. 2278-2324, 1998.
[31]Medium. Available: https://chih-sheng-huang821.medium.com/
[32]Roboflow. Available: https://blog.roboflow.com/yolov5-is-here/
[33]P. Luo, X. Zhang, and Y. Wan, Lightweight YOLOv5 model based small target detection in power engineering, Cognitive Robotics, Vol. 3, pp. 45-53, 2023.
[34]J. Yuan et al., Identification method of typical defects in transmission lines based on YOLOv5 object detection algorithm, Energy Reports, Vol. 9, pp. 323-332, 2023.
[35]GitHub. Available: https://github.com/ultralytics/yolov5
[36]泰利達貿易有限公司, CYRUS. Available: https://www.cyrus-linear.com/product-detail.php?id=511&lang=tw
[37]羅博特科技有限公司, Robotech. Available: https://www.robot-tech.com.tw/product.php?MT_id=site2018042710124056
[38]寶視納公司, Basler. Available: https://www.baslerweb.com/zh-tw/products/cameras/area-scan-cameras/ace/aca2500-14uc/
[39]中和碁電股份有限公司, JIDIEN. Available: https://www.jidien.com/zh_tw/product/ins.php?index_m1_id=0&index_id=143
[40]台灣氣立, CHELIC. Available: https://www.chelic.com.tw/products_Info/ProductGripperList/4/HDQ3/1/40