A pulse synchronization method, terminal equipment and medium for automatic control
By using the synchronous training frame and unit transmission line delay calculation method in the ring network of the industrial control system, high-precision pulse synchronization between slave stations is achieved, solving the problems of real-time, synchronization, reliability and security of the existing system. deficiencies, significantly improving the synchronization accuracy of the system.
Patent Information
- Application Number
- CN202411621661.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The existing industrial control systems have shortcomings in real-time, synchronization, reliability and security, and it is difficult to meet the needs of modern industrial networks for high-precision pulse synchronization.
A pulse synchronization method is adopted to achieve pulse synchronization and time alignment of all slave stations by using a master station and multiple slave stations in a ring network, using synchronization training frames and unit transmission line delay calculations.
It significantly improves the accuracy of pulse synchronization between slave stations in the system, shortens the microsecond-level synchronization error to hundreds of nanoseconds, and enhances the real-time, synchronicity, reliability and security of the system.
Smart Images

Figure CN119135471B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of integrated circuit design and industrial automation control, and in particular to a pulse synchronization method, terminal equipment and medium for automation control. Background Art
[0002] As the scale of production continues to expand, industrial control has a demand for interconnection (PC-side centralized control of all equipment within the production line and data exchange between different equipment within the production line, etc.). People hope to achieve operational control of multi-point information by comprehensively grasping the operating parameters and information of multiple points.
[0003] In the actual development process, many famous fieldbus technologies have emerged. The so-called fieldbus is a real-time control communication network that connects the lowest-level field controllers and field intelligent instrumentation equipment. It is precisely because of the popularity of fieldbus technology that PC control systems have been widely used. Traditional fieldbus technology has greatly improved the relevant performance of control systems, and technical protocols have also been further upgraded and updated. However, due to poor scalability and compatibility, and the technical standards in various control fields are relatively complicated, this technology also has certain application limitations.
[0004] At present, the frequency of development and updating of various technologies in the control field is very high, mainly because the requirements for real-time, synchronization, reliability, security, etc. in modern industrial network control are getting higher and higher, so the requirements for related control technologies are also higher.
[0005] It should be noted that the above introduction to the technical background is only for the convenience of providing a clear and complete description of the technical solutions of the present application and for the convenience of understanding by those skilled in the art. It cannot be considered that the above technical solutions are well known to those skilled in the art simply because they are described in the background technology section of the present application. Summary of the invention
[0006] The object of the present invention is to provide a pulse synchronization method, terminal equipment and medium for automatic control, so as to obtain an automatic control system with higher real-time performance, synchronization, reliability and safety.
[0007] In order to solve the above problems, in a first aspect, a pulse synchronization method for automatic control is provided below, comprising:
[0008] A ring network is provided, which is formed by a master station and a plurality of slave stations with station numbers connected in series in sequence, wherein the ring network includes a downlink path for transmitting signals from the master station to the terminal slave stations in sequence, and an uplink path for transmitting signals from the terminal slave stations back to the master station in sequence;
[0009] The master station sends a synchronous training frame, and the time interval from when any of the slave stations receives the synchronization header of the synchronous training frame in the downlink path to when the same slave station sends the synchronization header of the synchronous training frame in the uplink path is the time for any slave station to participate in data transmission;
[0010] Each slave station calculates a unit transmission line delay based on the data transmission time of any slave station involved, the relative position of the current slave station in the ring network, the uplink transmission processing delay and the downlink transmission processing delay of each intermediate slave station, and the terminal slave station processing delay;
[0011] Taking the synchronization pulse sent by the terminal slave station as a reference, the delay sending time of the synchronization pulse of the current slave station is calculated according to the positional relationship between the current slave station and the terminal slave station;
[0012] Based on the calculated synchronization pulse delay sending time, any of the slave stations controls the slave station to delay sending the synchronization pulse signal, thereby achieving pulse synchronization of all slave stations.
[0013] The technical solution of the present application is based on the symmetry of the system and devices and the synchronization algorithm. It can obtain the synchronization delay of each slave station of the automation control system by sending a synchronization training frame only once and transmitting it back, thereby realizing the pulse synchronization and time alignment of all slave stations. According to actual measurements, the scheme can shorten the synchronization error of microseconds to hundreds of nanoseconds, greatly improving the accuracy of pulse synchronization between each slave station in the system.
[0014] In some embodiments, the hardware and software facilities constituting each slave station are the same, and the connection lines between the slave stations are also the same. By using slave stations with the same hardware and software configurations and controlling the same connection lines to the slave stations, a high degree of symmetry of the system and devices is ensured, thereby more accurately ensuring the accuracy of pulse synchronization.
[0015] In some of the embodiments, determining the station number of the slave station includes, the master station sending a write ID frame including an initial slave station number to the slave station connected thereto; after the slave station receives the write ID frame and modifies the station number of the local station to the initial slave station number, the slave station number in the write ID frame is modified in an increasing order of equal proportion and sent to the next slave station, until all slave stations complete the setting of their local station numbers in turn.
[0016] In some of the embodiments, the process of determining the slave station number also includes: after the end slave station sets the local station number according to the write ID frame sent by the previous slave station, the received write ID frame is not modified, and the final modified write ID frame is returned to the master station through the uplink path. In the uplink path, each slave station does not modify the final modified write ID frame; the master station receives the final modified write ID frame and determines the number of active slave stations based on the final modified write ID frame.
[0017] In some embodiments, the master station sends a write ID frame to the slave station connected thereto, wherein the frame structure of the write ID frame includes a slave station number, and the initial value of the slave station number is 0; the slave station receives the write ID frame, sets the local station number to slave station 0 according to the initial value of the slave station number, and then increases the value of the slave station number in the write ID frame by 1 and sends it to the next slave station, until all slave stations complete the local station number setting in sequence. The present invention adopts a mechanism in which the downlink transmission slave station number is incremented and the uplink transmission slave station number remains unchanged, so as to realize the automatic identification of each slave station number.
[0018] In some of the embodiments, the current slave unit transmission line delay δ is calculated according to formula (1):
[0019] Tn=(N-1-n)*(T middown +T midup )+T end +(N-1-n)*2*δ (1);
[0020] Calculate the delay time T of the current slave synchronization pulse transmission delay , according to formula (2):
[0021] T delay =(N-1-n)*δ(2);
[0022] Among them, Tn is the time for any slave station to participate in data transmission, N is the total number of slave stations, n is the value of the current slave station number, T middown T is the time interval from the intermediate slave station receiving the synchronization header to sending the synchronization header in the downlink path. midup T is the time interval from the intermediate slave station receiving the synchronization header to sending the synchronization header in the upstream path, end T is the time interval from the end slave station receiving the synchronization header to sending the synchronization header; delay The synchronization algorithm provided by this technical solution can quickly calculate the transmission delay of the unit line, and then calculate the characteristics of the synchronization pulse of each slave station. This solution can shorten the synchronization error of microsecond level to hundreds of nanosecond level, greatly improving the accuracy of pulse synchronization between each slave station in the system.
[0023] In some embodiments, the synchronization training frame is sent multiple times, and each slave station calculates a plurality of respective unit transmission line delay data δ and takes an average value. Through multiple calculations, accidental interference can be eliminated, and the characteristics of the time delay between the slave station receiving the synchronization header on the downlink path and sending the synchronization header on the uplink path can be more accurately counted.
[0024] In some of the embodiments, a disconnection judgment method is also included: a corresponding timeout time T is set in the master station and each slave station; the master station starts timing after sending the write ID frame, and each slave station starts timing after receiving the write ID frame in the downlink path; when the timing time at a slave station exceeds the timeout time T corresponding to the current slave station, the current slave station returns the received write ID frame to the master station through the uplink path, and each slave station does not modify the write ID frame in the return; the master station receives the write ID frame and determines the disconnected slave station according to the value of the slave station number in the write ID frame; when the timing time of the master station exceeds the corresponding timeout time T, it is determined that the slave station directly connected to the master station is disconnected. By setting a timeout mechanism, there is no need to introduce additional connections and auxiliary means, which effectively saves time overhead and system complexity; and automatic ID recognition based on the timeout mechanism can also help locate the connection and power supply problems of the slave stations in the system.
[0025] In some embodiments, the master station timeout T=N*T0, the slave station timeout T=(Nn-1)*T0; wherein N is the total number of slave stations, n is the value of the current slave station number, T0 is the defined unit timeout, and the unit timeout T0 is the time interval from the synchronization header of the data frame sent by the second-to-last slave station to the synchronization header transmitted by the terminal slave station received by the second-to-last slave station under the maximum number of slave stations and the longest transmission bytes. By setting a timeout mechanism, there is no need to introduce additional connections and auxiliary means, which effectively saves time overhead and system complexity; and automatic ID recognition based on the timeout mechanism can also help locate the connection and power supply problems of the slave stations in the system.
[0026] In a second aspect, the present application also provides a terminal device, comprising a memory, a processor, and a communication control program stored in the memory and executable on the processor, wherein the communication control program, when executed by the processor, implements the steps of a pulse synchronization method for automated control as described in any one of the first aspects.
[0027] In a third aspect, the present application further provides a computer-readable storage medium having a communication control program stored thereon, and when the communication control program is executed by a processor, the steps of a pulse synchronization method for automated control as described in any one of the first aspects are implemented.
[0028] Compared with the prior art, the beneficial effects of the present invention mainly include the following: 1) The structure is simple. The serial data transmission in the present invention adopts serial interconnection to distinguish the transmission mode of the upstream and downstream channels. On the basis of a simple system serial connection, one master station can realize the overall control of multiple slave stations in the system; 2) The present invention adopts a mechanism in which the downstream transmission ID increases and the upstream transmission ID remains unchanged to realize the automatic identification of each slave station ID, and the timeout time of each slave station can be calculated based on the unit timeout time combined with the ID value of the slave station, thereby effectively saving time overhead and system complexity; automatic ID identification based on the timeout mechanism can also help locate the connection and power supply problems of the slave station in the system; 3) The present invention adopts synchronous training to count the receiving delay of each slave station, and calculates the synchronization delay of each slave station based on the symmetry of the system and the device and the synchronization algorithm, thereby realizing the pulse synchronization and time alignment of all slave stations. According to actual measurements, this scheme can shorten the synchronization error of microseconds to hundreds of nanoseconds, greatly improving the accuracy of pulse synchronization between each slave station in the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the specific embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 A system block diagram provided by the present invention.
[0031] Figure 2 This is a schematic diagram of the automatic ID recognition process provided by the present invention.
[0032] Figure 3 A schematic diagram of the timeout period of the master station and each slave station provided by the present invention.
[0033] Figure 4 This is a schematic diagram of the circuit breaker judgment process provided by the present invention.
[0034] Figure 5 This is a schematic diagram of the unit transmission line delay provided by the present invention. DETAILED DESCRIPTION
[0035] The above and other technical contents, features and effects of the present invention will be clearly presented in the following detailed description of a preferred embodiment with reference to the drawings. The directional terms mentioned in the following embodiments, such as up, down, left, right, front or back, etc., are only referenced to the directions of the attached drawings. Therefore, the directional terms used are used to illustrate and not to limit the present invention.
[0036] The following will describe the various embodiments of the present application in detail with reference to the accompanying drawings. However, it will be appreciated by those skilled in the art that in the various embodiments of the present application, many technical details are provided in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solution claimed in the present application can be implemented.
[0037] The steps in the following embodiments do not correspond one to one with the summary of the invention.
[0038] Embodiment 1:
[0039] In modern industrial network control, in order to achieve coordinated actions between industrial devices, a master control device can be used to synchronously control the controlled devices. The master control device belongs to the master station when communicating in the industrial network, and the controlled device belongs to the slave station. In the industrial network in this application, there is a master station and N slave stations, and the master station and the slave stations are connected in series to form a ring network.
[0040] The present invention provides a pulse synchronization method for automatic control, the system block diagram is as follows Figure 1 shown.
[0041] The system contains 1 master station and N slave stations, and the master station and the slave stations are connected in series to form a ring network, such as Figure 1 The master station sends a data frame to slave station 0. After receiving the data frame, slave station 0 parses the information content belonging to the station and sends the data frame to slave station 1. Slave station 1 operates similarly to slave station 0. While parsing the information content belonging to the station, it continues to transmit the data frame to slave station 2, and so on, until the information is passed to the terminal slave station N-1.
[0042] In this process, the information is sent by the master station, and the transmission process from slave station 0, slave station 1 to slave station N-1 is called the downlink path; correspondingly, the uplink path is that after the data frame is received and parsed by the end slave station N-1, its own user information is filled in the N-1 user information field in the data frame, and then the data frame is sent to slave station N-2, and so on. After slave station N-2 fills in its own user data, it also returns the data frame, until slave station 0 returns the user data of all slave stations to the master station.
[0043] Under such an information transmission mechanism, the master station can control all slave stations and recover the control information fed back by all slave stations. The data frame structure transmitted in the entire system is shown in Table 1:
[0044] Table 1 Frame structure transmitted in the system
[0045]
[0046] The workflow of the entire system is:
[0047] 1. Power on the system;
[0048] 2. The master station sends a write ID frame once;
[0049] 3. The master station sends three synchronization training frames at a time;
[0050] 4. The master station sends any number of service frames.
[0051] The process of automatic identification of the slave station number is as follows Figure 2 As shown, the master station sends a write ID frame to the slave station connected thereto, wherein the write ID frame includes the slave station number; the slave station receives the write ID frame, sets the local address according to the slave station number (i.e., modifies the local station number), and then modifies the slave station number in the write ID frame (there are many ways to modify, for example, it can be modified in an equal proportion and increasing order) and sends it to the next slave station until all slave stations complete the local address setting in turn; after the end slave station sets the local address according to the write ID frame sent by the previous slave station, it does not modify the received write ID frame, and transmits the final modified write ID frame back to the master station through the uplink path, and in the uplink path, each slave station does not modify the final modified write ID frame; the master station receives the final modified write ID frame, and determines the number of active slave stations according to the final modified write ID frame.
[0052] Specifically, the specific workflow of the system to achieve automatic ID recognition (i.e., determine the station number of each slave station) is as follows: when the master station sends a write ID frame, the master station will initialize the slave station ID in the frame structure (i.e., the value of the slave station number) to 0. After slave 0 receives the write ID frame, it will mark itself as slave 0 (i.e., modify the host settings of the slave station at this location and set itself as slave 0). At the same time, during the downlink transmission process, the slave station ID value in the write ID frame will be added by 1 and then sent out. After slave 1 receives the new write ID frame, it will parse out its own ID as 1, and then Then it sends out the new ID+1, and so on until the last slave station receives ID=N-1 (N is the value filled in the slave station number field when the master station sends the write ID frame in the system, which is the total number of slave stations in the system). That is, after the end slave station receives the write ID frame, it loops back to the upstream channel for transmission. During the entire upstream channel transmission process, each slave station no longer modifies the ID value in the write ID frame, and keeps the slave station ID value of the end slave station until the master station completes receiving it. The ID value + 1 finally received by the master station is the total number of active slave stations in the system.
[0053] In the actual working environment, the entire ID automatic identification process may fail to successfully identify the end slave station and finally loop back to the master station due to power supply or line problems of a slave station. In order to more accurately realize automatic ID identification and detect the number of active slave stations in the system, a timeout mechanism is used to determine whether the current slave station continues to send data to the downstream slave station or stops sending data on the downstream path and immediately starts looping transmission on the upstream path.
[0054] The timeout mechanism includes the parts applied to the master station and each slave station: first, the corresponding timeout time T is set in the master station and each slave station. The timeout time T of the master station should be greater than the time interval from the sending of the data frame to the receiving of the returned data frame when it is working normally, and the timeout time T of the slave station is greater than the time interval Tn of the corresponding slave station participating in data transmission (that is, the time interval from each slave station receiving the data frame in the downlink channel to sending the data frame in the uplink channel, see the time Tn of any slave station participating in data transmission described below); it can be understood that the longer the timeout time T is, the longer the waiting time at each place is, and the time overhead of the system is large, but if the timeout time T is too short, it may cause false alarms; therefore, there are many situations for determining the timeout time T, which can be considered in combination with the actual situation, so as to meet the requirements of judgment accuracy and minimize the time overhead of the system;
[0055] Afterwards, the master station starts timing after sending out the write ID frame, and each slave station starts timing after receiving the write ID frame in the downlink path; when the timing time at a certain slave station exceeds the timeout time T corresponding to the current slave station, the current slave station transmits the received write ID frame back to the master station through the uplink path, and each slave station does not modify the write ID frame during the return; the master station receives the write ID frame, and determines the disconnected slave station according to the value of the slave station number in the write ID frame; when the timing time of the master station exceeds the corresponding timeout time T, it is determined that the slave station directly connected to the master station is disconnected.
[0056] In this embodiment, in order to realize the judgment function, a unit timeout T0 is set, and the respective timeouts are determined based on the unit timeout T0 and the positions of the master station and each slave station in the system. T0 is based on the maximum number of slave stations in the current system (in the data frame structure in this embodiment, a maximum of 64 slave stations, in other embodiments, the maximum number of slave stations can be increased by modifying the data frame structure) and the longest transmission byte (similarly, in the data frame structure in this embodiment, the longest transmission byte of each slave station is 256, in other embodiments, the maximum value of the longest transmission byte can be increased by modifying the data frame structure). The timing starts when the synchronization header of the data frame is sent by slave station N-2, and ends when slave station N-2 receives the synchronization header transmitted from slave station N-1. The master station and each slave station need to wait for several unit timeouts T0 respectively, as shown below. Figure 3 As shown below:
[0057] Therefore, for the master station in the system, its timeout period is N*T0, and for any one of the slave stations, its specific timeout period T can be expressed by the following formula:
[0058] T=(N-n-1)*T0 (1)
[0059] Wherein, N represents the value filled in the slave station number field when the master station in the system sends a write ID frame (as shown in Table 1), n is the slave station ID value in the write ID frame received by the current slave station, and T0 represents the unit timeout period.
[0060] As Figure 4 shown, for example, if there is a break at the downstream transmission end a of slave station m (0<m<N-1), the ID automatic recognition process will time out at slave station m and immediately perform an upstream feedback (here, the write ID frame feedback by slave station m is the write ID frame received by slave station m from slave station m-1, and the value of the slave station number in this write ID frame is m), then the id finally received by the master station is m; therefore, based on this timeout mechanism, without introducing additional connection and auxiliary means, when the id value finally received by the master station in the automatic ID recognition does not conform to the preset number of slave stations in the system, it can be judged which power supply or link in the system has a problem.
[0061] After the confirmation of the station numbers of all slave stations is achieved, pulse synchronization is then implemented among the slave stations. First, the master station sends a synchronization training frame, and each slave station respectively records the time interval from receiving the synchronization training frame in the downstream path to sending the synchronization training frame in the upstream path; then, each slave station calculates the unit transmission line delay based on the recorded time interval, the relative position of the current slave station in the ring network, the upstream transmission processing delay and downstream transmission processing delay of each intermediate slave station, and the processing delay of the end slave station; finally, based on the synchronization pulse sent by the end slave station, the delay sending time of the synchronization pulse of the current slave station is calculated according to the position relationship between the current slave station and the end slave station, so as to determine the sending time of the synchronization pulse of the current slave station.
[0062] The principle and performance of the system provided by this application to achieve pulse synchronization among all slave stations depend on the symmetry of the entire system and devices (in this application, the symmetry of the system and devices refers to the consistency of the hardware devices, software of each slave station in the system, and the connection lines between each slave station. The higher the consistency, the better the symmetry, that is, it should be ensured as much as possible that the hardware and software of each slave station are the same, and the connection lines between adjacent two slave stations, including the downstream line and the upstream line, are also the same) and the pulse synchronization algorithm. In this embodiment, a specific step is as follows:
[0063] First, some time parameters need to be defined:
[0064] T middown : Downlink transmission processing delay of the intermediate slave station. In the downlink path transmission, each intermediate slave station (in this application, the intermediate slave station refers to the remaining slave stations except the terminal slave station, that is, slave station 0 to slave station N-2, and slave station N-1 is the terminal slave station) experiences a time delay from the time it receives the synchronization header to the time it sends the synchronization header.
[0065] T midup: The upstream transmission processing delay of the intermediate slave station is the time delay experienced by each intermediate slave station from the time it receives the synchronization header to the time it sends the synchronization header during the upstream path transmission.
[0066] T end : The processing delay of the end slave station is the time delay from the end slave station receiving the synchronization header to the end sending the synchronization header.
[0067] δ: Unit transmission line delay, end-to-end transmission line time delay, such as Figure 5 As shown:
[0068] The time Tn for any slave station to participate in data transmission is Tn, that is, for any slave station n in the system, 0<=n<=N-1, the synchronization header is used as the benchmark and the frame length of data transmission is ignored. The time starts from the time when the synchronization header is received in the downlink channel to the time when the synchronization header is sent in the uplink channel. The total time is Tn:
[0069] Tn=(N-1-n)*(T middown +T midup )+T end +(N-1-n)*2*δ (2)
[0070] N is the number of slaves in the write ID frame, and n is the value of the slave station number, which can be parsed by each slave after receiving the write ID frame. It can be understood that for a certain system, when the hardware and software configurations of each slave are the same, T middown , T midup and T end These processing delays are fixed (not related to the number of slave stations and the length of the slave station transmission bytes, etc.). When the connection lines are consistent, the unit transmission line delay is also the same. Therefore, the unit transmission line delay δ can be calculated using formula (2).
[0071] The pulse synchronization between all slave stations is based on the synchronization pulse time of the end slave station. The end slave station sends out the synchronization pulse immediately after receiving the synchronization header. Therefore, the intermediate slave station needs to wait for several units of transmission line delay δ before sending out the synchronization pulse after receiving the synchronization header. Therefore, after receiving the synchronization header in the downlink path, slave station n needs to delay T delayA synchronization pulse is given after one system clock, T delay The calculation method of is shown in formula (3): T delay =(N-1-n)*δ (3)
[0072] The statistical accuracy of Tn can be improved by multiple synchronous trainings (3 times is proposed in this paper), thereby improving the unit transmission line delay δ and T delay The calculation accuracy is improved by performing multiple synchronization trainings. After each synchronization training, a set of data about the unit transmission line delay δ is obtained. That is, each intermediate slave station will time itself and calculate a δ of its own station in each synchronization training. After multiple synchronization trainings, each slave station can take the average of the δ of multiple local stations and use it to calculate its own T delay This method can eliminate the deviation caused by accidental factors and effectively reduce the error. Therefore, for each slave station, the T corresponding to the current slave station can be calculated by combining formulas (2) and (3). delay , so as to achieve pulse synchronization and alignment of all slave stations at all times.
[0073] Embodiment 2:
[0074] The present application also provides a step of implementing the above-mentioned pulse synchronization method for automatic control, or a terminal device for implementing the above-mentioned step of the pulse synchronization method for automatic control, and the terminal device may include: a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory communicate with each other through the communication bus; a communication control program is stored in the memory and can be run on the processor, and the communication control program implements the above-mentioned step of the pulse synchronization method for automatic control when executed by the processor. The processor can call the logic instructions in the memory, and the logic instructions in the memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0075] Embodiment three:
[0076] The present application also provides a computer-readable storage medium, on which a communication control program is stored. When the communication control program is executed by a processor, the steps of the above-mentioned pulse synchronization method for automated control are implemented.
[0077] Based on such understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., various media that can store program codes.
[0078] In order to facilitate the description, some common English nouns or letters used in the present invention are only used for exemplary reference rather than restrictive interpretation or specific usage, and the protection scope of the present invention should not be limited by their possible Chinese translations or specific letters.
[0079] It should also be noted that, in this document, relational terms such as "first" and "second" are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
Claims
1. A pulse synchronization method for automatic control, characterized in that: include, A ring network is provided, which is formed by a master station and a plurality of slave stations with station numbers connected in series in sequence, wherein the ring network includes a downlink path for transmitting signals from the master station to the terminal slave stations in sequence, and an uplink path for transmitting signals from the terminal slave stations back to the master station in sequence; The master station sends a synchronous training frame, and the time interval from when any of the slave stations receives the synchronization header of the synchronous training frame in the downlink path to when the same slave station sends the synchronization header of the synchronous training frame in the uplink path is the time for any slave station to participate in data transmission; Each slave station calculates a unit transmission line delay based on the data transmission time of any slave station involved, the relative position of the current slave station in the ring network, the uplink transmission processing delay and the downlink transmission processing delay of each intermediate slave station, and the terminal slave station processing delay; Taking the synchronization pulse sent by the terminal slave station as a reference, the delay sending time of the synchronization pulse of the current slave station is calculated according to the positional relationship between the current slave station and the terminal slave station; Based on the calculated synchronization pulse delay sending time, any of the slave stations controls the slave station to delay sending the synchronization pulse signal, thereby achieving pulse synchronization of all slave stations.
2. A pulse synchronization method for automatic control according to claim 1, characterized in that: The hardware and software facilities that make up each slave station are the same, and the connection lines between the slave stations are also the same.
3. A pulse synchronization method for automatic control according to claim 2, characterized in that: Determine the station number of the slave station including, The master station sends a write ID frame including an initial slave station number to the slave station connected thereto; After the slave station receives the write ID frame and modifies its own station number to the initial slave station number, it modifies the slave station number in the write ID frame in an equal proportion and increases in sequence and sends it to the next slave station until all slave stations complete the setting of their own station numbers in turn.
4. A pulse synchronization method for automatic control according to claim 3, characterized in that: The process of determining the station number of the slave station also includes, after the end slave station sets the station number of the local station according to the write ID frame sent by the previous slave station, not modifying the received write ID frame, and returning the final modified write ID frame to the master station through the uplink path, and in the uplink path, each slave station does not modify the final modified write ID frame; The master station receives the final modified write ID frame, and determines the number of active slave stations according to the final modified write ID frame.
5. A pulse synchronization method for automatic control according to claim 3, characterized in that: The master station sends a write ID frame to the slave station connected thereto, wherein the frame structure of the write ID frame includes a slave station number, and an initial value of the slave station number is 0; The slave station receives the write ID frame, sets the local station number to slave station 0 according to the initial value of the slave station number, then increases the value of the slave station number in the write ID frame by 1 and sends it to the next slave station until all slave stations complete the local station number setting in turn.
6. A pulse synchronization method for automatic control according to claim 5, characterized in that: Calculate the current slave unit transmission line delay δ according to formula (1): Tn=(N-1-n)*(T middown +T midup )+T end +(N-1-n)*2*δ (1); Calculate the delay time T of the current slave synchronization pulse transmission delay , according to formula (2): T delay =(N-1-n)*δ (2); Where Tn is the time for any slave station to participate in data transmission; N is the total number of slave stations; n is the value of the current slave station number; T middown T is the time interval from the intermediate slave station receiving the synchronization header to sending the synchronization header in the downlink path; midup T is the time interval from the intermediate slave station receiving the synchronization header to sending the synchronization header in the upstream path; end T is the time interval from the end slave station receiving the synchronization header to sending the synchronization header; delay It is the time interval that the current slave station needs to delay sending after receiving the synchronization header in the downstream channel.
7. A pulse synchronization method for automatic control according to claim 6, characterized in that: The synchronization training frame is sent multiple times, and each slave station calculates a plurality of respective unit transmission line delay data δ and takes an average value.
8. A pulse synchronization method for automatic control according to claim 5, characterized in that: It also includes the circuit breaker judgment method: Setting a corresponding timeout time T in the master station and each slave station; The master station starts timing after sending the write ID frame, and each slave station starts timing after receiving the write ID frame in the downlink path; When the timing time at a certain slave station exceeds the timeout time T corresponding to the current slave station, the current slave station transmits the received write ID frame back to the master station through the uplink path, and each slave station does not modify the write ID frame in the return; The master station receives the write ID frame and determines the disconnected slave station according to the value of the slave station number in the write ID frame; When the timing time of the master station exceeds the corresponding timeout time T, it is determined that a circuit breaker occurs in the slave station directly connected to the master station.
9. A pulse synchronization method for automatic control according to claim 8, characterized in that: The timeout time of the master station is T=N*T0, and the timeout time of the slave station is T=(Nn-1)*T0; wherein N is the total number of slave stations, n is the value of the current slave station number, and T0 is the defined unit timeout time. The unit timeout time T0 is the time interval starting from the synchronization header of the data frame sent by the second-to-last slave station to the end of the time when the second-to-last slave station receives the synchronization header transmitted by the end slave station under the maximum number of slave stations and the longest transmission bytes.
10. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a communication control program stored in the memory and executable on the processor. When the communication control program is executed by the processor, the steps of a pulse synchronization method for automated control as described in any one of claims 1 to 9 are implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a communication control program, and when the communication control program is executed by a processor, the steps of a pulse synchronization method for automated control as described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Method for outputting synchronization signals accurately to solve problem on synchronization of multi-stations
CN102843764A
Site synchronization system and method for industrial Ethernet
CN106230541A