หุ่นยนต์จัดการด้าน Warehouse คลังสินค้า และด้าน Logistic ทีม Macaca mulatta การแข่งขันหุ่นยนต์เคลื่อนที่อัตโนมัติสำหรับการเกษตรอัจฉริยะ ปี 2021

หุ่นยนต์จัดการด้าน Warehouse คลังสินค้า และด้าน Logistic ทีม Macaca mulatta การแข่งขันหุ่นยนต์เคลื่อนที่อัตโนมัติสำหรับการเกษตรอัจฉริยะ ปี 2021

  1. ชื่อ-นามสกุล: นายกฤตวัฒน์ ทองผุด เลขประจำตัวนิสิตนักศึกษา: 6230302039
  2. ชื่อ-นามสกุล: นายสืบสกุล คำไล้ เลขประจำตัวนิสิตนักศึกษา: 6230305089
  3. ชื่อ-นามสกุล: นายทธิพันธ์ ไชยวัฒนพันธุ์ เลขประจำตัวนิสิตนักศึกษา: 6230340038
  4. ชื่อ-นามสกุล: นายณรัณธิกรณ์ น้ำรอบ เลขประจำตัวนิสิตนักศึกษา: 6230340062
  5. ชื่อ-นามสกุล: นายภูรินท์ นรารัตน์ เลขประจำตัวนิสิตนักศึกษา: 6230302039
  6. ชื่อ-นามสกุล: นายอรรถพันธ์ ภาคสกุณณี เลขประจำตัวนิสิตนักศึกษา: 6230350483
  7. ชื่อ-นามสกุล: นาย สหชัย สำเภาเงิน เลขประจำตัวนิสิตนักศึกษา: 6330340099
  8. ชื่อ-นามสกุล: นางสาวพชร กรานมูล เลขประจำตัวนิสิตนักศึกษา: 6330340072
  9. ชื่อ-นามสกุล: นายอุมัธ จิตต์ถวิล เลขประจำตัวนิสิตนักศึกษา: 6330340145
  10. ชื่อ-นามสกุล: นางสาวนิรัตศนีย์ คณโทเงิน เลขประจำตัวนิสิตนักศึกษา: 6330340048
  11. ชื่อ-นามสกุล: นายโฆษิต วงษ์เหรียญทอง เลขประจำตัวนิสิตนักศึกษา: 6330340005
  12. ชื่อ-นามสกุล: นายชยากร ปัญญาโรจน์ เลขประจำตัวนิสิตนักศึกษา: 6330340021
  13. ชื่อ-นามสกุล: นางสาวอทิตา พฤกษะศรี เลขประจำตัวนิสิตนักศึกษา: 6330340129

อาจารย์ที่ปรึกษา

นายกิตติพงษ์ เยาวาจา
นายพงศกร บำรุงไทย
นางสาวกาญจนา เอี่ยมสอาด
นายวรยศ ละม้ายศรี
นายทรงชัย จิตภักดีบดินทร์

https://fb.watch/b7KEGSBLU1/

Conceptual Drawing
ในปัจจุบัน Warehouse ทางด้านการเกษตรในประเทศไทยยังคงมีการจัดการสินค้าโดยใช้มนุษย์ เช่น การตรวจสอบคุณภาพสินค้า การจัดเรียงสินค้าขึ้นคลังสินค้าหรือจัดเรียงสินค้าตามข้อมูลที่ผู้บริโภคกำหนด แต่ในบางช่วงที่มนุษย์เกิดข้อผิดพลาดทางด้านการจัดการ เช่น การตรวจสอบสินค้าที่มีข้อผิดพลาดคือ ยังคงมีสินค้าที่มีตำหนิและเน่าเสีย ซึ่งเป็นข้อผิดพลาดที่มนุษย์เกิดขึ้นเป็นบ่อยครั้ง และการจัดเรียงสินค้าที่มีข้อผิดพลาดโดยมนุษย์ซึ่งส่งผลให้เกิด การจัดเรียงสินค้าที่ล่าช้าและผิดตามที่กำหนดการ
การนำเทคโนโลยีสมัยใหม่เข้ามาจัดการใน Warehouse ด้านการเกษตรจะเป็นเทคโนโลยีการบริหารจัดการสินค้าทางเกษตรแนวใหม่แบบครบวงจร เช่น การตรวจสอบคุณภาพสินค้า การจัดเรียงสินค้าขึ้นคลังสินค้าตามที่ได้รับกำหนด ซึ่งการนำเทคโนโลยีทางด้าน AI หรือหุ่นยนต์เข้ามาทดแทนแรงงานมนุษย์ทางด้านการจัดการใน Warehouse เป็นอีกหนึ่งหนทางที่ช่วยเหลือเกษตรกรที่ต้องการแก้ไขปัญหาทางด้านความล่าช้าในการตรวจสอบ และการจัดส่งสินค้า อีกทั้งยังช่วยลดต้นทุนการนำเข้าเครื่องจักรหุ่นยนต์จากต่างประเทศ รวมถึงการจ้างแรงงานมนุษย์ได้อีกด้วย เพื่อส่งเสริมคุณภาพการจัดการ Warehouse ในประเทศไทย เพราะเกษตรกรรมในไทยมีความสำคัญต่อประเทศ
ดังนั้นการนำเทคโนโลยีหุ่นยนต์เข้ามาใช้งานเป็นอีกทางเลือกทางด้านการจัดการ Warehouse สมัยใหม่เพื่อการเกษตรในประเทศไทย

เทคโนโลยีที่เกี่ยวข้อง
โครงการ Warehouse Management Systems จัดทำขึ้นเพื่อศึกษาการพัฒนาระบบการจัดการใน Warehouse โดยได้ศึกษาทฤษฎีและค้นคว้าที่เกี่ยวข้องเกี่ยวกับระบบอัตโนมัติของหุ่นยนต์ โดยผู้พัฒนาได้มีการใช้ความรู้ความสามารถทางด้านการออกแบบระบบเพื่อส่งเสริมทางด้านการเกษตร ดังนี้
• ความรู้ทางด้านการจัดการ AS/RS
งานวิจัยนี้เกี่ยวข้องกับการจัดระบบการคลังสินค้าอัตโนมัติ ASRS ซึ่งการจัดการในคลังสินค้าอัตโนมัติจะประกอบด้วยระบบควบคุมด้วยคอมพิวเตอร์ที่หลากหลายสำหรับ วางและดึงโหลดจากที่กำหนดไว้โดยอัตโนมัติ
สถานที่จัดเก็บ ระบบจัดเก็บและดึงข้อมูลอัตโนมัติ (ASRS) มักใช้ในแอปพลิเคชันที่มีการขนย้ายสิ่งของเข้าออกในปริมาณมาก และพื้นที่จัดเก็บความหนาแน่นของการจัดเก็บมีความสำคัญเนื่องจากพื้นที่มีข้อจำกัด
ซึ่งความแม่นยำเป็นสิ่งสำคัญเพราะเทคโนโลยีเพิ่มความแม่นยำอาจมีราคาแพง รวมถึงความเสียหายต่อโหลดสามารถใช้ ASRS กับโหลดมาตรฐานได้ การจัดเก็บอัตโนมัติและระบบดึงข้อมูลถูกนำมาใช้กันอย่างแพร่หลายในการสภาพแวดล้อมการผลิตตั้งแต่เปิดตัวในปี 1950
ประโยชน์ของการใช้ ASRS
o การปรับปรุงความจุและตัวดำเนินการ
o การเพิ่มความแม่นยำในการจัดการสต็อก
o การเพิ่มประโยชน์สูงสุดของพื้นที่จัดเก็บที่มีอยู่
o การลดต้นทุนแรงงาน
o ลดความเสียหายของสต็อกและต้นทุนของเสีย
o การปรับปรุงการบริการลูกค้าแบบเรียลไทม์
o การควบคุมสินค้าจากคลัง
o การป้องกันบุคลากรจากความรุนแรง
แหล่งอ้างอิง : Ahmed Farouk AbdelGawad, “Multidisciplinary Engineering for the Utilization of Traditional Automated Storage and Retrieval System (ASRS)” ,2015
• ความรู้ด้านการออกแบบโดยใช้หลักการ Autonomous Navigation
การเคลื่อนที่ของหุ่นยนต์ จำเป็นต้องเข้าใจสิ่งแวดล้อมและตำแหน่งและสภาวะของตนเอง ในสิ่งแวดล้อม นั้นๆ โดยอาศัยข้อมูลการวัดจาก Sensor ระบบนําร่องจึงจำเป็นต้องอาศัย 3 องค์ประกอบ ได้แก่ แผนที่ (Map) การระบุตำแหน่ง (Localization) การวางแผนเส้นทาง (Path Planning)
แผนที่อาจอยู่ในรูปแบบที่หลากหลาย เช่น Metric Map ซึ่งกำหนดกรอบอ้างอิง (Reference Frame) ซึ่งหุ่นยนต์ใช้ในการอ้างอิง เพื่อกำหนดตำแหน่งของตนจากกรอกอ้างอิง ดังกล่าว จากนั้นจึงสามารถคํานวณเส้นทาง (path) ซึ่งกำหนดแผนของการกระทำ (actions) เพื่อเดินทางไปยังเป้าหมาย
การระบุตำแหน่ง (Localization) คือการพิจารณาตำแหน่งปัจจุบันของหุ่นยนต์ โดยเทียบกับแผนที่
การวางแผนเส้นทาง (Path Planning) คือพิจารณาหาเส้นทาง และระบุชุดของการกระทำที่จะพาไปถึงจุดหมาย
ปลายทาง โดยอาศัยแผนที่และการระบุตำแหน่ง
แหล่งอ้างอิง : Anthony Stentz, John Bares, Thomas Pilarski, and David Stager, “The Crusher System for Autonomous Navigation”, National Robotics Engineering Center, Carnegie Mellon University.

• ความรู้ด้านการออกแบบหุ่นยนต์โดยใช้ Raspberry PI & Arduino

