FPGA based modbus gateway design
2015
0 views
0 downloads
Advisor: Yrd. Doç. Dr. Ali Fuat Ergenç
Abstract (EN)
Protocol is a system that outlines the rules with the aim of achieving a certain level of communication between two same cases. Industrial communication protokols are standart languages that allow data exchange among industrial devices and systems. Data transmission between two devices can obtain either using the same indutrial communication protocol or using an industrial protocol converter. Nowadays, the most used industrial protocols can list as Fieldbus, Profibus, Modbus, Canbus, Devicenet and Controlnet. Modbus protocol was developed in 1970s and new versions were developed in years. Electronic devices are widely used Modbus protocols nowadays, because of easy, fast and open source. Modbus protocol was first implemented over serial line. There are two serial transmission mode which is commonly used are Modbus RTU and Modbus ASCII. The transmission mode and serial port parameters must be the same for all devices on a Modbus serial line. Although, the ASCII mode is required in some specific applications, but generally for interoperability between Modbus devices RTU mode is used. Modbus RTU transmit data using specific data frame, but Modbus ASCII transmit data with using ASCII characters. With the development and expansion of Ethernet technology, Modbus protocol need to adapt Ethernet network and Modbus TCP protocol has been developed. In this thesis, Modbus RTU and Modbus TCP protocols are examined and a gateway device, which supports both Modbus protocols, is designed and tested on an industrial system that have different Modbus devices. Modbus RTU protocol works on the data link layer of the OSI model. On the physical layer, data transmission obtained using EIA/TIA 485 (RS-485) or EIA/TIA 232 (RS-232) data transmission modes. For RTU protocol, the third, fourth, fifth and sixth layer of OSI model is empty. Modbus application protocol works on application layer (seventh layer) of OSI model. Modbus serial line protocol is a kind of master/slave protocol. A master/slave type system has one master node that issues explicit commands to one-slave nodes and processes responses. Slave nodes are not typically transmit data without a request from the master node and do not communicate with other slaves. The control of the data obtains on the protocol frame using CRC error checking method. Modbus TCP protocol provides a server/client communication between devices connected on Ethernet TCP/IP network. TCP refers to the Transmission Control Protocol and IP refers to the Internet Protocol, which provides the transmission medium for Modbus TCP/IP messaging. Modbus TCP/IP uses TCP/IP and Ethernet to carry the data of the Modbus message structure between compatible devices. That is, Modbus TCP/IP combines a physical network (Ethernet), with a networking standard (TCP/IP), and a standard method of representing data. Essentially, the Modbus TCP/IP message is simply a Modbus communication encapsulated in an Ethernet TCP/IP wrapper. TCP/IP Standard Model, Ethernet handles the bottom 2 layers (1 & 2) of the seven-layer OSI stack, while TCP/IP handles the next two layers (3 & 4). The application layer lies above TCP, IP, and Ethernet and is the layer of information that gives meaning to the transmitted data. In this thesis, FPGA (Field Programmable Gate Array) is used to design Modbus gateway device. FPGA as the integrated circuits of which their hardware configuration can be changed by the user according to the desired functions. Using VHDL and Verilog hardware description language, hardware design can create using FPGA and embedded processor system can be design on it. In this thesis, Altera DE0 Nano FPGA Development and Education board has used for operation system and Nios II/e embedded processor, which is also Altera's software microprocessor, is embed on FPGA. Wiznet W5500 module has added on system for TCP/IP management. This module is used for fulfill TCP/IP operations of OSI models and sending data on physical layer. Wiznet module supports 32-bit SPI module to communicate FPGA, so a hardware developed on FPGA using VHDL language, named SPI module. To communicate RTU devices, a circuit is design using MAX485 integrated device that works on RTU physical layer. Quartus II programming platform, which is free and download from Altera website is used to program FPGA device. Ouartus is a multitasking development platform, which provide both hardware design and allow embedding microprocessor and peripheral devices on FPGA. Using Qsys system development tool, Nios II/e microprocessor and peripheral devices can design and connected each other. The program also creates the address map of processor. After generating the system, a software-embedded system is created on FPGA. Nios II Software Build Tools for Eclipse software also reached on Quartus platform and used to program the microprocessor using C language. In the testing industrial system, there are six Modbus TCP server devices and six Modbus RTU devices. The number of the devices can increase depending on the application. TCP devices are numbered from one to six (addressed was) and RTU devices are numbered from seven to twelve. The system includes a PLC that works on the Modbus TCP network as the client device. Servers and Modbus slave devices are Modbus input / output modules. The client device over a TCP network reaches the FPGA gateway via Wiznet and SPI module and informs the processor about which devices can send request. Processor examines the incoming request packet and redesigns it according to application. If the package send to the TCP device, it sends over the SPI module and Wiznet to TCP devices and the response is sent to the client device in the same way after the processor ago. If the package sends to the RTU device, processor translates it to the RTU format and sends it to the RTU network over the RS 485 converter circuit. RTU device receives the packet to the physical layer, performs the action and initiate the response. The response sent to RTU devices converts into the TCP format on processor and sent to the client device. Thus, exchange of data between TCP and RTU network is completed. Communication between Modbus TCP devices using Ethernet technology, Modbus RTU devices using serial line has been provided in this study by designed a FPGA based gateway. In addition, this thesis presents detail information about Modbus protocol over serial line and Ethernet in order to used by all system designer when they need to implement Modbus protocols. Moreover, the basic information is presented about gateway design which is used not only between Modbus protocols but also can be used another protocol using on industrial system. Hardware design and embedded processor design using FPGA is examined and presented. SPI and I2C communication protocols details, data formats, pin connections, data reading and writing examples is presented. About system components, such as PLC, switch, additional modules some sufficient information is given, and finally the results of application that perform on the testing system is added.
Author
Dr. Şirin Akkaya
Institution
How to Cite
Şirin Akkaya (Master Thesis). FPGA based modbus gateway design, 2015, Istanbul Technical University.
Keywords
License
Tüm Hakları Saklıdır
This work is shared under the specified license terms.
More theses from Istanbul Technical University
- Investigation Of Stretching Effect With Mixed Finite Element Formulations For Laminated Beams And Plates(2023)
- Classification of anemia using data mining methods: An application(2015)
- Removal and recovery of platinum group metals through anode slimes of moebius electrolysis(2015)
- A study of design approaches to Istanbul's city halls based on space syntax theory(2015)
- A II. German Empire project: From Kaiser Wilhelm Monument to German fountain(2015)
- Uzaktan algılama verilerinin yersel ölçümlerle entegrasyonu ile toprak tuzluluk haritalaması; Aşağı Seyhan Ovası, Adana, Türkiye(2015)
