Design of lightweight AGV car system based on mqtt

  • A+
Categories:AGV Data
Excerpt

Abstract: in this paper, a lightweight AGV car system applied to the Internet of things is designed. The main controller uses STM32F103 single chip microcomputer, combined with NFC chip to realize tracking and path positioning functions, and the information is transmitted to the server by sim7600lte chip through mqtt protocol. At the same time, the mobile app is designed to realize the lightweight AGV real-time monitoring and scheduling management system. Compared with the traditional MES system, the proposed system uses the modular design concept, has a more friendly UI interface and more flexible functions.

0 Introduction

With the rapid development of logistics system, the application field of AGV (automated guided vehicle) is also expanding. AGV is a kind of automatic guided vehicle, which is usually used in the factory workshop, and needs to be equipped with a specific manufacturing enterprise production process execution system (MES) [1]. This system is generally sold by professional companies for large enterprise users. For ordinary users, the cost is too high, the customization is difficult, and the practicability is not high.

The purpose of this paper is to study the lightweight AGV car system, so that it can be applied to more scenes. In order to schedule AGV in more scenarios, using the modular design concept, a server-side program is designed for data interaction with the lower computer, and the mobile app is designed for user interaction.

1 Overall design of the system

The overall system diagram of AGV logistics car is shown in Figure 1.

Design of lightweight AGV car system based on mqtt

Figure 1 overall system design block diagram

Compared with the traditional AGV car system, the starting point of this design is how to improve the flexibility of the AGV system compared with the complex and high cost AGV system, and expand the scope of use.

AGV car system is mainly divided into three parts: car end, server side and user side. When the car terminal is opened for the first time, it will enter the self-test, and then report the vehicle information to the server, which is transmitted through LTE using mqtt protocol. The server receives and updates the vehicle database, and then sends the vehicle and map information to the user through app. The car waits for the information feedback from the server at the starting point, and then starts to work.

When the car scans the code to detect the package bar code, it reports the location label information and package information. After receiving it, the server compares and queries the database, and calculates and returns the optimal path information to the car end. After receiving the information, the car will take the next action, and the server will update the information synchronously and feed back to the client. The user can query the status of the car through app at any time and control the car to form a closed-loop monitoring.

2 Hardware circuit design

2.1 Overall design of hardware circuit

Figure 2 shows the hardware system framework of AGV car system. The AGV car master uses stm32f103zet6 of Cortex-M3 core of ST company. The main frequency of the chip is 72 MHz and there are multiple UARTS. The system realizes infrared tracking and data processing through the main control, identifies and locates the NFC tag through serial port and SPI interface, and interacts with the server through LTE communication technology in real time.

Design of lightweight AGV car system based on mqtt

Figure 2 hardware system block diagram

2.2 NFC positioning and interaction

In the actual environment, most of the shelves are planned and placed in the form of grid. Therefore, the accurate positioning function can be achieved by placing NFC chips on the appropriate path points.

Near field communication (NFC) is used to identify the location of AGV car. NFC recognition process does not need human intervention and has strong anti-interference ability. It can be used in various harsh environments and more scenes. NFC is more flexible than RFID and easy to operate. It only needs to place tags in corresponding places. NFC also supports read-write mode, card mode and peer-to-peer (P2P) mode. It can control AGV to read and write tags. It can also communicate between two AGV cars, which greatly improves the interaction between AGVs. Since the label used for positioning is passive, it does not need additional power supply, which greatly reduces the power consumption and maintenance cost, and has high portability [3-4].

RFID location tag data is mainly the relative coordinate position information of the current tag, which can be set according to different needs. Considering the demand comprehensively, this paper selects the pn532 chip of NXP company. Pn532 is a highly integrated contactless read-write chip. It contains 80C51 microcontroller core and integrates various active / passive contactless communication methods and protocols at 13.56MHz (Serial uart, I2C, SPI). The test results show that the speed and accuracy can meet the requirements.

2.3 LTE communication

In order to improve the flexibility of AGV system transplantation, the practical scenarios of AGV are not limited to traditional workshops and factories. Therefore, the flexibility of transmission and communication is required to be very high. However, the conventional AGV needs to network by itself, which greatly increases the cost of construction and maintenance, and the portability is not high. Therefore, the communication technology selected here is LTE (long term evolution). Because the base station is maintained and constructed by mobile operators, the use and maintenance cost is greatly reduced, and the portability is greatly improved. As of May 2019, 4.37 million 4G base stations have been built in China, which can meet the coverage requirements of general use scenarios. Moreover, compared with the traditional GSM and WCDMA, its transmission rate is higher.

The communication between AGV car and server uses mqtt protocol. The fourth part is the content of the current vehicle ID, which can be updated by the current vehicle ID when it arrives; the fourth part is the content of the current vehicle ID which can be updated by the current vehicle ID The condition information is packaged and sent to the server, and then the server will feed back to the AGV car for the next action according to the algorithm calculation.

The use of LTE chip is sim7600ce chip of simcom company. It can support GSM, TD-SCDMA, CDMA, WCDMA, tdd-lte and fdd-lte frequency bands, and supports TCP / IP / IPv4 / IPv6 / mqtt. It can flexibly select communication protocol and mode according to the actual situation. It supports lte-cat4, with the maximum uplink speed of 50MB / s and the maximum downlink speed of 150MB / s. after physical debugging, it can meet the requirements of AGV between servers Data and information exchange[5].

3 Design of server and mobile app

3.1 Design of communication between server and car client based on mqtt protocol