การออกแบบหุ่นยนต์โดยใช้ Raspberry PI มีรูปแบบตัวหุ่นยนต์ E-puck ได้รับการพัฒนาให้ใช้เป็นหุ่นยนต์เคลื่อนที่ มีอาร์เรย์ของเซ็นเซอร์และแอคทูเอเตอร์: สองสเต็ปเปอร์มอเตอร์, พรอกซิมิตี้เซนเซอร์อินฟราเรด (IR) แปดตัว, 3D มาตรความเร่ง, ไมโครโฟนสามตัว, ลำโพง, สี CMOS ,กล้อง (ความละเอียด 640×480 พิกเซล), ตัวรับสัญญาณ IR ระยะไกล, และ LED จำนวนหนึ่ง e-puck ยังมีวิทยุ Bluetooth ซึ่งช่วยให้สามารถอัปโหลดโปรแกรมควบคุมแบบไร้สายได้ไปยังหุ่นยนต์ และอำนวยความสะดวกในการดีบักผ่านการตรวจสอบระยะไกล ความสำเร็จของแพลตฟอร์มหุ่นยนต์ e-puck ส่วนหนึ่งเป็นผลมาจากความจริงที่ว่าบอร์ดส่วนขยายซึ่งเชื่อมต่อ ให้กับหุ่นยนต์ผ่านทางSocketขยาย สามารถพัฒนาโดยบุคคลที่สาม จนถึงปัจจุบัน บอร์ดขยายจำนวนมีได้รับการออกแบบรวมถึงเซ็นเซอร์พื้นดินและ LED แม้ว่าบอร์ดส่วนขยายดังกล่าวจะช่วยเพิ่มความสามารถในการตรวจจับและสั่งงานของหุ่นยนต์ แต่ e-puck พื้นฐานก็มีจำกัด
แหล่งอ้างอิง : Millard, Alan Gregory orcid.org/0000-0002-4424-5953, Joyce, Russell Andrew
orcid.org/0000-0002-6773-3837, Hilder, James Alan et al. (5 more authors) (2017) The Pi-puck extension board: a Raspberry Pi interface for the e-puck robot platform. In: IEEE/RSJ
International Conference on Intelligent Robots and Systems, 24-28 Sep 2017.
การออกแบบหุ่นยนต์โดยใช้ Arduino แอปพลิเคชัน Android เป็นกุญแจสำคัญในการควบคุมหุ่นยนต์โดยใช้ท่าทางมือ แอปพลิเคชั่นอ่านมาตรความเร่ง รับค่าสถานะและ X, Y และ Z ในแอปพลิเคชัน มีค่าเกณฑ์สองค่าที่กำหนดสำหรับแต่ละการเคลื่อนไหว อันหนึ่งคือ MAX_THRESHOLD และอีกอันคือ MIN_THRESHOLD หากค่าที่ได้รับอยู่ระหว่างสิ่งเหล่านี้เคลื่อนไหวบางอย่าง จากนั้นอักขระที่กำหนดเพื่อแสดงถึงการเคลื่อนไหวนั้นซึ่งเรียกว่า DET หรือ
ดีเทอร์มิแนนต์ถูกส่งไปยังหุ่นยนต์ผ่าน Bluetooth แอปพลิเคชันจะตรวจจับสิ่งนี้อย่างต่อเนื่องจนกว่าแอปพลิเคชันจะเปิดอยู่ ส่วนต่อประสานกราฟิกกับผู้ใช้ได้รับการออกแบบเพื่อความสะดวกสบายของผู้ใช้ แอปพลิเคชั่นสรุปการคำนวณและ ค่ามาตรความเร่ง แต่อินเทอร์เฟซผู้ใช้แสดงทิศทางการเคลื่อนไหวของมือเพื่อให้ผู้ใช้รับทราบ
แหล่งอ้างอิง : Premangshu Chanda, Pallab Kanti Mukherjee, Subrata Modak, Asoke Nath
Department of Computer Science, St. Xavier s College(Autonomous),
Kolkata, West Bengal, India , International Journal of Advanced Research in
Computer Science and Software Engineering.
• หลักการการใช้กล้องในการตรวจสอบคุณภาพสินค้า (Vision & AI)
การตรวจสอบคุณภาพสินค้าโดยวัดลักษณะของสินค้าโดยใช้กล้องในการตรวจสอบสินค้า ได้แก่ ดูลักษณะ สี ขนาด ของผลไม้เพื่อประเมินความสุกและความสมบูรณ์ของผลไม้ เช่น สีของแอปเปิ้ลที่มีความสุกคือสีแดง และขนาดที่ทางผู้พัฒนากำหนดตามมาตรฐานของสินค้าเพื่อการส่งออกให้กับผู้บริโภค
ข้อดีของการจัดการด้าน Warehouse อัตโนมัติ :
o สามารถช่วยลดเวลาการจัดเรียงสินค้าให้สามารถลำเลียงสินค้าที่ต้องการปริมาณมากได้อย่างรวดเร็วและแม่นยำ
o ลดเวลาในการส่งมอบสินค้าแก่ลูกค้า จึงช่วยลดต้นทุนค่าเสียโอกาสและยังช่วยเพิ่มความพึงพอใจให้แก่ลูกค้าอีกด้วย
o ส่งเสริมพัฒนาให้เกษตรกรไทยได้มีเทคโนโลยี AI มีผลผลิตที่สมบูรณ์ให้แก่ผู้บริโภค
o ลดการเกิดข้อผิดพลาดที่เกิดจากมนุษย์ เช่น การตรวจสอบสินค้าและการจัดเรียงสินค้าที่ผิดพลาด
o มีราคาที่เข้าถึงได้ง่าย เกษตรกรรายย่อยสามารถนำไปใช้งานได้
ข้อเสียของการจัดการด้าน Warehouse อัตโนมัติ :
o เทคโนโลยี AI อาจยังไม่เสถียรจึงอาจยังมีข้อผิดพลาดบางส่วน เช่นระบบไม่ตรงตามผู้ใช้งาน ผู้พัฒนายังคงพัฒนาระบบอย่างต่อเนื่อง
o อาจเชื่อมต่อกับระบบอื่นได้ยาก หรือจำกัดตามโปรแกรมกำหนดไว้
o ระบบมีความยึดหยุ่นน้อย การพัฒนาระบบเพิ่มเติมทำได้ยาก

ความก้าวหน้า

Part 1

Progress VDO 1

Part 2

https://youtu.be/21zkriWIbME

Part 3

https://youtu.be/21zkriWIbME

Part 4

https://youtu.be/QTj79Th8SuY

Part 5

https://youtu.be/VeejOSIgXdM

Part 6

https://youtu.be/ulOinvMm8Zg

Part 7

https://youtu.be/MyaFLG16p90

————————-

Progress Post

Meeting Robot.

ซ่อมเครื่องมือ

ประชุมหุ่นยนต์

Robot Project Discussion หลักสูตรหุ่นยนต์และระบบอัตโนมัติ

ลองสร้าง amr ไล่โปรแกรมเล่นกับนิสิต

Student Project meeting

Final Presentation

Report

SMART Agricultural Robot Contest 2021
Warehouse Management Systems (WMS)
Submitted by
Mr. Kittawat Thongpud ID: 6230302039
Mr. Khosit wongriantong ID: 6330340005
Mr. Chayakon Panyarot ID: 6330340021
Mr. Naranthikorn Namrob ID: 6230340062
Mr. Phurin Nararat ID: 6230340071
Mr. Tathipan Chaiwattanapan ID: 6230340038
Mr. Sahachai Sampaongern ID: 6330340099
Mr. Suebsakul Kamlai ID: 6230305089
Mr. Atthaphan Paksakunnee ID: 6230350483
Mr. Umar Jittawin ID: 6330340145
Miss Phatchara Kranmool ID: 6330340072
Miss Niratsanee Khonthongoe ID: 6330340048
Miss Atita Plucksasri ID: 6330340129

Advisor
Kittipong Yaovaja
Pongsakon Bamrungthai
Songchai Jitpakdeebodin

This report is part of the course 03607399
Engineering Project for Robotics and Automation System II
Bachelor of Engineering Program in Robotics
and Automation System Engineering
Kasetsart University Sriracha Campus

Abstract

From the competition of automated mobile robots for smart agriculture 2021 In
Warehouse Management Robotics Warehouse and Logistic study Warehouse Management
Systems, whether managing warehouses by calling WAREBOT robot commands to transport
goods to storage in warehouses. Maintaining quality and checking data (Quality Control) of
products resulting from agricultural products. Reviewing records and storing historical data of
transport and logistic goods in the database to promote the development of innovative
robot technology prototypes to be further developed into research funding sources for
commercialization in the future. In addition, to create inventions that use automated moving
robot technology and artificial intelligence (AI) systems to solve problems according to the
issues obtained from the agricultural sector for farmers. It can be seen that ordinary
agricultural machinery currently in use is complex or can be done but must be ordered
imported from abroad with relatively high prices in the agricultural sector at present.
Therefore, research reports to develop this study are one of the methods for solving
problems and promoting equipment for agricultural machinery in Thailand.

Contents

Abstract …………………………………………………………………………………………………………………………………………………………………………… 2
Contents …………………………………………………………………………………………………………………………………………………………………………. 3
List of Figure ……………………………………………………………………………………………………………………………………………………………………. 6
Chapter 1 ………………………………………………………………………………………………………………………………………………………………………… 9
Introduction ……………………………………………………………………………………………………………………………………………………………………. 9
Statement and Significance …………………………………………………………………………………………………………………………………….. 9
Objective …………………………………………………………………………………………………………………………………………………………………. 9
Expected benefits ………………………………………………………………………………………………………………………………………………….. 10
Related technology ……………………………………………………………………………………………………………………………………………….. 10
Knowledge of AS/RS management ……………………………………………………………………………………………………………….. 10
Design knowledge using Autonomous Navigation principles ……………………………………………………………………….. 11
Robot design knowledge using Raspberry PI & Arduino ………………………………………………………………………………………. 11
Principles of using cameras in product quality inspection (Vision & AI) ……………………………………………………… 12
Advantages of automated warehouse management: ………………………………………………………………………………….. 13
Disadvantages of Automated Warehouse Management : ……………………………………………………………………………. 13
Chapter 2 ………………………………………………………………………………………………………………………………………………………………………. 14
Theory content and documents ………………………………………………………………………………………………………………………………….. 14
Use the Algorithm for designing a hydraulic scissor lifting platform to locate …………………………………………………… 14
Use the principle of a stepper motor for torque and vibration. …………………………………………………………………. 16
Calculating motor rpm with Encoder …………………………………………………………………………………………………………………… 17
PID Control …………………………………………………………………………………………………………………………………………………………….. 17
EFFECT OF P ACTION ……………………………………………………………………………………………………………………………………… 18
EFFECT OF I ACTION ………………………………………………………………………………………………………………………………………. 18
EFFECT OF D ACTION …………………………………………………………………………………………………………………………………….. 18
Chapter 3 ………………………………………………………………………………………………………………………………………………………………………. 20
Action plan ……………………………………………………………………………………………………………………………………………………………………. 20
Manager …………………………………………………………………………………………………………………………………………………………………. 20
QC(Quality Control) ……………………………………………………………………………………………………………………………………………….. 23
Sensor …………………………………………………………………………………………………………………………………………………………….. 23
Camera system ………………………………………………………………………………………………………………………………………………. 23
Information stored in the server ……………………………………………………………………………………………………………………. 23

Information to be sent to the Manager ………………………………………………………………………………………………………… 24
Warebot …………………………………………………………………………………………………………………………………………………………………. 26
The car ……………………………………………………………………………………………………………………………………………………………. 26
Scissor lift ……………………………………………………………………………………………………………………………………………………….. 26
Vacuum …………………………………………………………………………………………………………………………………………………………… 26
Chapter 4 ………………………………………………………………………………………………………………………………………………………………………. 27
Method of operation ……………………………………………………………………………………………………………………………………………………. 27
Material and equipment ……………………………………………………………………………………………………………………………………….. 27
QC …………………………………………………………………………………………………………………………………………………………………… 27
Warebot ………………………………………………………………………………………………………………………………………………………….. 27
Methodology …………………………………………………………………………………………………………………………………………………………. 28
June 2, 2022 …………………………………………………………………………………………………………………………………………………… 28
June 3, 2022 …………………………………………………………………………………………………………………………………………………… 33
June 4, 2022 …………………………………………………………………………………………………………………………………………………… 33
June 5, 2022 …………………………………………………………………………………………………………………………………………………… 35
June 9, 2022 …………………………………………………………………………………………………………………………………………………… 38
June 10, 2022 …………………………………………………………………………………………………………………………………………………. 40
June 11, 2022 …………………………………………………………………………………………………………………………………………………. 51
June 13, 2022 …………………………………………………………………………………………………………………………………………………. 53
June 16, 2022 …………………………………………………………………………………………………………………………………………………. 54
June 18, 2022 …………………………………………………………………………………………………………………………………………………. 57
June 19, 2022 …………………………………………………………………………………………………………………………………………………. 58
Chapter 5 ………………………………………………………………………………………………………………………………………………………………………. 60
Results …………………………………………………………………………………………………………………………………………………………………………… 60
Manager …………………………………………………………………………………………………………………………………………………………………. 60
Database …………………………………………………………………………………………………………………………………………………………. 60
Navigation and map ……………………………………………………………………………………………………………………………………….. 60
QC ………………………………………………………………………………………………………………………………………………………………………….. 61
Hardware ………………………………………………………………………………………………………………………………………………………… 61
Software …………………………………………………………………………………………………………………………………………………………. 61
Warebot …………………………………………………………………………………………………………………………………………………………………. 61
Hardware ………………………………………………………………………………………………………………………………………………………… 61
Software …………………………………………………………………………………………………………………………………………………………. 62

