Multi-slave synchronous acquisition method of safety automatic device
By adopting a multi-slave synchronous acquisition method in the safety automatic device, using optical fiber communication and PTP two-step clock mode to achieve slave clock synchronization and data transmission, the problem of inflexible slave configuration and insufficient acquisition accuracy in the prior art is solved, and high-precision and flexible electrical volume acquisition are achieved, which is suitable for complex and changeable application scenarios.
Patent Information
- Application Number
- CN202510172371.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-05-23
AI Technical Summary
When collecting electrical quantities of existing safety automatic devices, since the electrical quantities of the same interval must be collected on the same slave, the slave configuration is inflexible, which increases hardware cost and complexity of on-site access, making it difficult to meet complex and changeable application scenarios.
The multi-slave synchronization acquisition method is adopted to realize clock synchronization and data transmission between slaves through optical fiber point-to-point communication, and the PTP two-step clock mode and FPGA hardware time stamp are used to reduce time errors, and dynamic adjustment of slave clocks and phase compensation of sampled data are realized through the PID controller.
It improves the acquisition accuracy and data consistency between multiple slaves, enhances the flexibility of slave configuration, can meet the requirements of various special operating conditions and complex scenarios, and reduces hardware costs and the complexity of on-site access.
Smart Images

Figure CN120033845A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of power system automation, and in particular to a multi-slave synchronous acquisition method for a safety automatic device. Background Art
[0002] In the application of safety automatic devices, it is necessary to collect electrical quantities of multiple lines and loads. Existing devices generally adopt the architecture of a host plus multiple slaves. One slave processes electrical quantities at fixed intervals, and each slave is individually connected to the external time. The final results are summarized to the host for unified strategy judgment.
[0003] In the above design, since power, zero sequence and other calculations are involved, the same interval electrical quantities must be collected on the same slave. In field applications, this method will bring inflexibility to the slave configuration. Sometimes, in order to calculate power, it is necessary to repeatedly collect electrical quantities, which increases the hardware cost and also brings inconvenience to field access. Therefore, it is particularly important to invent a multi-slave synchronous collection method for a safety automatic device.
[0004] The existing technology also has the following defects, which are specifically reflected in: 1. In the existing safety automatic device architecture, because in the calculation scenarios involving key electrical quantities such as power and zero sequence, there are strict technical requirements based on relevant calculation principles and algorithm logic, that is, the electrical quantities of the same interval must be collected on the same slave. The task allocation of the slave is bound by fixed rules and cannot be flexibly adjusted according to actual on-site needs and the diverse distribution of electrical quantities. It is difficult to meet complex and changeable application scenarios, which limits the flexibility of slave configuration.
[0005] 2. Under the existing technical system, due to the complex algorithms that power calculation relies on, it is necessary to accurately collect electrical quantities in multiple dimensions and angles. In actual operation, in order to accurately calculate power, repeated collection of the same electrical quantity often occurs, which increases hardware costs. In the actual field environment, the existing collection rules require that the same interval electrical quantities must be collected on the same slave machine, so that when accessing the site, technicians have to strictly follow this fixed mode for wiring and equipment connection, which increases the difficulty and complexity of wiring. Summary of the invention
[0006] The purpose of the present invention is to provide a multi-slave synchronous acquisition method for a safety automatic device, which solves the problems existing in the background technology.
[0007] In order to solve the above technical problems, the present invention adopts the following technical solutions: The present invention provides a multi-slave synchronous acquisition method of a safety automatic device, comprising: step one, communication connection and data transmission.
[0008] Step 2: Clock synchronization.
[0009] Step 3: Process and upload electrical quantity data.
[0010] Step 4: Phase compensation.
[0011] Preferably, the step one, communication connection and data transmission, is specifically implemented as follows: the safety automatic device host and multiple slaves communicate point-to-point via optical fiber, the electrical quantity data collected by the slaves are transmitted to the host via an optical fiber channel, the collection and data transmission channel simultaneously transmits synchronization information, and the synchronization information and the collected data are transmitted in the same set of optical fibers, without the need for additional optical fiber channels.
[0012] Preferably, the step 2, clock synchronization, is specifically implemented by: utilizing a synchronization mechanism to achieve clock synchronization of multiple slaves.
[0013] The synchronization mechanism includes modules such as synchronization information related message management, master-slave clock synchronization, and slave machine acquisition data phase compensation.
[0014] The synchronization information message adopts the PTP synchronization message and the two-step clock mode, and directly adds a hardware timestamp in the optical fiber communication message.
[0015] The slave uses a PID controller to compensate for the master-slave clock frequency difference, ensures accurate synchronization of multiple slave acquisitions, and sends the sampling deviation to the host.
[0016] The PID controller realizes dynamic parameter adjustment, sets a threshold to prevent excessive oscillation or instability of the control system, and adjusts the count value of the slave sampling pulse counter according to the master-slave clock deviation value.
[0017] Preferably, the step three, processing and uploading of electrical quantity data, is specifically implemented as follows: the electrical quantity acquisition data is collected on different slaves, and is regularly sent to the host through a high-speed optical fiber link driven by the internal logic of the FPGA; the electrical quantity acquisition data is calculated as raw phasor data in the slaves and then uniformly sent to the host for use in subsequent calculations of the safety and automation system.
[0018] Preferably, the step four, phase compensation, is specifically implemented as follows: the host calculates the rotation angle according to the sampling deviation sent from the slave and the frequency of the electrical quantity, performs phase rotation on the sampled data phase, and generates compensated real and imaginary phase data.
[0019] The beneficial effects of the present invention are: 1. In the present invention, in the key channel for sending data to the host, the PTP two-step clock method is adopted to accurately calibrate the clock of each slave in two steps, and the FPGA hardware management is directly used to add a hardware timestamp in the optical fiber communication message, which reduces the time error, improves the collection accuracy between multiple slaves, and ensures the high consistency of the collected data in the time dimension.
[0020] 2. In the present invention, through innovative synchronization mechanisms and flexible data transmission methods, in the face of different types of units, complex line layouts, and diverse load characteristics, the slaves can be flexibly configured to collect electrical quantities according to actual needs, and are no longer bound by traditional fixed modes. The flexibility of data collection is improved, and the requirements of various special working conditions and complex scenarios are met, the accuracy of collected data is improved, and strong support is provided for the stable operation and accurate decision-making of safety automatic devices in various industrial control scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art 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.
[0022] Figure 1 The present invention is a schematic flow chart of the steps for implementing the method.
[0023] Figure 2 A schematic diagram of the framework of a multi-slave synchronous acquisition method provided by an embodiment of the present invention.
[0024] Figure 3 A schematic diagram of implementing a synchronization mechanism provided in an embodiment of the present invention.
[0025] Figure 4 A schematic diagram of a phase compensation method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] Reference Figure 1 As shown, the present invention provides a multi-slave synchronous acquisition method for a safety automatic device, including: step one, communication connection and data transmission.
[0028] In a specific embodiment, the step one, communication connection and data transmission, is specifically implemented as follows: the safety automatic device host and multiple slaves communicate point-to-point via optical fiber, the electrical quantity data collected by the slaves are transmitted to the host via an optical fiber channel, the collection and data transmission channel simultaneously transmits synchronization information, and the synchronization information and the collected data are transmitted in the same set of optical fibers, without the need for additional optical fiber channels.
[0029] It should be noted that the safety automatic device uses a master-slave structure, refer to Figure 2 A safety automatic device host can be connected to multiple slaves. The host is responsible for various control strategies and the management of the entire device, and the slave is responsible for the collection and output of various electrical quantities and switch quantities on site. The host is connected to external timing signals, such as GPS, Beidou, B code, etc., as the main clock of the entire safety automatic device. Each slave no longer needs to be connected to an external timing signal, but uses the data interaction channel between the master and the slave for clock synchronization.
[0030] The host is equipped with a master clock management module to process external timing signals and synchronize the slave clocks. The slave includes a slave clock management module, a dynamic PID control module and a sampling pulse generation module. The slave clock management module responds to the host synchronization PTP message and interacts with the dynamic PID control module. The dynamic PID control module dynamically adjusts the slave clock according to the clock deviation value in the PTP mechanism, and adjusts the output of the sampling pulse generation module to achieve synchronous acquisition of multiple slaves.
[0031] Step 2: Clock synchronization.
[0032] In a specific embodiment, the step 2, clock synchronization, is specifically implemented by: using a synchronization mechanism to achieve clock synchronization of multiple slaves.
[0033] The synchronization mechanism includes modules such as synchronization information related message management, master-slave clock synchronization, and slave machine acquisition data phase compensation.
[0034] The synchronization information message adopts the PTP synchronization message and the two-step clock mode, and directly adds a hardware timestamp in the optical fiber communication message.
[0035] The slave uses a PID controller to compensate for the master-slave clock frequency difference, ensures accurate synchronization of multiple slave acquisitions, and sends the sampling deviation to the host.
[0036] The PID controller realizes dynamic parameter adjustment, sets a threshold to prevent excessive oscillation or instability of the control system, and adjusts the count value of the slave sampling pulse counter according to the master-slave clock deviation value to minimize the sampling time deviation and stabilize it.
[0037] It should be noted that the synchronization mechanism, refer to Figure 3 The host performs synchronization operations regularly according to the user configuration, and sends a synchronization frame in the middle of the data channel interacting with the slave. The synchronization frame is a PTP protocol synchronization frame, which is transmitted based on the MAC layer, and the timestamp is a hardware timestamp.
[0038] The slave receives the synchronization frame and calculates the local clock deviation between the master and the slave according to the two-step clock operation mode method in the PTP protocol.
[0039] When the deviation value is greater than the set value, adjust the PID controller to enter the fast synchronization state until the deviation is less than the set value and enters the stable adjustment state, and adjust the sampling pulse according to the output of the PID to synchronize it with the host clock frequency. The adjustment method is to adjust the low value of the sampling generation counter according to the PID output to speed up or slow down the local crystal oscillator frequency according to the master-slave deviation value.
[0040] The slave simultaneously returns the master-slave deviation value to the host through the master-slave data interaction channel.
[0041] In the present invention, in the key channel for sending data to the host, the PTP two-step clock method is adopted to accurately calibrate the clock of each slave in two steps, and directly use FPGA hardware management to add hardware timestamps in the optical fiber communication message, which reduces the time error, improves the collection accuracy between multiple slaves, and ensures the high consistency of the collected data in the time dimension.
[0042] Step 3: Process and upload electrical quantity data.
[0043] In a specific embodiment, the step three, processing and uploading of electrical quantity data, is specifically implemented as follows: the electrical quantity acquisition data is collected on different slaves, and is regularly sent to the host through a high-speed optical fiber link driven by the internal logic of the FPGA. The electrical quantity acquisition data is calculated as raw phasor data in the slaves and then uniformly sent to the host for use in subsequent calculations of the security system.
[0044] Step 4: Phase compensation.
[0045] In a specific embodiment, the step four, phase compensation, is specifically implemented as follows: the host calculates the rotation angle based on the sampling deviation sent by the slave and the frequency of the electrical quantity, performs phase rotation on the sampled data phase, and generates compensated real and imaginary phase data, thereby further ensuring the synchronization accuracy of the collection.
[0046] It should be noted that the phase compensation, referring to Figure 4, the host receives the electrical quantity collection data of the slave, the collection data includes the real part, imaginary part, frequency and clock deviation between the master and the slave calculated by the slave according to the electrical quantity. After receiving the data frame, the clock deviation value is extracted for judgment. If the deviation is greater than the set value, the slave is considered to be in a state of out-of-step. At this time, the electrical quantity is directly considered to be unreliable and the slave is set to abnormal. After the deviation is stabilized and less than the set value, it is considered that the master and slave are in synchronization adjustment. At this time, phase compensation is required. First, the phase Δφ to be adjusted is calculated according to the frequency and time deviation of the electrical quantity, and then the new real part and imaginary part are calculated. The calculation formula is: Renew=Re·cos(Δφ)-Im·sin(Δφ), Imnew=Re·sin(Δφ)+Im·cos(Δφ), where Renew and Imnew represent the new real part and imaginary part respectively, and Re and Im represent the original real part and imaginary part calculated by the slave respectively.
[0047] In the present invention, through innovative synchronization mechanisms and flexible data transmission methods, in the face of different types of units, complex line layouts, and diverse load characteristics, the slaves can be flexibly configured to collect electrical quantities according to actual needs, and are no longer bound by traditional fixed modes. The flexibility of data collection is improved, and the requirements of various special working conditions and complex scenarios are met, the accuracy of collected data is improved, and strong support is provided for the stable operation and accurate decision-making of safety automatic devices in various industrial control scenarios.
[0048] The above contents are merely examples and explanations of the concept of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the concept of the invention or exceed the scope defined by the present invention, they shall all fall within the protection scope of the present invention.
Claims
1. A multi-slave synchronous acquisition method for a safety automatic device, characterized in that: include: Step 1: Communication connection and data transmission; Step 2: Clock synchronization; Step 3: Process and upload electrical quantity data; Step 4: Phase compensation.
2. The multi-slave synchronous data acquisition method of a safety automatic device according to claim 1, characterized in that: The specific implementation method of step 1, communication connection and data transmission is as follows: The safety automatic device host communicates with multiple slaves through optical fiber point-to-point. The electrical quantity data collected by the slaves is transmitted to the host through the optical fiber channel. The collected data transmission channel transmits synchronization information at the same time, and the synchronization information and collected data are transmitted in the same set of optical fibers, without the need for additional optical fiber channels.
3. The multi-slave synchronous data acquisition method of a safety automatic device according to claim 1, characterized in that: The specific implementation method of step 2, clock synchronization, is as follows: Use synchronization mechanism to achieve clock synchronization of multiple slaves; The synchronization mechanism includes modules such as synchronization information related message management, master-slave clock synchronization, and slave machine acquisition data phase compensation; The synchronization information message adopts PTP synchronization message and two-step clock mode to directly add hardware timestamp in the optical fiber communication message; The slave uses a PID controller to compensate for the master-slave clock frequency difference, ensures accurate synchronization of multiple slave acquisitions, and sends the sampling deviation to the host; The PID controller realizes dynamic adjustment of parameters, sets a threshold to prevent excessive oscillation or instability of the control system, and adjusts the count value of the slave sampling pulse counter according to the master-slave clock deviation value.
4. The multi-slave synchronous data acquisition method of a safety automatic device according to claim 1, characterized in that: The specific implementation method of step 3, electrical quantity data processing and uploading, is as follows: The electrical quantity acquisition data is collected on different slaves and sent to the host regularly through a high-speed optical fiber link driven by the internal logic of the FPGA. The electrical quantity acquisition data is calculated as raw phasor data in the slaves and then sent to the host in a unified manner for use in subsequent calculations of the safety and automation system.
5. The multi-slave synchronous data acquisition method of a safety automatic device according to claim 1, characterized in that: The specific implementation method of step 4, phase compensation, is as follows: The host calculates the rotation angle based on the sampling deviation sent by the slave and the frequency of the electrical quantity, performs phasor rotation on the sampled data phasor, and generates compensated real and imaginary phasor data.