GRADUATION THESIS MECHATRONICS ENGINEERING TECHNOLOGYDESIGN AND IMPLEMENT A LEPIRONIA ARTICULATA CORE EXTRACTION MACHINE WITH AN IOT CONTROLLER, MONITOR AND CONTROL BY SMARTPHONE, COU
INTRODUCTION
The importance of the topic
Currently, global warming is a pressing issue that has been a topic of concern for experts and people worldwide Many methods have been proposed to mitigate global warming, such as energy conservation, plastic waste reduction, and more Among these, using natural materials to replace single-use plastic items is gaining popularity However, the cost of such eco-friendly products is often higher due to less developed automation systems for their production Consequently, the production process becomes more expensive, leading to higher product costs
In the realm of plastic products, straws are widely used in our daily lives Therefore, replacing plastic straws with those made from natural materials is a significant step toward combating global warming In Vietnam, various types of natural-material straws are available on the market, including rice straws, bamboo straws, paper straws, and Lepironia articulata straws For grey sedge grass straws, the inner core of the grass needs to be hollowed out to create a functional straw However, the current process of manually extracting the grey sedge grass core is still very common To address this, I propose designing an automated machine for grey sedge grass core extraction, reducing production costs, and integrating IoT capabilities for better production process control and monitoring
Research objective
The research objective is to design and construct Lepironia articulata core extraction machine with an IoT control system The machine will allow monitoring and control of its operations via a smartphone, as well as counting the number of completed straws.
Research targets and study scope
- Research the dimensions of the grass before it is fed into the core extraction process, and then design the mechanical structure of the machine
- Design the IoT circuit for controlling the machine
- Develop a mobile app to remotely monitor and control the machine’s operations
- Get rid of all the grass nodes Straws that 90% of nodes are clean can be considered as clean
Due to time constraints, the scope of the topic will be limited as follows:
- The electrical system is roughly installed and does not comply with standards
- Regarding WiFi communication, I utilize the APIs provided by the ESP32 rather than delving deeply into signal transmission
- Use Google Firebase instead of creating my and database.
Approach and Research Methodology
- Approaching the production process of straws
- Approaching available machines and referencing the mechanism
- Approaching experimentally to ensure the feasibility of the mechanism
- Approaching software that supports mechanical design and circuit design
- Approaching IoT theories and applications using ESP32 and programming languages for mobile applications
The project synthesizes the following research methods:
- The observation method is used to study the core extraction process and seek ideas for the machine mechanism
- The experimental method is used to verify the core extraction method and the operational capability of the mechanical mechanism
- Classification method is used to categorize the grass input based on size, thereby analyzing the machine's performance on each different size
- Analytical and synthetic methods are used to analyze and evaluate system failure cases to propose future improvements.
Research content
- Studying the production process of grey sedge grass Investigating the manual method of core extraction
- Designing and machining a mechanical device for vetiver grass core extraction
- Design and implement an IoT circuit for machine control
- Embedded programming for the IoT circuit controlling the machine
- Develop a smartphone app to control and monitor the machine via the smartphone
Report structure
Chapter 7: Conclusion and future development direction
RESEARCH OVERVIEW
Introduction to Lepironia articulata
The reason of choosing Lepironia articulata
- Since the project aims to reduce the cost of the production process, we are only concerned with the types of grass that have been used to make straws Currently, the two most popular types of grass used as an alternative to plastic straws are grey sedge (Lepironia articulata) and reed grass (Phragmites australis) Both types of grass are used because they are environmentally friendly and readily available However, reed grass is thicker and larger than grey sedge, making its production process easier, especially the step of extracting the core, since reed grass used for straws typically has fewer nodes and more tools available to assist, unlike grey sedge, which is still often manually cored in many places For this reason, I have chosen grey sedge as the focus of my study
- Lepironia articulata belongs to the genus Lepironia in the Cyperaceae family
- This plant species is commonly found in the Mekong Delta region
- Additionally, in Central Vietnam, particularly in Phong Dien District, Thua Thien Hue Province, this grass species is also found with distinct characteristics of the Hue region
Applications of grey sedge grass
- Sedge grass is used as a material to create everyday household items similar to bamboo Typical items made from it include mats, hats, bags, etc
- Sedge grass is also commonly used for interior decoration items
- In addition, the grass is also used in the fashion industry Nowadays, artisans have developed various high-end designs of handbags, hats, caps, and other accessories using grey sedge grass, catering to current trends and aesthetic preferences They often incorporate engraved patterns and additional embellishments, making these fashion items made from grey sedge grass appealing to many people
- Regarding its application as a substitute material for single-use plastic products, although people in regions with grey sedge grass have long known about its use for
5 straws, it's only in recent years that grey sedge grass straws have become popular and commercialized [2]
The process of producing Lepironia articulata straws
- "Sedge grass straws sold on the market are typically 15-20cm long with diameters ranging from 4-7mm The production process of grey sedge grass straws involves 8 steps:"
- Select mature plants: grey sedge grass grows year-round regardless of rainy or sunny seasons, leading many households to cultivate it in large quantities The optimal age for harvesting is around two years after planting, making it suitable for straw production
- Cutting the grass to the required length: grey sedge grass straw lengths typically range from 15-20cm However, customers can place orders for specific dimensions if desired Nowadays, various cutting methods are employed by manufacturing facilities, including saws, laser cutting machines, etc In this project, I am designing a machine to core grey sedge grass with a length of 20cm, which is common for this type of product, and diameters ranging from 5-7mm The diameter specifications will be further explained in the mechanical design section of the project
- Thorough cleaning from the inside out involves two small steps: coring and multiple rinsing steps
- Expose to sunlight for 2 to 3 days to increase the hardness of the straws
- Put into a drying oven; after this step, the grass color will change from green to light yellow, which helps increase preservation and usage time Afterward, it is irradiated with UV rays once more to deactivate or sterilize microorganisms
- Finally, there are two steps: inspection and packaging [3]
The project focuses on the core extraction of the grass in this step.
Lepironia articulata Core Extraction Machines in the Market
Currently, this type of product is not available on the market However, a group of students from Ho Chi Minh City University of Technology and Education sponsored by YUWA Vietnam and ZEDER Vietnam have designed and developed this machine
Figure 2.1 The grey sedge core extraction machine developed by the student team
Currently, the machine has been put into operation for core extraction processes It has effectively extracted grey sedge cores, addressing and resolving production needs at the company However, there is potential for improvement by enhancing monitoring and control capabilities for business owners, especially in the Industrial Revolution 4.0 era with the rapid development of IoT (Internet of Things) technology
THEORETICAL FOUNDATION
Belt drive
Definition: belt drive is a type of transmission that uses friction force to transfer motion between two or more shafts
+Safe for the motor when an overload occurs
+Belts can slip under high loads or if not properly tensioned, reduce efficiency and accuracy in transmission
+Limited Power Transmission: Compared to chain drives or gear drives, belts may have limitations in transmitting very high torque or power
+Wear and Stretch: Belts can wear out over time and may stretch, requiring periodic adjustment or replacement
+Environmental Sensitivity: Belts can be affected by environmental conditions such as temperature, humidity, and exposure to chemicals, which can degrade their performance and lifespan
+Maintenance Requirements: Although generally low maintenance, belts still require periodic inspection, tension adjustment, and replacement, which can incur downtime and costs
Some formulas that are used in the project related to belt drive:
Introduction to step motor and control algorithm
-Definition: Stepper motor is a discrete mechanical rotation motor, meaning that its shaft rotates at a fixed angle in an amount of time Its special motion causes its internal configuration and working principle
+ Holding torque: hold the position when there is power supplied but not moving
+ High precision, open-loop control: with discrete mechanical rotation, the user can make sure that the error is lower than one step With that, the user can control the angle just by controlling the number of pulses
+ Power consumption: always consume energy and cause heat if there is power provided + Low reliability: due to open-loop control, the errors in a working process like losing steps cannot be recognized
+ Noisy work, rated speed low, high time response
The operation of a Variable Reluctance Stepper Motor is predicated on the magnetic flux lines seeking the path of least reluctance Since there is a tooth on the roto that is closer in the gap to coils in some positions of the roto, and because the roto’s reluctance is much lower than the air The motor’s stator and rotor should be arranged to minimize magnetic
9 reluctance, which means the tooth of the roto is as close to the nearest coil as possible In conclusion, the motor rotation is based on the switching coils’ order There are two types of variable reluctance including single-stack variable reluctance motor and multi-stack reluctance motor.[4]
Figure 3.2 Variable reluctance stepper motor
With 𝑁 𝑅 number of teeth, poles of rotor
𝑁 𝑆 number of phases/coils of stator
Figure 3.3 Permanent magnet stepper motor
In this type of motor, the rotor is a permanent magnet with many pairs of poles on it When the coils are energized, they create a magnetic field that attracts the nearest opposite pole of the rotor, causing the rotor to rotate and be held at that position So, like the variable reluctance stepper, the order of energized coils decides the rotation direction of the motor
Unlike variable reluctance, the permanent magnet can be switched in the direction of current through the coil Furthermore, I can energize one coil or two coils at the same time, which causes more torque for the motor The formula to calculate the step of the motor is the same as the formula in the variable reluctance type
Control with one coil is called unipolar and with two coils is called bipolar When controlling with bipolar, I can use the PWM pulse to adjust the voltage through a coil to minimize the step size of the motor
In a hybrid stepper motor, the rotor has both a magnetic polarity and a toothed structure, which decreases step size (by increase 𝑁 𝑆 ) and increase momentum
Holding torque: load ability, used to choose motor when calculating
Pull-in torque: describe the pulses corresponding to the torque output to start the stepper motor without losing steps
Pull-out torque: describe to pulse corresponding to the torque output when the speed is already stable without losing steps
Detent: torque when the stepper hasn’t energized
The first two in these torque types are more popular in practice use than the others since the pull-out and pull-in speeds are not too much different
To run the stepper at high speed, it is necessary to accelerate and decelerate the motor to avoid losing step and vibration There are 3 ways to accelerate and decelerate a stepper motor
-Stepped acceleration/ deceleration: Increase/ decrease step size after an interval of time
-Linear acceleration/ deceleration: increase/decrease linearly the step size after every pulse This method is smoother than the method 1
-S-curve acceleration/ deceleration: to decrease the step change in the start and end, increase the step change in the middle of the accelerate/ decelerate period This method is good for vibration suppression
These three methods are referenced from the document [5]
Internet of Things
“The Internet of Things (IoT) refers to a network of physical devices, vehicles, appliances, and other physical objects that are embedded with sensors, software, and network connectivity, allowing them to collect and share data.” [6]
There are 4 main components in an IOT system:
- Sensors and actuators: sensors are the main source of data in most of IoT system to measure needed information such as light, heat, PH, and objects, …Along with that, actuators execute tasks given based on collected data
- Connectivity: After the previous step, data now should be transmitted to other data storages to be analyzed To do this, I need connectivity To transmit data through devices, I need a general standard for every system and protocol like WIFI, Bluetooth, …
- Data processing: the collected data is considered raw data, which is usually not useful at first A processing stage should take place to turn these data into helpful data
- User interface: To interact with IoT systems, humans need a user interface
Some important concepts about transmitting data in an IoT system
TCP/IP: Commonly abbreviated as TCP/IP, it refers to the Transmission Control
Protocol/Internet Protocol, a suite of communication protocols responsible for managing and transmitting data across the Internet This robust network protocol system facilitates effective connectivity and information exchange among various devices on the Internet
Regarding operational mechanisms, the TCP/IP architecture includes two key protocols: TCP (Transmission Control Protocol) and IP (Internet Protocol)
TCP oversees the identification of applications and the creation of communication pathways, managing the data as it is sent to guarantee its precision
IP, on the other hand, ensures that the data is directed to the appropriate destination, handling address management and the routing of information
To deeply understand, let's dive into the TCP/IP model Similar to the OSI model, the TCP/IP model architecture is a reference blueprint for computer network design, deployment, and administration It consists of a hierarchy of network protocols divided into layers, where each layer is tasked with distinct functions for handling and conveying data through the network The OSI model has 7 layers when the number is 4 for the TCP/IP model including the physical layer, internet layer, transport layer, and application layer
- Physical layer: The purpose of the physical layer is to facilitate data transfer among devices within a shared Internet network Before routing and dispatching to the intended address, the data is encapsulated into frames In this layer, the data is sent as frames and the typical protocols are Ethernet, WIFI, Token Ring, …
- Internet layer: The network layer is tasked with the logical delivery of data, dividing it into segments and encapsulating these segments The packets of
13 information are created in an optimal size to streamline transportation Protocols like
IP, ICMP, and ARP are employed at this layer Data at this layer form as IP datagram
- Transport layer: The transport layer manages server-to-server communication challenges Here, data is segmented into parts of unequal sizes It encompasses protocols like TCP, which secures data integrity, and UDP, known for its speedier data delivery albeit with less reliability in terms of quality
- Application layer: The application layer is responsible for the data exchange between devices It utilizes tools like web browsers and email, along with protocols such as SMTP, SSH, and FT, to facilitate the byte-by-byte data transfer, guiding the packets accurately and securing successful information transmission [7]
Figure 3.7 OSI model and TCP/IP model
URL (Uniform resource location) is an address to a specific website or document on the internet
Scheme: define the protocol used such as HTTP, HTTPS, FTP, Mailto, …
Authority: where the site is, to whom it belongs, www.example.com is a domain that in some cases can be replaced by an IP address and 443 is the port default used for the HTTPS method, and 80 is for HTTP In most cases, the port number doesn’t show up because it uses the default port number corresponding to the protocol
Path: the direction leads to the specific document on the domain
Parameter: or query string are not a necessary part of a URL, they give data through key and value
Archon: an optional component which job is to bring the user to a specific section of the web page
HTTP protocol: belongs to the application layer of the TCP/IP model, HTTP stands as a prevalent protocol in current use, mainly utilized for the exchange of information among websites, web clients, and web servers The content often comprises image files and HTML files Nonetheless, the transmission of data via HTTP lacks security measures
HTTP request: An HTTP request serves as the means for internet communication platforms, such as web browsers, to request the data required to render a website
Each HTTP request sent over the internet includes a series of encoded data that encompasses diverse types of information
Method URL HTTP-version: contains the HTTP method (GET, POST, PUT, DELETE, …), the URL is the path to the resource being requested and the HTTP version is the version of HTTP protocol (1.0,1.1,2,3)
General header: is used for both the request and response to indicate the general information Request header: store information about the client like identity or specific document formats it wants to receive from the server
Entity header: store information about the entity like length, type, encoding schemes, …
Entity body: carries some data sent to the server and some additional components (for special HTTP method)
The first line describes the HTTP version, a status code, and a human-readable description of the status code Status codes have 5 blocks:
Response header: indicates the configuration of the server (methods that are supported, request authorization, or tell the client to try again)
Client method: commands or requests the client gives to the server
-GET: take the information from the server
-HEAD: take some information about the document but not the document itself
-POST: provide some information to the server
-PUT: provide a new or replacement document to be stored on the server
-DELETE: remove some documents from the server
HTTP request, response structure, and client method are referenced in [8]
Overview React Native
React native can be understood to be a mobile app development framework using JavaScript and JavaScript XML (JSX) languages that can program for both IOS and Android operating systems This means that the IOS and Android now can share the same codebase and can still be modified to suit their operating system This type of development is called cross- platform development
Working mechanism: let’s think that there are native components that belong to a specific platform and JavaScript components which is a different language with native components React native is now using a so-called “bridge” to form a bidirectional communication between those two languages [9]
Figure 3.12 Visualize how React Native works
Framework for react native app development
There are a lot of frameworks that support developers with react native projects But the two most popular are Expo and React Native CLI
Expo: is a strong platform that makes development easier by handling all the complicated jobs, and helps developers to quickly build their apps without diving into the underlying configuration Moreover, expos have a wide range of features that provide convenient usage for developers like:
• Expo Go: a mobile app that helps us to see the app I are coding work on a real device
A good tool to debug since the code behaviors are updated in real-time on your device
• Expo SKD: a wide range of pre-built libraries and APIs easier the development process
• Over-the-air update: updates the app without reinstalling for the new version
• Simplified build process: packaging for iOS and Android by automating build tool and dependency configurations, requiring only a few commands
• Access to Pre-built Libraries: Expo offers a selection of ready-to-use components and modules for various app functions, including UI, data storage, and authentication
Although there are a lot of strong features with the undeniable benefit it brings, Expo has some downsides:
• Limited Native Modules: Expo limits the use of some native modules, potentially restricting certain third-party integrations or advanced device functionalities
• Less Control over the Build: expo offers less build customization than React Native CLI, which can make it harder to tailor app performance and features to precise needs
• Size and Performance: expo apps often have bigger bundles, resulting in increased download and load times, particularly for those on slow internet
• Issues during Development: developers have faced problems using the Expo, although the Expo team is diligently fixing these issues
React native CLI: a traditional tool for making React Native apps, offers commands for project creation, running simulations, bundling code, and other development tasks
The only disadvantage of React Native CLI is it is hard to approach, especially for beginners Meanwhile, the benefits are incredibly large such as full native module support, and complete control over the build configuration, which match perfectly with the React Native ecosystem [10]
Overview of Google Firebase
Definition: firebase is Google’s client-side app development platform It is based on
Google Cloud, and Firebase integrates with several other Google tools such as Analytics and Ads And, as it’s built on Google infrastructure, it is designed to scale Firebase supports a lot of different client app platforms
There are a lot of products that help with different aspects of an app such as Authentication, Real-time Database, Storage, and App Check, …
Authentication, Real-time Database, and Firestore Database are the three functions that are used in this project
Authentication: This product provides identity as a service, is ready to use out of the box, and gives some advanced functionalities like email verification and account linking Firebase also works with many third-party identity providers including Google, Facebook, Twitter, … in case users don’t want to create a new account When logging in with those services, the user will receive a user ID and a signed web token consistently representing the user
Firestore Database: A NoSQL database to store data like strings, numbers, etc, used for structured data that might change often
Realtime Database: is similar to FireStore Database, except it is fast at writing data while cloud Firestore is fast at reading data
PLANS AND SOLUTIONS
Core extraction method
In practice, there are two popular methods to remove the grey sedge grass core
- Method 1: Use a small metal rod with a rough textured head to frictionally move back and forth inside the inner wall of the grass straw During this process, the worker rotates the straw to ensure uniform friction along the entire inner surface Specific steps include: inserting the rod into the straw, pressing it to one side, and pulling and pushing the metal rod while rotating the straw to ensure even friction
- Method 2: Use a small metal rod with evenly distributed plastic bristles, similar to those on a brush, attached to its surface Continuously push and pull the rod in and out of the grass straw, where the plastic bristles act as brushes to remove the core of the grass Specific steps include: inserting the rod into the straw and continuously pushing and pulling the metal rod
→I choose the second core extraction method because it is simpler in terms of the process, which leads to a simpler mechanism However, inserting the metal rod into the grass straw will differ slightly from manual handling
The dimension of the workpiece:
The blank used in processing is grey sedge grass that has been uniformly cut to 20cm in length, with any deformed or cracked stems removed during selection After this sorting process, the grass measures 20cm in length with an outer diameter ranging from 4-7mm However, for the core extraction process, the metal rod needs to have a diameter smaller than the inner diameter of the grass In the chosen method, the rod diameter is 3mm, combined with plastic bristles that may slightly exceed 3mm Considering the grass with a minimum diameter of 4mm and approximately 0.5mm thickness, the inner diameter of the grass can be reduced to approximately 3mm As the metal rod enters, it may cause cracking or even splitting of the grass, thus limiting the acceptable diameter range of the grass to 5-7mm
Mechanical solution
The metal rod has two ends, one end attached to a motor To facilitate the insertion of the grass straw into the core, I need to center the tail end of the metal rod using a sliding bearing, and the rod will slide within the bearing during operation Therefore, the plastic
20 bristles cannot distribute evenly along the entire length of the rod as in reality, but only at the tail end of the rod Thus, the vertical brushing method was ineffective, so I switched to horizontal brushing by continuously rotating and reversing the rods using a motor
In addition, to transmit motion through the 5 metal rods, a belt drive system is employed To reduce costs, a GT2 timing belt with a length of 110mm and shafts using a 1:1 transmission ratio with GT2 pulleys having 20 teeth are utilized Therefore, the spacing between the shafts is predetermined, and the distance between two grass straws (blanks) on the blank holder depends on the aforementioned available dimensions.
Electronic and electrical equipment
Several actuators could be considered for use in the system, including:
- DC motors are known for their fast speed, making them suitable for applications requiring high and continuous speed However, they can be challenging to control precisely and struggle with maintaining holding torque when at a standstill
- Servo motors offer high torque, speed, and precise angular control within defined limits, but they tend to be more expensive compared to other types of motors
- Stepper motors are known for their precision, ease of control, and relatively low cost, but they typically operate at lower speeds compared to other motor types
- Pneumatic cylinders: They provide high thrust force and fast speeds They can be challenging to control because common types typically have only two states: compressed and extended
→For the blank holder assembly requiring high precision and low-speed rotation, stepper motors are suitable
→ For the core extraction unit, precise positional control is needed for the movement, so a lead screw and nut transmission system is used to achieve linear motion with a stepper motor instead of using pneumatic cylinders The lead screw and nut system, equipped with sensors at both ends of the travel range, does not require extremely high precision but demands positional control Therefore, a stepper motor or a DC motor with an encoder can be used In this project, I am using a stepper motor
→For the lead screw and nut assembly used to secure the grass blanks, similarly, a stepper motor is chosen for its ability to provide precise control over positioning
→For the rotary drive assembly for the 5 metal rods, where continuous speed is needed and positional accuracy is not critical, a DC motor is suitable
→Similarly, for the motor driving the vibratory feeder hopper for supplying the blanks, a
- Limit switches such as roller lever type, push button type, or lever type are widely used in the industry due to their low cost, ease of use, and reasonable accuracy However, physical contact in limit switches often leads to issues such as wear at the contact point Additionally, if there are errors during motion, it can cause misalignment or damage to the limit switch
- The U-shaped optical sensor has several advantages: it operates without physical contact, has a long lifespan, minimal wear, stability, high accuracy, and quick response time
→Therefore, all the limit switches in the system are U-shaped optical sensors.
Smartphone application
To program an App using React Native, since I am new to this field and the time for this project is limited, moreover, the application of the project does not require a special function that the expo framework does not support, so I choose using Expo which is friendly for the beginner
Here is a basic visualization of how esp32 and a mobile app connect
Figure 4.1 Dataflow of the system
For Firebase, to store productivity from esp32 and commands from the mobile app, I use the real-time database product of Firebase, because project data is simple, with no need for deeply nested structure, and the real-time database is very efficient for simple structure data.
Control program
- There needs to be a screen for users to log in or register an account, with direct input into the database
- There should be a screen used to display control functions
- A page is needed to view the current number of machines running during the day and to see the history of other days
- Use authentication for registration and store user accounts
- Use a real-time database to store machine commands and productivity
- The control section will include machine status, remote control permissions via the internet, whether there is an active control command and other indicators of the stepper motors Everything will be kept in a flat structure because deeper nesting requires more time
- Control section by adjusting parameters
- Control section by selecting operational steps
- Can communicate and control via HMI (Human-Machine Interface)
- Can communicate and control via Firebase.
Conclusion
CONTENT IMPLEMENTATOIN
Mechanical design
Grass dimension: length 20cm, diameter 5-7mm
Productivity: 500 straws/hour, a cycle lasting 36s In which:
- Feed grasses to core extraction location: 5s
- Anti-slip unit goes in: 2s
- Core extraction unit goes in:13s
- Core extraction unit go out: 13s
- Anti-slip unit goes out: 2s
Figure 5.1 Grass support cage structure
1 are metal discs used to connect the support bars and position the grass
2 are support bars that support the grass
Because the metal discs are used to position the grass, the distance between the two discs must be less than the spacing of the grass Choose a disc spacing of 170mm
The support bars are stainless steel 304 box bars with dimensions of 10x10mm
The curved grooves are where the grass is contained and positioned during operation The empty slots are where the support bars are placed
Figure 5.3 The shape of the positioning groove
To accommodate both straw sizes of 5mm and 7mm in diameter, the metal rod with a diameter of 3mm must be concentric with the position of the 5mm diameter tube
Figure 5.4 The center-to-center distance between two grooves
The center-to-center distance between two grooves, with the center being the center of the grass with a diameter of 5mm, is 35mm This dimension is also the distance calculated between two metal shafts
Satisfying the center-to-center distance of 35mm between two grooves and an angle of 20 degrees between them, I calculate the radius from the center to the center of the groove as 100.78mm
Using SolidWorks software, I measured the mass (excluding the shaft) as 2238.26g, rounded to m = 2.500 kg, and the moment of inertia (including the shaft) as I = 14345 kg.mm²
Figure 5.5 Measure the mass and moment of inertia using SolidWorks
In addition to moving the grass into position for core extraction at a slow speed to ensure no steps are missed during operation, there is also a need for higher speed when returning to the home position to ensure the set home operation occurs as quickly as possible Due to the need for high accuracy, stepper motors are used for driving and supporting the core extraction mechanism To reduce vibrations and increase torque, accelerating the stepper motor speed is crucial
Workpiece support cage’s velocity diagram
I have the maximum velocity in feeding progress (not including the set home step)
1 = 0.436 (𝑟𝑎𝑑/𝑠 2 ) Choose the set home velocity 15 times faster than the normal working process 𝜔 ℎ𝑜𝑚𝑒 6.54 𝑟𝑎𝑑/𝑠 accelerate in 2 second → 𝛼 ℎ𝑜𝑚𝑒 = 3.27 𝑟𝑎𝑑/𝑠 2
We calculate the needed torque of the motor:
𝑠 2 𝑚𝑚 = 47.382 𝑁𝑚𝑚 Where 𝜂 𝑜𝑙 is the roller bearing efficiency chosen from the Table 2.3 reference [1] →Choose step motor KH42KM2R015D
Because the application is for light loads, I use commercially available smooth shafts to reduce costs Additionally, since the bearing housing is not symmetrically balanced, the weight is evenly distributed at the contact point of the two discs with the shaft, with a downward force of 𝐹 𝐶𝑦 = 𝐹 𝐷𝑦 = 12.5 N
The force arrangement diagram of the shaft is as follows:
Figure 5.7 Force diagram for the cage shaft
Reaction forces at the bearing supports
Apply forces and moments in SolidWorks using SolidWorks Simulation to perform durability testing
The maximum displacement at the center of the cage mechanism is 0.003mm
Durability testing of the cage using SolidWorks
Choose motors for moving the whole assembly and for removing the grass core task
-To create linear movement, I use a screw thread mechanism, with the pitch of the thread is 8mm Therefore, the velocity v in testing will have the smallest division is 8mm/s
In practical experiments, when the velocity of the moving part exceeds 72mm/s (with the drilling head in this project) will sometimes break the straws
Table 5-1 Test velocity to avoid straws breaking
Number of test straws Velocity(mm/s) Number of broken straws
-In the initial parameter, I assume that this assembly will move within 13s Let’s calculate with 10s The velocity diagram of the core extraction assembly is described in the following diagram
Figure 5.12 Velocity diagram of the assembly
Because the straw is 200 mm in length, choose the moving distance is 220
Choosing the velocity of the drilling part somewhere below 50mm/s is both safe and serves the demand of productivity I choose it equal to the 𝑉 𝑚𝑎𝑥 calculated above The motor for the movement of the whole assembly also uses step motor KH42KM2R015D
Also, the cleaning of the straws is not related to the velocity, but to the factor mentioned below:
Figure 5.13 Movement of brush head inside the straws
To ensure the straws are clean, all the inner surfaces of the straws have to be brushed, the non-brush part should be 0 It means that the motor that does the core extraction task should complete a circle before the metal stick moves a distance equal to the length of the brush part, which is 10mm
𝑠 = 2.75 𝑟𝑝𝑠 = 165 𝑟𝑝𝑚 →Choose DC motor JGB37-520 333rpm
This speed change be decreased by increasing the number of brush sides
Each metal stick looks like this:
Figure 5.14 Each stick kinematic diagram
Choosing a 1:1 transmission ratio between the motor and the 5 metal shafts, using dual GT2 pulleys with a length of 27.5mm, outer diameter of 15.8mm, and shaft diameter of 8mm
To minimize the distance between the core straw holders, use the shortest GT2 belt found, which is 110mm in length The distance between the two rotating shafts:
→ 𝑎 = 35 𝑚𝑚 Because the grass straws are fixed on the disc in a circular arrangement, the centers of the core extraction shafts must also lie on a concentric circle with the same diameter The diameter of the circle depends on the angle between two consecutive radii passing through the centers of the core extraction shafts
Figure 5.15 The blocking force of the anti-slip assembly acts on a grass straw
In the figure above, I can see that the holding force exerted by the anti-slip assembly on the straw is calculated as
In this context, a is the angle formed by the radius line passing through the center of the core axis with the horizontal direction From this, I can see the difference in the holding force of the straw at the position where the radius coincides with the horizontal direction compared to other positions If a is large, it leads to a much higher holding force required at the outermost position among the five straws compared to the middle straw, making it more prone to slipping If the holding force of the outermost straw is met, it may cause the middle straw to crack or break However, if the angle is too small, it will lead to an increase in the
35 diameter of the support cage, increasing the moment of inertia of the support cage → Select
𝑎 = 20° → the resistance applied to the outermost straw is 76.6% F
Choose some dimensions as follows:
- The distance between the two bearing surfaces of the drive shaft among the five core extraction shafts is 3.4 cm, which is greater than the length of the double pulley
- The drive shaft for the five core shafts is a smooth shaft with a diameter of 8mm because it handles light loads Additionally, the 8mm slide rail along with the 8mm shaft bearing is cost-effective, widely available, and easy to access
- Use a lead screw and nut mechanism along with two guide rails to move the core extraction unit
- The drive motor for the five core shafts is a JGB37 333rpm because the force required to rotate the core extraction shafts is small
-The distance between the two guide rails is 120mm
-Because the sliding distance of the assembly is greater than the length of the tube, select 22 cm
Therefore, the distance between the two support bearings of the guide rail = sliding distance + distance between two surfaces + additional distance (for the total thickness of the two bearings, the length of the shaft connection, and the thickness of the stainless steel plate)
Using SolidWorks software, I calculated that the mass of the moving part of the core extraction assembly was 2.72 kg, which I rounded up to 3 kg This mass is offset 42 mm horizontally towards the side with the five core shafts
Figure 5.16 Measure the mass and center of gravity using SolidWorks
Figure 5.17 Forces apply on the slide shafts
The weight of the assembly and the supporting force of the two slides
𝐹 𝐵𝑦 = 25.5𝑁 Unfortunately, with the sliding bearing, due to the small size of the metal rod, the corresponding diameter details of the sliding bearing are without accompanying fixed parts Therefore, I created a series of 5 consecutive sliding bearings in the following shape:
To calculate the shaft's durability, I place the case in the center of the slide assembly Since the two shafts are identical, I focus on the one that bears more load Using SolidWorks software, I use dimensions from the available slide for durability testing
The maximum displacement is 0.05 mm
When extracting the grass core, the movement of the shaft into the straw generates a force that pushes the grass out of its original position Therefore, a mechanism is needed to prevent this The grass barrier consists of a curved plate, which is part of a circle so that when pushed in, it can make even contact with the grass tubes However, since the straws vary in size, the curved plate is not made of metal or hard materials but from deformable foam that can adjust to uneven grass tubes The movement of the barrier also uses a lead screw and nut mechanism combined with a slider To minimize costs, the plate is used as a grass stopper, allowing the grass straws to continue moving along the curved path when there is no need for frictional resistance to block the grass
Figure 5.21 Contact point of grass and PE foam
Circuit design and control program
The system uses electrical equipment as follows
Figure 5.30 ESP32 kit RF Table 5-2 Operating condition [11]
Figure 5.31 Step motor KH42KM2R015D
-The ratio of the gearbox: 1:30
Figure 5.33 U-shape optical sensor EE-SX671
Through-beam laser switch sensor
-Supply voltage: 6~36 VDC, 90-250 VAC 50/60Hz
The total power consumption of the electrical devices in the system is
I use a hive-shaped power source 12V 5A
To convert from a 12VDC beehive power source to supply devices using 5V and a microcontroller operating at 3.3V, you need a power filtering circuit for both 12V to 5V and 5V to 3.3V conversions
Figure 5.38 The block diagram of the converter circuit 12V-5V-3.3V
XL1509 -5.0 is a 5V voltage regulator IC
The circuit principle above is based on a typical application circuit of the XL1509 IC as outlined in the datasheet Capacitors and inductors serve as noise filters Diode D3 acts as a clamping diode to protect the circuit
The capacitors in the circuit principle above act as noise filters
Switch-type sensor reading block
Figure 5.39 (NPN) switch-type sensor reading schematic
The (NPN NO) sensor with 3 wires is connected to the 3-pin socket Stop_s1 as shown in the example image When the sensor signal is active, the E_st pin is pulled low, allowing current from the 12V source to pass through the opto-isolator transistor at the output, closing the circuit This action pulls the st_e pin (connected to the microcontroller) low
Table 5-6 Maximum value parameters table
Table 5-7 Normal working specifications at temperature T%°𝐶
Parameter Symbol Min Typ Max Unit Condition
The resistor connected to pin 1 of Opto:
The rated power of the resister
The resistor value at pin 4 is just a pull-up resistor; based on experience, choose 1kohm
In the schematic above, JP1, JP2, and JP3 are used to adjust the divide factor of the step motor Pins En1, step1, dir1 are connected to the MCU
On-off DC motor, buzzer, and LED block
Figure 5.43 On off DC and buzzer
In the system, the motor that generates vibrations for the feeder cage does not require a change in direction throughout the operation process; therefore, it only needs a trigger signal to turn it on or off Additionally, there is a signal LED to facilitate programming
Here, I use the NPN MOSFET SI2300 as a switch The specifications of the MOSFET are as follows:
Figure 5.45 On- resistance vs drain current and gate voltage
With LED SMD use Red LED SMD type 0603 have the following specifications:
Resistor in series with LED:
Diodes D2 and D4 are pulse diodes used to protect the coil in the motor and the buzzer Resistors R7 and R8 are pull-down resistors for the G pin
Figure 5.46 On off led circuit
To create a user interface that can be controlled and monitored, I use the DWIN HMI The DWIN HMI screen can communicate with the microcontroller via UART communication and upload programs through an SD card Therefore, on the control circuit, I only need the UART pin of the microcontroller to communicate with the screen Additionally, to communicate with the DWIN HMI screen and simplify the programming process, I use the T5L DGUS software run environment application provided on the DWIN's official website This allows us to design the interface by dragging and dropping modules and editing parameters directly in the software interface
Figure 5.49 Pin that should pay attention when choosing[12]
ESP32 has some special pins that only use as input pins such as pin 36, pin 34, pin 39, and pin 35 So those pins are used for receiving input signals from sensors Especially, for pins
36 and 39, there are no internal pull-up or pull-down resisters so there must be an external pull-up resistor to stabilize the signal when there is no signal Also, some pins have a special effect on the boot process that may cause it to fail if pulled up such as pin 0, pin 2 and pin
12 should be used as output because their logic can be controlled Moreover, ESP32 has 18 PWM channels and most of the pins can function as output can be used to generate PWM
Due to the lack of digital pins, I use pcf8574 to communicate with I2C to extend the number of possible pins used The three pins A0, A1, and A2 define the IC address used in the I2C protocol Three pins all pulled down mean that the address is 20h The power supply is from 2.5 to 6VDC, I use capacitors to reduce noses and pull-down resistors in the output pins The pull-up resistor is necessary because the out current of this IC is too low, so if it floats, it may not be able to pull up the signal The I2C line should be pulled up to avoid any unexpected problem on the communication line, its pull-up resister is typically 4.7𝑘𝜊𝑚
Using Kicad software I design a PCB circuit below
Figure 5.52 3D model of the circuit
Figure 5.53 Block diagram of mobile app back-end
First, the user logins, and the app will certify the user account If the account is available, the app will receive a user ID, token The app then first navigates to the observe page, where the user can see every information about the machine If the user needs to control, the user can call and wait until the one who can contact the HMI allows it Only then, the user can control the machine with their phone The data sent from the app to Firebase should have the machine status and other parameters of stepper, also, enable a variable of the Firebase, which function is to show that there is a command from the internet Since it costs a lot of time for ESP32 to read data for the internet every loop, this will help to only read others if the variable confirms the command availability
Block diagram of the machine
` The machine starts working but does nothing until receives a command from HMI or the internet To be controlled by the internet, the machine needs to connect to the internet using a WIFI ID and WIFI password, which is also received from HMI Then enable the permission to control through the internet, receive commands, and run it When there is a command from the internet, that command will overwrite the command from HMI In every
69 loop of AUTO mode, when the workpieces support bring support to the right position the count sensor will update the number of grasses on firebase This main function will stop when the power off Setting through HMI is the only way to enable control with the internet The number of grass counts can only be sent to Firebase at the end of each cycle of AUTO mode
Figure 5.55 Run follow the commands Function
The machine is divided into AUTO mode and MANUAL mode The AUTO includes a sequence of steps in order: Feed new workpieces → Anti-slip on → Drill in → Drill out→ Anti-slip off but not each step itself Those three steps along with the custom mode of the 3 steppers, set home mode, and connect to WIFI process belong to MANUAL mode in general
The ESP32 default is connected to a specific WIFI with time out 10s, after this period, if the WIFI does connect, the user has to do this manually through the HMI screen
Figure 5.57 Custom drilling mode function
Figure 5.58 Custom anti-slip mode function
Figure 5.59 Custom feeding mode function
These three functions are the basic functions used for all the functions that control using three steppers
Figure 5.60 Feed new workpiece function
Figure 5.61 Drill in mode function and Drill out mode function
Figure 5.62 Anti-slip in function and Anti-slip out function
These functions based on the three basic control functions above, accept the feed wheel control stepper moving exactly every 100° every cycle of the machine, the other two are set to move longer than needed and stop by limit switches
In the Set Home function, first let the anti-slip unit get home, then the drilling part and after that the workpieces support unit The workpieces support unit has to rotate one circle to find the home position and then turn back, while the other two stop by limit switches All the speed and position of the three steppers reset to 0
RESULT
Mechanical
Figure 6.2 Grass core removing unit
Figure 6.4 Blank supply container front view
Electrical
Figure 6.6 Front view of the circuit
Figure 6.7 Back view of the circuit
Figure 6.8 Box looked from outside
App
Figure 6.16 Login screen and sign-up screen
In the observe screen, the 7 squares in the top-right describe what stage the machine is in Besides the auto mode and home mode, every other mode is considered manual With auto mode, the screen will point out which stage exactly in the auto mode the machine is in The lower center box contains the productivity history of the machine and the history of the latest day will be emphasized as a big green text on the middle-left
This part is similar to HMI control, the highest block is used to control the machine by stage and the other three control the machine by parameter
Productivity
To test the performance of the machine, I test in 2 ways: the first one is on groups of grass’s diameters including 5-5.5 mm, 5.5-6 mm, and 6-6.5 mm, and the second is based on the differences from the small grass and the largest grass in 5 straws in one cycle fed in one
89 when any cycle has a fault Each test of each method implements 5 cycles
Table 6-1 Diameter’s range from 5-5.5 mm
Cycle Number of faulted grasses
3 1 Stuck at container out way
5 1 Slide out of the cage
Table 6-2 Diameter’s range from 5.5-6 mm
Cycle Number of faulted grasses
Table 6-3 Diameter’s range from 6-6.5 mm
Cycle Number of faulted grasses
2 1 Stuck at container out way
Cycle Number of faulted grasses
Table 6-5 Diameter difference range 1 mm (5.5-6.5mm)
Cycle Number of faulted grasses
2 2 Slide out of the cage
5 2 Slide out of the cage
Table 6-6 Diameter difference range 1.5 mm (5-6.5mm)
Cycle Number of faulted grasses
1 1 Slide out of the cage
2 2 Slide out of the cage
3 1 Slide out of the cage
4 1 Slide out of the cage
5 2 Slide out of the cage
From the result, I can conclude that:
-With the small diameter, the grass is cleaner but easy to be pushed out of the process position because the force acting on the inner side is bigger In addition, it is also easy to be stuck at the output of the blank container since it leaves a big space for the next grass to step in
-With medium diameter, the machine works more stable but the grass is not clean
This is because not only the diameter is big but also the whole grass bent a bit This makes the size of the side view of the grass exceed the limit of 7mm
-The more difference in the diameter of the grasses, the more chance it gets to be pulled out of the working position
Some images of result straws:
CONCLUSION AND FUTURE DEVELOPMENT DIRECTION
Archived result
Based on the above results, the team has drawn the following conclusions:
I have successfully designed and constructed a machine for extracting Bang grass cores to make straws, and programmed IoT for monitoring and controlling via a phone app, operating as expected by the team The machine operates with a productivity of 500 straws per hour The machine can be controlled and monitored through a phone application
However, there are still some limitations in the operation and performance of the machine, such as slow operation, a loud noise generated by the feeding mechanism during operation, the machine being prone to errors during operation, easy step loss due to open-loop control, and the straws not being completely clean after core extraction.
Future development direction
Areas for improvement and development:
- Use a crank-slider mechanism to create oscillation and reduce noise
- Improve the core extraction head to achieve cleaner extraction If successful, consider switching from the current pushing motor to a DC motor for higher speed and efficiency
- Add encoders to the places using stepper motors to ensure precision
- Research the rotary mechanism of the core punching motor to prevent continuous direction reversal, thereby reducing motor lifespan
- Research the part for identifying and pushing out invalid cores to reduce the number of errors caused by invalid cores
- Research a component that can identify and eject invalid cores to minimize errors caused by them
[1] Trịnh Chất -Lê Văn Uyển, Tính toán thiết kế hệ dẫn động cơ khí tập một
[2] Maries Từ bàn tay Việt, Ứng dụng của cây cỏ bàng đến đời sống thực tiễn, link https://madebymaries.com/ung-dung-cua-cay-co-bang-den-doi-song-thuc-tien/ 6/2024
[3] Eco friendly, Quy trình sản suất ống hút cỏ bàng, link https://ecofriendly.vn/vi/quy- trinh-san-suat-ong-hut-co-bang/ 6/2024
[4] Circuit Globe, Variable Reluctance Stepper Motor, link Variable Reluctance Stepper Motor – its Working - Circuit Globe 6/2024
[5] NPM Nippon Pulse Motor “Impress, not just satisfy”, Acceleration and deceleration of stepping motors, link https://www.pulsemotor.com/global/Engineering/Special- features/stepping-motor-drive-IC_08.html 6/2024
[6] IBM, What is the Internet of Things (IoT), link What is the Internet of Things (IoT)? | IBM
[7] FPTShop, Giao thức TCP/IP là gì? Tổng hợp các kiến thức từ cơ bản đến nâng cao về mô hình này, link https://fptshop.com.vn/tin-tuc/danh-gia/giao-thuc-tcp-ip-la-gi-171251
[8] Clinton Wong, HTTP Pocket Reference: Hypertext Transfer Protocol, O’Reilly Media,
[9] Maciej Budziński, What Is React Native? Complex Guide for 2024, link https://www.netguru.com/glossary/react-native 6/2024
[10] Flatirons, Expo vs React Native CLI: Key Differences Explained, link https://flatirons.com/blog/expo-vs-react-native/ 6/2024
[11] Alldatasheet.com, ESP32 Datasheet (PDF) - ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD., linkhttps://www.alldatasheet.com/datasheet- pdf/pdf/1148023/ESPRESSIF/ESP32.html 6/2024
[12] Random Nerd Tutorials, ESP32 Pinout Reference: Which GPIO pins should you use?, link https://randomnerdtutorials.com/esp32-pinout-reference-gpios/ 6/2024