Ho Chi Minh City, September 2023 CONTROL AND MONITOR AUTOMATED STORAGE AND RETRIEVAL SYSTEMS USING S7 - 1200... Project title: CONTROL AND MONITOR AUTOMATED STORAGE AND RETRIEVAL SYSTE
INTRODUCTION
Problem statement
According to data from the Ministry of Industry and Trade in 2021, total import- export turnover reached a record of 668.5 billion USD, an increase of 22.6% compared to the previous year, bringing Vietnam into the group of 20 leading economies in terms of trade international trade; of which exports increased by 19%, imports increased by 26.5% The average export growth over the past 35 years has reached over 20%/year, among the highest in the world In particular, Vietnam has many export products ranked in the top 5 in the world such as rice, cashew nuts, coffee, textiles, footwear, and seafood, this is the step to create momentum and create a breakthrough force for the industry import and export activities in the coming period
Facing the integration of the world economy, the industry of our country in particular, and countries around the world, in general, are in a period of strong development Accompanying that development, the number of industrial products and goods increased rapidly To meet the needs of scientific storage and warehousing, it requires workers to perform their work with high speed and accuracy, not only ensuring the labor safety of workers always taken care of To improve this, in many industrial parks, companies, and factories around the world, many machine parts and robots have been invented to transport goods and products most scientifically
In Vietnam, this technology is still limited and not used much in industrial parks and factories Therefore, automatic classification and storage is an optimal direction for the development of the country's economy in particular and the world in general The smart warehouse is an ideal system that helps classify, store, rotate, and track accurately and flexibly Importing and exporting warehouses only requires commands, data is stored, remembered automatically, and managed in real-time accurately A smart warehouse application is a necessary solution to help improve supply chain and logistics flexibility, increase warehouse storage productivity, reduce labor, ensure operational safety, import and export goods quickly and accurately, and manage inventory Manage warehouse scientifically and strictly,
For those reasons, the group researched and implemented the project: "CONTROL AND MONITOR AUTOMATED STORAGE AND RETRIEVAL SYSTEMS USING S7 - 1200".
Objectives
• Design and complete the model of the automatic storage and retrieval system
• Using PLC to control and monitor actual systems
• Collect, classify, and store data warehouse.
Limitation
• The construction project is carried out on small models Therefore, the warehouse will be designed with nine storage cells suitable for small models
• The warehouse is designed to only lift small loads weighing from 0-450 grams All parameters of the import and export process can be set and monitored remotely
• The control and monitoring program is built to satisfy set requirements such as classification, control to warehouse location, data storage,
Research methods
Based on the automated storage systems available on the market, the team conducts research and improves automation and intelligence for warehouses This saves a lot of costs and makes it easy to control
In this project, the team aims for a solution to identify goods by scanning barcodes and transporting blocks of goods to compartments with goods information The solution is researched to save land-use area and distinguish the origin and type of goods that need to be exported/imported, thereby improving the quality of goods transportation and best- controlling goods, optimizing storage space way to minimize transportation time.
Contents
The rest of the topic has the following content:
Chapter 2 introduces product classification methods, goods storage systems, centralized input and output system configuration, and distributed input and output systems; Introducing different types of PLCs, sensors, etc currently on the market; barcode theory,
From the system requirements, the team proposes technological, calculation, and design processes, drawing drawings of system mechanical details; Providing block and functional diagrams, configuration options, equipment, wiring diagrams, control flow diagrams,
This chapter presents the steps of mechanical construction and electrical cabinet construction Device configuration and settings operations
Chapter 5 presents the results of implementation, including results of mechanical and electrical construction, barcode reading interface, system control, and monitoring interface, actual operating results of the system, comments, and evaluation the resulting price
Chapter 6: Conclusion and development direction
In chapter 6, conclusions are drawn about what has been done and what has not been done and directions for further development of the topic in the future.
THEORETICAL BASIS
Product classification methods
Depending on the system requirements, priority is given to which classification method to apply, currently including the following main classification methods:
• Method of classifying products by volume
• Method of classifying products by color
• Method of classifying products by height
• Method of classifying products by barcode or QR code.
Types of AS/RS
A fully Automated Storage and Retrieval System (AS/RS)—also called AS-RS,
AS RS, or ASRS—is a type or genre of warehouse automation technology specifically designed to buffer, store, and retrieve product and inventory on demand
AS/RS technology varies substantially and can consist of shuttles, cranes and aisles, Autonomous Mobile Robots (AMRs), horizontal and vertical carousels, Vertical Lift Modules (VLMs), Micro-Loads, Mini-Loads, Unit-Loads, stockers, or other systems
It is often integrated with Warehouse Execution Systems software (WES), Warehouse Management Systems software (WMS), Warehouse Control Systems software (WCS) or other software and controls
Automated storage and retrieval systems (AS/RS) come in three main varieties: Unit-Load AS/RS (primarily pallets), Mid-Load AS/RS (inventory requiring custom handling requirements), and Mini-Load AS/RS (each or split case picking) Between these three main buckets, there are eight primary styles of AS/RS systems:
• Unit-Load AS/RS Cranes (Fixed-Aisle & Moveable Aisle)
• Mini-Load AS/RS Cranes (Fixed-Aisle)
• Carousel-based AS/RS (Vertical, Horizontal, and Robotic)
• Vertical Lift Module (VLM) AS/RS
• Vertical Sequence Systems (VSM) AS/RS
• We explore each of these in more detail below
Unit-load AS/RS systems are typically used to handle large and heavy loads ranging from 1,000 to 5,500 pounds This capability allows for unit-load AS/RS to handle full or partial pallets and cases
Usually, Unit-Load AS/RS consists of narrow aisle racks, which can extend to heights greater than 100 feet and which house pallets of product and inventory These racks are paired with a crane, which is used to physically place and retrieve pallets as needed
Unit-Load AS/RS is a particularly helpful option when pallet-level storage is limited and quick retrieval is critical
The two primary forms that unit-load AS/RS take are fixed-aisle and moveable aisle cranes
2.2.1.1 Fixed-Aisle Unit-Load AS/RS Crane
In fixed-aisle Unit-Load AS/RS systems, pallet racks are arranged with narrow aisles between them A crane travels between these aisles moving both vertically and horizontally to retrieve and store product The crane is fixed to a single aisle of pallets
Figure 2.1 Fixed-Aisle Unit-Load
2.2.1.2 Moveable-Aisle Unit Load AS/RS Crane
Moveable-aisle Unit Load AS/RS works much the same way as fixed-aisle unit- load AS/RS It consists of a crane moving between narrow aisles of pallets along some kind of track The key difference is that it is not fixed to a specific aisle This capability allows a single piece of equipment to service multiple aisles and, ultimately, a greater working space
Figure 2.2 Moveable-Aisle Unit Load
Mini-Load AS/RS typically handles smaller loads (up to 75 pounds) compared to unit-load systems Instead of full pallets, Mini-Load AS/RS handles totes, trays, and/or cartons Sometimes, these systems are called “case-handling” or “tote-stacking” systems
Mini-load AS/RS is especially well-suited for operations that require storage locations for a large number of SKUs, and lack the floor space required for traditional carton-flow shelving to provide a pick face for each SKU Mini-load AS/RS systems can also be used to buffer and efficiently release/sequence products to picking or palletizing stations and can be used to automatically replenish pick locations like carton flow
Shuttle-based AS/RS delivers inventory via a shuttle or “bot” that runs on a track between a racking structure
They can operate on a single level or multiple levels, depending on the needs of the operation, and can be battery- or capacitor-powered The shuttles deliver the tote or carton to a workstation integrated into the system
When an item is requested, the shuttle moves to the location of the product and retrieves the tote or carton that contains the requested item The shuttle will then take the tote/carton directly to a workstation or transfer it to a conveyor to convey the tote/carton to a workstation
Different shuttle models utilize different designs to provide different benefits For example, one model is vertically oriented to optimize floor space The shuttles move on the perimeter of the rack and then move into an aisle to extract a tote and deliver it to an integrated workstation
A third shuttle model utilizes a vertical rack, but each bot moves on the floor and climbs vertically to extract its tote Then it comes down to the floor and independently delivers the inventory to a remote workstation It will queue at the workstation until picked and then is automatically assigned a new task and it repeats the process
Carousel-based AS/RS systems consist of bins of products or inventory that rotate continuously along a track When the operator requests a particular item, the system will automatically rotate so that the appropriate bin is accessible so that the item can be picked An integrated Lightree will indicate to the picker which carousel, shelf, and item to pick
Carousel-based AS/RS may consist of either a Horizontal Carousel (bins move horizontally, as on a merry-go-round) or a Vertical Carousel (bins move vertically, as on a Ferris wheel) Horizontal carousels are often utilized for small items and parts, as well as documents or raw materials
Robotic Horizontal Carousel AS/RS is another variety that provides fully automated storage and retrieval AS/RS functionality
In these systems, up to three tiers of carousels are stacked on top of each other, and totes or cases are loaded on each shelf level All three vertical carousels work independently to present the necessary inventory to an inserter/extractor device that runs horizontally in front of them The inserter/extractor takes as many as two totes or cartons per trip to the take-away conveyor, which delivers the goods to a workstation, and picks up returning inventory, placing it back in a waiting shelf It is possible to increase capacity and throughput by increasing the number of carousel rows with an inserter/extractor in front of it
2.2.5 Vertical Lift Module (VLM) AS/RS
Types of control system configurations
Centralized input/output circuits are plugged directly into the computer via expansion buses Typically used in applications where the PC is close to sensors and actuators
Characteristics: compact, fastest data collection and control speed, low cost so often used
Sensors and actuators are often located far from the PC, often in production environments, sensors and actuators are in harsh environments and cover a large area hundreds of meters away from the PC
In noisy environments, it is difficult to receive small signals from sensors such as thermocouples over long transmission lines The connection cable from the sensor to the
PC is long and can be expensive
Solution: Distributed I/O, meaning the signal conditioning module is placed near each corresponding sensor Each sensor needs a signal conditioning module
This solution can be expensive if there are many sensors but is compensated by signal quality and accuracy
A common form of distributed I/O is the digital transmitter This digital generator performs all necessary signal conditioning functions and has a microprocessor and ADC to convert the signal to be measured into digital form This digital signal is transmitted to the PC using the RS-232 or RS-485 standard
• RS-232 (point to point): cumbersome when there are many points
• RS-485: (multi-drop): reduces the amount of transmission cable, can connect up to
32 modules, transmission distance can be up to 10km if using multi-drop network (RS-232: up to 15m)
An RS-232 to RS-485 converter is often needed because most PCs do not support the RS-485 standard
PLC
PLC is the abbreviation for Programmable Logic Controller (Can be understood simply in Vietnamese as a control device that allows users to program (Programmable)
Through the PLC controller, users can completely change the control algorithm through PLC programming (written in programming language)
The most famous and most used PLC manufacturers include Siemens (Germany), Omron and Mitsubishi (Japan), and Delta (Taiwan) In Vietnam, PLC lines from Siemens and Mitsubishi are the most popular It is included in the training program of technical schools
Siemens PLC has the following lines: Logo (with a display screen or not), S7 -
PLC_Siemens is strong in process control and control via communication
Siemens Analog modules are cheaper and simple to use; (Just plug into PLC and configure in a few steps to read/write easily)
Communication with Siemens PLCs is also quite easy to do because Siemens has specialized function blocks to provide maximum support to users
Siemens PLC has both a horizontal and vertical program structure This means that the program still executes sequentially from top to bottom, however, the program is in block form and multiple blocks can be executed peer-to-peer
Siemens PLCs are suitable for process control and communication applications Programming will be more difficult to access at first, but once mastered, it will provide better support for users
Mitsubishi PLC has lines: FX, A, Q, L, Motion,
Mitsubishi PLC has strengths in discrete control and transmission control
The number of commands of Mitsubishi PLC is very rich, including specialized commands for position control or high-speed counters (Much simpler, the Siemens PLC must be configured through many steps and many parameters to do this)
Mitsubishi PLC has a vertical program structure, only executed in one direction from top to bottom It's all about commands Even though you have to remember many commands, programming is simpler
Mitsubishi PLCs are suitable for drive control and discrete control applications Programming is simple and easy to learn, but programming complex programs will be more difficult
Stepper motors
A stepper motor is essentially a synchronous motor used to convert control signals in the form of successive discrete electrical pulses into rotational movements or rotor movements and can fix the rotor at certain positions necessary location
Stepper motors work thanks to an electronic switch that sends control signals to the stator in a certain order and frequency The total number of rotation angles of the rotor corresponds to the number of switching times, as well as the rotation direction and rotation speed of the rotor, depending on the switching order and switching frequency
There are many types of stepper motors such as variable resistance motors, unipolar motors, and bipolar motors The most common stepper motor is the 1.8 degree/1 step type (equivalent to 200 steps for 1 revolution)
On the market, we most often encounter unipolar and bipolar motors When shopping, we often encounter 4-wire, 5-wire, 6-wire, and 8-wire motors Among them, 4 wires and 6 wires are the most common
Figure 2.15 Stepper motor control system
A system using a stepper motor can be generalized according to the diagram above:
• Power supply: Responsible for providing one-way power to the system
• Controller: Responsible for generating motor control signals This logic block can be a pulse source, or it can be an electronic circuit system It generates control pulses Stepper motors can be controlled in whole steps or micro steps
• Driver: Responsible for supplying adjusted power to the engine It takes power from the power supply and control pulses from the control block to create a current for the motor to operate
• Stepper motor: Motor parameters include: Angular step, angular step error, pulling torque, braking torque, and working torque
As for the stepper motor control system, we see that it is a quite simple system because there is no feedback element This is because the stepper motor during operation does not cause accumulated errors or errors of the motor due to errors during manufacturing Although the use of stepper motors does not bring high accuracy, it is increasingly used commonly Because the capacity and accuracy of angular stepping are improving day by day
• Detect objects up to 100m away without needing to come into contact with that object
• Less wear and tear, long life and high accuracy, quite high stability
• Can detect many different objects
• Fast response time and sensitivity can be adjusted according to the application
• Only works well when clean If the surface is dirty, the recognition ability of the optical sensor will decrease
• Recognition distance depends largely on color and reflectivity
The proximity sensors are available in different categories as per their detection Some proximity sensors are useful to detect materials; whereas some are useful to detect different environmental conditions upon these classifications proximity sensor types are as follows
According to the non-contact object detection method, there are 2 most common types of proximity sensors They are:
• Works even in harsh environments, not affected by humidity, dust, or color
• Long lifespan, easy to install
• Works even in harsh environments, not affected by humidity, dust, or color
• Long lifespan, easy to install
• Ability to identify electrically conductive and non-conductive objects
• Limited to the perceived distance of objects
• Sensitive to environmental changes: humidity, temperature, dust,
• The connecting wire must be short so that the capacitance does not affect the oscillations of the oscillator
• Poor linearity, and poorer accuracy than inductive proximity sensors.
Warehouse data management methods
Barcode, also known as barcode, is a method of representing data and information in image form A barcode is a tool for manufacturers to express product information such as brand name, origin, and quality inspection information fully without using too much text or description space on each product
Some types of 1D barcodes are on the market today: EAN8, EAN13, Code128,
Same as the barcode, but the QR code is an improved version of the traditional barcode Compared to the storage capacity of only 20 characters of a barcode, a QR code can contain a maximum of 7,089 numeric characters and 4,296 alphanumeric characters This allows the amount of information transmitted by QR code to be larger and has many outstanding advantages
Image processing
Humans receive information through their senses, in which sight plays the most important role In recent years, with the development of computer hardware, image processing, and graphics have developed strongly and have many applications in life Image and graphics processing play an important role in human-machine interaction Image processing is considered the process of manipulating input images to produce desired results The output of an image processing process can be a “better” image or a conclusion
An image can be viewed as a collection of pixels and each pixel is considered a characteristic light intensity or a certain sign at a certain location of the object in space and it can be viewed as a function of n variable P(c1, c2, , cn) Therefore, images in image processing can be considered as n-dimensional images
Softwares used for programming
TIA Portal (Total Integrated Automation Portal): This is software that has integrated all configuration and programming software for automation and electric drive systems such as PLC, HMI, and Inverter from Siemens
Within the scope of the thesis, the TIA Portal is used to program the PLCS7-1200 control and design the information collection interface screen for the warehouse model
TIA Portal software has the great advantage of integrating everything in one interface, creating consistency in the working process However, it also has a disadvantage: because it integrates many things, it leads to large software capacity and requires high computer configuration
The Totally Integrated Automation (TIA) Portal is designed to be an application that allows a programmer to design PLC programs, HMI displays, and motion/motor control systems, all from a single software
We will be using version 18 of the TIA portal, which may not be the most recent update, but the application will be largely the same Be aware that future revisions may change the interface, so this guide may not work for all versions
When the software is first opened, the Portal View will be visible, as shown in the figure below 'Create new project' will allow us to give a name and optional comments to our new project, which we’ll call TIA_Test_1 for simplicity
We are presented with some recommended first steps The first step should usually be to configure the hardware and establish the proper modules, communication parameters, etc This way, we should not meet unexpected challenges when we create tags or instructions that somehow are unsupported by the hardware we have not yet specified Therefore, I prefer to always select the right hardware before programming
On this next screen, that means ‘Configure a device’
Since this is a new project and we have not yet connected to any controller, we’ll want to 'Add new device', and choose the right controller from the list
Figure 2.26 Devices to choose from
It should be noted that the ‘Version’ selection is important at this stage, otherwise, there may be a mismatch between the project version and the current version loaded in the existing hardware
2.9.2 Microsoft Visual Studio and Windows Forms Application
Windows Forms is a Graphical User Interface(GUI) class library that is bundled in Net Framework Its main purpose is to provide an easier interface to develop applications for desktops, tablets, and PCs It is also termed as the WinForms The applications that are developed by using Windows Forms or WinForms are known as the Windows Forms Applications that run on the desktop computer WinForms can be used only to develop Windows Forms Applications, not web applications WinForms applications can contain different types of controls like labels, list boxes, tooltips, etc
Creating a Windows Forms Application Using Visual Studio 2019
First, open the Visual Studio then Go to File -> New -> Project to create a new project, and then select the language as Visual C# from the left menu Click on Windows Forms App(.NET Framework) in the middle of the current window After that give the project name and Click OK
Here the solution is like a container that contains the projects and files that may be required by the program
After that following window will display which will be divided into three parts as follows:
1 Editor Window or Main Window: Here, you will work with forms and code editing You can notice the layout of the form which is now blank You will double-click the form then it will open the code for that
2 Solution Explorer Window: It is used to navigate between all items in the solution For example, if you will select a file form this window then particular information will be displayed in the property window
3 Properties Window: This window is used to change the different properties of the selected item in the Solution Explorer Also, you can change the properties of components or controls that you will add to the forms
Now to add the controls to your WinForms application go to the Toolbox tab present in the extreme left side of Visual Studio Here, you can see a list of controls To access the most commonly used controls go to Common Controls present in the Toolbox tab
Now drag and drop the controls that you need on the created Form For example, you can add TextBox, ListBox, Button, etc as shown below By clicking on the particular dropped control you can see and change its properties present in the right-most corner of Visual Studio
In the above image, you can see the TextBox is selected and its properties like TextAlign, MaxLength, etc are opened in the rightmost corner You can change its properties’ values as per the application's need The code of controls will be
28 automatically added in the background You can check Form 1.The designer cs file present in the Solution Explorer Window
PROFINET and ETHERNET
PROFINET and EtherNet/IP are currently the most popular Industrial Ethernet protocols in automated industrial environments After all, both offer real-time communication, use the same Ethernet technology, and can even operate on the same physical network
PROFINET is an application, so it sits on Layer 7 (application layer) of the OSI model delivering data through several communication channels For non-time-critical tasks such as configuration and parameterization, it can use TCP/IP or UDP/IP
29 communication But for time-critical tasks like RT, IRT, or TSN, it skips this and communicates directly through the Ethernet layer instead
PROFINET is a full duplex system and runs at high transmission speeds It sends I/O data between controllers and devices in standard Ethernet frames, whose sequence is prioritized by a virtual local area network (VLAN) Because these frames have little overhead, the deviation of the cycle time, or jitter, is low
Identification is mainly done using device names that comprise letters and numbers, and IP addresses are assigned automatically
Like PROFINET, EtherNet/IP sits at the application layer and is backed by defined standards and extensive communities Unlike PROFINET, it transfers data to the network via the TCP/IP and/or UDP/IP layers These packages of data are packed and unpacked, and headers and info are added and deleted as they move through the layers
Two types of messages are carried by EtherNet/IP: “Implicit” messages for sending I/O data and “Explicit” messages for configuration and diagnostics Implicit messages are sent from pre-set memory locations to a controller through a UDP port at prescheduled intervals Explicit messages are sent to a client through a TCP port in response to a specific request for that data
Identification of EtherNet/IP devices is done through IP addresses
H-bridge circuit controls a DC motor
The H-bridge circuit is a simple circuit used to control a DC motor for forward or reverse rotation In reality, there are many different types of H-bridge circuits depending on how we choose components with a large or small current, control voltage, and PWM pulse frequency and they will determine the control ability of the H-bridge
A DC motor can rotate forward or reverse depending on how the positive and negative poles are connected to that motor For example, a DC motor has two terminals A and B If A is connected to the positive (+) terminal and B is connected to the negative (-) terminal of the source, the motor will rotate in the positive direction (assuming clockwise) Now connect in reverse, A to (-) and B to (+), the motor will rotate in reverse (say counterclockwise)
Similarly, when we close S1 and S4, we have A connected to the positive pole (+) and B connected to the negative pole (-) of the source, a current flows from the source through S1 through the motor through S4 to Mass to actuate mechanism rotates in the forward direction
Figure 2.33 State when S1 and S4 are closed
On the contrary, when we close S2 and S3, the motor rotates in reverse
Figure 2.34 State when S3 and S2 are closed
Thus, the H-bridge circuit is used to reverse the direction of motor rotation
Never close S1 and S2 or S3 and S4 at the same time or even close 4 switches at the same time If you do so, it will create a direct path from Vcc to GND and cause a short circuit The power source will be damaged and more seriously, the circuit may explode
In this project, the H-bridge circuit controlling the conveyor motor only needs the reversing function, not speed control, so choose Relay for control.
Web server
A web server is a place to store and provide content for a website In the form of text, images, video, and application data – to customers who request it The most common type of client application is a web browser program Requests data from your website when a user clicks a link or downloads a document on a page displayed in the browser
Figure 2.35 Structure of remote monitoring and control system
A web server communicates with a web browser using Hypertext Transfer Protocol (HTTP) The content of most web pages is encoded using Hypertext Markup Language (HTML) Content can be static (e.g text and images) Or dynamic (calculated price or list of items the customer has marked for purchase) To provide dynamic content Most web servers support server-side scripting languages to encode business logic into communication Commonly supported languages include Active Server Pages (ASP), Javascript, PHP, Python, and Ruby
Web servers often host websites accessible on the Internet They can also be used to communicate between clients and web servers in local networks such as corporate intranets A web server can even be embedded in a device such as a digital camera So that users can communicate with the device through any popular Web browser
HTML, short for Hypertext Markup Language, is a programming language used to build and restructure components on a website A Website often contains many subpages and each subpage has its own HTML file Note, that HTML is not a programming language This means it cannot perform “dynamic” functions To put it more simply, similar to Microsoft Word software, HTML only has the effect of layout and formatting the website HTML when combined with CSS and JavaScript will become a solid foundation for the online world
• There are many support resources with a very large user community
• Can operate smoothly on almost any browser today
• Learning HTML is quite simple
• The markup used in HTML is often brief and highly consistent
• Use open-source code, completely free
• HTML is a web standard operated by W3C
• Easy to integrate with backend languages (eg: PHP, Node.js, )
• Mainly only applied to static websites If you want to create dynamic features, programmers must use JavaScript or a third-party backend language (eg: PHP)
• Each HTML page needs to be created separately, even if there are many overlapping elements such as headers and footers
• It is difficult to control how the browser reads and displays HTML files (for example, some old browsers cannot render new tags Therefore, even if these tags are used in the HTML document, the browser will not be able to read them) )
• Some browsers are slow to update to support new HTML features
CSS stands for Cascading Style Sheets, a simple design language that partly handles the look and feel of a website CSS describes how HTML elements appear on screens and other media
Using CSS, you can control text color, font size, font style, spacing between paragraphs, size of elements on the web page, background color, layout design, and how the web page appears on the screen screens of different sizes as well as a variety of other effects
CSS is very useful and convenient It can control all the pages on a website External stylesheets are stored as “.CSS” files The CSS language helps a lot when writing a website in HTML CSS is used to define the style of your website's pages, including design, layout, and how they display differently on different devices and screen sizes
JavaScript is a popular website programming language today It is integrated and embedded into HTML to make websites more lively JavaScript acts as a part of the web page, allowing client-side scripting from the user side as well as the server side (Nodejs) to create dynamic web pages
JavaScript is an interpreted programming language with object-oriented capabilities Is one of the three main languages in web programming and is interconnected to build a lively, professional website:
• HTML: Supports building layouts and adding content easily on the website
• CSS: Supports design formatting, layout, style, color,
• JavaScript: Creates "dynamic" content on the website
Figure 2.39 Contact between 3 languages when programming a Web server
Javascript language is a powerful, versatile language, has many libraries that support connection with other languages (PLC), and has many accessible reference materials, so my team decided to Use Javascript as the tool to write this software
It is a simple, modern, general-purpose, and object-oriented programming language It provides implementations that meet software engineering principles such as strict data type checking, array bounds checking, detecting uses of variables that have no data, and automatically collecting garbage
Figure 2.40 Create a new project in VS code
Open VS code software, go to File folder New file to name, and select the folder where you want to save the file After creation, all subsequent files created during the coding process are saved in this folder (for example, in the image, the folder is named WEBSERVER_PLC1200)
Figure 2.41 Code to set up a Web server and connect to PLC
Create a file in the Folder with the extension ".js", this file provides the communication function to send to PLC and the Web through special commands in javascript language It can receive and transmit signals from PLC to Webserver and vice versa (Detailed code is in the Appendix).
CALCULATION, DESIGN AND EQUIPMENT SELECTION
System operating requirements
With this topic, it is required to make the structure able to lift, lower, and take goods into and out of the frame so that it can be easily manipulated in picking up and storing goods
The system has some requirements:
- There is a model of the warehouse monitoring control system
- Build utilities so operators can control and monitor the system
- Build system algorithms using PLC
- Design monitoring system on Webserver
- The system can be monitored and controlled on the phone
- Goods type rectangular blank type
- The system can distinguish whether storage locations are full of goods or not
- The average warehouse import and export time is 30 seconds.
System operation
The system has 2 operating modes:
- Import mode: The goods are placed on the conveyor belt and after the camera scans the code, the correct row is taken to the location where the code was previously stored in each column If the code is wrong, the goods are taken to the end of the conveyor and taken out
- Export mode: Enter the location where the goods need to be shipped, the goods are put on the conveyor belt and released from the warehouse
We have a warehousing cycle carried out through the following steps:
- Step 0 (preparation): the crane returns to the waiting position (home position)
- Step 1: run the conveyor belt to bring goods inside
- Step 2: The barcode scanner scans barcodes and classifies products
- Step 3: check the warehouse, determine the warehouse location to bring goods into
- Step 4: the crane receives goods from the conveyor belt
- Step 5.1: the crane transports goods to the warehouse location where the goods need to be placed (only done when the goods are not full)
- Step 5.2: for goods and products that are full in the warehouse, the crane transfers the goods to another conveyor belt to take them to another warehouse (only done when the goods are full)
- Step 6: the crane sends goods to the warehouse reports that there are goods in the warehouse location and returns to the first step
We have a warehouse release cycle that is carried out through the following steps:
- Step 0: (preparation): the crane returns to the waiting position (home position), and stops the supply conveyor
- Step 1: The employee selects the type of goods to be released from the warehouse on the control interface screen
- Step 2: check whether the goods in the warehouse that need to be shipped are still available or not If the warehouse has stock, the system determines the warehouse location to go to to take the goods out If the warehouse is out of stock, notify us of the supply and return to step 1
- Step 3: the crane moves to the warehouse location where the goods need to be removed
- Step 4: The crane picks up goods from the warehouse
- Step 5: The crane transports the goods to the home location
- Step 6: The crane feeds the goods onto the conveyor belt and notifies the system that the goods have been removed
3.2.3 Selection of model design solutions
With optimal criteria in terms of quantity of goods stored in the warehouse within a certain area as well as quick pickup and return times, high efficiency The group found that the rectangular warehouse model could meet the stated requirements
Why choose automatic storage instead of traditional?
- Increase the number of goods in the warehouse when land area is limited, especially land reserved for warehouses is currently quite limited and expensive, including the construction of factories and warehouses, the storage area will not be large spacious, therefore saving space when applying the automatic system
- Reducing the time to import and export warehouses, short time will help increase the quantity of imported and exported goods and higher productivity
- Costs for labor, insurance, and maintenance are also significantly reduced
The mechanical part of the system needs to meet the following requirements:
- Solid structure, stable operation, no vibration
- The conveyor belt must match the size of the goods and withstand the load of the goods
- Moving parts need high precision and stable operation for a long time without maintenance.
Design calculations
Diameter of driving and driving wheels: D = D1 = D2 = 2.7 cm
The distance between the two axes is L = 30 cm
The width of the belt B = 2 cm, depending on the product size, we have width
The average mass of objects on the conveyor belt is m = 0.2 kg
To keep the object balanced on the conveyor belt while moving, we have a total force:
The reaction force N of the conveyor belt towards the product is:
The friction force of the conveyor belt is:
Where k is the friction coefficient between the object and the conveyor belt
Work A performs the pulling force:
➢ With the above calculations, we chose the JGB37 engine
3.3.2 Axis with 2 degrees of freedom
Calculate and select system components
- Main shaft rotation speed: 250 rpm
Calculate the screw-nut motion axis
The average diameter of thread:
𝛹H: Nut height coefficient (1.2 2.5 for whole nuts)
𝛹h: Thread height coefficient (0.5 for square threads)
The screw and nut material is steel - copper, so choose [q] = 8 (Mpa), 𝛹𝐻= 1.2
Substituting into formula (1) we have: d 2 ≥ √ 60 π 1,2.0,5.8 = 2(Lấy d 2 = 7mm)
Testing the durability according to the durability theory we have: σ tđ = √σ 2 + 3τ 2 = √(4Fa πd 1 2 )
[σ]: allowable stress (tensile or compressive)
43 d1: inner diameter of screw thread (6 mm)
7π) = 10,3 0 With the friction coefficient f = 0.1, we can calculate the friction angle φ arctg(0,1) = 5,71 0 , substituting into the formula we have:
Where: γ: screw angle φ=arctgf:friction angle d 2 : average diameter of screw thread
Substituting into formula (3) we have:
2= 68,9 (𝑁 𝑚) Select bearing surface: D0"mm, bearing moment value:
We have the friction coefficient f = 0.1:
Substituting into formula (2) we have:
➢ Because 𝝈 𝒕đ < [𝛔] the durability condition is guaranteed
Moment of inertia of screw section J:
6) = 33,9(mm 2 ) Radius of lead screw shaft cross-section: i = √ J π d 1 2 4
Substituting into formula (5) we get: i = √33,9 π 6 2 4
The softness λ of the lead screw is λ = 𝜇 1
Where: μ: equivalent length coefficient, determined as follows: μ = 1 when both screw heads are fixed by hinges μ = 0.7 when the screw head is fixed by a hinge, the other end is clamped μ = 0.5 when both screw heads are locked μ = 2 when the screw head is clamped at one free end l: length of screw
Because λ > 100, use the relay formula to calculate the limit load:
Substituting into formula (7) we get:
Durability test for lead screws:
Substituting into formula (8) we get:
Calculation and selection of Y axis motor
- Lead screw diameter: DB = 9.5 mm
Calculate the torque of the stepper motor:
F: force that makes the machine table move
F0: estimated displacement (F_0=1/3 F) μ0: threaded joint friction coefficient (0.1-0.3 take 0.3) η: engine efficiency (0.85-0.95 take 0.95) i: transmission ratio of the system
PB: lead screw pitch (4mm)
Force causing the machine table to move:
FA: External force μ: surface friction coefficient (0.1) θ: tilt angle of X axis (0 0 )
Figure 3.1 Force causes the Y axis to move
Consider that the external force applied is dismissed, the mass of the X axis is 10 (kg) and the tilt angle of the X axis is 0 degrees
Substituting numbers into formula (11) we have:
Because the motor is connected to the vitme transmission mechanism with a rigid coupling, the transmission coefficient is 1:
Substituting numbers into formula (10) we have:
Formula for calculating acceleration torque: (generally applicable to engines)
JL: moment of inertia t t1: acceleration time (2s)
NM: rotation speed of lead screw
Calculate the load moment of inertia:
Moment of inertia of lead screw:
Substituting numbers into formula (14) we have:
Figure 3.3 Moment of inertia of lead screw
LB: lead screw length ρ: density of steel
Moment of inertia of the machine table:
Substituting numbers into formula (15) we get:
Deduce the load moment of inertia according to formula (13):
Select the rotation speed of the lead screw 𝑁 𝑀 = 250 𝑟𝑝𝑚
Acceleration torque according to formula (12)
Choosing the safety factor S f = 2, we have the motor torque according to formula (9)
Conclusion: From the above calculation results, we choose the Step motor NEMA
17, size 42 x 48mm, rated intensity 1.5A, holding torque 0.55 Nm
Figure 3.4 Dimensions of Nema 17 stepper motor
Step motor NEMA 17 size 42 x 48mm (Stepper motor) is a type of stepper motor commonly used when making 3D printers, and mini CNC machines and is often installed with the GT2 pulley
Shaft diameter 5mm The flat beveled shaft end helps keep pulleys and joints from loosening during operation
Rated intensity 1.5A, holding torque 0.55 Nm, rotation angle each step 1.8°
1m extension cord, standard wire end XH2.54 Compatible with stepper motor output on RAMPS 1.5 or CNC shield V3 circuits
Suitable capacity for mini 3D and CNC printers
Calculation and selection of X-axis motor
- Lead screw diameter: DB = 16mm
Calculate the torque of the stepper motor:
F: force that makes the machine table move
F0: estimated displacement (F_0=1/3 F) μ0: threaded joint friction coefficient (0.1-0.3 take 0.3) η: engine efficiency (0.85-0.95 take 0.95) i: transmission ratio of the system
PB: lead screw pitch (4mm)
Force causing the machine table to move:
FA: External force μ: surface friction coefficient (0.1) θ: tilt angle of X axis (0 0 )
Figure 3.5 Force causes the X axis to move
Consider that the external force applied is negligible, the mass of the X axis is 10 (kg) and the tilt angle of the X axis is 0 degrees
Substituting numbers into formula (11) we have:
Because the motor is connected to the lead screw transmission mechanism by a rigid coupling, the transmission coefficient is 1:
Substituting numbers into formula (10) we have:
Formula for calculating acceleration torque: (generally applicable to engines)
JL: moment of inertia t t1: acceleration time (2s)
NM: rotation speed of lead screw
Calculate the load moment of inertia:
Moment of inertia of lead screw:
Substituting numbers into formula (14) we have:
Figure 3.7 Moment of inertia of lead screw
LB: lead screw length ρ: density of steel
Moment of inertia of the machine table:
Substituting numbers into formula (15) we get:
Where: m: mass of machine table
Deduce the load moment of inertia according to formula (13):
Select the rotation speed of the lead screw 𝑁 𝑀 = 250 (𝑟𝑝𝑚)
Acceleration torque according to formula (12)
Choosing the safety factor Sf=2, we have the motor torque according to formula (9)
Conclusion: From the above calculation results, we choose a stepper motor with a torque of 1.8Nm
Figure 3.8 Dimensions of Nema 23 stepper motor
Stepper motor Nema 23 57BYGH311 stepper motor has Dimensions: Flange 57mmx57mm, body length 76mm, shaft diameter 8mm
Load capacity: 3A, axial torque 1.8 Nm, 4 wires, weight 1.1kg
It is a 3-phase stepper motor, step angle 1.8 degrees/step
Engine runs smoothly, stably, low noise
The motor runs without heating, has a long life
Precise control of rotation angle
Nema 23 stepper motor 57BYGH311 Used widely for laser engraving machines, mini cnc machines, small automation machines
The factory's stepper motor has good quality, stable and accurate operation
Materials for conveyor belts
Currently, PVC conveyor belt production units are being widely used in all manufacturing industries today From heavy industry to light goods manufacturing industry such as used to transport food (food conveyor belt), electronic component manufacturing industry (heat-resistant conveyor belt)
Because the properties and structure of PVC conveyor belts create special features for conveyor belts when used in production
In today's assembly and production lines, PVC conveyor belts are one of the important and almost indispensable parts It contributes to the formation of a scientific and advanced production system that brings high production efficiency and liberates labor
PVC Conveyor Belt With Common Advantages Such As:
- Simple, compact design, highly aesthetic
- Very popular in many industries
- Relatively cheap price compared to other types of conveyors
- PVC conveyor belts are applied in many electronic industries such as: assembling components, assembling cars, motorbikes, electric bicycles, manufacturing machines,
- Good bearing capacity: As a product made from aluminum alloy material, aluminum has good bearing capacity Normally, shaped aluminum bars are designed with hollow cavities to increase rigidity The thickness of the aluminum, aluminum boundaries and technical walls are measured and designed most carefully Shaped aluminum products have heat-insulating bridges, stiffening ribs and many empty grooves, increasing the product's bearing capacity
- High aesthetics: Glass doors made from shaped aluminum have high aesthetics Aluminum walls, although thinner than other brands, have a large structure, so they both increase aesthetics and ensure the ability to bearing force from within Good heat and sound insulation: Aluminum profiles are resistant to high temperatures, tightly bonded aluminum elements create an aluminum frame system with good sound insulation
- Light weight: The weight of aluminum profiles is the lightest product material with the thinnest thickness Therefore, it will reduce the internal load and pressure on the projects, while also making it easier to move and install
- There are not many designs for customers to choose from
- Lifespan: After many years of using shaped aluminum products, they need to be maintained and replaced to ensure
- Within the framework of this project, I chose to use shaped aluminum to make the frame for the automatic warehouse because the advantages of shaped aluminum meet the proposed needs and the goods used in this project also has a small load
POM plastic possesses superior properties like other polymer plastics, some outstanding advantages of this plastic:
In addition to the advantages, POM plastic also has certain limitations such as:
- Poor resistance to acids and alkalis
- High expansion rate when weather changes
- Rich colors, smooth, flat, shiny, iridescent surface
- Abrasion resistant, withstands quite high temperatures, does not conduct heat
- Easy to shape, assemble, and bend
➢ Use mica plastic as railing for conveyor belts.
Mechanical transmission solutions
It is a transmission mechanism thanks to the friction force between the contact surfaces of the conductor and the conducted object The structure consists of 3 parts: driving wheel, driven wheel and belt Operating on the principle: when the driving wheel rotates, the friction between the belt and the driving wheel causes the driven wheel to rotate Belts come in toothed and toothless types and are all made from materials that create good friction Belt drive is also the earliest used mechanical transmission and is
56 still commonly used today in 3D printer applications, sewing machines or in continuously variable transmissions in motorbikes and cars
Outstanding features: The characteristic of synchronous (toothed) belts is low initial tension and therefore low load It is very suitable for slip-free transmission of small and medium power
Using the periodic rotation of steel balls between a rectangular rail and a sliding box creates linear motion The slider is usually tightly fixed on the machine surface, the slider is attached to the part that needs linear motion
- Smooth, low-friction linear motion
- Product purchase costs are expensive
Composed of: Slide rail, slider and bearing The sliding rail will be fixed in a position that meets the movement of that device Sliders help parts of the device move
- Simple structure, easy to install
A lead screw is a kind of mechanical linear actuator that converts rotational motion into linear motion Its operation relies on the sliding of the screw shaft and the nut threads with no ball bearings between them The screw shaft and the nut are directly moving against each other on a large contact area, so higher energy losses due to friction are produced However, the designs of lead screw threads have evolved to minimize friction
- The nut transmission has a simple structure, compact size, and convenient to use
- The transmission has high load capacity, works reliably, and does not make noise
- It has a very large transmission ratio that creates large axial force so the impact force is small
- Can perform highly precise movement with great self-braking ability
- Threads wear out quickly when working at high speed
Pulley GT2 20 Teeth is a GT2 standard pulley product used in belt drives commonly used in 3D printers, laser cnc machines and other machines with belt mechanisms The product is made from solid aluminum for good rigidity
➢ The belt drive mechanism uses pulleys and belts to rotate in the system because it is simple, easy to install, low cost, suitable for the group's capabilities and the system's requirements To increase the rigidity and certainty of the lifting mechanism, use a 4mm lead screw linear motion mechanism in parallel because the vitme needs high speed and precision
➢ Choose GT2 belt because this is a belt made of rubber, which transmits motion from the driving wheel to the driven wheel and creates linear motion for the system Because the pulley is GT2 type, we will choose GT2 belt type to suit the system.
Equipment choice
The power supply is used to provide power for the entire system Use 24 V DC, 6.5 A power source for the entire system (PLC, Driver, Sensor, Motor, )
3.6.2 PLC SIEMENS 1214C DC/DC/DC 6ES7214-1AG40-0XB0
The function of PLC is to receive peripheral signals, using built-in algorithms to create signal processing programs and control the system automatically
According to the analysis of the advantages and disadvantages of PLC types along with system requirements, our group uses PLC of Siemens, because Siemens PLCs are strong in process control and control via communication, supporting many functions related to the requirements of the maths lesson
There are 3 high-speed pulse channels to control the motor
Connect to transmit and receive data with Visual studio
Figure 3.19 SIEMENS 1214C DC/DC/DC
- Compact CPU DC/DC/DC
- Onboard I/O: 14 DI 24 V DC; 10 DO 24 V DC; 2 AI 0-10 V DC
By choosing the size and capacity of the stepper motor, we choose the driver for the motor, type TB6600 with a maximum control current of up to 4A TB6600 4A 42V stepper motor driver circuit uses IC TB6600HQ/HG, used for stepper motor types: 42/57/86 2-phase or 4-wire with load current of 4A/42VDC
Used in machine making such as CNC, laser or other automatic machines
- Input has optical isolation, high speed
- Has built-in overcurrent and overvoltage measurement
- DC+: Connect to a power source from 9 - 40VDC
- DC-: Negative (-) voltage of the source
- A+ and A-: Connect to the coil pair of the stepper motor
- B+ and B-: Connect to the remaining pair of coils of the motor
- PUL+: Control pulse supply signal
- PUL-: Control pulse supply signal
- ENA+ and ENA-: when giving signals to this pair, the motor will no longer have holding and rotating torque
Control the stepper motor with PLC through the TB6600 stepper motor driver:
In this project, we use a stepper motor to control the lead screw to move in a straight line along the axes Through the belt drive, we determine the necessary number of revolutions of the motor to reach the specified position
Through digital control of the pulses supplied to the stepper motor driver, we will be able to control the stepper motor to rotate the correct number of revolutions as required to reach the desired position We will use the driver's two pins PUL+ and DIR+ to control: with PUL+ receiving the number of pulses supplied to the motor, DIR+ receiving a logic level of 0 or 1 to determine the direction of rotation of the motor Connection diagram between PLC with driver and stepper motor as shown
When using a PLC to control a stepper motor, we will use the 3 integrated PTO pulse channels in the S7 - 1200 to generate control pulses for the driver In the device configuration section in the TIA Portal software, we turn on 3 PTO pulse channels as shown
Next we will declare the technology element in the PLC To control the 3 axes X, Y,
Z with a stepper motor, we declare 3 technology elements: go to Technology Objects > Add new object as shown
Figure 3.24 Declare pulse generator pin, control direction pin
We select the control pulse generator channel in the Select pulse generator section In the figure, we configure the horizontal axis with channel 1 (Pulse 1) as the control pulse channel In which pin Q0.0 will be the pulse generator pin connected to PUL+ of the driver, and pin Q0.1 is the direction setting pin connected to DIR+ of the driver
Figure 3.25 Pulse per step and lead screw step distance
Next, in the Mechanics section, we configure the motion for the stepper motor: the number of rotation pulses in 1 revolution (here we choose the microstepping mode of 800 steps/revolution, so we will enter 800) The displacement distance of the object when the motor rotates 1 revolution, for example the X axis is 16.25mm/revolution (determined
65 through the number of teeth of the belt pulley and tooth pitch and is equal to the number of teeth multiplied by the tooth pitch for direct drive and for indirect drive through the transmission, multiplied by the transmission ratio)
Figure 3.26 Declare speed, acceleration and deceleration time
Next, we enter the maximum and minimum speed as well as the acceleration and deceleration time to control the motor as shown
We will do the same with the remaining two objects (controlling the z axis and y axis)
For the graduation project model, the group used a stepper motor to control the lead screw because the error was small (within the allowable range) as well as the cost was reasonable
Technical specifications of the stepper motor used for the Y axis in the project model:
Technical specifications of stepper motor used for X, Z axis in project model: Rated voltage: 4-5.5VDC
For conveyor operation, our team uses a 24v gear reduction motor in this project model
With the purpose of minimizing costs and requiring object detection with fast and stable response time, our team uses photoelectric sensors
One prominent and popular sensor among them is the E3F-DS30C4 sensor with the following technical specifications:
- Distance can be adjusted via potentiometer
- There is a red LED displaying the output signal
To optimize costs, our team uses the phone's camera to upload the QR code image to the SCADA control and monitoring interface
- Integrated Microphone, easy to talk and video call
- 3x Zoom mode for closer, clearer observation
- Compatible with operating systems: Windows XP, VISTA, 7 and higher; Mac OS 10.4.6 and higher; Linux 2.6.21 or later
3.6.8 Circuit Breaker ANDELI ADB3-63 (CB)
CB plays an important role in the electrical system, the main task of the CB is to protect the electrical circuit, prevent overloads, short circuits, voltage drops, reverse power transmission, anti-shock, anti-leakage, and thermal protection
- Short circuit breaking current: 6kA
- Application: Used in civil power networks
- Impulse test voltage (Uimp): 4kV
Relay is a type of automatic electrical device whose output signal changes step by step when the input signal reaches certain values It is an electrical device used to switch, protect, and control electrical circuits work of electrodynamic circuits Intermediate relays belong to the electromagnetic relay group, made of electromagnets and a system of switching contacts
In this model project, our team uses 3 intermediate relays
- Contact current (resistive load): 7A at 250VAC, 7A at 30VDC, 5A at 220VAC, 5A at 24VDC
Limit switches are used to close, disconnect, and switch control circuits in automatic electric drives according to the "travel" signal in mechanical moving mechanisms to automatically control the working journey or automatically disconnect electrical circuit at the end of the journey to ensure safety
In this model, our team uses 3 limit switches
Figure 3.36 Some type of push button
Functions: Used to start, stop and select the system's working mode
- Use 24VDC power supply to 2 power pins
- Number of contacts: 1NO + 1NC 5A/250 VAC
Use the 24V AD16 indicator light to display the system's operating status Because this type of lamp is quite common, there are very few choices
3.6.13 Siemens SM 1223 DC/DC 6ES7 223-1BH32-0XB0
Due to the shortage of PLC output pins, our team decided to choose the sm 1223 dc/dc module to expand the pins
- Current consumption (SM Bus): 145 mA
Design sketch drawings for model construction
The warehouse is responsible for storing goods brought in from the crane and is a place to take goods out when goods need to be exported from the crane
Figure 3.41 Dimensions of the warehouse
The conveyor belt is responsible for bringing goods into and taking goods out of the crane The goods supply conveyor is designed with an additional scanner rack attached The results of conveyor belt simulation using Solidworks software are as shown below:
Figure 3.43 Size of conveyor belt
The team's ultimate goal is to build a complete reality model as shown in the following simulation using Solidworks software:
Block diagram and functions
Figure 3.45 Block diagram of the system
Functions of blocks in the system:
- Source: Provides 24VDC power for operating devices
- SCADA: Receive, process and display product code information then transmit the information to the central processing block
- Actuators: Receive control information (coordinates, velocity, ) from the central processing block and driver block to run lead screw motors, indicator lights, and conveyors
- Sensors: Receive the signal that the goods have been detected and send them to the central processing block
- Drivers: Receive signals from the central processing block and control the actuators block
- QR code Reader: Recognize and process the image of the QR code and write the data to the central processing block then send the processed information to the scada block.
System control flow diagrams
Flow chart of import and export process:
80 Flow chart of crane control algorithm:
81 Flow chart of import and export algorithm:
83 Flow chart of operating modes:
84 Flow chart of QR code processing algorithm:
Figure 3.52 QR code processing algorithm
Wiring diagram
3.10.1 PLC input and output wiring diagram
Figure 3.53 PLC input and output connection diagram
3.10.2 Wiring diagram of reducer motor and stepper motors
Figure 3.54 Connection diagram of drivers and relays
SYSTEM CONSTRUCTION
Mechanical parts
According to the initial calculated data, the system uses the following devices:
Table 4-1 List of devices used
2 PLC SIEMENS 1214C DC/DC/DC 1
Electrical parts
Based on the connection diagrams made in chapter 3, the team assembles the system's electrical cabinets
Figure 4.4 rear of the outside
The login screen is simple, easy to use, will appear first on the interface when we access online according to the ip address set in the PLC
The system's display screen has the function of controlling and monitoring the status of warehouses and crane
System image obtained during testing:
In the initial state when the system is not operational, after pressing Power, the Start light lights up and the system begins to operate Press Home and the system will move to the home position
Figure 5.3 Turn on the power button
In import mode: the green indicator light indicates that the system is in the mode of importing goods into the warehouse
After reading the data from the QR code on the package, the screen will display information about the goods being imported and start counting the quantity of the sorted product
After the goods have been placed in the warehouse, the display screen will show which places are full
Figure 5.5 Display mode when goods are in stock
In export mode: the green indicator light indicates that the system is in the mode of exporting goods from the warehouse
After we enter the type of goods to be warehoused, the crane will start to go to the storage location corresponding to the data to pick up the goods
Figure 5.6 Select the type of goods to export
After the goods are brought to the conveyor belt, the system receives data from the
QR code and begins to subtract the quantity corresponding to the product type distinguished by the data attached to the package
Figure 5.7 Displays the remaining quantity of goods
After goods are exported from the warehouse, the display screen will indicate which storage locations are out of stock
Figure 5.8 Display mode when goods are out of stock
The conveyor icon will emit a green signal when the area where the conveyor belt is operating In addition, we can also monitor the positions of the crane
Figure 5.9 Display mode when the conveyor belt is operating
5.2 QR code image processing interface
QR code reader software is written in C# language, it has a simple interface and is easy to use
Figure 5.10 QR code scanning software interface
Here, we have the camera source device option
Figure 5.11 Select the image source
RESULTS - COMMENTS – EVALUATION
Control and monitor on the phone
Here, after opening the nat port on wifi and establishing the correct connection with the computer and PLC, we can easily access the web server on the phone
The interface is displayed on the phone after successfully accessing the web server
Figure 5.14 Interface displayed on the phone
We can easily control and monitor the product model on the phone
Figure 5.15 System management interface on the phone
Analyze and compare
Table measuring export and import time between storage locations (numbers 1A to 9B are the location of the goods storage place)
Table 5-1 Comparison table of import and export times
The period for import and export in the automatic system is quite stable and does not differ much According to experimental records, the team found that when entering inventory at the first location, it only took about 15 seconds and at the farthest location, the storage time was 47 seconds The average time is about 24 seconds.
Evaluation
- The system does export and import according to the required location,
- Scan dynamic and continuous barcodes
- Develop an algorithm to help warehouse import and export operate in the fastest and most stable time
- The system has the ability to distinguish whether the storage area has enough goods or not
- Able to monitor and control the system on the phone
- Simple structure, easy maintenance and repair
- Still have to deliver goods by hand
- Data loss when the system crashes
- The system does not operate correctly if the goods are oriented incorrectly
- The system cannot store and retrieve detailed commodity data
- The system is not capable of storing and retrieving detailed data on goods
- Not taking optimal advantage of PLC features
- The function of the product model is not close to reality
CONCLUSION AND DEVELOPMENT DIRECTION
Conclusion
After the research and implementation process, the student group completed the project "Control and monitoring of an automatic storage system based on barcodes" and achieved the following results:
- Use SolidWorks software to design mechanical parts in the model, and export drawings so they can be ready for manufacturing
- Use AutoCAD Electrical software to design and construct electrical cabinets following actual electrical cabinet standards
- Complete the automatic storage system model to operate to meet the requirements set out by the group
- Classify products by scanning QR codes from the scanner
- Designed PLC control program using Tia Portal software
- Designed the Web server interface to control and monitor the system
- Designed QR code processing software in C# language
- Understand the operating principles of devices used in projects such as PLCs, stepper motors, cylinders, sensors, etc Know more about how to wire devices together.
Limitations of the product model
In the process of completing the project, there are certain limitations:
- Because the model system uses stepper motors, it is easy to miss steps during operation
- The project model has a small warehouse system with a small number of rows
- The quality of scanning codes from the scanner is still slow and the stability is not good
- There is no manual mode
- The mechanical part makes noise when operating.
Development direction
- Expand and increase the number of storage spaces in the warehouse
- Increase the number of warehouses so that cranes can operate more
- To increase accuracy during the picking process, the crane can be replaced with a robotic picking arm
- Replace the stepper motor with a servo motor with encoder feedback to increase the accuracy of the system
- Develop automation of supplying goods to conveyor belts
- Develop and integrate SQL database into the system
[1] Assoc Prof Ph.D Ngô Văn Thuyên Lập trình với PLC S7 1200 và S7 1500
[2] Trần Văn Hiếu Thiết kế hệ thống HMI/SCADA với Tia Portal
[3] SIEMENS S7-1200 Programmable Controller System Manual
[4] Assoc Prof Ph.D Trần Thu Hà Giáo trình Điện tử cơ bản
[5] MSc Nguyễn Trần Minh Nguyệt Bài giảng Hệ thống điều khiển tự động
[6] Assoc Prof Ph.D Ngô Văn Thuyên Bài giảng Hệ thống SCADA
[7] https://www.elementlogic.co.uk/insights/category/autostore/types-of-asrs/
[8] https://www.plcskilltree.com/blog/control-your-servo-axis-my-top-5-motion-control- instructions-in-TIA-Portal
[9] https://www.automation-fair.com/stepper-motor-control-with-siemens-s7-1200/
[10] https://www.engineersgarage.com/dc-motor-control-using-h-bridge/
Code of software to read and process QR code image data
// Khai báo thư viện sử dụng trong mô hình using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using AForge.Video.DirectShow; using AForge.Video; using System.Threading; using ZXing; // Thư viện Zxing là thư viện quét QR code using S7.Net; // Thư viện giao tiếp PLC với C# namespace Send_Scan_Data_To_PLC
{ public partial class Form1 : Form
Plc plc_s7_1200; // Khai báo tên PLC
CpuType Cpu_Type = CpuType.S71200; // Chọn kiểu CPU string Ip = "192.168.0.7"; // Địa Chỉ PLC cần kết nối vào short Rack = 0; // ở Rack 0 short Slot = 1; // Vị trí thứ 1
FilterInfoCollection filterInfoCollection; // Khai báo hàm camera
CancellationTokenSource cancellationToken; // Khai báo hàm quét dữ liệu byte[] Ouput = new byte[10]; // Khai báo mãng dữ liệu public object S7Net { get; private set; } public Form1()
} private void label1_Click(object sender, EventArgs e)
} private void Form1_Load(object sender, EventArgs e)
{ plc_s7_1200 = new Plc(Cpu_Type, Ip, Rack, Slot); // Sau khi load chương trình lên sẽ khai báo PLC plc_s7_1200.Open(); // Mở kết nối với PLC filterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice); // Lấy dữ liệu camera kết nối dc với chương trình foreach (FilterInfo Device in filterInfoCollection) // Hàm lấy tất cả camera show ra combobox
107 comboBox1.Items.Add(Device.Name); if (comboBox1.Items.Count > 0)
{ comboBox1.SelectedIndex = 0; videoCaptureDevice = new VideoCaptureDevice();
} private void button2_Click(object sender, EventArgs e)
VideoCaptureDevice(filterInfoCollection[comboBox1.SelectedIndex].MonikerString); // Sau khi nhấn button sẽ kết nối với PLC videoCaptureDevice.NewFrame += FinalFrame_NewFrame; // kiểm tra camera videoCaptureDevice.Start();// Camera bắt đầu hiển thị cancellationToken = new CancellationTokenSource(); // khai báo sử dụng hàm cancell var sourcetoken = cancellationToken.Token;
Read_Data_QR(sourcetoken); // Khai báo chương trình đọc QR Code
Write_Data(sourcetoken); // Khai báo chương trình ghi dữ liệu xuống PLC if (plc_s7_1200.IsConnected ==true) // Kiểm tra đã kết nối với PLC chưa ?
{ timer1.Enabled = true; timer1.Interval = 1000;
MessageBox.Show("Connect OK", "MessageBox", MessageBoxButtons.OK, MessageBoxIcon.Information); // Show ra 1 bảng thông báo trên màn hình
MessageBox.Show("Connect Error", "MessageBox", MessageBoxButtons.OK, MessageBoxIcon.Information);
} private void FinalFrame_NewFrame(object sender, NewFrameEventArgs eventArgs) // Chuong trinh hiển thi video
{ pictureBox1.Image = (Bitmap)eventArgs.Frame.Clone(); // Đọc dữ liệu camera
} bool Start_Scan = false; public void Read_Data_QR(CancellationToken sourcetoken) // chương trình read data QR code
Task.Factory.StartNew(new System.Action(() =>
Thread.Sleep(300); if (Start_Detect_Color == true)
BarcodeReader Reader = new BarcodeReader(); pictureBox1.BeginInvoke(new System.Action(() =>
{ var results = Reader.DecodeMultiple((Bitmap)pictureBox1.Image); if (results != null)
{ foreach (Result result in results)
{ textBox1.Text = result.ToString(); //Show dữ liệu QR code lên màn hình
} bool Start_Detect_Color = false; void Read_Data_1()
{ plc_s7_1200 = new Plc(Cpu_Type, Ip, Rack, Slot); plc_s7_1200.Open(); byte[] Read_Data = plc_s7_1200.ReadBytes(DataType.Memory, 0, 0, 10); if (Read_Data[4].SelectBit(1) == true) //Read m0.7
Console.WriteLine("Tín hiệu M0.7 là TRUE");
Console.WriteLine("Tín hiệu M0.7 là FALSE");
Thread.Sleep(1000); // Đọc dữ liệu mỗi giây (có thể thay đổi thời gian theo nhu cầu của bạn)
Console.WriteLine("Lỗi: " + ex.Message);
// Write_Log("Start Detect QR Code ");
} int get2(string a) // Chương trình con lấy 2 số đầu của mã sản phẩm trên giao diện
{ string bienA = a.ToCharArray()[0].ToString() + a.ToCharArray()[1].ToString(); return Convert.ToInt32(bienA);
} int Data_QR_Code; public void Write_Data(CancellationToken sourcetoken) // chương trình read data QR code
Task.Factory.StartNew(new System.Action(() =>
Write_Data_To_PLC(); // Chương trình con ghi dữ liệu
} void Write_Data_To_PLC() // Chương trình số QR code ghi xuống PLC ( Chú ý phần này )
{ int dbNumber = 59; // Địa chỉ DB18 ( Data Block 18 trong PLC ) int dbstartAddr = 0; // Địa chỉ bắt đầu ghi xuống string input = textBox1.Text; // Sẽ ghi dữ liệu từ Textbox1 xuống PLC byte[] dataBytes = Encoding.ASCII.GetBytes(input); // Khai báo 1 chuỗi data để lưu dữ liệu QR code byte maxLength = (byte)input.Length; // Chiều dài của chuỗi byte actualLength = (byte)input.Length;//Chiều dài của chuỗi byte[] data = new byte[maxLength + 2]; data[0] = maxLength; data[1] = actualLength;
Array.Copy(dataBytes, 0, data, 2, actualLength); plc_s7_1200.WriteBytes(DataType.DataBlock, dbNumber, dbstartAddr, data); // Hàm ghi dữ liệu QR xuống PLC
} private void button1_Click(object sender, EventArgs e)
{ if (videoCaptureDevice != null) // Kiểm tra đã kết nối camera chưa ?
{ if (videoCaptureDevice.IsRunning) // Nếu kết nói rồi thì cho videoCaptureDevice.Stop(); // Stop Camera
} private void textBox1_TextChanged(object sender, EventArgs e) // Hàm ghi 8 vị trí xuống PLC theo từng số model QR code
Data_QR_Code = get2(textBox1.Text); // Sau khi lấy dữ liệu 2 số đầu if (Data_QR_Code == 11) // Nếu đọc được 2 số đầu của mã QR là 11 thì sẽ ghi dữ liệu M25.4 xuống PLC { plc_s7_1200.WriteBit(DataType.Memory, 0, 2, 3, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 2, 3, false);
} if (Data_QR_Code == 22)// Nếu đọc được 2 số đầu của mã QR là 21 thì sẽ ghi dữ liệu M25.5 xuống PLC { plc_s7_1200.WriteBit(DataType.Memory, 0, 2, 5, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 2, 5, false);
111 if (Data_QR_Code == 33)// Nếu đọc được 2 số đầu của mã QR là 31 thì sẽ ghi dữ liệu M25.6 xuống PLC { plc_s7_1200.WriteBit(DataType.Memory, 0, 3, 3, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 3, 3, false);
} if (Data_QR_Code == 141)// Nếu đọc được 2 số đầu của mã QR là 41 thì sẽ ghi dữ liệu M25.7 xuống PLC { plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 7, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 7, false);
} if (Data_QR_Code == 112)// Nếu đọc được 2 số đầu của mã QR là 12 thì sẽ ghi dữ liệu M25.0 xuống PLC { plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 0, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 0, false);
} if (Data_QR_Code == 122)// Nếu đọc được 2 số đầu của mã QR là 22 thì sẽ ghi dữ liệu M25.1 xuống PLC { plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 1, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 1, false);
} if (Data_QR_Code == 132)// Nếu đọc được 2 số đầu của mã QR là 32 thì sẽ ghi dữ liệu M25.2 xuống PLC { plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 2, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 2, false);
} if (Data_QR_Code == 142)// Nếu đọc được 2 số đầu của mã QR là 42 thì sẽ ghi dữ liệu M25.3 xuống PLC { plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 3, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 25, 3, false);
} private void Status_Click(object sender, EventArgs e)
} private void timer1_Tick(object sender, EventArgs e)
} private void button6_Click(object sender, EventArgs e)
{ plc_s7_1200.WriteBit(DataType.Memory, 0, 0, 0, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 0, 0, false);
} private void button4_Click(object sender, EventArgs e)
{ plc_s7_1200.WriteBit(DataType.Memory, 0, 0, 7, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 0, 7, false);
} private void button5_Click(object sender, EventArgs e)
{ plc_s7_1200.WriteBit(DataType.Memory, 0, 0, 6, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 0, 6, false);
} private void button3_Click(object sender, EventArgs e)
{ plc_s7_1200.WriteBit(DataType.Memory, 0, 0, 5, true);
Thread.Sleep(100); plc_s7_1200.WriteBit(DataType.Memory, 0, 0, 5, false);
} private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
} private void pictureBox1_Click(object sender, EventArgs e)
} private void label2_Click(object sender, EventArgs e)
Code on the web server program
×
Username
Password
Login
Remember me
Cancel
Forgot password?