Implementation of network controllers in industrial control Ethernet
2026-04-06 08:01:05··#1
Abstract: This paper introduces a new communication mechanism and control strategy for network controllers in industrial Ethernet, and discusses the changes that need to be made in hardware and software. Keywords: network controller; communication mechanism; DSP In recent years, fieldbus technology has been widely used in the field of industrial process control. It has the characteristics of good real-time performance, simple wiring and high reliability, and is more suitable for industrial environment. However, it also has its own disadvantages, such as the lack of unified standards and the fact that each manufacturer does its own thing; low transmission rate, unable to transmit image and voice information; difficult network interconnection, unable to be directly connected to the Internet. The existence of these disadvantages seriously restricts the development of fieldbus technology [1]. When the development of fieldbus is hindered, Ethernet technology has developed rapidly. Nowadays, Ethernet can be said to be ubiquitous in the Internet and office automation fields. If Ethernet technology can be successfully applied to the bottom layer network of industrial control, the traditional industrial control network system can be broken, and the seamless connection between industrial control network and office automation network can be realized, achieving true integrated management and control. This paper combines the advantages of fieldbus and Ethernet, proposes a new network flow control algorithm, and develops a network controller to match it. 1. Communication Mechanism The new communication mechanism adopts a bus topology, with all transmissions controlled by the hub controller. Only the designated station receiving the command frame can initiate data transmission. The system sets a cycle T, and the control node polls each station from low to high priority. When the polling time exceeds T, the control stops polling for that cycle and directly enters the next cycle. It is important to note: 1. For high-priority data packets, regardless of the number of unsent data packets in the queue, transmission must be ensured, even if the cycle exceeds T. 2. For medium-priority and low-priority data packets, transmission can only begin after the data of the previous priority has been completely transmitted, and it is a restricted transmission, sending only the first rp data packets of the queue at a time. Simulation results using Matlab show that even under network overload, the network control algorithm can still guarantee the transmission of high-priority control frames; therefore, this network control algorithm is feasible. 2 Functional Principles The network hub controller is the core of the entire network system. It has two main functions: First, network control function, that is, coordinating the communication pace of the entire network, avoiding conflicts, and ensuring the real-time nature of important information. Second, as a communication gateway, it shares IP addresses with internal network devices and provides interfaces between internal network devices and the external Internet. 2.1 Settings required to implement control function 1. Priority level classification. The first 3 bits of the TOS field in the IP data format [1] are used as flags. 2. IP addressing. Assume that all control devices are in an internal network and they share an Internet public address 202.114.101.58, while the internal network is a series of internal addresses starting with 192.168.0. 3. Control frame format. The control frame is the data frame that the network hub controller controls the pace of the entire network. All network nodes should be able to receive this data frame and communicate under its instructions. Therefore, the control frame must be a broadcast frame, and its target address is all network devices in the local area network. In the specific implementation, the control instructions are encapsulated in a UDP broadcast data packet. Its format is shown in Figure 1: [align=center] Figure 1 Control Frame Format[/align] Command: The command code sent by the network hub controller to the network nodes, including communication reset, data transmission, etc. Device Number: The number of the network device receiving the command, which corresponds to the internal IP address. For example, 192.168.0.2 represents device number 2, and 192.168.0.n represents device number n. If the command is sent to all devices, it is set to 0xff. Data Priority: If the command entry indicates that the command can be sent, then the data priority entry indicates that the corresponding network device should take a frame of data from the corresponding priority queue and send it. To ensure that the control frame is sent normally, the following entries need to be set in the upper layer protocol: 1. Set the destination address of the Ethernet frame to 0xff 0xff 0xff 0xff 0xff 0xff to ensure that all network cards in this Ethernet can receive this frame of data. 2. Set the destination IP address in the IP frame to 192.168.0.255 to indicate that this is a broadcast frame. 3. Fill TOS with 0x94, indicating that this is a control frame requiring the highest reliability. 2.2 Translation table and the difference between the translation table and commercial Ethernet translation table The network hub controller is a bridge between the internal industrial Ethernet and the external Internet. Its two network interfaces are connected to the external Internet and the internal network respectively. The network hub controller not only needs to have forwarding function, but also needs to have NAT[2] (Network Address Translation) function, so it must be equipped with an address translation table. The dynamic translation table mode of commercial Ethernet cannot be used here, which is determined by the characteristics of industrial Ethernet. First, in industrial Ethernet, most communication requests are initiated from the external network (such as monitoring parameters of the industrial site from the outside). Therefore, it is impossible to establish a connection using a dynamic translation table. Second, if the table entry is dynamic, its reliability is difficult to guarantee. If the allocation algorithm has a loophole (for example, UDP connection, since there is no handshake protocol, it is difficult to know when it starts and when it stops), it may accidentally delete the table entry that is being connected, making communication impossible. Therefore, in the actual implementation, a static translation table is adopted, and a static table entry is established for each possible connection. For this static translation table, it is set on the PC with special configuration software and then downloaded to the network hub controller through the network. In this way, the network hub controller can realize the gateway function according to the translation table. 3 Hardware Implementation Figure 2 is the hardware structure diagram. The entire network operates under the coordination of the network hub controller. The faster its response speed, the shorter the idle time of the network and the greater the network throughput. Therefore, TI's TMS320VC5402[3] is selected as its core processor. The Ethernet interface chip is Realtek's RTL8019AS, which is a widely used interface chip in the ISA network card market. Two such chips are used in total, one for communication with the internal network and the other for connection with the external Internet. [align=center] Figure 2 Hardware block diagram of the network hub controller[/align] The RTL8019AS has three working modes: plug and play mode, jumper mode and jumperless mode. To reduce resource consumption, a jumper method is chosen here. In this case, the I/O address of the RTL8019AS is determined by pins IOS0-IOS3. Except for SA8 and SA9, which are connected to high level, the rest of the address bus SA5-SA19 are connected to low level. SA0-SA7 are connected to pins A8-A15 of the DSP's address bus. Thus, accessing the corresponding I/O address of the DSP is equivalent to accessing the corresponding register in the two Ethernet interface chips, thereby establishing an address mapping relationship between the DSP's I/O address and the two RTL8019AS chips. Therefore, by accessing these registers, the RTL8019AS can be controlled to send or receive data. In addition, an external random access memory ISSI61LV6416 is added as a communication buffer to temporarily store data packets that cannot be processed in time. Since the TMS320VC5402 does not have integrated Flash or EPROM, it cannot bootstrap. Therefore, the HPI interface is used to boot the DSP, and the program is stored on the 78E54B microcontroller. When the system powers on, the 78E54B writes the program into the on-chip RAM of the TMS320VC5402 via the HPI interface, and then starts it, thus enabling the DSP to begin operation. 4. Software Programming The network control function requires a fast response time, so this part of the program is completed in the interrupt handler. In the hardware design, the interrupt of the first RTL8019AS is connected to the DSP's INT0, and the interrupt of the second RTL8019AS is connected to INT1. Because the first RTL8019AS is connected to the internal network, the program for implementing the network control function is mainly completed in INT0. Figure 3 is a block diagram of the INT0 interrupt response program. [align=center] Figure 3 INT0 Interrupt Response Program[/align] The system has two forwarding buffers. Buffer 1 is used to temporarily store data forwarded from the internal network to the external network, while buffer 2 is used to temporarily store data forwarded from the external network to the internal network. One buffer sends data while the other is filled with data, improving efficiency. To ensure the real-time performance of the network control function, prevent interrupt conflicts, and simplify the program structure, this part of the gateway function's program is implemented using a polling method. The block diagram is shown in Figure 4: [align=center] Figure 4 Gateway Program Block Diagram[/align] It is particularly important to note that the checksum must be recalculated after redirecting the IP address. This is because the IP address is included in the checksum of both IP headers and TCP/UDP. If the IP address is changed, the checksum must be recalculated; otherwise, the receiving devices will consider the checksum incorrect and refuse to accept the data packets. 5 Conclusion Although the network controller is the core device, its functionality depends on the corresponding changes made by related control devices on the industrial Ethernet network to the overall control strategy. In industrial Ethernet, control devices performing tasks for production must complete communication functions under the coordination of the network hub controller, including data acquisition front-ends, output front-ends, PID front-ends, and actuator front-ends. This requires them to meet certain speed requirements, because after receiving the sending command from the control node, they must quickly send out the data packet; any delay on their end will delay the entire network. The author's innovation: A novel real-time control algorithm for industrial Ethernet is proposed, and based on the characteristics of this algorithm, relevant protocols and settings, hardware selection, and program flow are specifically improved. References [1] Xing Guowen, Yu Zheming, Application of real-time control protocol in industrial Ethernet [J], Microcomputer Information, 2006, 1; 1-3. [2] W. Richard Stevens, translated by Fan Jianhua et al., TCP/IP Illustrated [M]. Beijing: Machinery Industry Press, 2000.4, P1-268. [3] Kjeld Borch Egevang, Paul Francis. The IP Network Address Translator. Internet RFC/STD/FYI/BCP Archives. [4] Texas Instruments Incorporated. TMS320VC5402 Fix-Point Digital Signal Processor. www.ti.com, 2002.8, P1-57.