Share this

Research on EPS Emergency Power Supply Monitoring System Based on Modbus

2026-04-06 06:25:46 · · #1
1. Introduction With increasing environmental protection and fire safety requirements, diesel generators are gradually losing their advantages. However, due to the mature development of inverter technology, new, pollution-free, highly reliable, and powerful large-scale emergency power supplies (EPS) are gradually becoming the "green power source" to replace diesel generator sets, and are now widely used in the construction industry. Simultaneously, with the rapid development of microprocessors, computers, and digital communication technologies, computer control has expanded to almost all industrial fields. Integrating all functions onto a unified and open platform, through a human-machine interface, simplifies complex control and data processing. 2. Monitoring System Design The RS-485 standard, developed by the Electronic Industries Association (EIA) of the United States, is an electrical specification for multi-point differential data transmission and has become one of the most widely used standard communication interfaces in the industry. This communication interface allows for multi-point, bidirectional communication over a simple pair of twisted pairs. It features balanced transmission and balanced reception, long transmission distance, high communication speed, strong anti-interference capability, rich software and hardware support, simple interface with field instruments, and ease of implementation and expansion. Up to 32 devices can be connected to the interface bus, and with repeaters, up to 255 devices can be connected. Therefore, RS-485 is used as a data transmission link in many fields, such as automotive electronics, telecommunications equipment, local area networks, cellular base stations, and industrial control instruments. This system uses a PC as the host computer, and several P89C51 microcontrollers as slave computers. The monitoring system structure diagram is shown in Figure 1. The host computer's RS-232 serial port is converted to an RS-485 bus via an RS-232/RS-485 converter, and each slave computer is connected to the bus via a MAX485 chip. Each slave computer has its own unique address, and slave computers cannot communicate with each other; all communication is controlled by the host computer. Initially, all slave computers are in a listening state, waiting for instructions from the host computer. When the host computer issues an instruction, all slave computers receive it and compare the address frame with their own address. If they match, they continue to receive subsequent instructions or data; otherwise, they ignore it. 3. Communication Protocol Modbus The Modbus protocol is a common language used in electronic controllers. Through this protocol, controllers can communicate with each other and with other devices via a network. It has become a universal industrial standard, allowing control devices from different manufacturers to be connected into industrial networks for centralized monitoring. The Modbus protocol defines a common format for message fields and content, as shown in Tables 1 and 2, enabling controllers to recognize and use the message structure without considering the topology of the communication network. It describes the process of a controller accessing other devices. When using the Modbus protocol for communication, this protocol stipulates that each controller needs to know its own device address, recognize messages sent to that address, how to respond to requests from other devices, and how to detect and log errors. System communication uses a master-slave technology, meaning only the master device can send queries, and slave devices respond with messages. The master device can communicate with a slave device independently, and the slave device returns a message. If a query is sent via broadcast (address zero), the slave device does not respond. The Modbus protocol has two modes: ASCII and RTU. Only one mode can be selected in a Modbus communication system; mixing the two modes is not allowed. This system uses RTU mode. Messages begin with a pause of at least 3.5 character transmission times (typically 4). After transmitting the last character, there is another pause of at least 3.5 character transmission times to mark the end. A new message can begin after this pause. During reception, if the time waiting for the next character exceeds 1.5 character transmission times, it is considered the start of the next message. The checksum uses CRC16 and is applied only to device addresses, function codes, and data segments. The entire message frame must be transmitted as a continuous stream, with a higher transmission rate than ASCII mode. Possible Modbus slave device addresses are 0–247 (decimal), and the address range for a single device is 1–247. Possible function codes range from decimal 1 to 255. Some codes are applicable to all controllers, some are specific to certain Modicon controllers, and some are reserved for user use or as backup. 4 Software Design The host computer software of this system is developed using VC 6.0 and the operating system is Windows 98. The host computer reads and writes data to the serial port and sends control information to each EPS device on site through the 485 bus. It can monitor any EPS device on the network. At the same time, the voltage, current and other signals collected on site are displayed on the host computer interface in real time. (1) The human-machine interface subroutine includes real-time information dynamic update and digital display, abnormal judgment and alarm sound prompt. (2) The serial communication subroutine unifies the operation of serial port and file in Windows 98. The same API functions are used for opening, reading, writing and closing operations, but there are differences. For example, the serial port cannot be deleted like a file. These differences are reflected in the parameter settings of some API functions. When designing serial communication programs in VC, some communication API functions are used, such as CreateFile(), CloseHandle(), ReadFile(), WriteFile(), SetupComm(), WaitCommEvent(), etc. In addition to the functions mentioned above, an important record, the DCB (Device Control Block), is frequently used. The DCB records definable serial port parameters. When setting serial port parameters, the system default values ​​must first be filled into the DCB using the GetCommState function before user-defined values ​​can be set. PC serial communication begins with calling the CreateFile() function, followed by setting parameters such as the serial port baud rate, data bits, parity bits, stop bits, and timeout parameters. Finally, a working mode is selected for reading and writing to the serial port. In the Windows environment, there are four serial communication modes to choose from: polling, synchronous I/O, asynchronous I/O, and event-driven I/O. Each mode has its own advantages and disadvantages: ① Polling is relatively direct but consumes a significant amount of CPU time; ② Synchronous I/O only returns after reading the specified number of bytes or when a timeout occurs, which can easily block threads for extended periods; ③ Asynchronous I/O allows data to be read and written in the background while other tasks are performed in the foreground; ④ Event-driven I/O involves Windows notifying the application when certain events occur, and then operating the serial port based on these events. In monitoring systems, due to the randomness of events and the requirement for real-time transmission, computers often use event-driven I/O for on-site monitoring. Event-driven I/O refers to the thread performing I/O operations by monitoring a set of events in the communication resources. This method is similar to the interrupt method under MSDOS and is relatively efficient. In actual project applications and development, this working method is mostly used to realize the communication between the PC and the lower-level machine. The implementation process of the upper-level communication program is as follows: 5 System anti-interference problem Real-time monitoring systems are increasingly used in industry. Due to the complex electrical environment on site, various interference sources are easily formed, especially in harsh industrial environments. Therefore, studying and solving the system anti-interference problem is very important to ensure the stable operation of the system. RS 485 itself has strong anti-electromagnetic interference capability, but some problems still occur in actual applications. Therefore, the following aspects should be noted: (1) RS 485 supports half-duplex or full-duplex network topology and generally adopts a bus structure with terminal matching. It does not support ring or star networks. It is best to use a bus to connect all nodes in series. The length of the lead-out line from the bus to each node should be as short as possible so that the reflected signal in the lead-out line has the least impact on the bus signal. (2) When using twisted pair as RS 485 transmission line, although it has a strong ability to suppress electromagnetic induction noise, it has a poor ability to suppress noise caused by electrostatic induction. Therefore, shielded twisted pair should be selected, and the shielding layer of the twisted pair should be properly grounded. (3) The signal reflection problem can be solved by adding matching resistors at both ends A and B of the bus. (4) For RS 485 network, a reasonable grounding system is very important for the reliability of the system. Based on common mode interference and EMI problems, the centralized power supply method can basically eliminate the situation of unequal reference potentials at various points. (5) During the switching of high-power inductive loads, lightning, etc., high-amplitude transient interference will be generated. If proper protection is not taken, the interface will be damaged. Such transient interference can be protected by isolation or bypass. 6 Conclusion The master-slave distributed multi-machine communication system proposed in this paper has simple hardware circuit and flexible control. The advantage of using VC++ to implement host computer data transmission is that it can effectively realize low-level control of communication. However, since RS-485 bus communication is still a serial communication method, its communication speed is relatively low. To improve the communication speed, further improvements to the control system are needed.
Read next

CATDOLL Bebe 92CM Body with TPE Material

Height: 92cm Weight: 13kg Shoulder Width: 25cm Bust/Waist/Hip: 47/47/56cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm Anal ...

Articles 2026-02-22