Chapter 6 ………………………………………………………………………………………………………………………………………………………………………. 63
Conclusion and Discussion …………………………………………………………………………………………………………………………………………… 63
Manager …………………………………………………………………………………………………………………………………………………………………. 63
Mapping code ………………………………………………………………………………………………………………………………………………………… 67
QC …………………………………………………………………………………………………………………………………………………………………… 70
Generate EAN-13 Number ……………………………………………………………………………………………………………………………… 70
Generate Barcode ………………………………………………………………………………………………………………………………………….. 70
Generate QR Code …………………………………………………………………………………………………………………………………………. 70
Control Stepper Motor …………………………………………………………………………………………………………………………………… 71
Load Cell Manual Calibration ………………………………………………………………………………………………………………………… 72
Load Cell Auto Calibration …………………………………………………………………………………………………………………………….. 73
Wiring ………………………………………………………………………………………………………………………………………………………………. 74
Warebot …………………………………………………………………………………………………………………………………………………………………. 75
Car …………………………………………………………………………………………………………………………………………………………………… 75
Scissor Lift ………………………………………………………………………………………………………………………………………………………. 93
………………………………………………………………………………………………………………………………………………………………………… 93
Vacuum …………………………………………………………………………………………………………………………………………………………… 94
Group Section ……………………………………………………………………………………………………………………………………………………………….. 95
Manager …………………………………………………………………………………………………………………………………………………………………. 95
Group members Manager ………………………………………………………………………………………………………………………………. 95
QC : Camera & Conveyor ………………………………………………………………………………………………………………………………………. 95
Group members QC ……………………………………………………………………………………………………………………………………….. 95
WAREBOT ……………………………………………………………………………………………………………………………………………………………….. 96
Group members WAREBOT ……………………………………………………………………………………………………………………………. 96
Individual operation ……………………………………………………………………………………………………………………………………………………… 97
Manager …………………………………………………………………………………………………………………………………………………………………. 97
QC ………………………………………………………………………………………………………………………………………………………………………….. 98
Warebot …………………………………………………………………………………………………………………………………………………………………. 99
Reference ……………………………………………………………………………………………………………………………………………………………………. 102

List of Figure

Figure 1 Robot E-puck ………………………………………………………………………………………………………………………………………………….. 11
Figure 2 Basic design of a lifing table …………………………………………………………………………………………………………………………… 14
Figure 3 Schematic diagram of a platform with n scissors …………………………………………………………………………………………. 15
Figure 4 PID Control system …………………………………………………………………………………………………………………………………………. 18
Figure 5 PID Control Reference Variable Trend Graph ………………………………………………………………………………………………… 19
Figure 6 Project overview …………………………………………………………………………………………………………………………………………….. 20
Figure 7 Data Flow ………………………………………………………………………………………………………………………………………………………… 20
Figure 8 CAD QC (Top view) …………………………………………………………………………………………………………………………………………. 23
Figure 9 CAD QC (Auxiliary View) ………………………………………………………………………………………………………………………………….. 23
Figure 10 Flow chart QC ………………………………………………………………………………………………………………………………………………. 25
Figure 11 Overview Warebot ………………………………………………………………………………………………………………………………………… 26
Figure 12 Organize the motor driver wiring. ………………………………………………………………………………………………………………… 28
Figure 13 Organize the wiring board of the car. ………………………………………………………………………………………………………….. 28
Figure 14 Code Arduino I2C (Slave) ………………………………………………………………………………………………………………………………. 29
Figure 15 Example code Raspberry Pi I2C (Master) ……………………………………………………………………………………………………… 29
Figure 16 Communication test image with sending value 120 …………………………………………………………………………………… 30
Figure 17 IImage display filter ………………………………………………………………………………………………………………………………………. 30
Figure 18 CNC Aluminum Flat Parts …………………………………………………………………………………………………………………………….. 31
Figure 19 Assemble the Scissor Lift ……………………………………………………………………………………………………………………………… 31
Figure 20 Latest model of the car (Front View) ………………………………………………………………………………………………………….. 32
Figure 21 Latest model of the car (auxiliary view) ……………………………………………………………………………………………………… 32
Figure 22 Latest model of the car (Top View) …………………………………………………………………………………………………………….. 32
Figure 23 Handling events that occur on the line ………………………………………………………………………………………………………. 33
Figure 24 Image showing the vacuum assembly (Front View) ……………………………………………………………………………………. 36
Figure 25 Image showing the vacuum assembly (Behind View) …………………………………………………………………………………. 36
Figure 26 Image showing the vacuum assembly (Front View) ……………………………………………………………………………………. 37
Figure 27 An example of Arduino code to control the vacuum. ……………………………………………………………………………….. 37
Figure 28 Create a new workspace ……………………………………………………………………………………………………………………………… 38
Figure 29 workspace line test ………………………………………………………………………………………………………………………………………. 38
Figure 30 Parts of the vacuum that will be printed on a 3D printer. ………………………………………………………………………… 39
Figure 31 Raspberry pi code example showing Sensor Loadcell tuning via HX711 2 Wire Amplifier ………………………. 40
Figure 32 Test image …………………………………………………………………………………………………………………………………………………….. 40
Figure 33 Raspberry code showing variable tuning …………………………………………………………………………………………………….. 41
Figure 34 Raspberry pi code showing Generate product code ………………………………………………………………………………….. 42
Figure 35 Raspberry pi code showing Generate Barcode (Version 1) …………………………………………………………………………. 43
Figure 36 Details of the code obtained from the scan (result 1) ………………………………………………………………………………. 43
Figure 37 Code obtained from scanning (result 1) ……………………………………………………………………………………………………… 43
Figure 38 Raspberry pi code showing Generate Barcode (Version 2) …………………………………………………………………………. 44
Figure 39 Details of the code obtained from the scan (result 2) ………………………………………………………………………………. 44
Figure 40 QR Code (Version 2) ……………………………………………………………………………………………………………………………………… 44
Figure 41 Code obtained from scanning (result 2) ……………………………………………………………………………………………………… 45

Figure 42 Raspberry pi code showing decoding from QR code ………………………………………………………………………………….. 45
Figure 43 The image shows the decoding result from the QR code. ………………………………………………………………………… 46
Figure 44 Raspberry pi code showing decoding from QR code in real time ……………………………………………………………… 46
Figure 45 Image of the result of decoding from a QR code in real time. ………………………………………………………………….. 47
Figure 46 Raspberry pi code to control Stepper …………………………………………………………………………………………………………. 48
Figure 47 NEMA23 Stepper Motor Torque 190 N.cm. …………………………………………………………………………………………………. 48
Figure 48 DM556 microstep driver ……………………………………………………………………………………………………………………………….. 49
Figure 49 Shows the communication planning of the computer and the warebot via the OPC server. …………………. 50
Figure 50 GUI Database ………………………………………………………………………………………………………………………………………………… 51
Figure 51 Code MSSQL Python Connector ………………………………………………………………………………………………………………… 51
Figure 52 Code MSSQL GUI ………………………………………………………………………………………………………………………………………….. 51
Figure 53 Parts from Vacuum 3D Printer (1st time) …………………………………………………………………………………………………….. 52
Figure 54 Planning the rotation of the car in the map ……………………………………………………………………………………………….. 52
Figure 55 Parts from Vacuum 3D Printer (1st time) …………………………………………………………………………………………………….. 54
Figure 56 Test the strength of the scissor lift ……………………………………………………………………………………………………………… 54
Figure 57 Testing the movement of the scissor lift 1st time ……………………………………………………………………………………… 55
Figure 58 2nd scissor lift movement test ……………………………………………………………………………………………………………………. 56
Figure 59 Use billet aluminum parts instead of mc nylon parts ……………………………………………………………………………….. 57
Figure 60 3rd Scissor Lift Movement Test ……………………………………………………………………………………………………………………. 57
Figure 61The bottom part of the vacuum ………………………………………………………………………………………………………………….. 58
Figure 62 Build the shelf ………………………………………………………………………………………………………………………………………………. 59
Figure 63 Create TABLE named “client” ……………………………………………………………………………………………………………………… 63
Figure 64 Create TABLE “demand” ………………………………………………………………………………………………………………………………. 63
Figure 65 Create Table “QC_ID” ………………………………………………………………………………………………………………………………….. 64
Figure 66 Create Table “position” ……………………………………………………………………………………………………………………………… 64
Figure 67 Create Table “product” ……………………………………………………………………………………………………………………………… 65
Figure 68 Create Table the product’s ID QC ……………………………………………………………………………………………………………….. 65
Figure 69 Create table “QR_data” ………………………………………………………………………………………………………………………………. 66
Figure 70 create table “Stock” …………………………………………………………………………………………………………………………………….. 66
Figure 71 create table “Warebot_ID” ………………………………………………………………………………………………………………………….. 67
Figure 72 Mapping code Line1-44 ………………………………………………………………………………………………………………………………… 67
Figure 73 Mapping code Line46-88 ……………………………………………………………………………………………………………………………… 68
Figure 74 Mapping code Line 88-120 …………………………………………………………………………………………………………………………… 68
Figure 75 Mapping code Line123-162 ………………………………………………………………………………………………………………………….. 69
Figure 76 Mapping code Line163-169 ………………………………………………………………………………………………………………………….. 69
Figure 77 Generate EAN-13 Number ……………………………………………………………………………………………………………………………. 70
Figure 78 Generate Barcode …………………………………………………………………………………………………………………………………………. 70
Figure 79 Generate QR …………………………………………………………………………………………………………………………………………………. 70
Figure 80 Control Stepper Motor …………………………………………………………………………………………………………………………………. 71
Figure 81 Load Cell Manual Calibration ………………………………………………………………………………………………………………………. 72
Figure 82 Load Cell Auto Calibration …………………………………………………………………………………………………………………………… 73
Figure 83 Wiring Stepper Motor with Raspberry Pi ……………………………………………………………………………………………………… 74
Figure 84 Wiring Load cell with Raspberry Pi ………………………………………………………………………………………………………………. 74
Figure 85 Code Arduino working flow chart ………………………………………………………………………………………………………………… 75

