Photovoltaic system fault diagnosis method based on Modbus protocol
By adopting a MODBUS -based fault diagnosis method in the photovoltaic system, the accurate and real -time fault diagnosis of photovoltaic inverters is realized, the errors and lagging problems in existing technologies are solved, and data redundancy and network communication load are reduced Essence
Patent Information
- Application Number
- CN202411708928.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-01-24
AI Technical Summary
There are errors and lags in the fault diagnosis of existing photovoltaic inverters, the host side has large data volume and redundancy, and the network communication pressure is high.
By introducing a fault diagnosis method based on the Modbus protocol into the photovoltaic system, the host sends communication messages to the slave devices, and through address conversion and function code checking, regular collection and alarm diagnosis are achieved, reducing data redundancy and network communication load.
Improve the accuracy and real -time nature of fault diagnosis, reduce data redundancy and network communication load, and avoid errors and lag problems.
Smart Images

Figure CN119363030A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of Modbus communication, and in particular to a photovoltaic system fault diagnosis method based on the Modbus protocol. Background Art
[0002] As a widely used communication protocol, Modbus protocol has become the industry standard for communication protocols in the industrial field and can be applied to various data acquisition and process monitoring environments. However, since Modbus protocol is a protocol based on master / slave architecture, one node is the master node (i.e., host node), and the other nodes that use Modbus protocol to participate in communication are all slave nodes (i.e., slave nodes). Each slave node device has a unique address. At any time, only the host node can initiate transmission and issue query instructions, and other slave nodes respond accordingly based on the host node query instructions.
[0003] As a representative emerging clean energy industry, the photovoltaic industry plays an important role in addressing energy issues and alleviating climate warming. At present, the installed capacity of distributed photovoltaic power stations is growing rapidly and its proportion is increasing, which makes the large-scale photovoltaic power generation grid-connected to the normal dispatching and operation of the power grid bring greater uncertainty and intermittency. In order to strengthen the dispatching and operation management of distributed photovoltaics and ensure the safe and stable operation of the power grid, the power grid control department requires the data of the grid-connected points and inverters of distributed photovoltaic power stations to be collected and transmitted back to the power grid control center in real time. In addition, as a photovoltaic equipment manufacturer or photovoltaic user, in order to keep abreast of the operation status, alarm information and power generation data of the photovoltaic system at any time, it is usually necessary to plug an inverter data acquisition and monitoring module (commonly known as inverter monitoring stick) on the photovoltaic inverter. The inverter data acquisition and monitoring module is widely used in online monitoring of photovoltaic power stations. The collected data is transmitted to the cloud platform using WiFi, LoRa, 2G / 3G / 4G networks, and the data is presented to users through Web pages or APPs. At the same time, users can also use Web pages or APPs to remotely control and maintain the inverter.
[0004] At present, the monitoring of photovoltaic inverters or data collection in the power grid control center is done through the RS485 interface on the inverter, using the Modbus communication protocol to collect inverter operation data. However, most photovoltaic equipment has only one Modbus bus interface, and the host side sends a request message to the slave side to return data. The collected data is analyzed and sorted to diagnose whether there is a fault, which causes the following problems: the analyzed data has certain errors and lags; the host side has a very large amount of data and a large amount of redundant data; the communication pressure of the network is very high. Summary of the invention
[0005] The purpose of the present invention is to provide a photovoltaic system fault diagnosis method based on the Modbus protocol, which improves the accuracy and real-time performance of fault diagnosis and avoids the problems of data redundancy and excessive network communication load, so as to solve the problems raised in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A photovoltaic system fault diagnosis method based on Modbus protocol includes the following steps:
[0008] S1: The host sends a communication message to each slave device according to the requirement, and the host communication message is stored in the instruction queue of the corresponding host device; the host communication message includes: a virtual slave address field, a function code field, a data field and an error check field;
[0009] S2: According to the address relationship list, perform address conversion on the host communication message, convert the virtual slave address into the actual slave address, and send the host communication message to the slave;
[0010] S3: The slave device receives the host communication message and checks the function code field according to the read host communication message;
[0011] S4: The slave performs the corresponding timed collection operation according to the function code, determines whether to alarm the collected data, and returns the slave communication message in response to the host communication message according to the function code requirement;
[0012] S5: The host analyzes and saves the returned slave communication message, and displays or sends alarm information as required;
[0013] S6: If you want to stop the acquisition, the host can send a communication message to the slave to give the stop acquisition information;
[0014] S7: Steps S1-S6 may then be executed cyclically to complete the host's monitoring of the slave device and real-time fault diagnosis.
[0015] Preferably, the S1 specifically comprises the following steps:
[0016] S101: In the communication message sent by the host, the extended segment function code can be used to specify what kind of work the slave is to do, whether to do a timed collection work or stop the collection work;
[0017] S102: In the data segment of the sent host communication message, the information to be collected by the slave, the period of timed collection, and the threshold conditions for judging the alarm are specified;
[0018] S103: In the data segment of the sent host communication message, it is necessary to specify where to start writing data, how many bytes of data to write, and the specific data to be written is acquisition information, acquisition cycle and threshold conditions; at the same time, it is necessary to specify where to start reading data and how much data to read.
[0019] Preferably, the S4 specifically comprises the following steps:
[0020] S401: The slave side needs to add additional network programming and device configuration in advance according to actual application requirements;
[0021] S402: The slave determines whether to start or stop the timing collection according to the function code in the received host communication message;
[0022] S403: When the function code is to start the timed collection work, it specifically includes:
[0023] S4031: The slave parses the communication message sent by the host, obtains the data segment information, and reads the following from the data segment: collection information, collection cycle, alarm threshold conditions, and stores them in a designated location;
[0024] S4032: The slave end periodically executes the pre-added network code according to the collected information and the collection cycle, and diagnoses whether the collected information or the device has a fault according to the threshold condition. If a fault occurs, the abnormal information is sent to the host end.
[0025] Preferably, the S5 specifically includes the following steps:
[0026] S501: The slave message information includes a function code and a data segment, and the data segment mainly includes acquisition information and fault results;
[0027] S502: The host reads the collected information and the fault result according to the communication message information sent back by the slave, and the host performs corresponding processing as needed, and can reprocess the data or directly save the data and send an alarm message to the user.
[0028] Preferably, the S6 specifically comprises the following steps:
[0029] S601: In the host communication message sent, the extended segment function code can be used to specify the slave to stop the acquisition work, and the data segment needs to send the acquisition information to be stopped;
[0030] S602: The slave analyzes the function code and the collection information according to the communication message sent by the host, thereby stopping the timing collection work.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] In the present invention, the slave first determines the function code sent by the host message to decide whether to start the timing program or stop the timing program. If it is to start, the slave analyzes the collection information, timing cycle and threshold conditions according to the host communication message data segment to execute the pre-set network program in a timely manner, and at the same time diagnoses whether there is a fault according to the threshold conditions. If there is a fault, the fault information is sent to the host; if it is to stop, the slave analyzes the collection information in the host message data segment to stop the timing program, thereby improving the accuracy and real-time performance of fault diagnosis, and avoiding the problems of data redundancy and excessive network communication load. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] See also Figure 1 In an embodiment of the present invention, a photovoltaic system fault diagnosis method based on the Modbus protocol is provided, comprising the following steps:
[0036] S1: The host sends a communication message to each slave device according to the requirement, and the host communication message is stored in the instruction queue of the corresponding host device; the host communication message includes: a virtual slave address field, a function code field, a data field and an error check field;
[0037] S2: According to the address relationship list, perform address conversion on the host communication message, convert the virtual slave address into the actual slave address, and send the host communication message to the slave;
[0038] S3: The slave device receives the host communication message and checks the function code field according to the read host communication message;
[0039] S4: The slave performs the corresponding timed collection operation according to the function code, determines whether to alarm the collected data, and returns the slave communication message in response to the host communication message according to the function code requirement;
[0040] S5: The host analyzes and saves the returned slave communication message, and displays or sends alarm information as required;
[0041] S6: If you want to stop the acquisition, the host can send a communication message to the slave to give the stop acquisition information;
[0042] S7: Steps S1-S6 may then be executed cyclically to complete the host's monitoring of the slave device and real-time fault diagnosis.
[0043] The S1 specifically includes the following steps:
[0044] S101: In the communication message sent by the host, the extended segment function code can be used to specify what kind of work the slave is to do, whether to do a timed collection work or stop the collection work;
[0045] S102: In the data segment of the sent host communication message, the information to be collected by the slave, the period of timed collection, and the threshold conditions for judging the alarm are specified;
[0046] S103: In the data segment of the sent host communication message, it is necessary to specify where to start writing data, how many bytes of data to write, and the specific data to be written is acquisition information, acquisition cycle and threshold conditions; at the same time, it is necessary to specify where to start reading data and how much data to read.
[0047] In this embodiment, the format of each host communication message is shown in the following table:
[0048] Table 1 Host communication message format
[0049]
[0050] in:
[0051] (1.1) The slave address range is from 1 to 255 (where 1 to 247 is the address range that can be used by slaves and devices as specified by the standard, and 248 to 255 is the address range for user-defined extensions)
[0052] (1.2) Function code refers to the abbreviation of the code for the function operation that the host device wants to send to the photovoltaic inverter. The commonly used function codes specified by the standard are shown in the following table. In this embodiment, the function codes used are 65-72 extended codes, which are defined by the user.
[0053] Table 2 Common function codes
[0054]
[0055] (1.3) Error checking is a data verification method used to avoid data errors during data transmission. In this embodiment, the error checking field in the host communication message is an error checking result generated by the CRC check method usually adopted in the Modbus protocol.
[0056] (1.4) The data field is a specific instruction for the host device to communicate with the slave device, or refers to the information or action being transmitted; in this embodiment, the data field in the host communication message includes: a register address field and a register data field, the register address field is the storage address of the information data to be sent to the slave device and the data storage address of the operating status or information to be read by the slave device, and the data field specifically includes the collection information, collection cycle and threshold conditions.
[0057] The S4 specifically comprises the following steps:
[0058] S401: The slave side needs to add additional network programming and device configuration in advance according to actual application requirements;
[0059] S402: The slave determines whether to start or stop the timing collection according to the function code in the received host communication message;
[0060] S403: When the function code is to start the timed collection work, it specifically includes:
[0061] S4031: The slave parses the communication message sent by the host, obtains the data segment information, and reads the following from the data segment: collection information, collection cycle, alarm threshold conditions, and stores them in a designated location;
[0062] S4032: The slave end periodically executes the pre-added network code according to the collected information and the collection cycle, and diagnoses whether the collected information or the device has a fault according to the threshold condition. If a fault occurs, the abnormal information is sent to the host end.
[0063] The S5 specifically includes the following steps:
[0064] S501: The slave message information includes a function code and a data segment, and the data segment mainly includes acquisition information and fault results;
[0065] S502: The host reads the collected information and the fault result according to the communication message information sent back by the slave, and the host performs corresponding processing as needed, and can reprocess the data or directly save the data and send an alarm message to the user.
[0066] The S6 specifically comprises the following steps:
[0067] S601: In the host communication message sent, the extended segment function code can be used to specify the slave to stop the acquisition work, and the data segment needs to send the acquisition information to be stopped;
[0068] S602: The slave analyzes the function code and the collection information according to the communication message sent by the host, thereby stopping the timing collection work.
[0069] In summary, in a photovoltaic system fault diagnosis method based on the Modbus protocol of the present invention, the slave first determines the function code sent by the host message to decide whether to start the timing program or stop the timing program. If it is started, the slave analyzes the collection information, timing cycle and threshold conditions according to the host communication message data segment to execute the pre-set network program in a timely manner, and at the same time diagnoses whether it is a fault according to the threshold conditions. If it is a fault, the fault information is sent to the host; if it is stopped, the slave analyzes the collection information in the host message data segment to stop the timing program, thereby improving the accuracy and real-time performance of fault diagnosis, and avoiding the problems of data redundancy and excessive network communication load.
[0070] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A photovoltaic system fault diagnosis method based on Modbus protocol, characterized in that: The following steps are involved: S1: The host sends communication messages to each slave device according to the requirements, and the host communication messages are saved in the command queue of the corresponding host device; The host communication message includes: a virtual slave address field, a function code field, a data field and an error check field; S2: According to the address relationship list, perform address conversion on the host communication message, convert the virtual slave address into the actual slave address, and send the host communication message to the slave; S3: The slave device receives the host communication message and checks the function code field according to the read host communication message; S4: The slave performs the corresponding timed collection operation according to the function code, determines whether to alarm the collected data, and returns the slave communication message in response to the host communication message according to the function code requirement; S5: The host analyzes and saves the returned slave communication message, and displays or sends alarm information as required; S6: If you want to stop the acquisition, the host can send a communication message to the slave to give the stop acquisition information; S7: Steps S1-S6 may then be executed cyclically to complete the host's monitoring of the slave device and real-time fault diagnosis.
2. A photovoltaic system fault diagnosis method based on Modbus protocol as claimed in claim 1, characterized in that: The S1 specifically includes the following steps: S101: In the communication message sent by the host, the extended segment function code can be used to specify what kind of work the slave is to do, whether to do a timed collection work or stop the collection work; S102: In the data segment of the sent host communication message, the information to be collected by the slave, the period of timed collection, and the threshold conditions for judging the alarm are specified; S103: In the data segment of the sent host communication message, it is necessary to specify where to start writing data, how many bytes of data to write, and the specific data to be written is acquisition information, acquisition cycle and threshold conditions; at the same time, it is necessary to specify where to start reading data and how much data to read.
3. A photovoltaic system fault diagnosis method based on Modbus protocol as claimed in claim 1, characterized in that: The S4 specifically comprises the following steps: S401: The slave side needs to add additional network programming and device configuration in advance according to actual application requirements; S402: The slave determines whether to start or stop the timing collection according to the function code in the received host communication message; S403: When the function code is to start the timed collection work, it specifically includes: S4031: The slave parses the communication message sent by the host, obtains the data segment information, and reads the following from the data segment: collection information, collection cycle, alarm threshold conditions, and stores them in a designated location; S4032: The slave end periodically executes the pre-added network code according to the collected information and the collection cycle, and diagnoses whether the collected information or the device has a fault according to the threshold conditions. If a fault occurs, the abnormal information is sent to the host end.
4. A photovoltaic system fault diagnosis method based on Modbus protocol as claimed in claim 1, characterized in that: The S5 specifically includes the following steps: S501: The slave message information includes a function code and a data segment, and the data segment mainly includes acquisition information and fault results; S502: The host reads the collected information and the fault result according to the communication message information sent back by the slave, and the host performs corresponding processing as needed, and can reprocess the data or directly save the data and send an alarm message to the user.
5. A photovoltaic system fault diagnosis method based on Modbus protocol as claimed in claim 1, characterized in that: The S6 specifically comprises the following steps: S601: In the host communication message sent, the extended segment function code can be used to specify the slave to stop the acquisition work, and the data segment needs to send the acquisition information to be stopped; S602: The slave analyzes the function code and the collection information according to the communication message sent by the host, thereby stopping the timing collection work.