Method for controlling operation of multiple frequency converters through PLC

By using counter polling and interrupt transmission in the main PLC module, the problem of low communication efficiency of RS485 communication protocol in the control scenario of more nodes is solved, and efficient and reliable communication and real-time control are achieved.

CN119987276APending Publication Date: 2025-05-13XIAN XINDA MACHINERY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510013237.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing RS485 communication protocol is inefficient in control scenarios where there are many nodes, complex programs, long execution time, and is not suitable for node requirements with control requirements.

Method used

The PLC main module is adopted, including a counter polling module, a change communication command module, a data sending and receiving module and an interrupt communication module. The counter polls the node address and interrupts the transmission instructions to improve communication efficiency and real-timeness, and ensures data accuracy and error detection through data conversion and error judgment modules.

Benefits of technology

Improve communication reliability and efficiency, ensure that any node failure does not affect the normal communication of other nodes, realize real-time communication of a node within 100ms, and promptly discover error node data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987276A_ABST
    Figure CN119987276A_ABST
Patent Text Reader

Abstract

The invention discloses a method for controlling operation of a plurality of frequency converters by a PLC (Programmable Logic Controller), which comprises a PLC main module, the PLC main module comprises a counter polling module, a communication command changing module, a data sending and receiving module and a communication interruption module, frequency converter addresses are generated in a mode of polling nodes by a counter, the communication interruption module sends and receives communication commands, and the frequency converter addresses are sent and received by the communication interruption module. The communication command changing module changes commands of the frequency converters, the data conversion and error judgment module judges and processes received data, and the main module calls all the modules, so that communication is carried out on the multiple frequency converters, and reliability and timeliness of communication are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of industrial control communication, and in particular relates to a method for controlling the operation of multiple frequency converters by using a PLC. Background Art

[0002] RS485 is a common industrial communication method. It is often used in data acquisition systems because of its stability, reliability, and long transmission distance. It is rarely used for control because the RS-485 communication protocol bus is a traditional communication bus with a low communication rate. The communication efficiency of the entire system is low. When the amount of data is large, the RS-485 bus is not suitable for control requirements with more nodes. The general node polling method is that each node transmits data separately, and the next node data transmission is performed after the judgment of this node is completed. If each node has multiple read and write requirements, multiple judgments are required. The disadvantage of this method is that the program is complex and the execution time is long. If there are many nodes, the communication delay is relatively long, which is not suitable for node requirements with control requirements. Summary of the invention

[0003] The purpose of the present invention is to provide a method for controlling the operation of multiple frequency converters by using a PLC to improve communication reliability and communication efficiency.

[0004] The object of the present invention is achieved by the following technical means: a method for PLC controlling the operation of multiple frequency converters, comprising:

[0005] PLC main module, the PLC main module is electrically connected to each inverter;

[0006] The PLC main module includes a counter polling module, a communication command change module, a data sending and receiving module, and an interrupt communication module;

[0007] The data sending and receiving module sends the communication address and sending instructions to each variable frequency inverter according to the current communication address and the instruction to be sent, and receives the feedback data of the inverter from the interrupt communication module, and finally sends the feedback data to the external host device;

[0008] The counter polling module changes the node address of the data sending and receiving module. According to the counter output, the communication address of the data sending and receiving module is changed to the communication address of the inverter corresponding to the current counter count value, thereby performing polling communication with the corresponding inverter node;

[0009] Change the communication command module to transmit a sending instruction to the data sending and receiving module, so that the data sending and receiving module sends a corresponding instruction to the inverter, specifically, first write the sending instruction as a reading inverter status instruction, write the sending instruction as a frequency instruction after a delay, and then write the sending instruction as a running instruction after another delay;

[0010] The interrupt subroutine module is triggered by an interrupt to send and receive instructions and receive data to the data sending and receiving module. First, the interrupt triggers the data sending and receiving module to execute a sending instruction and clear the data buffer of the interrupt subroutine module. Then, a receiving command is executed to make the interrupt subroutine module read feedback data from the data buffer.

[0011] The PLC main module also includes a data conversion module, which receives the feedback data sent by the data receiving module, converts the feedback data into data recognizable by the external host device, and then sends it to the external host device.