Figure 86 Communication code for control warebot …………………………………………………………………………………………………. 80
Figure 87 Communication code for control motor …………………………………………………………………………………………………….. 81
Figure 88 Code for opening SERVER OPC and creating Data_tag ……………………………………………………………………………….. 82
Figure 89 Library OPC UA SERVER. ……………………………………………………………………………………………………………………………….. 83
Figure 90 Code for opening SERVER OPC and creating Data_tag line 1-5 ………………………………………………………………….. 83
Figure 91 Code for opening SERVER OPC and creating Data_tag line 6-13 ……………………………………………………………….. 83
Figure 92 Code for opening SERVER OPC and creating Data_tag line 15-18 ……………………………………………………………… 84
Figure 93 Code for opening SERVER OPC and creating Data_tag line 19-31 ……………………………………………………………… 84
Figure 94 Code for opening SERVER OPC and creating Data_tag line 34-44 ……………………………………………………………… 84
Figure 95 Code for reading data from setRPM of OPC Server and sending value to Arduino UNO with I2C ……………. 85
Figure 96 library smbus2 ……………………………………………………………………………………………………………………………………………… 86
Figure 97 Code for reading data from set RPM of OPC Server and sending value to Arduino UNO with I2C line 2-686
Figure 98 Code for reading data from set RPM of OPC Server and sending value to Arduino UNO with I2C line 8-18
……………………………………………………………………………………………………………………………………………………………………………………………………….. 86
Figure 99 Code for reading data from set RPM of OPC Server and sending value to Arduino UNO with I2C line 20-26
……………………………………………………………………………………………………………………………………………………………………………………………………….. 87
Figure 100 Code for reading data from setRPM of OPC Server and sending value to Arduino UNO with I2C line 27-
46 …………………………………………………………………………………………………………………………………………………………………………………………………… 87
Figure 101 Code used to read RPM value from Arduino via Serial. …………………………………………………………………………… 88
Figure 102 Warebot Code line 1- 34 ……………………………………………………………………………………………………………………………. 89
Figure 103 Warebot Code line 37- 66 ………………………………………………………………………………………………………………………….. 89
Figure 104 Warebot Code line 65- 106 ………………………………………………………………………………………………………………………… 90
Figure 105 Warebot Code line 105- 145 ……………………………………………………………………………………………………………………… 90
Figure 106 Warebot Code line 146 – 186 …………………………………………………………………………………………………………………….. 91
Figure 107 Warebot Code line move fuction ………………………………………………………………………………………………………………. 91
Figure 108 Wiring Driver ………………………………………………………………………………………………………………………………………………… 92
Figure 109 Wiring I2C ……………………………………………………………………………………………………………………………………………………… 92
Figure 110 Wiring IR Frontand Mid ……………………………………………………………………………………………………………………………….. 92
Figure 111 Scissor Lift summary …………………………………………………………………………………………………………………………………… 93
Figure 112 Vacuum summary ………………………………………………………………………………………………………………………………………. 94

Chapter 1
Introduction

Statement and Significance
The agricultural warehouse in Thailand still manages the goods by using humans,
such as product quality inspection. Sorting products into the warehouse or sorting products
according to the information specified by the consumer. But in some moments when human
errors occur in management, such as checking the product with mistakes. There are still
defective and spoiled products. which is a common human error, and the sorting of goods
with a human error results in Late and wrong sorting as scheduled
The introduction of modern technology into agricultural warehouse management will
be a new integrated product management technology, such as product quality inspection.
Sorting products into the warehouse as scheduled The introduction of AI technology or
robotics to replace the human labour in the warehouse management is another way to help
farmers who want to solve the problem of delays in inspections. And shipping also reduces
the cost of importing robotic machinery from abroad, including hiring human labour and
promoting the quality of warehouse management in Thailand because agriculture in
Thailand is vital to the country.
Therefore, robotic technology is another alternative to modern warehouse
management for agriculture in Thailand.

Objective

  1. To develop a prototype system for use in product quality inspection, such as
    product integrity, ripeness
  2. To develop a prototype of a warehouse management system using robots and
    artificial intelligence technology.

Expected benefits

  1. Reduce the cost of hiring and human error in warehouse management.
  2. AI technology can increase the efficiency of product inspection and accurate
    sorting.
  3. Farmers have access to technology at a low cost and reduce the cost of importing
    technology products from abroad.
  4. Encourage farmers to use more automated management systems.
  5. There has been AI technology that helps farmers have complete output.

Related technology
The Warehouse Management Systems project is designed to study the development
of management systems in the warehouse by studying theories and research related to
robot automation. The developers have used their knowledge and abilities in designing
systems to promote agriculture as follows:
Knowledge of AS/RS management
This research is related to ASRS Automated Warehouse Management System.
Automated warehouse management consists of various computerised control systems for
Automatically placing and extracting loads from a predetermined
storage location. Retrieval Systems (ASRS) are commonly used in applications where
large volumes of loads are handled. And storage space and storage density is vital due to
space constraints.
Accuracy is essential because precision-enhanced technologies can be expensive. As
well as damage to loads, ASRS can be applied to standard loads. Automated storage and
retrieval systems have been widely used in production environments since their introduction
in 1950.
Benefits of using ASRS
• Capacity and operator improvements
• Increasing stock management accuracy
• Maximizing the Use of Available Storage
• Reducing labour costs
• Reduce stock damage and waste costs

• Real-time Customer Service Improvements
• Inventory control
• Protection of personnel from violence
Reference : (AbdelGawad, Multidisciplinary Engineering for the Utilization of
Traditional Automated Storage and Retrieval System (ASRS), 2015)
Design knowledge using Autonomous Navigation principles
Robot movement. It is necessary to understand the environment and one’s position
and state. In that environment, by relying on measurement data from Sensor, the navigation
system must rely on three components, namely map (Map) and positioning. (Localization)
Path Planning.A map can be in various formats, such as a Metric Map, which defines a
Reference Frame that the robot uses to reference. To determine their location from the
above references, they can then calculate a path, which chooses the plan of actions
(actions) to travel to the target. Positioning Localization is the consideration of the robot’s
current position. compared to the map Path Planning is to consider finding a route. And
specify a series of actions that will lead to a destination. based on maps and positioning
Reference: Anthony Stentz, John Bares, Thomas Pilarski, and David Stager, “The
Crusher System for Autonomous Navigation”, National Robotics Engineering Center, Carnegie
Mellon University.

Robot design knowledge using Raspberry PI & Arduino

Robot design using Raspberry PI, based on the E-puck robot body, was developed for
use as a mobile robot. There are sensors and actuators: two stepper motors, eight infrared
(IR) proximity sensors, a 3D accelerometer, three microphones, speakers, colour CMOS,
camera (640×480 pixel resolution), an IR remote receiver, and a handful of LEDs. The e-puck
also features a Bluetooth radio, which allows wirelessly to be uploaded to the robot. And

Figure 1 Robot E-puck

facilitates debugging through remote monitoring. The success of the e-puck robotic platform
is partly because third parties can develop the expansion board, which connects to the
robot via the socket expansion. Until now, Several expansion boards have been designed,
including ground sensors and LEDs. Although such expansion boards enhance the robot’s
sensing and command capabilities, the basic e-puck is limited.
Reference: (Millard, 2017)

Robot Design Using Arduino The Android application is the key to controlling the
robot using hand gestures. Accelerometer reading application Get flags and X, Y and Z in the
application. There are two threshold values defined for each movement, one is
MAX_THRESHOLD, and the other is MIN_THRESHOLD. If the value obtained between these
moves something, Then the character given to represent that motion is known as DET or
The determinant is sent to the robot via Bluetooth. The application will continually
detect this until the application is open. The graphical user interface is designed for the
convenience of the users. Calculation summary application and Accelerometer But the user
interface shows the direction of hand movement for the user to know.
Reference: Premangshu Chanda, Pallab Kanti Mukherjee, Subrata Modak, Asoke Nath
Department of Computer Science, St. Xavier s College(Autonomous),
Kolkata, West Bengal, India , International Journal of Advanced Research in Computer
Science and Software Engineering.

Principles of using cameras in product quality inspection (Vision& AI)

Product quality inspection by measuring the product’s characteristics using a camera
to inspect the product, such as looking at the fruit’s appearance, colour, and size to assess
the fruit’s ripeness and maturity. For example, the colour of ripe apples is red. and the
extent that the developer sets according to the standards of products for export to
consumers.

Advantages of automated warehouse management:
• It can help reduce the time of sorting to convey large quantities of goods
quickly and accurately.
• Reduce delivery time to customers, Thereby reducing opportunity cost
and increasing customer satisfaction.
• Promote and develop Thai farmers with AI technology with complete
products for consumers.
• Reduce human errors such as product inspections and wrong sorting
• It has a price that is easily accessible. Small farmers can use it.
Disadvantages of Automated Warehouse Management :
• AI technology may be unstable, so there may still be some bugs. Such as
the system does not meet the user. The developer continues to develop
the plan continuously.
• May be challenging to connect to other systems or limited according to
the program set
• The system is less flexible. As a result, developing different techniques is
difficult.

Chapter 2

Theory content and documents

Use the Algorithm for designing a hydraulic scissor lifting
platform to locate

  1. Upper frame or platform
  2. Base frame
  3. Articulated fixed bearing
  4. Movable bearing side with linear or sliding guide
  5. Scissors lever mechanism
    Industrial scissor lifting tables to lift and lower objects in conveyor systems are either
    operated by personnel or automatically as series lifting equipment. Only automatically
    controlled scissor lifting tables are described in this application example. As a rule, scissor
    lifting tables are required with a constant lifting velocity. As a consequence, designs are used
    to linearize the ratio between the drive output speed and the hoisting velocity. Figure 2

Figure 2 Basic design of a lifing table

shows such a design. When lifting, the roll is guided at the white scissor arm. The lifting
velocity can be kept constant by the curved element along the track
Reference: (SINAMICS G120, SIMOGEAR, SIMATIC: Scissor lifting table, 2016)
In order to facilitate the design and optimization of lifting platforms, it is planned to
perform a calculation program based on the input data: platform dimensions (LP x lP), lifting
height (Hmin, Hmax), maximum load (Pmax).
Depending on these data, it is first and foremost to determine the size of the scissors
and their number. Once the structure of the platform has been established, one can move
on to the calculation of the joint forces and the driving forces of the hydraulic motors.
Finally the platform is designed according to the user’s requirements, applications,
dimensions, load, cost, but also the results of the calculations. Based on figure 3, a program
has been developed that allows the number of scissors to be determined, considering the
following input data

The input data for calculating the number of scissors are Platform length, (L) and
maximum height, (Hmax).

Figure 3 Schematic diagram of a platform with n scissors

The constructive data are, the minimum/ maximum (folded/open scissors) angle,
αmin; αmax [] and cotes a1, a2, h1, h2 as in the figure 3. The length of the scissors
(between the axes of the extreme bearings) is l1=LF/2 and can be calculated with the
following relation:

Reference: (Cornel Ciupan, 2019)

Use the principle of a stepper motor for torque and vibration.
First, we need to understand where the torque comes from. In simple terms, torque
can be described as the rotational force generated by the stator’s electromagnet interacting
with the rotor’s permanent magnets. While aluminum-nickel-cobalt (AlNiCo) and samarian-
cobalt (SmCo) magnets were popular in the past, most of the motors on the market today
use neodymium-iron-boron (NdFeB) magnets in the rotor to provide strong magnets and high
magnetization. Assuming that the permanent magnet remains the same, the torque is
proportional to the number of turns of the winding on the stator poles multiplied by the
input current.

T: torque
N: Number of coils
I: current

To increase the torque of the motor, Either increase the turns of the coil or increase
the input current. Now, this may sound easy. But there are two kinds of problems. First,
motor manufacturers generally have the easiest way to do this by increasing the number of
turns of the windings. But to increase the size of the motor Increasing the input current also
improves the motor’s operating temperature, which can damage the copper windings if used
for a long time.
To increase torque, some motor manufacturers have made this by using stronger
magnets. For example, add more stator teeth or a permanent magnet between the slots of
the stator teeth. But these high torque designs tend to make motors a little more expensive.
Another way to increase torque is to use bipolar stepping motors in series or parallel
instead of unipolar or bipolar with half an active winding. By doing so, the electrical