Mqtt message queuing telemetry transport is a message protocol based on publish / subscribe paradigm under ISO standard (ISO / IEC PRF 20922) [6]. It works on the TCP / IP protocol family and is a publish / subscribe message protocol designed for remote devices with low hardware performance and poor network conditions [7].

Compared with traditional HTTP queries, mqtt has the following advantages [8]:

(1) Mqtt uses the publish / subscribe paradigm to provide two-way links.

(2) With QoS (quality of service) function, mqtt can provide high transmission guarantee for the network with limited capacity. There are three QoS levels: guarantee the best delivery; ensure that the message is delivered at least once; ensure that each message is received by the other party only once.

(3) Mqtt has the functions of last will and Testament and retained messages. The former enables the server to receive the abnormal offline information of the client in time after the abnormal offline, and the latter enables the client to receive the information sent by the server in time after it goes online.

An example of an mqtt connection (QoS 0) is shown in Figure 3

Design of lightweight AGV car system based on mqtt

Figure 3 an example of an mqtt connection (QoS 0)

Table 1 shows the packet capture statistics of the string {hello ":" world "} returned by the server after 10 requests from the two methods. The statistical results show that the mqtt protocol has obvious advantages over the HTTP get mode in terms of the number of packets transmitted and the length of the packets.

Design of lightweight AGV car system based on mqtt

Table 1 network traffic statistics of mqtt protocol and HTTP protocol

The mqtt broker used this time is emqx, which provides convenient docker deployment and convenient dashboard, which can be used for broker management and information sending and receiving. After the dockerfile and docker composer are packaged into containers, the environment can be simply configured in other servers. The configuration environment is as follows:

$ docker pull emqx/emqx :v3.1.0
$ docker run -d --name emqx31 -p 1883 :1883 -p 8083 :8083 -p 8883 :8883 -p 8084 :8084 -p 18083 :18083 emqx/emqx :v3.1.0

When the broker receives the message, it forwards it to the server back-end for processing. In this case, the server side uses eclipse PAHO mqtt Python client to receive the information forwarded by the broker. In addition to supporting running in non blocking mode, the eclipse PAHO mqtt Python client also provides many callback functions to use and process callback information in different situations [9]。
This paper uses the on_ The message callback function automatically stores the information received by mqttclient into the variable MSG, and then calls the write written by ourselves_ The payload function is passed to the main program for processing. The multithreading architecture is shown in Figure 4.

Design of lightweight AGV car system based on mqtt

Figure 4 multithreading architecture

In order to improve the efficiency of the server back-end, this paper creates a process for restful API and mqttclient respectively, and schedules the two threads to work together by using the threading library.

3.2 Design of communication between server and app based on restful API

Representational state transfer (rest) is a kind of World Wide Web software architecture style proposed by Roy Thomas fielding in his Doctoral Dissertation [10] in 2000. The purpose is to facilitate different software / programs to transfer information to each other in the network.

Restful API abstracts the data stored on the server into a resource, uses URL as its identifier, and uses general HTTP request methods (get, post, put, delete) to add, modify, delete and query it. Compared with the common API, the modeling process of restful API is similar to the object-oriented modeling process, so it is more suitable for Python programming ideas.

The server background program is written in Python based on the above principles. Python has a very convenient library for building restful API and processing JSON format data, and can also be ported to other systems. App is used in this paper wx.reguest After requesting data from the server, it can be directly parsed and called, which is very convenient.

App is divided into overview, vehicle management and package management. The overview part can see some basic statistical information. The vehicle management part can manage the car offline and recall, and the package management can manage the package addition, modification, distribution and car delivery. The app interface is shown in Figure 5.

Design of lightweight AGV car system based on mqtt

Figure 5 app interface

4 Conclusion

This paper designs a set of system applied to the Internet of things technology AGV car, through NFC technology to achieve tag positioning recognition, car through LTE communication technology, using flexible mqtt protocol to establish communication interaction between the server, in the server for data processing and integration, through app to feed back information to users, forming a closed loop, compared with the traditional AGV The system reduces the cost and improves the flexibility.

Reference

[1] 张辰贝西,黄志球 . 自动导航车(AGV)发展综述 [J]. 中国制造业信息化,2010,39(1):53-59.
[2] 卢少平 . 基于 RFID 的 AGV 定位与导引研究 [D]. 济南:山东大学,2011.
[3] 唐浩强 . 基于物联网的智慧工厂实验系统的设计与开发 [D]. 南京:南京理工大学,2017.
[4] 潘军,王焜,缪欣呈 .AGV 智能制造平台方案的设计与研究 [J].物流技术与应用,2019,24(12):146-148.
[5] 丘源,经本钦,李精华 . 基于 ESP8266WiFi 模块和 MQTT 协议的物联网传感节点设计 [J]. 物联网技术,2019,9(6):24-26.
[6] International Organization for Standardization. ISO/IEC 20922:2016-Information technology-message queuing telemetry transport(MQTT)v3.1.1 [S]. Geneva:IX-ISO,2016.
[7] 郭力,胡伟,张政成 . 试析 MQTT 协议在物联网中的应用 [J]. 电脑知识与技术,2019,15(28):31-32.
[8] 成闻博 . 基于 MQTT 协议的物联网消息推送系统构建 [J]. 信息与电脑,2019(18):161-162.
[9] ARLEN Nipper. MQTT's role as an IoT message transport [J]. Control Engineering,2019,66(1):20-21.
[10] FIELDING Roy Thomas. Architectural styles and the design of network-based software architectures [D]. Irvine:University of California,2000.

Comment

You must beto post a comment.