[0012] The inverter status instruction is to read the current working status of the inverter, the frequency instruction is to set the inverter operating frequency, and the operating instruction is to determine the start and stop of the inverter.

[0013] The PLC main module also includes an error judgment module, which is used to judge the data received by the data conversion module to determine whether the data format is wrong.

[0014] The polling communication is to number the inverters in sequence, each number corresponds to a inverter, the counter outputs numbers in sequence after a fixed delay, and the counter polling module changes the communication address to the communication address of the inverter corresponding to the number according to the number.

[0015] Each time the communication command modification module writes a sending instruction, a CRC check code is generated and sent together.

[0016] After the counter outputs the initial digit to the final digit in sequence, it outputs the initial digit next time and performs a cycle from the initial digit to the final digit.

[0017] The error judgment module also judges the communication status of the corresponding inverter according to the feedback data. When the feedback data is empty, it indicates that there is a problem with the communication, and generates an alarm message and sends it to the external host device.

[0018] It also includes a 485 communication module, and the PLC main module is electrically connected to each frequency converter via the 485 communication module.

[0019] The beneficial effects of the present invention are as follows: by means of polling nodes with a counter, the communication reliability is effectively improved, ensuring that the failure of any node does not affect the normal communication of other nodes, automatically changing the transmission communication address dynamically according to the counter output, communicating with multiple inverters, improving the real-time performance of command transmission by interrupting transmission instructions, ensuring that one node communicates within 100ms, and making a correct or incorrect judgment on data reception, converting data into displayable data and timely discovering erroneous node data. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 The structure diagram of the method for PLC to control the operation of multiple frequency converters;

[0021] Figure 2 This is the flow chart of the PLC main module;

[0022] Figure 3 This is a flowchart of the counter polling module;

[0023] Figure 4 To change the communication command module flow chart;

[0024] Figure 5 It is a flow chart of data conversion module and error judgment module;

[0025] Figure 6 It is a flow chart of interrupt communication module;

[0026] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. DETAILED DESCRIPTION

[0027] [Example 1]

[0028] As shown in the accompanying drawings, a method for PLC to control the operation of multiple frequency converters includes:

[0029] like Figure 1 As shown, the PLC main module is electrically connected to each inverter;

[0030] It also includes a 485 communication module, and the PLC main module is electrically connected to each frequency converter via the 485 communication module.

[0031] like Figure 1 As shown, the PLC main module communicates with each inverter through the 485 communication module. Each time a signal is sent out, the inverters at all addresses can receive it, but only the inverter at the corresponding address will process it, and the other inverters will not take any action. For example, when a command is sent to the inverter at address 3, all inverters will receive the command, but only the inverter at address 3 will receive the command and feedback data, and the other inverters will not take any action.

[0032] The PLC main module includes a counter polling module, a communication command change module, a data sending and receiving module, and an interrupt communication module;

[0033] The data sending and receiving module sends the communication address and sending instructions to each variable frequency inverter according to the current communication address and the instruction to be sent, and receives the feedback data of the inverter from the interrupt communication module, and finally sends the feedback data to the external host device;

[0034] Data sending and receiving module,

[0035] When sending, according to the communication address provided by the counter polling module, the sending type command provided by the communication command module is changed, and a signal is sent to the inverter under the triggering of the interrupt communication module;

[0036] When receiving data, under the triggering of the interrupt communication module, the data in the data buffer of the interrupt communication module is read and then sent out.

[0037] The specific hardware implementation is that the PLC uses Siemens S7-1200 CPU plus 485 communication module, and the inverter uses Huichuan MD290 series inverter.

[0038] like Figure 2 As shown, the counter polling module changes the node address of the data sending and receiving module, and according to the counter output, changes the communication address of the data sending and receiving module to the communication address of the inverter corresponding to the current counter count value, thereby performing polling communication with the corresponding inverter node;

[0039] The counter of the counter module is a 10hz counter, which uses a 10ms interrupt to trigger the sending command. The 10hz counter can count 10 times per second, 100ms each time, so communication within 20 nodes can basically be completed within 2.5 seconds, which improves communication efficiency.