properties of the windings, such as voltage, resistance, and inductance, can change Both the
speed and torque of the motor will also change. By using the full winding of the motor’s
windings, torque can be increased by approximately 41%, a current trend favoring cost
reductions on the driver’s part and improving efficiency. This makes choosing a bipolar motor
the primary choice for most users.

This article will introduce a design to achieve high torque in different configurations
while minimizing vibration. As a result of our design and manufacturing efforts, our motor’s
maximum axial fixation torque is increased by 1.2 to 1.7 times compared to conventional
models of the same size and over previous high torque stepper motors. This page is about
20%.
Reference: (Tang, n.d.)

Calculating motor rpm with Encoder
An encoder using 400 CPR Gear ratio of motor 4000 RPM: 110 rpm When the wheel
spins one turn, the motor spins

Set the time it takes to count one time is t%
and the number of times the encoder can count is

PID Control
PID Control, or Proportional Integral Derivative Control, is a control process.
Commonly used for temperature control. It can fix the problem of causing Offset Error at
the stable state of the system. which can find the variable of PID

EFFECT OF P ACTION
It can increase the effect of P action by lowering the PB value.
• Less Offset
• There is a higher overshoot and more swing.
• The system becomes more unstable; if the PB value is reduced too much,
it will cause the system to oscillate.

EFFECT OF I ACTION
It can increase the effect of I action by lowering the TI value.
• No Offset
• There is a higher overshoot and more swing.
• The system is more unstable; if the TI is lowered too much, it will cause
the system to oscillate or be unstable.
EFFECT OF D ACTION
It can increase the effect of D action by expanding the TD value.
• There is a decrease in overshoot with a shorter oscillation period.
• The system is more stable and faster.
• In a system that is already fast will lack stability

Figure 4 PID Control system

The figure shows the working process of PID Control.
The figure shows that in PID Control when Kp is added to the system, the PV
value can reach the target SV set. But still causing OFFSET error value, therefore added part
of Ki value, thus reducing OFFSET error value, but still having problems with system
oscillation or oscillating, therefore adding Kd value to reduce where P is directly
proportional to Error, I or inertia is independent of P and D variables. Finally, D or resistance
is caused by System lag. It will be the sum of the difference in the past Error values. It will
be equal to t-1 because there will be no previous Error at the system startup.

Figure 5 PID Control Reference Variable Trend Graph

Chapter 3

Action plan

Manager

Receiving and transmitting information and knowledge related to the work

Figure 6 Project overview

Figure 7 Data Flow

Design/build DATABASE from MSSQL
The tables in the database are as follows:

  • TABLE client serves to store customer data
    TABLE client details
  • client_ID stores Client_ID information.
  • client_name store customer name
  • TABLE demand serves to store order information
    TABLE demand details
  • Order_ID stores Order_ID number information.
  • Client_ID Stores the Client_ID number.
  • Client_name stores the customer’s name.
  • Product_ID stores the Product_ID number.
  • Date_order to store the date of importing the product
  • TABLE output stores the position of the product that comes out of the QC.
    TABLE output details
  • QC_ID stores the QC_ID number data.
  • OUT_ID stores the sequence of exiting the QC part.
  • Order_ID stores the status of the goods leaving the QC part.
  • The TABLE position serves to store information about various positions
    TABLE position details
  • Warebot_ID stores Warebot_ID information.
  • Node_ID stores the location of the Node where the Warebot is.
  • TABLE product serves to store information about the product
    TABLE product details
  • Product_ID stores the Product_ID number.
  • Product_type stores the type of product information.
  • Weight – store the weight of the product
  • Exp to store product expiration date information
  • date_in to store the date of importing the product
  • product_pic stores image data of the product.
  • TABLE QC is responsible for collecting data sent from the QC part.
    TABLE QC details
  • QC_sequence stores the sequence of leaving the QC part.
  • product_ID Product_ID stores the Product_ID number.
  • QC_INdate collects the date of importing the product.
  • QC_weight to store product weight data
  • QC_status collects product quality data
  • TABLE QR_data serves to store QR code data.
    Details TABLE QR_data
  • QR_ID stores QR_ID number information.
  • Description to store details of QR code
  • TABLE stock serves to store stock information
    TABLE STOCK DETAILS
  • Product_type stores the type of product information.
  • Amount stores the number of products.
  • TABLE warebot serves to collect data of warebot
    Details of TABLE warebot
  • Warebot_ID stores the ID of the warebot.
  • Warebot status stores information about the status of the warebot.

Figure 8 CAD QC (Top view) Figure 9 CAD QC (Auxiliary View)

QC(Quality Control)
Check the product’s sorting quality by measuring the apples’ ripeness and sorting
them according to their ripeness. After that, it will be delivered to the next warebot. The
product is Apple.
Sensor
It consists of a camera or sensor to measure ripeness and product weight and detect
defects.
Camera system
The ripeness can be graded using basic knowledge of machine vision and
measurement criteria as if-else before further development to AI, ML, DL, flaw detection
(uncertain) and QR code checking.

Information stored in the server
Sample products used in the experiment
• Apples in a crate (according to ripeness)
• Defective apples (according to blame)
Criteria for Sorting
• Criteria for separating ripeness.
• Criteria for separating weight.
Methods for computation of the results of the screening
• Weight of each crate
• PASS or NOT PASS status (to call a warebot to pick up the product)

• The number of defective apples .
• The number of apples in each crate.
• The total number of apples entering the QC system.
• Diameter (Optional)
Information to be sent to the Manager
It is a product data set (retrievable from QR).
• Product QR CODE
• Date of bringing the product into the Warehouse.
• Ripeness of apples
• Size of apples
• Photos of the products.
• The weight of the measured product.
Changed from the number of apples in the crate. Instead of the weight per crate because of
the current product, Use the measured weight compared to the original weight as directed.

Figure 10 Flow chart QC

Warebot

The car
It consists of an aluminum profile frame, two wheels and two independent wheels.
The size of the car is designed to fit the weight of the cargo and transport it to the
destination quickly and successfully. In addition, it will use to follow the line and have a
Lidar as a Safety to prevent bumping into obstacles during transport.

Scissor lift
must be lightweight strong structure, and can lift packaged goods and vacuum up to
10 kg without allowing the vehicle to be loaded with too much weight.

Vacuum
must be lightweight. The product can be picked up with a vacuum pump. without
allowing the packaged product to be dropped, broken or damaged.

Figure 11 Overview Warebot

Chapter 4
Method of operation
Material and equipment
QC
• Main Conveyor
• Conveyor input crate
• Camera
• IR sensor at the apple
drop point.

• IR sensor to check the
camera.
• Crate
• Electric linear actuator
• Load cells
• Raspberry pi

Warebot
the car
• Two 12V batteries,
• Motor with Encoder
• 1 raspberry pi board
• 2 Arduino boards
• 4 free nylon wheels
• 2 large wheels

• Terminal
• Breaker
• Battery indicator
• IR sensor
• Aluminum profile
• Motor Driver

Scissor lift
• Aluminum flat
• R-1360-ZZ-NIZ
• Socket head screw
5mmx10mm
• Stainless steel sink nut
415mm

• Stainless steel socket
head nut 515mm
• Cable tie 50 cm.
• Outer locking ring
• Plastic ring M613*1.0
• Stainless steel ring 6
mm.

Figure 12 Organize the motor driver wiring.

Vacuum
• Acrylic sheet
• Aluminum profile
• Aluminum screen

• Nut tool
• Vacuum pump
• 3D printing plastic

Workspace
• PVC tube
• Wood sheet 40×60
• Black tape
Methodology
June 2, 2022
Organise the wires
Make sure the wiring layout is complete. to reduce the problem of wire tangling

Sorting by color of wires
Encoder
Green channel a
White channel b
Yellow channel z
Red + Power
Black -GND

IR sensor
Green Left
Purple Middle
Blue Right

Motor Driver
Purple Pwm1
Brown Pwm2
Red Dir1
Yellow Dir2

Operated by
Mr. Naranthikorn Namrob
Mr. Tathipan Chaiwattanapan

Figure 13 Organize the wiring board of the car.

Installing a communication system in the car (Warebot)

  1. OPC UA Server
    Create an OPC via python to set up a server to exchange data. Create an OPC via
    python to set up a server to exchange data By using the data by creating a data tag and
    extracting the data.
  2. I2C
    It is used for communication between raspberry pi and Arduino Uno to send data as an
    integer set RPM of the wheel. Arduino Uno takes the value and processes it through the
    function PID as setValue, resulting in a controlled PWM signal. Speed through Driver
    which is communication between board set raspberry pi as master Arduino as a slave by
    bit directly into it to read, so it won’t cause an error in less time and print the received value by
    setting int value to 120, then try to send address 0x8 via python The resulting value can be
    displayed in realtime. Figure 14 Code Arduino I2C (Slave)

Figure 15 Example code Raspberry Pi I2C (Master)

Problem: An error occurred in the value received from the communication. Expected
CPU-heavy periods affect the signal.
Solution: Create a filter to filter out erroneous data. by storing two historical values (2nd,
3rd value) and 1st value is the current value, where

Operated by
Mr. Kittawat Thongpud

Figure 16 Communication test image with sending value 120

Figure 17 IImage display filter

Figure 18 CNC Aluminum Flat Parts

Figure 19 Assemble the Scissor Lift

CNC scissor lift and assembly

Scissor lift that can be stretched 1.2 meters and weighs less than 1 kg.

Problem: When the scissor lift is extended to its maximum height, it wobbles easily.
Operated by
Mr. Suebsakul Kamlai

Figure 21 Latest model of the car (auxiliary view)

Draw CAD vacuum and scissor lift, and the model is still uncertain.

Figure 20 Latest model of the car (Front View)

Figure 22 Latest model of the car (Top View)

June 3, 2022
Set and test the OPC system
We try to bring the car to the entire area.

Operated by
Mr. Kittawat Thongpud

June 4, 2022
Make a plan to solve problem that car running off the line.

L C R Front Sensor

L C R Middle Sensor
Set the front sensor’s event is Tilt-left, Normal,Tilt-right.
And the middle sensor’s event is Run out from the middle, Run along the middle.

Figure 23 Handling events that occur on the line

Event

Tilt-left

Run out from the
middle

Let the car run until
you enter the event
Run along the
middle

Run along the
middle

movec() to the right

Normal

Run out from the
middle

Let the car run until
you enter the event
Run along the
middle

Run along the
middle

The car continued to
run forward.

Tilt-right

Run out from the
middle

Let the car run until
you enter the event
Run along the
middle

Run along the
middle

movec() to the left

Operated by
Mr. Kittawat Thongpud

Make a plan to solve problem that car stopping beyond the line.
Set the front sensor’s event is Found_Line (Set bool = true)
And the middle sensor’s event is Count_Line(Set Found_line = false)
The principle of counting lines

An error occurs in the Initial state
when the car starts, The sensor immediately detects the line. It should keep the last
state before it becomes the Past state, then if past state ≠ present and then set start = true
condition.
Motor control plan
Start adjusting speed when Found_Line = true. Constant(C) is the distance from the front
of the car to the center of the car.
S(t,) = 0
S(t-) = distance from center to tip of sensor

Calculated as follows

