Communication method and device of self-anti-interference real-time bus
By adopting the communication method of self-immune interference real-time bus in the PLC system, the existing PLC system has solved the problem of low communication rate and poor anti-interference performance in high-precision mechanical equipment and extreme environments, and data transmission with high transmission rate and strong anti-interference capability is achieved.
Patent Information
- Application Number
- CN202510154492.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-02-12
AI Technical Summary
When used in high-precision mechanical equipment and extremely harsh environments, existing PLC systems have problems such as low communication rate, poor anti-interference performance, short transportation distance and poor real-time performance.
The communication method of the self-immunication real-time bus is adopted, and the encoded control instructions are periodically sent to the slave station through the master controller, and the control instructions are adjusted based on the feedback data. The method includes packet encoding and decoding, checksum correction using polynomial representations in the Galahua domain.
It realizes data transmission with high transmission rate, improves the system's anti-interference ability and real-time performance, and is suitable for high-precision mechanical equipment and extreme environments, simplifies wiring operations and reduces costs.
Smart Images

Figure CN119945828A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial communication, and in particular to a communication method and device of a self-interference-resistant real-time bus. Background Art
[0002] In the prior art, in order to expand I / O (Input / Output) points or functions, PLC generally needs to connect various I / O modules or functional modules through an expansion bus to form a PLC control system. PLC communicates with the I / O modules or functional modules through the expansion bus.
[0003] Traditional PLC wiring is complex and has many wiring requirements. This cable will cause inter-channel interference during operation. In addition, PLC's CAN, RS485, Ethernet, and EtherCAT communication cables have problems such as low communication rate, poor anti-interference performance, short transportation distance, and poor real-time performance when transmitting over long distances. They cannot be used on high-precision mechanical equipment, nor can they work in extremely harsh environments. Summary of the invention
[0004] 1. Technical issues to be resolved In view of the deficiencies in the prior art, the present invention provides a communication method and device for a self-interference-resistant real-time bus to solve the problems raised in the above background technology.
[0005] (II) Technical solution To achieve the above object, the present invention is implemented by the following technical scheme: a communication method of a self-interference-resistant real-time bus, comprising the following steps: The master controller periodically sends control instructions to the slaves via the real-time bus; After receiving the control instruction, the slave station performs the corresponding operation and generates feedback data based on the execution result; Wherein, the control instruction and the feedback data are both in the form of data packets; The slave station transmits the feedback data back to the master controller via the real-time bus, and the master controller adjusts the control instructions based on the feedback data.
[0006] As a further preferred embodiment, the master controller periodically sends control instructions to the slave station via the real-time bus, including: The master controller generates control instructions for the slave station based on the target state and encodes the control instructions so that the control instructions are encoded into a fixed 1KB data packet. The master controller uses a timer interrupt to trigger the sending operation of the data packet and sends the encoded data packet to the slave station at a fixed interval of 100 milliseconds.
[0007] The control instructions include execution flow, configuration parameters and 64-bit synchronous clock.
[0008] As a further preferred embodiment, the process of encoding the control instruction by the main controller includes: Data processing: parsing the content of the control instruction to obtain several different types of data, processing the different types of data separately, setting the priority of the data, and marking the important data; The process of processing several different types of data separately includes: scanning each type of data separately and removing duplicate data items and filtering out important data that needs to be synchronized; Coding processing, selecting communication coding parameters, generating a check polynomial R(x) based on the communication coding parameters, obtaining the encoded codeword C(x) through the representation of the check polynomial in the Galois field, and converting the coefficients of C(x) to obtain a data packet of the control instruction; Among them, the code length n in the communication coding parameters is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432.
[0009] As a further preferred embodiment, the method of generating a check polynomial R(x) based on the communication coding parameter, obtaining the encoded codeword C(x) by representing the check polynomial in the Galois field, and converting the coefficients of C(x) to obtain a data packet of the control instruction includes: Select the communication coding parameters and construct GF (2 9 ) elements, from 0 to 2 9 The integer of -1 is mapped to the element in the Galois field; The primitive polynomial is p(x)=x9+x4+x3+x+1; Among them, the code length n in the communication coding parameter is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432; For the check bit length r=432, generate the base polynomial:
[0010]
[0011] Based on the primitive polynomial and the benchmark polynomial, the information polynomial M(x) is calculated, and the degree of the information polynomial is increased by 432 times to obtain x r M(x)=x 432 M(x); The quotient Q(x) and remainder R(x) are obtained through the primitive polynomial and the information polynomial, satisfying x r M(x)=Q(x)g(x)+R(x); R(x)=r 0 +r1 x+r 2 x 2 +…+r 431 x 431 =a 13 +a 21 x+a 37 x 2 +…, is the check polynomial, whose coefficient r 0 , R 1 ......R 431 is an element in the Galois Field; The encoded codeword C(x)=x r M(x)-R(x) , the information bits and check bits are combined to obtain a 1024-bit encoded data packet; Among them, it is expressed in Galois Field as ; c0, c1...c1023 are all Galois field elements.
[0012] Finally, each coefficient of C(x) is converted into binary to obtain a 1KB data packet.
[0013] As a further preferred embodiment, the slave station performs a corresponding operation after receiving the control instruction, and generates feedback data based on the execution result, including: Decode the data packet by parsing the protocol header, verifying the checksum, and extracting the valid data to extract the original information contained in it; Perform corresponding operations based on the information obtained by decoding; After completing the corresponding operation, the slave generates feedback data to be returned based on its own status and processing results.
[0014] As a further preferred embodiment, the slave station transmits the feedback data back to the main controller via a real-time bus, and the main controller adjusts the control instructions based on the feedback data, including: The slave station encodes the generated response data into a data packet with a fixed size of 15KB according to the same encoding rules as the master station; The slave determines whether there is a next slave to forward or return the data packet; If there is a next slave station, the slave station sends the encoded data packet to the next slave station, and the next slave station repeats the above process of receiving, decoding, processing and forwarding; The master station further adjusts the control instructions according to the returned data packets and starts the next round of control instruction transmission cycle.
[0015] As a further preferred embodiment, a self-interference-resistant real-time bus device is used to implement the communication method of the self-interference-resistant real-time bus, comprising: A master controller is used to periodically send control instructions to a number of slave stations based on demand, and encode the control instructions into data packets of fixed size; A bus, used to connect the main controller and a plurality of slave stations, and the bus is also used to complete parallel communication of control instructions; The slave station is used to receive data packets from the master controller, decode the data packets, obtain control instructions and execute them, and generate feedback data; Among them, both the master controller and the slave station can encode and decode data packets.
[0016] As a further preferred embodiment, the specific process of the main controller encoding the control instruction into a data packet of a fixed size includes: The master controller generates control instructions for the slave station based on the target state and encodes the control instructions so that the control instructions are encoded into a fixed 1KB data packet. The master controller uses a timer interrupt to trigger the sending operation of the data packet and sends the encoded data packet to the slave station at a fixed interval of 100 milliseconds.
[0017] The control instructions include execution flow, configuration parameters and 64-bit synchronous clock.
[0018] As a further preferred embodiment, the process of encoding the control instruction by the main controller includes: Data processing: parsing the content of the control instruction to obtain several different types of data, processing the different types of data separately, setting the priority of the data, and marking the important data; The process of processing several different types of data separately includes: scanning each type of data separately and removing duplicate data items and filtering out important data that needs to be synchronized; Coding processing, selecting communication coding parameters, generating a check polynomial R(x) based on the communication coding parameters, obtaining the coded codeword C(x) by representing the check polynomial in the Galois field, and converting the coefficients of C(x) to obtain a data packet of the control instruction including: Select the communication coding parameters and construct GF (2 9 ) elements, from 0 to 2 9 The integer of -1 is mapped to the element in the Galois field; The primitive polynomial is p(x)=x9+x4+x3+x+1; Among them, the code length n in the communication coding parameter is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432; For the check bit length r=432, generate the base polynomial:
[0019] Based on the primitive polynomial and the benchmark polynomial, the information polynomial M(x) is calculated, and the degree of the information polynomial is increased by 432 times to obtain x r M(x)=x 432 M(x); The quotient Q(x) and remainder R(x) are obtained through the primitive polynomial and the information polynomial, satisfying x r M(x)=Q(x)g(x)+R(x); R(x)=r 0 +r 1 x+r 2 x 2 +…+r 431 x 431 =a 13 +a 21 x+a 37 x 2 +…, is the check polynomial, whose coefficient r 0 , R 1 ......R 431 is an element in the Galois Field; The encoded codeword C(x)=x r M(x)-R(x) , the information bits and check bits are combined to obtain a 1024-bit encoded data packet; Among them, it is expressed in Galois Field as ; c0, c1...c1023 are all Galois field elements.
[0020] Finally, the coefficients of C(x) are converted into binary to obtain a 1KB data packet; Among them, the code length n in the communication coding parameters is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432.
[0021] As a further preferred embodiment, the decoding of the data packet, obtaining and executing the control instruction, and generating feedback data includes: Decode the data packet by parsing the protocol header, verifying the checksum, and extracting the valid data to extract the original information contained in it; Perform corresponding operations based on the information obtained by decoding; After completing the corresponding operation, the slave generates feedback data to be returned based on its own status and processing results; The slave station encodes the generated response data into a data packet with a fixed size of 15KB according to the same encoding rules as the master station; The slave determines whether there is a next slave to forward or return the data packet; If there is a next slave station, the slave station sends the encoded data packet to the next slave station, and the next slave station repeats the above process of receiving, decoding, processing and forwarding; The master station further adjusts the control instructions according to the returned data packets and starts the next round of control instruction transmission cycle. (III) Beneficial effects
[0022] The present invention provides a communication method and device for a self-interference-resistant real-time bus, which has the following beneficial effects: by periodically sending control instructions to slave stations in the form of small data packets, high transmission rate data transmission is achieved, and at the same time, the control instructions are encoded into data packets, and the data packets of the control instructions are parallel on the bus, and the slave stations can accurately identify them from the data packets, so that the bus has extremely strong anti-interference ability, ensuring the use of the bus so that the entire system runs smoothly; In addition, higher data transmission rates allow the main controller to obtain feedback data more quickly, thereby identifying faults and communication problems more quickly and enhancing the timeliness of remedial measures; The self-interference-resistant real-time bus device simplifies the wiring operation, improves the wiring efficiency, and can be wired simultaneously, reducing the huge material cost and the time and labor cost of installation and debugging caused by complex cables, and improving assemblability and maintainability; and the use of a distributed control architecture can handle data transmission of multiple nodes at the same time, providing efficient network communication capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flow chart of the communication method of the self-interference-resistant real-time bus of the present invention; Figure 2 A schematic diagram of an embodiment of a communication method for a self-interference-resistant real-time bus of the present invention; Figure 3 It is a block diagram of the communication device of the self-interference-resistant real-time bus of the present invention. DETAILED DESCRIPTION
[0024] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0025] The disclosure below provides many different embodiments or examples to realize different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or reference letters in different examples, and this repetition is for the purpose of simplicity and clarity, which itself does not indicate the relationship between the various embodiments and / or settings discussed. In addition, the present invention provides various specific examples of processes and materials, but those of ordinary skill in the art can be aware of the application of other processes and / or the use of other materials.
[0026] like Figure 1 As shown, an embodiment of the present invention provides a communication method of a self-interference-resistant real-time bus, characterized in that it includes the following steps: S1: The master controller periodically sends control instructions to the slave station through the real-time bus; The control instructions are sent in the form of data packets.
[0027] Specifically, the master controller generates control instructions for the slave station based on the target state and encodes the control instructions so that the control instructions are encoded into data packets fixed to 1KB. The master controller uses a timer interrupt to trigger the sending operation of the data packet and sends the encoded data packet to the slave station at a fixed interval of 100 milliseconds to ensure the periodicity and stability of data transmission.
[0028] The control instructions include information such as execution flow, configuration parameters, and 64-bit synchronous clock; such information may come from user input, system presets, or other upper-level applications.
[0029] It should be noted that if the data packet is less than or equal to 1KB, specific placeholders or meaningless data are directly filled to 1KB; if the data packet is larger than 1KB, packetization and compression are combined to ensure that the data packet is 1KB, so as to ensure the accuracy and integrity of the data during transmission.
[0030] Furthermore, the main controller encodes the control instruction so that the control instruction is encoded into a data packet fixed to 1KB, including: Data processing: parsing the content of the control instruction to obtain several different types of data, processing the different types of data separately, setting the priority of the data, and marking the important data; The process of processing several different types of data separately includes: scanning each type of data separately and removing duplicate data items and filtering out important data that needs to be synchronized; Among them, the 64-bit synchronous clock in the control instruction, due to its particularity, is usually retained as important data for synchronization.
[0031] Coding processing, selecting communication coding parameters, constructing GF (2 based on primitive polynomial p(x) 9 ) elements, from 0 to 2 9 The integer of -1 is mapped to the element in the Galois field; The primitive polynomial is p(x)=x9+x4+x3+x+1; Among them, the code length n in the communication coding parameter is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432; For the check bit length r=432, generate the base polynomial:
[0032]
[0033] Based on the primitive polynomial and the benchmark polynomial, the information polynomial M(x) is calculated, and the degree of the information polynomial is increased by 432 times to obtain x r M(x)=x 432 M(x); The quotient Q(x) and remainder R(x) are obtained through the primitive polynomial and the information polynomial, satisfying x r M(x)=Q(x)g(x)+R(x); R(x)=r 0 +r 1 x+r 2 x 2 +…+r 431 x 431 =a 13 +a 21 x+a 37 x 2 +…, is the check polynomial, whose coefficient r 0 , R 1 ......R 431 is an element in the Galois Field; The encoded codeword C(x)=x r M(x)-R(x) , the information bits and check bits are combined to obtain a 1024-bit encoded data packet; Among them, it is expressed in Galois Field as ; c0, c1...c1023 are all Galois field elements.
[0034] Finally, each coefficient of C(x) is converted into binary to obtain a 1KB data packet.
[0035] It should be noted that in the control instruction of the present application, in order to enable a certain function, it is represented by binary as 0000000000000010, which represents the instruction code for enabling the function (a total of 16 bits).
[0036] The working modes, frequencies and other parameters of some devices are assumed to be represented by 512-bit binary as 110101010101...0101010 (512 bits in total).
[0037] 64-bit synchronous clock. The binary representation of the synchronous clock signal is 010101010101...010101 (64 bits in total).
[0038] Putting these three parts of information together in order, we get the original information sequence 000000000000001011010101010101...0101010010101010101...010101, a total of 592 bits.
[0039] S2: After receiving the control instruction, the slave performs the corresponding operation and generates feedback data based on the execution result; Wherein, the control instruction and the feedback data are both in the form of data packets; Specifically, the slave station decodes the data packet by parsing the protocol header, verifying the checksum, and extracting valid data to extract the original information contained therein, and obtains information such as control instructions and configuration parameters sent by the master station.
[0040] The process of the slave station processing the control instruction data packet includes: Execute operation: The slave station performs corresponding operations according to the decoded information; For example, if the received message is an execution process, the slave station may adjust its own working mode, start or stop a certain function; if it is a configuration parameter, the slave station will update the internal configuration register or parameter table.
[0041] In this embodiment, when the slave station decodes the received data packet, it divides it according to the encoding convention (16 bits for control instructions, 512 bits for configuration parameters, and 64 bits for synchronization clock), and can obtain the original control instructions, configuration parameters, bit synchronization clock and other information.
[0042] Specifically, when receiving a control instruction, the slave station will perform error correction on the control instruction data packet to obtain the original execution process, configuration parameters, bit synchronization clock and other information.
[0043] Generate response data: After completing the corresponding operation, the slave generates the data to be returned based on its own status and processing results.
[0044] It is understandable that such data may include the results of operations performed, data collected by sensors, the current status of the device, etc.
[0045] S3: The slave station transmits the feedback data back to the main controller via the real-time bus, and the main controller adjusts the control instructions based on the feedback data.
[0046] Specifically, the response data packet is encoded: the slave station encodes the generated response data into a data packet with a fixed size of 15KB according to the same encoding rules as the master station. It also needs to perform operations such as data format conversion, adding checksums, and encapsulating protocol headers.
[0047] Forward or return data packets from the station Determine whether there is a next slave: The slave detects whether it is connected to the next slave through the hardware connection status.
[0048] Forwarding data packets: If there is a next slave station, the slave station sends the encoded data packet to the next slave station. The next slave station repeats the above process of receiving, decoding, processing and forwarding.
[0049] Return data packets to the master: If there is no next slave, the slave will directly return the encoded data packet to the master. After receiving the data packet, the master's receiving module decodes it and obtains the processing results and status information returned by the slave. The master can further adjust the control instructions based on this information and start the next round of control instruction transmission cycle.
[0050] The entire data transmission cycle process realizes the effective control of the master station over the slave station and the feedback of the slave station status information through the orderly sending, receiving, processing and forwarding of data packets between the master station and the slave station, ensuring the normal operation of the self-interference-resistant real-time bus system and the accuracy of data interaction.
[0051] In other embodiments, the slave station can also cascade slave stations via the real-time bus.
[0052] The self-interference-resistant real-time bus communication method of the present invention periodically sends control instructions to slave stations in the form of small data packets to achieve high transmission rate data transmission. At the same time, the control instructions will be encoded into data packets. The data packets of the control instructions are parallel on the bus, and the slave stations can accurately identify them from the data packets, so that the bus has extremely strong anti-interference ability, ensuring the use of the bus so that the entire system runs smoothly.
[0053] In addition, a higher data transmission rate allows the main controller to obtain feedback data more quickly, thereby identifying faults and communication problems more quickly and enhancing the timeliness of remedial measures.
[0054] In order to further understand the anti-interference ability of the self-interference anti-real-time bus communication method of the present invention, the following is a description of the test results of the self-interference anti-real-time bus, CAN bus and Ethercat bus: EMC test operation process: Axesgo anti-interference real-time bus, CAN bus and Ethercat bus are tested in the order of radiated emission test, conducted emission test, electrostatic discharge immunity test and electrical fast transient pulse group immunity test.
[0055] Three independent test stations are set up to place the test equipment of Axesgo real-time bus, CAN bus and Ethercat bus respectively. Each station is equipped with a standard power socket, signal cable interface and grounding device to ensure stable power supply, reliable signal transmission and good grounding of the tested equipment.
[0056] Radiated Emission (RE) Test: Place the bus device under test on the turntable in the semi-anechoic chamber according to the standard requirements, adjust the position and direction of the device to ensure that it is in the best test state. Connect the signal generator, power amplifier and transmitting antenna, use the receiving antenna and spectrum analyzer to measure the electromagnetic interference signal radiated into space in the frequency range of 30MHz-18GHz. Measure the intensity of electromagnetic radiation emitted by the bus device under test. During the measurement process, the polarization direction and position of the transmitting antenna need to be continuously adjusted to obtain the maximum radiation signal.
[0057] Perform the above tests on the three buses in turn and record the test data.
[0058] Conducted Emission (CE) Test: Connect the bus device under test to the power supply through the artificial power network, install current probes on the power line and signal line, and connect the current probes to the spectrum analyzer. Set the frequency range and measurement parameters of the spectrum analyzer, start the power supply, and measure the electromagnetic interference signal conducted through the power line in the frequency range of 150kHz-30MHz. Perform multiple measurements under different working conditions to ensure the comprehensiveness of the data.
[0059] Test the three buses in turn and record the test data.
[0060] Radio frequency electromagnetic field immunity (RS): Build a test site in an electromagnetic shielding room to ensure that the environmental background noise is lower than the test requirements and avoid external electromagnetic interference from affecting the test results.
[0061] Connect the RF signal generator, power amplifier, antenna and other equipment, and set the frequency range, field strength, modulation mode and other parameters of the RF signal generator. The frequency range is 80MHz-1GHz, the field strength is 30V / m, the field strength is 40V / m for 1GHz-6GHz, and the field strength is 35V / m for 6GHz-18GHz. The modulation mode is 80% AM, 1kHz modulation signal.
[0062] Use oscilloscopes, bit error meters and other monitoring equipment to monitor the data transmission of the bus in real time, such as bit error rate, packet loss rate, data transmission delay and other parameters.
[0063] Test the three buses in turn and record the test results Electrostatic Discharge Immunity (ESD) Test: Place the bus device under test on an electrostatic discharge test bench and ensure that the device is well grounded.
[0064] Use an electrostatic discharge generator to perform contact discharge (±8kV) and air discharge (±15kV) on the casing, interface and other parts of the bus device. Discharge each test point 10 times and observe the working status of the device during the discharge process.
[0065] Perform discharge operations on the device's casing, interfaces and other parts, and observe the working status of the device during the discharge process.
[0066] Test the three buses in turn and record the test results.
[0067] Electrical Fast Transient (EFT) Test: Connect the electrical fast transient pulse group generator to the power line and signal line of the bus device under test through a capacitive coupling clamp.
[0068] The pulse signal (4kV, 100kHz) generated by the EFT pulse group generator is injected into the power line and signal line of the bus device through the capacitive coupling clamp to observe whether the device can work normally.
[0069] Test the three buses in turn and record the test results.
[0070] The following table shows the EMC test results of the three buses:
[0071] It can be seen from the above table: Self-interference-resistant real-time bus: In all test items, bus communication is always stable, data transmission is error-free and packet loss-free, and the equipment works normally, fully meeting the EMC requirements in harsh industrial environments.
[0072] CAN bus: In the radiated emission and conducted emission tests, the interference signal strength in some frequency bands was close to or exceeded the standard limit. In the electrostatic discharge immunity test, some nodes experienced brief communication interruptions during contact discharge, and some nodes crashed during air discharge. In the electrical fast transient pulse group immunity test, many data errors and packet losses occurred.
[0073] Ethercat bus: In the radiated emission and conducted emission tests, the interference signal strength in some frequency bands exceeded the standard. In the electrostatic discharge immunity test, multiple nodes crashed during air discharge. In the electrical fast transient pulse group immunity test, bus communication was frequently interrupted and data transmission was seriously erroneous.
[0074] For ease of understanding, the following Figure 2 To illustrate the application process of the self-interference-resistant real-time bus communication method of the present invention; like Figure 2 As shown in the figure, an automated packaging production line is required to complete product transportation, counting, packaging and quality inspection. The master station, i.e., the host controller, and the 10XY module (i.e., 10-channel digital input and output module), 3MC module (i.e., 3-channel pulse output module), 3GSJ module (i.e., 3-channel counter module), and AI module (i.e., intelligent AI module) are powered by a 24V power supply. The "ACT bus" port of the host controller is connected to the "in" port of the 10XY module with a network cable, the "out" port of the 10XY module is connected to the "in" port of the 3MC module, the "out" port of the 3MC module is connected to the "in" port of the 3GSJ module, and the "out" port of the 3GSJ module is connected to the "in" port of the AI module.
[0075] It should be noted that in Figure 2 The master station, i.e. the host controller, is arranged in sequence from left to right with the 10XY module, 3MC module, 3GSJ module and AI module. The 10XY module, 3MC module, 3GSJ module and AI module are all slave stations.
[0076] 1. Product conveying and position detection (mainly involving 10XY module and 3GSJ module) 1. The master station sends instructions After the master host controller connects to the slave, it starts preparing data to be sent to the slave. The control instructions for starting the conveyor motor and related configuration parameters are encoded to form a 1KB data packet. This includes instructions for starting the corresponding conveyor motor control output port in the 10XY module, and setting the counter in the 3GSJ module for detecting product position to select the AB phase pulse counting mode, which is used to connect the encoder installed on the conveyor belt.
[0077] The master sends the data packets at fixed intervals of 100 milliseconds via the Axesgo anti-interference real-time bus.
[0078] 2. (Slave 1) "10XY module" receives and processes 10XY module (slave 1): Slave 1 receives the data packet and stores it in the receiving buffer, then decodes it. After parsing the synchronization clock and the instruction to start the conveyor belt motor, it synchronizes the clock and sets the corresponding output port to a high level, turns on the motor power, and the conveyor belt starts to run. At the same time, the module monitors the status input signal of the conveyor belt in real time, and encodes it together with the synchronization information to generate a response data packet. It is sent to the 3MC module (slave 2).
[0079] 3. (Slave 2) "3MC module" receives and processes 3MC (Slave 2): Slave 2 receives the data packet and stores it in the receiving buffer, then decodes it. It parses the synchronous clock information and calibrates its own clock with the 64-bit synchronous clock of the master station. There is no control instruction information for the 3MC module in the data packet, so the synchronous clock information is directly encoded into the data packet and sent to the 3GSJ module (Slave 3).
[0080] 4. (Slave station 3) "3GSJ module" receives and processes 3GSJ (Slave 3): Receives and decodes data packets, and configures the counter to AB phase pulse counting mode as required. When the encoder on the conveyor belt generates AB phase pulse signals as the conveyor belt rotates, the 3GSJ module counts these pulses. Each product will generate a certain number of pulses when passing through the encoder, and the position of the product on the conveyor belt is determined by the value of the counter. The 3GSJ module encodes the feedback information and the synchronous clock into a 1KB data packet and sends it to the AI module (Slave 4).
[0081] 5. (Slave 4) "AI module" receives and processes AI module (slave 4): Slave 4 receives the data packet and decodes it. It parses the synchronous clock information and calibrates its own clock with the 64-bit synchronous clock of the master station. There is no control instruction information for the AI module in the data packet. The synchronous clock information is directly encoded into the data packet. There is no next slave station, and the data packet is sent to the host.
[0082] The host receives and decodes the information, and obtains the conveyor belt running status and product location information.
[0083] 2. Product counting and packaging control (mainly involving 3MC module and 10XY module) 1. The master station sends instructions When the product arrives at the designated location, the master station will encode and send the instructions for the 3MC module to drive the packaging machinery, as well as the instructions and configuration parameters for controlling the supply of packaging materials in the 10XY module and the output of the packaged products.
[0084] 2. (Slave 1) "10XY module" receives and processes 10XY module (slave 1): After receiving and decoding the data packet, slave 1 uses the digital output to control the solenoid valve to open the packaging material supply device. At the same time, it monitors in real time whether the packaging material is used up and whether the packaging is completed, etc. It encodes the operating status, material status and synchronization information of the packaging-related equipment into a 1KB response data packet. The response data packet is sent to the 3MC module (slave 2).
[0085] 3. (Slave 2) "3MC module" receives and processes 3MC Slave 2): After receiving and decoding the data packet, slave 2 starts the corresponding pulse output channel according to the instruction, outputs the pulse signal according to the set frequency, pulse quantity and direction, and drives the various moving parts of the packaging machinery to perform packaging operations according to the predetermined process.
[0086] The pulse output status, current pulse parameters, synchronization information, etc. are encoded into a 1KB response data packet and sent to the 3GSJ module (slave 3).
[0087] 4. (Slave station 3) "3GSJ module" receives and processes 3GSJ (Slave 3): Slave 3 receives the data packet and stores it in the receiving buffer, then decodes it. It parses the synchronous clock information and calibrates its own clock with the 64-bit synchronous clock of the master station. There is no control instruction information for the 3GSJ module in the data packet, so the synchronous clock information is directly encoded into the data packet and sent to the AI module (Slave 4).
[0088] 5. (Slave 4) "AI module" receives and processes AI module (slave 4): Slave 4 receives the data packet and decodes it. It parses the synchronous clock information and calibrates its own clock with the 64-bit synchronous clock of the master station. There is no control instruction information for the AI module in the data packet. The synchronous clock information is directly encoded into the data packet. There is no next slave station, and the data packet is sent to the host.
[0089] The host receives and decodes the information, and obtains the conveyor belt running status and product location information.
[0090] 3. Quality inspection and parameter adjustment (mainly involving AI module and 10XY module) 1. The master station sends instructions During the packaging process, the product needs to be tested for quality, such as testing the sealing of the package (through a pressure sensor). The master station sends the command to start the intelligent AI module for pressure testing and related configuration parameters (such as the pressure detection threshold, etc.) to the intelligent AI module, and also sends the command to control the quality inspection-related equipment in the 10-channel digital input and output module (such as the cylinder that pushes the product to be tested to the testing station, etc.).
[0091] 2. (Slave 1) "10XY module" receives and processes 10XY module (slave 1): After receiving and decoding the data packet, slave 1 controls the relevant equipment to push the product to the inspection station, monitors the status of the inspection station, and encodes the status information and synchronization information of the quality inspection-related equipment into a 1KB response data packet. The response data packet is sent to the 3MC module (slave 2).
[0092] 3. (Slave 2) "3MC module" receives and processes 3MC Slave 2): Slave 2 receives the data packet and stores it in the receiving buffer, then decodes it. It parses the synchronous clock information and calibrates its own clock with the 64-bit synchronous clock of the master station. There is no control instruction information for the 3MC module in the data packet, so the synchronous clock information is directly encoded into the data packet and sent to the 3GSJ module (Slave 3).
[0093] 4. (Slave station 3) "3GSJ module" receives and processes 3GSJ (Slave 3): Slave 3 receives the data packet and stores it in the receiving buffer, then decodes it. It parses the synchronous clock information and calibrates its own clock with the 64-bit synchronous clock of the master station. There is no control instruction information for the 3GSJ module in the data packet, so the synchronous clock information is directly encoded into the data packet and sent to the AI module (Slave 4).
[0094] 5. (Slave 4) "AI module" receives and processes AI module (slave station 4): After receiving and decoding the data packet, slave station 4 initializes the pressure sensor and collects the pressure value of the packaging area in real time. The collected pressure value is compared with the set threshold. If it is not within the normal range, the control output is calculated according to the self-tuning PID control algorithm, and it is determined whether the packaging is qualified.
[0095] The pressure detection value, control output, detection results, and the module's own working status are encoded into a 1KB response data packet. The data packet is sent back to the host. The host receives and decodes it, decides whether to adjust the packaging process based on the quality detection information, and then starts the next round of data transmission and control process.
[0096] Through the above process, orderly data transmission, processing and feedback are achieved between the host and each slave station on the anti-interference real-time bus, ensuring the coordinated work and automated operation of all links in the entire production line. In each link, the accurate transmission of data packets and the correct processing of slave stations are the key to ensuring the stable operation of the system, and the real-time decision-making and control command sending of the host based on the feedback information from the slave stations realize the effective management and optimization of the entire production process.
[0097] This embodiment also provides a self-interference-resistant real-time bus device, which is used to implement the above-mentioned self-interference-resistant real-time bus communication method, including: A master controller is used to periodically send control instructions to a number of slave stations based on demand, and encode the control instructions into data packets of fixed size; A bus, used to connect the main controller and a plurality of slave stations, and the bus is also used to complete parallel communication of control instructions; The slave station is used to receive data packets from the master controller, decode the data packets, obtain control instructions and execute them, and generate feedback data; Among them, both the master controller and the slave station can encode and decode data packets.
[0098] Furthermore, the specific process of the main controller encoding the control instruction into a fixed-size data packet includes: The master controller generates control instructions for the slave station based on the target state and encodes the control instructions so that the control instructions are encoded into a fixed 1KB data packet. The master controller uses a timer interrupt to trigger the sending operation of the data packet and sends the encoded data packet to the slave station at a fixed interval of 100 milliseconds.
[0099] The control instructions include execution flow, configuration parameters and 64-bit synchronous clock.
[0100] Furthermore, the process of encoding the control instruction by the main controller includes: Data processing: parsing the content of the control instruction to obtain several different types of data, processing the different types of data separately, setting the priority of the data, and marking the important data; The process of processing several different types of data separately includes: scanning each type of data separately and removing duplicate data items and filtering out important data that needs to be synchronized; Coding processing, selecting communication coding parameters, generating a check polynomial R(x) based on the communication coding parameters, obtaining the coded codeword C(x) by representing the check polynomial in the Galois field, and converting the coefficients of C(x) to obtain a data packet of the control instruction including: Select the communication coding parameters and construct GF (2 9) elements, from 0 to 2 9 The integer of -1 is mapped to the element in the Galois field; The primitive polynomial is p(x)=x9+x4+x3+x+1; Among them, the code length n in the communication coding parameter is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432; For the check bit length r=432, generate the base polynomial:
[0101]
[0102] Based on the primitive polynomial and the benchmark polynomial, the information polynomial M(x) is calculated, and the degree of the information polynomial is increased by 432 times to obtain x r M(x)=x 432 M(x); The quotient Q(x) and remainder R(x) are obtained through the primitive polynomial and the information polynomial, satisfying x r M(x)=Q(x)g(x)+R(x); R(x)=r 0 +r 1 x+r 2 x 2 +…+r 431 x 431 =a 13 +a 21 x+a 37 x 2 +…, is the check polynomial, whose coefficient r 0 , R 1 ......R 431 is an element in the Galois Field; The encoded codeword C(x)=x r M(x)-R(x) , the information bits and check bits are combined to obtain a 1024-bit encoded data packet; Among them, it is expressed in Galois Field as ; c0, c1...c1023 are all Galois field elements.
[0103] Finally, the coefficients of C(x) are converted into binary to obtain a 1KB data packet; Among them, the code length n in the communication coding parameters is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432.
[0104] Further, the decoding of the data packet, obtaining and executing the control instruction, and generating feedback data includes: Decode the data packet by parsing the protocol header, verifying the checksum, and extracting the valid data to extract the original information contained in it; Perform corresponding operations based on the information obtained by decoding; After completing the corresponding operation, the slave generates feedback data to be returned based on its own status and processing results; The slave station encodes the generated response data into a data packet with a fixed size of 15KB according to the same encoding rules as the master station; The slave determines whether there is a next slave to forward or return the data packet; If there is a next slave station, the slave station sends the encoded data packet to the next slave station, and the next slave station repeats the above process of receiving, decoding, processing and forwarding; The master station further adjusts the control instructions according to the returned data packets and starts the next round of control instruction transmission cycle.
[0105] The self-interference-resistant real-time bus device provided by the present invention simplifies the wiring operation, has higher wiring efficiency, can be wired simultaneously, reduces the huge material cost and the time and labor cost of installation and debugging caused by complex cables, and improves assemblability and maintainability; and uses a distributed control architecture, which can process data transmission of multiple nodes at the same time, providing efficient network communication capabilities.
[0106] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A communication method for a self-interference-resistant real-time bus, characterized in that: The following steps are involved: The master controller periodically sends control instructions to the slaves via the real-time bus; After receiving the control instruction, the slave station performs the corresponding operation and generates feedback data based on the execution result; Wherein, the control instruction and the feedback data are both in the form of data packets; The slave station transmits the feedback data back to the master controller via the real-time bus, and the master controller adjusts the control instructions based on the feedback data.
2. The communication method of a self-interference-resistant real-time bus according to claim 1, characterized in that: The master controller periodically sends control instructions to the slave station via the real-time bus, including: The master controller generates the control instructions of the slave station according to the target state, and encodes the control instructions so that the control instructions are encoded into a fixed 1KB data packet. The master controller uses a timer interrupt to trigger the sending operation of the data packet, and sends the encoded data packet to the slave station at a fixed interval of 100 milliseconds. The control instructions include execution flow, configuration parameters and 64-bit synchronous clock.
3. The communication method of a self-interference-resistant real-time bus according to claim 2, characterized in that: The process of encoding the control instruction by the main controller includes: Data processing: parsing the content of the control instruction to obtain several different types of data, processing the different types of data separately, setting the priority of the data, and marking the important data; The process of processing several different types of data separately includes: scanning each type of data separately and removing duplicate data items and filtering out important data that needs to be synchronized; Coding processing, selecting communication coding parameters, generating a check polynomial R(x) based on the communication coding parameters, obtaining the encoded codeword C(x) through the representation of the check polynomial in the Galois field, and converting the coefficients of C(x) to obtain a data packet of the control instruction; Among them, the code length n in the communication coding parameters is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432.
4. The communication method of a self-interference-resistant real-time bus according to claim 1, characterized in that: The method of generating a check polynomial R(x) based on the communication coding parameter, obtaining the encoded codeword C(x) by representing the check polynomial in the Galois field, and converting the coefficients of C(x) to obtain a data packet of the control instruction includes: Select the communication coding parameters and construct GF (2 9 ) elements, from 0 to 2 9 The integer of -1 is mapped to the element in the Galois field; The primitive polynomial is p(x)=x9+x4+x3+x+1; Among them, the code length n in the communication coding parameter is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432; For the check bit length r=432, generate the base polynomial: Based on the primitive polynomial and the benchmark polynomial, the information polynomial M(x) is calculated, and the degree of the information polynomial is increased by 432 times to obtain x r M(x)=x 432 M(x); The quotient Q(x) and remainder R(x) are obtained through the primitive polynomial and the information polynomial, satisfying x r M(x)=Q(x)g(x)+R(x); R(x)=r0+r1x+r2x 2 +…+r 431 x 431 =a 13 +a 21 x+a 37 x 2 +…, is the check polynomial, whose coefficients are r0, R1…R 431 is an element in the Galois Field; The encoded codeword C(x)=x r M(x)-R(x) , the information bits and check bits are combined to obtain a 1024-bit encoded data packet; Among them, it is expressed in Galois Field as ; c0, c1...c1023 are all Galois Field elements; Finally, each coefficient of C(x) is converted into binary to obtain a 1KB data packet.
5. The communication method of a self-interference-resistant real-time bus according to claim 1, characterized in that: The slave station performs corresponding operations after receiving the control instruction, and generates feedback data based on the execution result, including: Decode the data packet by parsing the protocol header, verifying the checksum, and extracting the valid data to extract the original information contained in it; Perform corresponding operations based on the decoded information; After completing the corresponding operation, the slave generates feedback data to be returned based on its own status and processing results.
6. The communication method of a self-interference-resistant real-time bus according to claim 1, characterized in that: The slave station transmits the feedback data back to the main controller via the real-time bus, and the main controller adjusts the control instructions based on the feedback data, including: The slave station encodes the generated response data into a data packet with a fixed size of 15KB according to the same encoding rules as the master station; The slave determines whether there is a next slave to forward or return the data packet; If there is a next slave station, the slave station sends the encoded data packet to the next slave station, and the next slave station repeats the above process of receiving, decoding, processing and forwarding; The master station further adjusts the control instructions according to the returned data packets and starts the next round of control instruction transmission cycle.
7. A self-interference-resistant real-time bus device, used to implement the communication method of the self-interference-resistant real-time bus according to any one of claims 1 to 6, characterized in that: include: A master controller is used to periodically send control instructions to a number of slave stations based on demand, and encode the control instructions into data packets of fixed size; A bus, used to connect the main controller and a plurality of slave stations, and the bus is also used to complete parallel communication of control instructions; The slave station is used to receive data packets from the master controller, decode the data packets, obtain control instructions and execute them, and generate feedback data; Among them, both the master controller and the slave station can encode and decode data packets.
8. The self-interference-resistant real-time bus device according to claim 7, characterized in that: The specific process of the main controller encoding the control instruction into a fixed-size data packet includes: The master controller generates the control instructions of the slave station according to the target state, and encodes the control instructions so that the control instructions are encoded into a fixed 1KB data packet. The master controller uses a timer interrupt to trigger the sending operation of the data packet, and sends the encoded data packet to the slave station at a fixed interval of 100 milliseconds. The control instructions include execution flow, configuration parameters and 64-bit synchronous clock.
9. The self-interference-resistant real-time bus device according to claim 7, characterized in that: The process of encoding the control instruction by the main controller includes: Data processing: parsing the content of the control instruction to obtain several different types of data, processing the different types of data separately, setting the priority of the data, and marking the important data; The process of processing several different types of data separately includes: scanning each type of data separately and removing duplicate data items and filtering out important data that needs to be synchronized; Coding processing, selecting communication coding parameters, generating a check polynomial R(x) based on the communication coding parameters, obtaining the coded codeword C(x) by representing the check polynomial in the Galois field, and converting the coefficients of C(x) to obtain a data packet of the control instruction including: Select the communication coding parameters and construct GF (2 9 ) elements, from 0 to 2 9 The integer of -1 is mapped to the element in the Galois field; The primitive polynomial is p(x)=x9+x4+x3+x+1; Among them, the code length n in the communication coding parameter is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432; For the check bit length r=432, generate the base polynomial: Based on the primitive polynomial and the benchmark polynomial, the information polynomial M(x) is calculated, and the degree of the information polynomial is increased by 432 times to obtain x r M(x)=x 432 M(x); The quotient Q(x) and remainder R(x) are obtained through the primitive polynomial and the information polynomial, satisfying x r M(x)=Q(x)g(x)+R(x); R(x)=r0+r1x+r2x 2 +…+r 431 x 431 =a 13 +a 21 x+a 37 x 2 +…, is the check polynomial, whose coefficients are r0, R1…R 431 is an element in the Galois Field; The encoded codeword C(x)=x r M(x)-R(x) , the information bits and check bits are combined to obtain a 1024-bit encoded data packet; Among them, it is expressed in Galois Field as ; c0, c1...c1023 are all Galois Field elements; Finally, the coefficients of C(x) are converted into binary to obtain a 1KB data packet; Among them, the code length n in the communication coding parameters is 1024 (corresponding to 1KB), the information bit length k is 592, and the check bit length r=nk=432.
10. The real-time bus device capable of resisting interference according to claim 1, characterized in that: The decoding of the data packet, obtaining and executing the control instruction, and generating feedback data includes: Decode the data packet by parsing the protocol header, verifying the checksum, and extracting the valid data to extract the original information contained in it; Perform corresponding operations based on the decoded information; After completing the corresponding operation, the slave generates feedback data to be returned based on its own status and processing results; The slave station encodes the generated response data into a data packet with a fixed size of 15KB according to the same encoding rules as the master station; The slave determines whether there is a next slave to forward or return the data packet; If there is a next slave station, the slave station sends the encoded data packet to the next slave station, and the next slave station repeats the above process of receiving, decoding, processing and forwarding; The master station further adjusts the control instructions according to the returned data packets and starts the next round of control instruction transmission cycle.
Citation Information
Patent Citations
Optical fiber-based high speed serial industrial real-time communication bus system and its control method
CN101060457A
Bus type distributed control system master-salve station opposite terminal control method
CN101232425A
Optical fiber interface multi-axis motion control system based on FPGA (field programmable gata array) uniprocessor
CN102004468A
Master-slave synchronous serial communication bus based on node cascading and implementation method thereof
CN104461985A
Data transmission method and device
CN105207971A
Cited By
EtherCAT real-time performance improving method and system, storage medium and program product
CN120848442A