[0040] The polling communication is to number the inverters in sequence, each number corresponds to a inverter, the counter outputs numbers in sequence after a fixed delay, and the counter polling module changes the communication address to the communication address of the inverter corresponding to the number according to the number.

[0041] After the counter outputs the initial digit to the final digit in sequence, it outputs the initial digit next time and performs a cycle from the initial digit to the final digit.

[0042] First, modify the inverter communication parameters, including the inverter communication address and communication baud rate, so that each output of the counter can correspond to a inverter and the inverter communication address.

[0043] The inverter initializes the counter in the order of 1-20, and then cyclically outputs the serial number to the data sending and receiving module. After outputting 20, the counter is reset and the next time it outputs 1, and the cycle repeats. For example, if the inverter is 1-20, when the counter module outputs 1, the data sending and receiving module changes the data transmission address to the communication address of inverter 1 and sends instructions to inverter 1.

[0044] If a node fails and communication is impossible, the system waits for the counter module to output the next sequence number and directly communicates with the next node.

[0045] When communicating with each node, when a node fails to communicate, there is no need to wait. When the counter is not equal to the value of the corresponding faulty node, other normal nodes communicate normally and do not affect the normal operation of communication. When the faulty node returns to normal, normal communication is automatically restored.

[0046] For example, if the communication of inverter No. 1 fails, ignore it and wait until the counter module outputs 2, and then communicate directly with inverter 2. If inverter 1 returns to normal later, when the counter module outputs 1, it can communicate with inverter 1 again.

[0047] like Figure 3 As shown, the communication command module is changed to transmit a sending instruction to the data sending and receiving module, so that the data sending and receiving module sends a corresponding instruction to the inverter, specifically, first write the sending instruction as a reading inverter status instruction, write the sending instruction as a frequency instruction after a delay, and then write the sending instruction as a running instruction after another delay;

[0048] After a fixed delay, one of the three sending instructions is written to the data sending and receiving module. When the interrupt communication module is triggered, it is sent to the inverter according to the type of the current sending instruction. For example, the communication command module is changed to write a frequency instruction to the data sending and receiving module. At this time, the interrupt communication module is triggered to send, and the data sending and receiving module sends a frequency instruction to the inverter.

[0049] The inverter status instruction is to read the current working status of the inverter (normal or alarm, running or stopped and the current working frequency), the frequency instruction is to give the inverter operating frequency, and the running instruction determines the start and stop of the inverter.

[0050] Each time the communication command modification module writes a sending instruction, a CRC check code is generated and sent together.

[0051] The delay time interval between each two instructions is 30ms. The three instructions are executed in sequence. First, the inverter status instruction is read, the frequency instruction is delayed by 30ms, the frequency instruction is delayed by 30ms, and then the inverter status instruction is read by 30ms, and the cycle continues.

[0052] The interrupt subroutine module is triggered by an interrupt to send and receive instructions and receive data to the data sending and receiving module. First, the interrupt triggers the data sending and receiving module to execute a sending instruction and clear the data buffer of the interrupt subroutine module. Then, a receiving command is executed to make the interrupt subroutine module read feedback data from the data buffer.

[0053] like Figure 6 As shown, the interrupt subroutine module controls the data sending and receiving module to send instructions and receive data, and caches the data fed back by the inverter.

[0054] Specifically, first, the interrupt subroutine module sends a data sending and receiving command to the data sending and receiving module, controls the data sending and receiving module to send a signal to the inverter, and the signal is sent to the inverter bus. At the same time, the data stored in the data buffer of the interrupt subroutine module is cleared. After the inverter receives the data, it transmits the new feedback data to the interrupt subroutine module and stores it in the data buffer.

[0055] Then the interrupt subroutine module sends a command to receive data to the data sending and receiving module, the data sending and receiving module moves the feedback data in the data buffer to the data sending and receiving module, and the data sending and receiving module then sends the data to the external host computer.

[0056] like Figure 5 As shown, each time the data sending and receiving module writes an instruction to the inverter, the data buffer clears the instruction and clears the previous data. In this way, if the inverter communication fails and there is no feedback data, the buffer data is zero. In this way, when a node fails, the buffer data changes in time, the node error can be discovered in time, and error information is generated for abnormal alarm. It can be intuitively seen that the data is abnormal, that is, it suddenly returns to zero.