Take the calculated speed, change it to RPM and send it to the Arduino board.
Operated by
Mr. Kittawat Thongpud

If Found_Line:
If Count_Line:
count+=1

June 5, 2022
Define each Event(Warebot)
Tilt-left >> L=1 C=1 R=0 or L=1 C=0 R=0 Front sensor of car
Normal >> L=0 C=1 R=0 Front sensor of car
Tilt-right >> L=0 C=1 R=1 or L=0 C=0 R=1 Front sensor of car
Run out from the middle >> C=0 Middle Sensor of car
Run along the middle >> C=1 C=0 Middle Sensor of car
Emergency >> L=1 C=1 R=1 Front sensor of car
Stop >> L=1 C=1 R=1 C=0 Middle Sensor of car

Operated by
Mr. Kittawat Thongpud

Plan rotation(Warebot)

The condition is when the current state Sensor_Front_Center ≠ 0 then the car will stop
when Sensor_Front_Center = 0 then set Boolean start =1 only if present=1
Car status (Warebot)
normal is the state of the car is not moving
movep is the state of the car going along the line as follows:
• Go ahead
• Turn left (turn_left)
• Turn right (turn_right)

movec(bool d)
while condition:
if d ==1:
rotate CW
else:
rotate CCW

movec is the state of the car turning
emergency is the state of the vehicle stopped due to the vehicle not detecting the line.
Problem: Once the car has been tested and adjusted accordingly. Found that it can
work normally, but if the function sleep(delay) is removed, Error occurs.
Cause
• Some parts of the field lines are not straight.
• Removed the sleep(delay) function and caused the car’s sensors to run too
fast.
Operated by
Mr. Kittawat Thongpud

Assembly and control Vacuum(Warebot)
Draw CAD vacuum, cut acrylic and assemble.

Figure 24 Image showing the vacuum assembly (Front View)

Figure 25 Image showing the vacuum assembly (Behind View)

Figure 26 Image showing the vacuum assembly (Front View)

Operated by
Mr. Kittawat Thongpud
Miss Atita Plucksasri

Figure 27 An example of Arduino code to control the vacuum.

June 9, 2022

Improve the worksapce line of the car (Warebot)

Problems:
• Old tapes can reflect light.
• There is dust on the black tape.
• Tape width contributed to the error
Solution:
• From the original line size, 1.5 cm changed to 3 cm.
• Reduce the speed of each function call.
• The length of the field is from 93 cm to 140 cm.

Operated by
Mr. Naranthikorn Namrob
Mr. Tathipan Chaiwattanapan
Miss Niratsanee Khonthongoe
Mr. Sahachai Sampaongern
Mr. Khosit wongriantong

Figure 28 Create a new workspace Figure 29 workspace line test

Plan to improve vacuum(Warebot)
It will design and improve the parts attached to the vacuum motor and print them with
a 3D printer.

Operated by
Miss Atita Plucksasri

Figure 30 Parts of the vacuum that will be printed on a 3D printer.

Figure 32 Test image

June 10, 2022

Calibrate Sensor Loadcell with HX711 2 Wire Amplifier(QC)
Adjust the Sensor Loadcell Amplifier and compare the obtained values to the actual
weights. Then, the ratios between the exact weights and the resulting values are used. Library
converters used with HX711 are taken from https://github.com/bogde/.HX711, but this library
belongs to Arduino, which is not a Python language, so it must be converted to Python first.

The result of testing the Loadcell code. In this case, 90 grams of minced pork flavored
instant noodles will be used as a test.

Figure 31 Raspberry pi code example showing Sensor Loadcell tuning via HX711 2 Wire Amplifier

Initially, the program displays the Zero factor, which is unique to the sensor when there
is no object on the weigh scale.
The next step, the program will ask for the weight of the object placed on the scale, in
this case 90 grams.
Finally, the program will run to determine the calibrate factor to obtain a weight that
matches the actual weight of 90 grams.
The principle of operation is that when an object is on the scale, the zerofactor is
converted to the factor of that weight on the scale. We multiply the Calibrate Factor by that
value to get the exact value.

Operated by
Mr. Phurin Nararat

Figure 33 Raspberry code showing variable tuning

Figure 34 Raspberry pi code showing Generate product code

Camera control test with Raspberry pi(QC)
QR Code with Python

Test for generating product codes using the EAN-13 barcode number system by
The first 3 digits are the country code (for Thailand, it is 885).
The next 4 digits are the factory code.
The next 5 digits are the product code.
The last digit is the barcode verification code.
Here we use the library from barcode import EAN13 (pip install python-barcode) to
generate a product code by specifying the first 12-digit code, then using the function EAN13(12-
digit code) to return the 13-digit EAN13 code; the summary is 12. First digit to get VERIFY CODE

Generate Barcode from EAN-13 with Python

Create barcodes from EAN-13 code using the library from barcode.writer import
ImageWriter.

Result

Figure 35 Raspberry pi code showing Generate Barcode (Version 1)

Figure 36 Details of the code obtained from the scan (result 1)

Figure 37 Code obtained from scanning (result 1)

Generate QR Code from EAN-13 with Python

Generate QR Code from EAN-13 code using qrcode library (pip install qrcode).
qrcode.make(EAN-13 code)

Result

Figure 38 Raspberry pi code showing Generate Barcode (Version 2)

Figure 39 Details of the code obtained from the scan (result 2)

Figure 40 QR Code (Version 2)

Figure 41 Code obtained from scanning (result 2)

Detect and Decode QR Code with Open CV – Python

Decode from QR Code using cv2 library (pip install opencv-python) Create Object QR to
use QR.detectAndDecode(QR image), here import QR image from cv2.imread()

Figure 42 Raspberry pi code showing decoding from QR code

Result

Realtime Decode QR

Decode products in real-time using Open CV, create variable video = cv2.VideoCapture()

to import an image from the camera, then create a variable to call the QR decode function
from the image, then loop to get the image. From the camera at the current time and
immediately decrypt the product. The product code will be displayed in the image on the
screen by cv2.puttext() can exit the loop by pressing “q.”

Figure 43 The image shows the decoding result from the QR code.

Figure 44 Raspberry pi code showing decoding from QR code in real time

Result

Problem: When connecting camera part: USB to Raspberry pi 3, it freezes and restarts.
Solution: Switch to Raspberry pi 4 instead.

Problem: Still unable to use two cameras at the same time in real time.
Solution: Camera detects QR code, use it in Realtime (product camera is only used when taking
pictures (rear-QR shots)).

Problem: Unable to install OpenCV in Jetson Nano 2GB via pip install.
Operated by
Mr. Phurin Nararat

Figure 45 Image of the result of decoding from a QR code in real time.

Stepper motor control test with Raspberry pi (QC)

case, use NEMA23 Stepper Motor with the torque of 190 N.cm and DM556 micro-step driver.

Figure 46 Raspberry pi code to control Stepper

Figure 47 NEMA23 Stepper Motor Torque 190 N.cm.

In the function section, RPM(angleperstep, rpm) is used to set the rotation speed in rpm.
angleperstep is the degree per step of the motor.
Therefore, RPM is the speed we need.

For calculating the number of turns required from Angle per Step

In the line DL = RPM(1.8, 5)/(2*1000), i.e., we want the motor to spin 5 rpm while the
motor moves by 1.8 degrees, then divide by 2 to divide it in half for use when sending pulses.
High and Pulse Low, then divide by 1000 to get Milliseconds.

Operated by
Mr. Phurin Nararat

milliseconds millisecond 360
step revolution l p

Figure 48 DM556 microstep driver

Plan communication between computer and warebot via OPC server(Warebot).
Create two data tags as a Receiver and a Talker and define the events that occur as

follows:

Talker None, start, stop, data, change
Reciever Not ready, Ready, success, unsuccess, change

Start When Talker is ready, Event start If not prepared, then Event None, when Reciever
is ready, occur Event Ready, if not prepared, Event Not Ready. Success data, Event success
occurs, then talker stops and returns Event None. If data fails, event unsuccess occurs, and
Talker stops and waits to start again.

Problems : Communication is still relatively slow.
Solution: Create a data tag named “Found_Line” in Boolean value format and create a
condition like this:
If Found_Line == True:
Found_Line.set_value(False) #Keep position in the array
Operated by
Mr. Kittawat Thongpud

Event
talker/reciever

None start

Not Ready Ready

data

success

stop

None

unsuccess

stop

Figure 49 Shows the communication planning of the computer and the warebot via the OPC server.

Figure 52 Code MSSQL GUI Figure 51 Code MSSQL Python Connector

June 11, 2022
Design a GUI of Database(Manager)

Operated by
Mr. Chayakon Panyarot

Figure 50 GUI Database

Print the parts adjacent to the motor and other parts of the Vacuum(Warebot)

Operated by
Miss Phatchara Kranmool
Miss Niratsanee Khonthongoe
Miss Atita Plucksasri

Plan the rotation of the car in map(Warebot)
Determine the rotation of the car by comparing the speed of the wheels on both sides.

Figure 53 Parts from Vacuum 3D Printer (1st time)

Figure 54 Planning the rotation of the car in the map

Operated by
Mr. Kittawat Thongpud

June 13, 2022
Scissor lift progress (Warebot)
Problem: Motor doesn’t have enough scissor lift propulsion at first. Not push up, But
when using a hand to help push at the first point, it can go up at the specified moment.
Solution: I will use bearings to test first. But if this method doesn’t work will switch to a
geared motor

Figure 56 Test the strength of the scissor lift

Print the parts attached to the motor and other parts of the Vacuum (Warebot).

Operated by
Miss Phatchara Kranmool
Miss Niratsanee Khonthongoe
Miss Atita Plucksasri
Mr. Umar Jittawin
June 16, 2022
Assemble the Scissor Lift to the base of the car and test its strength (Warebot).
Connect the scissor lift base, drill perpendicular holes for the base of the car to be
attached to it, and test its strength by placing an object on top of the scissor lift.

Figure 55 Parts from Vacuum 3D Printer (1st time)

Operated by
Mr. Suebsakul Kamlai

First and second scissor lift movement test (Warebot)
1st test
Using a 24V 3A motor, try to pull in and out of the scissor lift without load.

Problem: The motor cannot be pulled at the beginning of the first 20 mm.
Solution: Switch to gear reducer motor (need to drill holes and tap new linear motors).

Problem: The scissor arm is tilted to the side because scissor arm are weak and can give.
Solution: Insert the bearings and increase the thickness of the scissor arm.

Problem: The central part of the mc nylon can’t stand the strength.
Solution: Replace mc nylon parts, use solid billet aluminum, and try brass bushing.

Figure 57 Testing the movement of the scissor lift 1st time

2nd test
Using a 24v 3a motor, try pulling it in and pushing it out. After that, lower your leg 2
steps, add weight and test your balance.

Problem: The motor cannot be pulled at the beginning of the first 20 mm.
Solution: Switch to gear reducer motor (need to drill holes and tap new linear motors).

Problem: Scissor arm are still tilted to the side. But less than the first test.
Solution: Insert the bearings and increase the thickness of the scissor arm.

Problem: The central part of the mc nylon can’t stand the strength.
Solution: Replace mc nylon parts, use solid billet aluminum, and try brass boot.

Operated by
Mr. Suebsakul Kamlai

Figure 58 2nd scissor lift movement test

Figure 60 3rd Scissor Lift Movement Test Figure 59 Use billet aluminum parts instead of mc nylon parts

June 18, 2022
3rd Scissor Lift Movement Test
3rd test
Secure the joint between the scissor arm and the rod. Replaced the mc nylon parts with
stiffer aluminum, found that the Scisssor Lift tilted less and the scissor arm and axis joints were
not as twisted as in Test 2.
Problem: The joint between the scissor arm and the axis is too small.
Solution: Change the scissor arm.

Problem: Motor torque is not enough.
Solution: Change the motor.

Operated by
Mr. Suebsakul Kamlai

Figure 61The bottom part of the vacuum

June 19, 2022
Print the bottom part of the vacuum with a 3D printer.

Problem: The bottom part obtained is a problem with the 3D printer.
Solution: Reprint the bottom of the vacuum with the 3D Printer.

Operated by
Miss Phatchara Kranmool
Miss Niratsanee Khonthongoe
Miss Atita Plucksasri
Mr. Khosit wongriantong
Mr. Chayakon Panyarot

Figure 62 Build the shelf

Build the shelf in workspace
Shelves are made up of 2 floor, each 76 cm in height, 30 cm in width and 50 cm in

length.

Operated by
Mr. Khosit wongriantong
Mr. Sahachai Sampaongern
Miss Niratsanee Khonthongoe
Miss Phatchara Kranmool

Chapter 5
Results

Manager

Database
Achievable goal
Switch from using MYSQL to Microsoft SQL, create a python library, and set up the IP
Router of the Database.
Still doing
Drawing a user GUI.

Navigation and map
Achievable goal
Use the program to create a map from the Warebot action, track the node from the
Warebot Event and draw the node from the map successfully.
Still doing
creating a path from the warebot point of origin to the target point.
The problem
The PDDL generation is still a problem with how it is built. And there is still no way to
optimize the system.
Not start
Locating the PDDL Library in python and Warebot Classification & Targeting.

QC

Hardware
Achievable goal
Procuring the Actuator, Conveyer and other equipment within the QC group
Still doing
The construction of the equipment section. The work system of the QC group
Software
Achievable goal
Draw a CAD drawing of the QC system and the crate for the goods in the solid work and
the code section. The sensor has been coded. Measure weight (Load cell), test weight and send
data to manager group, create QR code in Python, create a vision system to check product
quality, and successfully control step motor.
Still doing
Installing Bullseye software operating system on Raspberry pi and testing the Pi camera
V2 crate on Raspberry pi with jetson nano.
The problem
Installed Ubuntu 18.04 software operating system in jetson nano and found that it
cannot run.

Warebot

Hardware
The car
Achievable goal
The structure of car was built, and the wheel balance was adjusted to make the car run
more efficiently.
Not start
To Assemble all of the parts
Scissor Lift

Achievable goal
Successfully attempted to model a scissor lift using 3D printing.
Not start
Making and modifying a real scissor lift using a ball bearing, gear motor

Vacuum
Achievable goal
Successfully attempted to create a vacuum model using aluminum profiles.And fixing
the parts attached to the motor and base of the vacuum using 3D printing.

Workspace
Achievable goal
A-line width workspace line has been created to allow the car’s IR sensor to detect the
line better.
Still doing
Building a shelf

Software
Achievable goal
Coded the operation of the Warebot in Raspberry pi, such as controlling the speed, RPM
of the motor encoder, and communication data between the Raspberry Pi and the Arduino Uno
using I2C principles, creating an Event IR sensor to detect the line. It is a function that controls
the RPM value according to the Event function, and can send various values through the OPC
Server; whether it is the motor RPM value, the Warebot Event function flag is successful.
Still doing
Working code in the scissor lift and vacuum section

Chapter 6
Conclusion and Discussion

Manager

Figure 63 Create TABLE named “client”
Establish TABLE named “client” to take order to keep customer data, with the column
named “client_ID” that had a duty to maintain the client’s ID, be primary key also have
“client_name” whose kept the person’s name.

Figure 64 Create TABLE “demand”
Create TABLE “demand”, to take responsibility to keep the data about client orders. It
had five columns firstly there is “Order_ID” whose kept Order ID also be a primary key. Second,
there’s “Client_ID” that kept the ID of the client. Next, “Client_name” remain to store the

customer’s name. Then, the “Product_ID” would take place to gather the ID of the Product.
Lastly, “Date_order” collect the date data when the product arrived.

Figure 65 Create Table “QC_ID”
“output” is the table that contains the info around the out’s position of the QC device
with the primary key that collects the QC’s ID named “QC_ID”, additionally this table has the
column “OUT ID” that keeps the sequence of the product that export from the QC device and
“Order_ID” which have to remain the Order’s ID.

Figure 66 Create Table “position”

Table “position” got a bond to store the position information, “Warebot_ID” is Its
primary key, Warebot_ID keeps the ID of the warebot, and there is a column name “Node_ID”
to store the position of the node that warebot.

Create “product” to store the data about the good in the warehouse there are six
columns in themselves. The first is “Product_ID” which stores the Product’s ID. The
second is “Product_type” which keeps the type of the product. Third, “Weight” are stored as its
name. forth, “Exp” that data inside is the date that the product will spoil. Fifth, collect the date
data when the product arrived were the duty of “date_in” Lastly, the photo of the product will
store in the column “product_pic”

Table “QC” is the storage of the information bond to the QC device. With the primary
key named “QC_sequence” who is the container of the product which goes out a sequence

Figure 67 Create Table “product”

Figure 68 Create Table the product’s ID QC

From the QC module. Another one is the product ID that keeps the product’s ID in this
column and “QC_INdate” is the column that contains the date that the product arrived in the
system. The “QC_weight” is stored by the weight of the product and the “QC_status” is store
the quality data of the product.

To create table “QR_data” that had a responsibility to keep the QR code. We need to
set the primary key as the “QR_ID” who’s the container of QR’s ID and also had the columns
for the description named “Description.”

Figure 70 create table “Stock”

Figure 69 Create table “QR_data”

Figure 72 Mapping code Line1-44

Establish a TABLE named “stock” was generated to store the data about stocking stuff,
firstly “Product_type” would store the type of product and “Amount” keep the amount of
product in each lot.

“Warebot” is the table that stores the data about warebot. “Warebot_ID” contains the
ID of warebot. either “Warebot_status” stores the status of warebot.

Mapping code
Create the pygame to mapping the warebot using pygame,opcua and os libraly.this file
take data via opc server and simulate the map by the variable that it’s got then display through
pygame module.

Figure 71 create table “Warebot_ID”

Figure 73 Mapping code Line46-88

Figure 74 Mapping code Line 88-120

Figure 75 Mapping code Line123-162

Figure 76 Mapping code Line163-169

Figure 77 Generate EAN-13 Number

Figure 78 Generate Barcode

Figure 79 Generate QR

QC
Generate EAN-13 Number

Generate Barcode

Generate QR Code

Figure 80 Control Stepper Motor

Control Stepper Motor

Figure 81 Load Cell Manual Calibration

Load Cell Manual Calibration

Figure 82 Load Cell Auto Calibration

Load Cell Auto Calibration

Figure 83 Wiring Stepper Motor with Raspberry Pi

Figure 84 Wiring Load cell with Raspberry Pi

Wiring

Warebot
Car
Arduino
Code – plan

  1. Read the value from the encoder as a counter by using pin interrupt of Arduino Uno
    connected to encoder wire A and check the rotation direction with Digital read Encoder wire B.
    The direction to the front of the car is positive, and the other side is negative.
  2. Read the Set RPM that was ordered from the Raspberry pi.
  3. Read the obtained value calculated through the PID function and use it to control the
    RPM and rotation direction of the car via

1.Read Encoder

2.Read I2C

3.Calculate from
read value

Send signal to
driver
direction,PWM

Print RPM in
serial
Figure 85 Code Arduino working flow chart

Motor driver code

include

include

PID p = PID(0.8,1.25,0.1);
//0.5 0.1 0.1

define Encoder_output_A 2 // pin2 of the Arduino

define Encoder_output_B 4 // pin 3 of the Arduino

define dir1 8 // pin2 of the Arduino

define pwm1 9 // pin 3 of the Arduino

bool couter = false;
bool begining = false;
bool stopped = true;

int Count_pulses = 0;
float durantion = 0;
float rpm;
float rpm_set;
int timedelay = 10;
void setup() {

Serial.begin(115200); // activates the serial communication
pinMode(Encoder_output_A,INPUT_PULLUP); // sets the Encoder_output_A pin as the
input
pinMode(Encoder_output_B,INPUT); // sets the Encoder_output_B pin as the input
pinMode(3,INPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);

attachInterrupt(digitalPinToInterrupt(Encoder_output_A),DC_Motor_Encoder,RISING);

Wire.onReceive(receiveEvent); // register event
Wire.begin(9); // join i2c bus with address #8
delay(1000);
}

int pwmc = 0;
int readi2c = 0 ;
unsigned long Count_pwm = 0;
bool waiting = false;

int past1 = 0;
int past2 = 0;

float val = 0;
unsigned long start_pwm = 0;
unsigned long timer = 0;
void loop() {

delay(timedelay);
detachInterrupt(digitalPinToInterrupt(Encoder_output_A));

Wire.begin(9);
timer = millis();
while (!waiting)
if ((timer – millis())<= 500)
break;

waiting = false;
bool Avgfilter = abs((readi2c+past2)/2 – past1) <= 20 ;
if (Avgfilter)
val = map(readi2c, 0, 240, -120, 120);

rpm = (Count_pulses/0.242424/timedelay*0.826);

if (val >= 110)
val = 110;
else if (val <= -110)
val = -110;

if ((-5 <= val)&& (val <= 5))
val = 0;
pwmc = p.calPID(rpm,val);//Serial.println(digitalRead(3));

if (pwmc <0)
digitalWrite(7,LOW);
else
digitalWrite(7,HIGH);

//Serial.println(“Count_pulses : “+String(Count_pulses)+” || value : “+String(readi2c)+” ||
“+”RPM_SET : “+String(val)+” || “+”RPM : “+String(rpm)+” || error : “+String(p.geterror())+” || PID
: “+String(pwmc)+” || “+”P : “+String(p.getP())+” || I : “+String(p.getI())+” || “+” || D :
“+String(p.getD()));

//Serial.println(String(readi2c)+” || “+String(past1)+” || “+String(past2)+” || error : “+
((readi2c+past2)/2 – past1)+” || Bool : “+(Avgfilter)+” || filter : “+ String(val));

analogWrite(6,abs(pwmc));
Serial.println(String(rpm));
Count_pulses = 0;
past2 = past1;
past1 = readi2c;

attachInterrupt(digitalPinToInterrupt(Encoder_output_A),DC_Motor_Encoder,RISING);
}
void receiveEvent(int howMany) {

int x = Wire.read(); // receive byte as an integer
readi2c = x;
Wire.end();
waiting = true;
}

void DC_Motor_Encoder(){

if (digitalRead(Encoder_output_B)){
Count_pulses++;
}
else{
Count_pulses–;
}
}

Figure 86 Communication code for control warebot

Figure 87 Communication code for control motor

OPC Server

Code for opening SERVER OPC and creating Data_tag
File name: OPC_SERVER.py

Figure 88 Code for opening SERVER OPC and creating Data_tag

Library used to open OPC UA SERVER.
opcua Version 0.98.13 from pypi.org

Figure 89 Library OPC UA SERVER.

Note: pip3 install opcua (pip3 as it uses python3)
Line 1 : import Class Server from opcua library
Run OPC SERVER

Line 6 : Create Object from Class Server
Lint 7-8 : Read server string url from JSON File
Line 9 : Set server url