[0057] The PLC main module also includes a data conversion module, which receives the feedback data sent by the data receiving module, converts the feedback data into data that can be recognized and displayed by the external host device, and then sends it to the external host device.

[0058] The PLC main module also includes an error judgment module, which is used to judge the data received by the data conversion module to determine whether the data format is wrong.

[0059] For example, if the received data format is abnormal due to interference, it can be obtained through the error judgment module and fed back to the external host computer.

[0060] The error judgment module also judges the communication status of the corresponding inverter according to the feedback data. When the feedback data is empty, it indicates that there is a problem with the communication, and generates an alarm message and sends it to the external host device.

[0061] Since the old data is cleared before the new data in the data buffer is received, when the inverter cannot communicate, the data received by the data sending and receiving module is zero. It can be clearly judged that there is a problem with the inverter communication at this time, and an alarm information is generated and fed back to the external host device.

Claims

1. A method for controlling the operation of multiple frequency converters by PLC, characterized in that: include: PLC main module, the PLC main module is electrically connected to each inverter; The PLC main module includes a counter polling module, a communication command change module, a data sending and receiving module, and an interrupt communication module; The data sending and receiving module sends the communication address and sending instructions to each variable frequency inverter according to the current communication address and the instruction to be sent, and receives the feedback data of the inverter from the interrupt communication module, and finally sends the feedback data to the external host device; The counter polling module changes the node address of the data sending and receiving module. According to the counter output, the communication address of the data sending and receiving module is changed to the communication address of the inverter corresponding to the current counter count value, thereby performing polling communication with the corresponding inverter node; Change the communication command module to transmit a sending instruction to the data sending and receiving module, so that the data sending and receiving module sends a corresponding instruction to the inverter, specifically, first write the sending instruction as a reading inverter status instruction, write the sending instruction as a frequency instruction after a delay, and then write the sending instruction as a running instruction after another delay; The interrupt subroutine module is triggered by an interrupt to send and receive instructions and receive data to the data sending and receiving module. First, the interrupt triggers the data sending and receiving module to execute a sending instruction and clear the data buffer of the interrupt subroutine module. Then, a receiving command is executed to make the interrupt subroutine module read feedback data from the data buffer.

2. The method for controlling the operation of multiple frequency converters by PLC according to claim 1, characterized in that: The PLC main module also includes a data conversion module, which receives the feedback data sent by the data receiving module, converts the feedback data into data recognizable by the external host device, and then sends it to the external host device.

3. The method for controlling the operation of multiple frequency converters by PLC according to claim 1, characterized in that: The inverter status instruction is to read the current working status of the inverter, the frequency instruction is to set the inverter operating frequency, and the operating instruction is to determine the start and stop of the inverter.

4. The method for controlling the operation of multiple frequency converters by PLC according to claim 2, characterized in that: The PLC main module also includes an error judgment module, which is used to judge the data received by the data conversion module to determine whether the data format is wrong.

5. The method for controlling the operation of multiple frequency converters by PLC according to claim 1, characterized in that: The polling communication is to number the inverters in sequence, each number corresponds to a inverter, the counter outputs numbers in sequence after a fixed delay, and the counter polling module changes the communication address to the communication address of the inverter corresponding to the number according to the number.

6. The method for controlling the operation of multiple frequency converters by PLC according to claim 1, characterized in that: Each time the communication command modification module writes a sending instruction, a CRC check code is generated and sent together.

7. The method for controlling the operation of multiple frequency converters by PLC according to claim 5, characterized in that: After the counter outputs the initial digit to the final digit in sequence, it outputs the initial digit next time and performs a cycle from the initial digit to the final digit.

8. The method for controlling the operation of multiple frequency converters by PLC according to claim 2, characterized in that: The error judgment module also judges the communication status of the corresponding inverter according to the feedback data. When the feedback data is empty, it indicates that there is a problem with the communication, and generates an alarm message and sends it to the external host device.

9. The method for controlling the operation of multiple frequency converters by PLC according to claim 1, characterized in that: It also includes a 485 communication module, and the PLC main module is electrically connected to each frequency converter via the 485 communication module.