Figure 90 Code for opening SERVER OPC and creating Data_tag line 1-5

Figure 91 Code for opening SERVER OPC and creating Data_tag line 6-13

Line 13: Change Server Name
Line 15-17 : Create a node variable as an object of the node in the Class Server.
and create a data group called Parameters

Line 19 – 31 : Create Data_tag with add_variable function followed by argrument.
(Server name, Data_tag name, data type)

Line 34 – 44 : Set that each Data_tag can be changed by the Client

Figure 92 Code for opening SERVER OPC and creating Data_tag line 15-18

Figure 93 Code for opening SERVER OPC and creating Data_tag line 19-31

Figure 94 Code for opening SERVER OPC and creating Data_tag line 34-44

Code for reading data from setRPM of OPC Server and sending value to Arduino UNO with I2C

Figure 95 Code for reading data from setRPM of OPC Server and sending value to Arduino UNO with I2C

Using the library smbus2

Figure 96 library smbus2

Figure 97 Code for reading data from set RPM of OPC Server and sending value to Arduino UNO with I2C line 2-6
Line 3 : import Class Client from opcua library
Line 5 import SMBus Class from smbus2

Figure 98 Code for reading data from set RPM of OPC Server and sending value to Arduino UNO with I2C line 8-18
Line 8-9 : set the address of I2C
Line 10 : Create variable from Class SMBus(1)
Line 12-16 : Read url as String from JSON file and create Client OPC SERVER.
Line 17-18: Create a variable node specifying coordinates according to the ID of the
data_tag that you want to Subscribe.

Figure 99 Code for reading data from set RPM of OPC Server and sending value to Arduino UNO with I2C line 20-26
Line 21 – 26 : Create a function to change The range of data from -120 to 120 is 0 – 240.
(because I2C can’t transmit negative numbers)

Figure 100 Code for reading data from setRPM of OPC Server and sending value to Arduino UNO with I2C line 27-46
Line 29: p_time is a float variable used to determine The amount of time it takes to run
the loop code.
Line 33 – 46: Create a loop code with a while loop and use the try-except function to
keep the code running even if an error occurs and a KeyboardInterrupt occurs. Close the
program immediately. Inside the code, the timer is captured as a time variable, reads both left
and right RPM_set values from the OPC_Server, and sends the matter to the I2C Slave through
the specified address. the period since The timer, by default, is stored in the time variable, if
the current time is the time difference of the entire code by the variable p_time, if it is not
complete, the pass is in the loop first, if it completes and then releases it to start a new loop
code.

Code used to read RPM value from Arduino via Serial.

Figure 101 Code used to read RPM value from Arduino via Serial.

Line 1. Import Class Serial, time
Line 7 – 11 : Read OPC_Server url from JSON file and open Client Opc Server.
Line 14 : Creates the node and subcribe ID Data_tag of the RPM variable.
Line 15 – 28 : Create function main. If there is Serial USB0 open with baud rate
115200 and if Arduino is open, it will read the value that Arduino prints into Serial decode as
utf-8 and write that variable to Data_tag that has been subscribed

Figure 102 Warebot Code line 1- 34

Figure 103 Warebot Code line 37- 66

Warebot Code

Figure 104 Warebot Code line 65- 106

Figure 105 Warebot Code line 105- 145

Figure 106 Warebot Code line 146 – 186

Figure 107 Warebot Code line move fuction

Figure 108 Wiring Driver

Figure 109 Wiring I2C

Figure 110 Wiring IR Frontand Mid

Wiring

Figure 111 Scissor Lift summary

Scissor Lift
Assembly and design
The scissor lift can stretch up to 1.2 meters and weigh no more than 1 kg.

Test summary
The test showed that the 24V 3A motor used in the scissor lift movement could not
withstand a weight of 2 kg in the first 20 mm of action. But when testing for a weight of 1 kg.
An aluminum bar found The more contact area, the scissor lift tilts, but the motor requires
more torque.

Figure 112 Vacuum summary

Vacuum
Assembly and design
The vacuum has a limit switch and linear motor to control move forward and move
back of the vacuum pump. where the parts come from a 3D printer.
Currently waiting to print only one piece of Vacuum from a 3D printer to assemble is
the base part. due to a problem with a 3D printer.

Group Section

Manager

• Base on Computer
• Stock database
• Send and receive information
• Map and location of the warebot.

Group members Manager

  1. Mr.Kittawat Thongpud
  2. Mr.Chayakon Panyarot
  3. Mr.Sahachai sampaongern
    QC : Camera & Conveyor
    Sort products and check their quality by using the criteria for separating
    (Choose Apple)
    • Product size
    • Color (ripeness)

Group members QC

  1. Mr. Phurin Nararat
  2. Mr. Atthaphan Paksakunnee

WAREBOT

• Hardware & Software design of robots.
• Pick up and deliver goods to the warehouse.
• Product weight ( > 500 g)
• Receive information from the Manager.
• Robot forklift
Group members WAREBOT

  1. Mr. Suebsakul Kamlai 
  2. Mr. Naranthikorn Namrob 
  3. Mr. Tathipan Chaiwattanapan 
  4. Miss Phatchara Kranmool  
  5. Miss Niratsanee Khonthongoe
  6. Mr. Umar Jittawin
  7. Mr. Khosit Wongriantong
  8. Miss Atita Plucksasri

Individual operation

Manager

  1. Mr.Kittawat Thongpud
    • Design a communication system between Raspberry Pi and Arduino.
    • OPC Server system design
    • Calculate the equation to find RPM.
    • Write PID Library Arduino to control the RPM of the car.
    • Improve communication between Raspberry Pi and Arduino with filters.
    • Try Microsoft SQL Server.
    • Try RPlidar
    • Trial MPU-9250
    • Trial ROS1 and ROS2
    • Test programs on Raspberry pi such as bullseyes ubuntu and Jetson nano.
    • Write a Warebot driver.
    • Simulate the movement of Warebot on the map.
    • Calculate warebot motion simulation equations.
  2. Mr. Chayakon Panyarot
    • Learn how to use MySQL to design and build DATABASE structures with
    the MYSQL workbench.
    • Design/create DATABASE from MSSQL.
    • Design/create a PYTHON LIBRARY responsible for retrieving data from a
    database for use.
    • Design/create GUI pages for users to facilitate adding/deleting/editing
    databases.
    • Software vacuum
  3. Mr. Sahachai Sampaongern
    • Learn how to use MySQL to design and build DATABASE structures with
    the MYSQL workbench.
    • CAD drawing of shelf
    • Make a workspace of the car.

QC

  1. Mr. Phurin Nararat
    • QC system design
    • Choose a conveys to make it easier to line up the apples.
    • Design a Vision system to measure the ripeness of apples.
    • Design output Qc
    • Reduce the measure of ripeness. to reduce the scale of work
    • Design weighing systems.
    • Specify the required information in the product code.
    • Coding overview qc
    • Control step motor via Raspberry pi.
  2. Mr. Atthaphan Paksakunnee
    • CAD drawing for QC
    • Apple crate design.
    • Select the type of actuator.
    • Select the type of converter.
    • Try using Raspberry Pi Camera with Jetson Nano to detect QR Code.
    • Choose/design the crate scales.
    • Camera system design in QC
    • Material selection in QC
    • Try using OpenCV with a Raspberry Pi Camera.

Warebot

  1. Mr. Suebsakul Kamlai 
    • Select the material, equipment of the car and scissor lift.
    • Balancing wheels and motors.
    • Drilling of car parts.
    • Assemble and design the structure of the car.
    • Draw CAD Scissor lift
    • Test the operation of the vacuum linear motor (old type).
    • Assemble the structure of the scissor lift.
    • CNC parts of Scissor lift
    • Test the linear operation of the scissor lift.
  2. Mr. Naranthikorn Namrob 
    • Test Raspberry pi Input/Output control.
    • Test Raspberry pi Camera control raspberry pi camera v2 module
    • Test the Raspberry pi control line tracking car kit.
    • Test the Raspberry pi. Control the motor speed with PWM.
    • Test the operation of the vacuum linear motor (old version).
    • Record results each day.
    • Make a report
    • Make a workspace of the car.
  3. Mr. Tathipan Chaiwattanapan
    • Find the materials and equipment for the car.
    • CAD drawing of the car
    • Edit the video of the project.
    • Test the car’s software operation.
    • Assemble the car and install the IR sensor.
    • Accounting for income expenses of the project.

• Make an assembly, an overview of all works.
• Make a field of the car.

  1. Miss Phatchara Kranmool
    • Draw CAD scissor lift
    • Demo scissor lift parts design
    • Design and simulation of scissor lift
    • Find a supplier for the scissor lift components.
    • Design and test vacuum software.
    • 3D print the parts of the vacuum.
    • Make a field of the car.
    • Vacuum
  2. Miss Niratsanee Khonthongoe
    • Create a project planning schedule.
    • Design the structure of
    • Draw CAD scissor lift
    • Demo scissor lift parts design
    • Design and simulation of scissor lift
    • Find a supplier for the scissor lift components.
    • Design and test vacuum software.
    • 3D print the parts of the vacuum.
  3. Mr. Umar Jittawin
    • CAD drawing of the vacuum’s workpiece.
    • 3D print the parts of the vacuum.
    • Assemble the parts of the Vacuum.
  4. Mr. Khosit Wongriantong
    • Test the Raspberry pi control line tracking car kit.
    • Test Raspberry pi motor speed control.
    • Assemble shelf.
    • Make a workspace of the car.
  5. Miss Atita Plucksasri
    • Draw CAD Vacuum
    • Assemble the vacuum
    • 3D print the parts of the vacuum.
    • Test the operation of the vacuum linear motor (old type).
    • Software vacuum

Reference

Ahmed Farouk AbdelGawad. (2015). Multidisciplinary Engineering for the Utilization of
Traditional Automated Storage and Retrieval System (ASRS).
Alan Gregory,Joyce, Russell Andrew,Hilder, James Alan Millard. (2017). The Pi-puck
extension board: a Raspberry Pi interface for the e-puck robot platform. International
Conference on Intelligent Robots and Systems.
Pallab Kanti Mukherjee, Subrata Modak, Asoke Nath Premangshu Chanda. (ม.ป.ป.).
International Journal of Advanced Research in Computer Science and Software Engineering.
West Bengal, India: Department of Computer Science, St. Xavier s College(Autonomous).
John Bares, Thomas Pilarski, and David Stager Anthony Stentz. (ม.ป.ป.). The Crusher
System for Autonomous Navigation. Carnegie Mellon University.
SINAMICS G120, SIMOGEAR, SIMATIC: Scissor lifting table. (16 11 2016). from SIEMENS:
https://cache.industry.siemens.com/dl/files/756/109482756/att_898506/v1/109482756_Scher
enhubtische_Internet_V1.0_EN.pdf
from orientalmotor: https://www.orientalmotor.co.th/om/technical/stepper-
motors/stepper-motor-improving-motor-design-for-torque-vibration.html
Emilia Ciupan, and Emanuela Cornel Ciupan. (2019). Algorithm for designing a
hydraulic scissor lifting platform. from MATEC Web of Conferences 299,: https://www.matec-
conferences.org/articles/matecconf/pdf/2019/48/matecconf_mtem2019_03012.pdf

Other Information

https://www.moisttech.com/products/

ต้นแบบหุ่นยนต์

6 warehouse robots that are reshaping the industry – YouTube
https://www.moisttech.com/products/

Related Posts

Create Account



Log In Your Account