Electric IRIG-B (Inter-Range Instrumentation Group-B) code time synchronization signal processing method of cascade device
By using the rising and falling edges to trigger timing and set time windows in the electrical IRIG-B code timing signal processing, the debounce and decoding logic is integrated, and the problem of impact on time signal distortion in the cascade device is solved, and the problem of time distortion in the cascade device is improved. The accuracy and accuracy of the time-based signal.
Patent Information
- Application Number
- CN202410945702.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-08
AI Technical Summary
The prior art uses debounce processing to eliminate time signal distortion in the cascade device, making it difficult to take into account the accuracy of the time signal, resulting in the inability to meet the time accuracy requirements of the product standard.
By triggering timing from the rising and falling edges of the time signal from the electrical IRIG-B code, a time window is set to avoid the influence of distortion, and combined with decoding logic, the fusion processing of debounce and decoding is realized to ensure the accuracy and accuracy of symbol timing.
It effectively handles the distortion of time-based signals, improves the accuracy and accuracy of time-based signals, and meets the time-based accuracy requirements of product standards.
Smart Images

Figure CN118921071A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an electrical IRIG-B code timing signal processing method for a cascade device, and belongs to the field of relay protection automation of electric power engineering. Background Art
[0002] Driven by the "dual carbon" goal, new energy continues to develop vigorously, and the demand for stability control and relay protection is also increasing. The number of corresponding devices in the substation is accumulating. However, a site generally only provides one clock source device. There are some devices in the station that are dispersed and far away from the timing source device, such as low-voltage relay protection devices. Generally, a one-to-many timing method is adopted, such as the timing method using the electrical IRIG-B code (which can be referred to as the "electrical B code"). Each device that needs a timing source is cascaded, and the clock source device is cascaded with the device that needs a timing source. Through one electrical B code, a timing signal is provided for each cascaded device that needs a timing source. At the same time, the electromagnetic environment in the substation is complex, and devices such as TVS tubes and capacitors are usually required in circuit design to reduce the impact of interference such as surges on the device.
[0003] This one-to-many timing method and anti-interference design have a great impact on the integrity of the electrical signal. Even if the circuit has a corresponding signal integrity design, the subsequent device in the cascade device will still reflect the signal to the front end, resulting in the signal received by the device at the front end being a composite signal, that is, the accumulation of the signal source and multiple subsequent reflected signals; due to the inconsistent delays of each signal component relative to the clock source signal, the superimposed signal waveform will be severely distorted at the edge of the signal jump. The more signal components are accumulated and the greater the delay difference between each signal, the more obvious the distortion of the superimposed signal will be; for example, in an actual smart substation, there are more than 10 devices such as an integrated protection and measurement device and a standby automatic transfer device using an electrical B code source. At this time, a distorted signal of about 2us is continuously generated at the high and low level jump position, and the integrity of the timing signal received by the front-end device is seriously affected, causing errors in the data decoded according to the received timing signal, resulting in abnormal timing of the cascade front-end device. For the timing signal with distortion exceeding 2us, after connecting to the FPGA, de-jitter processing of more than 2us will be performed to eliminate signal distortion, but this will cause a delay of the same time, that is, a delay of more than 2us; and in the prior art, the power system usually requires the timing accuracy of equipment such as line traveling wave fault ranging devices and synchronous phasor measurement devices to be better than 1us. Therefore, although this de-jitter processing method can solve the problem of timing errors caused by distortion of the signal received by the front-end device when a clock source device is cascaded with multiple devices requiring a clock source through de-jitter processing, it reduces the timing accuracy and fails to meet the timing accuracy requirements of the product standard. Summary of the invention
[0004] The purpose of the present invention is to provide a method for processing electrical IRIG-B code timing signals of a cascade device, so as to solve the problem that the existing method of processing the timing signals by de-jittering is difficult to take into account the timing accuracy of the timing signals while eliminating the distortion of the timing signals to avoid timing errors.
[0005] In order to solve the above technical problems, the present invention provides a method for processing an electrical IRIG-B code timing signal of a cascade device, the method comprising:
[0006] 1) Start the timing corresponding to the first code element from the first rising edge of the electrical IRIG-B code timing signal after being sent to a cascade device;
[0007] 2) After a set time window, the timing is stopped when the first falling edge is encountered. After the next set time window, if a rising edge is encountered, the timing corresponding to the code element is stopped and the timing corresponding to the next code element is started; the timing value when the timing corresponding to the code element is stopped is used for decoding, thereby obtaining the decoded data of the code element;
[0008] 3) Repeat step 2) until the timing signal is completed, and obtain the decoded data of each code element accordingly;
[0009] The length of each set time window is greater than the time width of distortion at the rising edge and the falling edge of the timing signal and is less than the high level duration length of all types of code elements of the electrical IRIG-B code under normal circumstances.
[0010] Furthermore, when the timing corresponding to each code element ends, decoding is performed according to the current timing value of the timing.
[0011] Furthermore, decoding is performed according to the timing value corresponding to the code element when the timing is stopped, so as to obtain the decoded data of the code element, including: judging the type of the code element by comparing the timing value corresponding to the code element when the timing is stopped with the high level duration time of different types of code elements of the IRIG-B code.
[0012] Furthermore, the method further comprises: before performing the step 1), preprocessing the electrical IRIG-B code timing signal sent to the cascade device, wherein the preprocessing comprises phase reversal and glitch filtering.
[0013] Furthermore, the steps 1)-3) are implemented by FPGA modules respectively arranged at each cascade device.
[0014] Furthermore, it also includes: after the decoded data of each code element is obtained accordingly, triggering a time synchronization interrupt, and sending out time information corresponding to the decoded data of each code element, so that the cascade device can complete the time synchronization according to the time information.
[0015] Furthermore, the glitch width targeted by the glitch filtering is determined according to the timing accuracy requirement of the timing signal.
[0016] Furthermore, the method for determining the end of the timing signal includes: when a time length corresponding to the total number of code elements included in a frame of the timing signal has passed, determining that the timing signal has ended.
[0017] Beneficial effects: As a pioneering invention, the present invention effectively utilizes the width characteristics of the code element itself and the time width characteristics of the distortion of the timing signal when processing the timing signal, and realizes the decoding logic by triggering the high level start and stop timing of each code element by the rising edge and falling edge, and decoding according to each high level timing; at the same time, by setting the corresponding time window, it is ensured that during the decoding process, the high level timing of the current code element is prevented from being affected by the distortion and stopped in advance during the time period when the timing signal is prone to distortion at the rising edge, and the high level timing of the next code element is prevented from being affected by the distortion and started in advance during the time period when the timing signal is prone to distortion at the falling edge, thereby achieving de-jittering. logic; that is, high-level timing and the setting of the corresponding time windows when the timing starts and ends are adopted, so as to integrate the de-jittering logic with the decoding logic; and the time width of the time window is set to be larger than the time width of the distortion and smaller than the high-level duration length of all types of normal code elements of the electrical B code, so as to ensure that the time window itself will not affect the normal stop and start of the high-level timing, so as to obtain the accurate time length of the code element high level, and then facilitate the comparison with various types of code elements of the electrical B code to obtain accurate code element analysis results (i.e., decoding data), so as to parse the accurate time information, so that the method can take into account the accuracy of the timing signal and the timing precision. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a connection structure diagram of a timing system of a cascade device based on FPGA in an embodiment of the electrical IRIG-B code timing signal processing method of the cascade device of the present invention;
[0019] Figure 2 It is a flow chart of the method for processing the electrical IRIG-B code timing signal of the cascade device in the embodiment of the method for processing the electrical IRIG-B code timing signal of the cascade device of the present invention;
[0020] Figure 3a It is a waveform diagram of a code element "P" of an electrical B code in an embodiment of an electrical IRIG-B code timing signal processing method of a cascade device of the present invention;
[0021] Figure 3b It is a waveform diagram of the code element logic "0" of the electrical B code in the embodiment of the electrical IRIG-B code timing signal processing method of the cascade device of the present invention;
[0022] Figure 3cIt is a waveform diagram of the code element logic "1" of the electrical B code in the embodiment of the electrical IRIG-B code timing signal processing method of the cascade device of the present invention;
[0023] Figure 4 It is a waveform diagram of the distorted waveform of the electrical IRIG-B code and the digital signal in the embodiment of the electrical IRIG-B code timing signal processing method of the cascade device of the present invention. DETAILED DESCRIPTION
[0024] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0025] Embodiment of the method for processing the electrical IRIG-B code timing signal of the cascade device
[0026] The present invention proposes a technical solution for a method for processing an electrical IRIG-B code timing signal of a cascade device, the method comprising:
[0027] 1) Start the timing corresponding to the first code element from the first rising edge of the electrical IRIG-B code timing signal after being sent to a cascade device;
[0028] 2) After a set time window, the timing is stopped when the first falling edge is encountered. After the next set time window, if a rising edge is encountered, the timing corresponding to the code element is stopped and the timing corresponding to the next code element is started; the timing value when the timing corresponding to the code element is stopped is used for decoding, thereby obtaining the decoded data of the code element;
[0029] 3) Repeat step 2) until the timing signal is completed, and obtain the decoded data of each code element accordingly;
[0030] The length of each set time window is greater than the distortion time width at the rising and falling edges of the timing signal and less than the high level duration of all types of IRIG-B code elements under normal circumstances. This method integrates the de-jitter logic with the decoding logic, and better handles the distortion of the visual signal, thereby parsing accurate time information, and can take into account both the accuracy of the timing signal and the timing precision. The following is a detailed description.
[0031] The connection structure diagram of the time synchronization system based on the FPGA cascade device in this embodiment is as follows: Figure 1As shown, it includes a clock source and seven devices cascaded with the clock source. The clock source provides a timing signal for the seven devices cascaded with the clock source. The system connects the clock source to the protection device-1 through a cable, and the cascade cable is connected to the protection device-2 at the terminal of this device, and the seven devices are connected in sequence. At this time, the waveform of the FPGA signal input end of the protection device-1 is likely to be greatly distorted due to the signal reflected from the rear device to the front end. Since the timing method of the electrical IRIG-B code signal has the advantages of one-to-many and low cost, this embodiment uses the electrical IRIG-B code signal as the timing signal to process the distortion of the timing signal received by the front-end device of the cascade device.
[0032] The flowchart of the method for processing the electrical IRIG-B code timing signal of the cascade device in this embodiment is as follows: Figure 2 As shown, the method includes:
[0033] 1) The timing corresponding to the first code element starts from the first rising edge of the electrical IRIG-B code timing signal after being sent to a cascade device. Since the distorted waveform is caused by the superposition of the subsequent reflected signal, the first rising edge is closest to the actual rising edge of the electrical B code, that is, the starting time of the code element. Therefore, the timing corresponding to the first code element starts from the first rising edge of the timing signal.
[0034] Among them, the electrical IRIG-B code timing signal after conversion to a single end is the electrical IRIG-B code timing signal obtained by converting the differential signal sent to a certain cascade device through the RS-485 physical chip to a single end; before performing step 1), the electrical IRIG-B code timing signal after conversion to a single end sent to the cascade device is preprocessed, and the preprocessing includes phase flipping and burr filtering.
[0035] In this embodiment, the glitch filtering process targets occasional glitches with a width of less than 100ns. This process will cause a delay of the same magnitude, that is, a delay of about 100ns. Therefore, the glitch width targeted by the glitch filtering is determined according to the timing accuracy requirements of the timing signal to avoid the delay caused by the glitch filtering alone making the timing accuracy unable to meet the requirements. The role of the phase flipping process is to ensure that the electrical IRIG-B code signal input to the next level processing module is in a positive phase.
[0036] 2) After a set time window, the timing is stopped when the first falling edge is encountered. After the next set time window, if a rising edge is encountered, the timing corresponding to the code element is ended and the timing corresponding to the next code element is started; the timing value when the timing corresponding to the code element is stopped is used for decoding, so as to obtain the decoded data of the code element; it is equivalent to locking the function of stopping the timing triggered by the falling edge within the first set time window (the time window near the rising edge), thereby avoiding the situation where the high-level timing of the current code element is stopped prematurely due to the abnormal falling edge that occurs in advance due to the influence of distortion; locking the function of starting the timing of the new code element triggered by the rising edge within the second set time window (the time window near the falling edge), thereby avoiding the situation where the high-level timing of the next code element is started prematurely due to the abnormal rising edge that occurs in advance due to the influence of distortion.
[0037] To ensure timely acquisition of decoded data and avoid delays caused by untimely decoding, when the timing corresponding to each code element ends, decoding is performed according to the current timing value, which is equivalent to decoding the identified code element while identifying the code element.
[0038] Specifically, decoding is performed according to the timing value corresponding to the code element when the timing is stopped, so as to obtain the decoded data of the code element, including: judging the type of the code element by comparing the timing value corresponding to the code element when the timing is stopped with the high level duration time of different types of code elements of the IRIG-B code.
[0039] According to the three code element waveform diagrams of the IRIG-B code, the code element "P" of the B code is as follows (i.e. Figure 3a ), the waveform diagram of the code element logic "0" of the electrical B code (i.e. Figure 3b ) and the waveform of the code element logic "1" of the electrical B code (i.e. Figure 3c ) It is known that the time length of the IRIG-B code element is 10ms, of which the high level durations are 8ms, 2ms, and 5ms respectively.
[0040] The method for determining the end of the timing signal includes: when the time length corresponding to the total number of code elements included in a frame of the timing signal has passed, the timing signal is determined to be ended. In this embodiment, according to the B code protocol, a frame of the timing signal has a total of 100 code elements. When the timing corresponding to the 100 code elements is completed, the timing signal ends.
[0041] It should be noted that, in order to avoid the setting of the time window being too short to cross the distorted waveform segment, resulting in the inability to achieve the effect of avoiding the abnormal rising edge and falling edge triggering the stop timing and starting the timing of the new code element in advance, the length of each set time window is greater than the time width of the distortion at the rising edge and falling edge of the timing signal; in order to avoid the setting of the time window affecting the normal falling edge triggering the stop timing and the normal rising edge triggering the start timing of the new code element, the length of each set time window is less than the high level duration length of all types of code elements of the electrical IRIG-B code under normal circumstances.
[0042] In order to more fully protect against the problem caused by too long a time window, the length of each set time window is usually much shorter than the high level duration length of all types of code elements of the IRIG-B code under normal circumstances.
[0043] The time length of each time window can be different, as long as the above conditions are met. The time window setting method includes: firstly analyzing the code element waveform and the distorted waveform of the electrical IRIG-B code, and then converting the distorted waveform of the timing signal into a digital signal waveform through the RS-485 physical chip differential to single-ended conversion. The waveform diagram of the distorted waveform of the electrical IRIG-B code and the digital signal in this embodiment is as shown in Figure 4 As shown, there will be microsecond-level jitter on both the rising and falling edges of the signal. The distorted waveform is reflected in the multiple jumps of the digital level inside the FPGA. The time widths of the three code elements of the electrical B code are all in the millisecond order, which is much larger than the microsecond order. Combined with the definition of the three code elements of the electrical B code and the actual setting of the time window length, for the convenience of management and setting, in this embodiment, the length of each time window is consistent; combined with the definition of the three code elements of the electrical B code and the actual setting of the time window length, the length of each time window is set to 5us.
[0044] 3) Repeat step 2) until the timing signal is completed, and obtain the decoded data of each code element accordingly;
[0045] After the decoded data of each code element is obtained accordingly, the time synchronization interrupt is triggered, and the time information corresponding to the decoded data of each code element is sent out, so that the cascade device can complete the time synchronization according to the time information.
[0046] The above steps 1)-3) are implemented by FPGA modules respectively arranged at each cascade device. The above timing of the high level time length of the code element is implemented by a high level counter. In this embodiment, the high level counter is used to time the high level time length of the code element.
[0047] The following is a flowchart of the method for processing the electrical IRIG-B code timing signal of the cascade device in this embodiment (i.e. Figure 2 ) and the distorted waveform of the electrical IRIG-B code and the waveform of the digital signal (i.e. Figure 4) is used to specifically illustrate the timing signal decoding process of the cascade device of the present method. First, power-on initialization is performed and a high-level counter is started. The high-level counter is used to count the time length of the high level of the timing code element and the counter clearing function is locked. The high-level counter starts timing from the first rising edge corresponding to the electrical IRIG-B code timing signal after the conversion to single-ended, that is, time t1. Within the time window (5us) of t1 to t2, the timing is not stopped even if there is a falling edge. After the time window, that is, time t2, the high-level counter stops timing from the first falling edge, that is, time t3. The first falling edge from the high level to the low level is also the actual falling edge closest to the electrical B code. Within the time window of t3 to t4, even if there is a rising edge, the timing is not started. At the same time, the high-level counter value is latched, the counter is locked to start for 5us, and the counter is cleared. After time t4, when a rising edge is encountered, the timing corresponding to the code element is ended and the decoding of the next code element is started. The decoding steps are consistent with the above steps. When the timing corresponding to each code element ends, the high level time lengths of the three code elements of the electrical B code are compared and decoded according to the latched high level counter timing value, so as to obtain the decoded data of the code element corresponding to the latched high level counter timing value.
[0048] According to the decoded data, the message is parsed synchronously. According to the B code protocol, a frame of the message has 100 code elements. At the end of the message, the timing interrupt is triggered and the time information is sent. The device synchronizes the time according to the received time information, and the FPGA starts parsing the next frame of the message. According to the actual effect, the timing delay is about 400ns, which is much smaller than the 5us delay of the traditional method.
Claims
1. A method for processing electrical IRIG-B code timing signals of a cascade device, characterized in that: include: 1) Start the timing corresponding to the first code element from the first rising edge of the electrical IRIG-B code timing signal after being sent to a cascade device; 2) After a set time window, the timing is stopped when the first falling edge is encountered. After the next set time window, if a rising edge is encountered, the timing corresponding to the code element is stopped and the timing corresponding to the next code element is started; the timing value when the timing corresponding to the code element is stopped is used for decoding, thereby obtaining the decoded data of the code element; 3) Repeat step 2) until the timing signal is completed, and obtain the decoded data of each code element accordingly; The length of each set time window is greater than the time width of distortion at the rising edge and the falling edge of the timing signal and is less than the high level duration length of all types of code elements of the electrical IRIG-B code under normal circumstances.
2. The method for processing electrical IRIG-B code timing signals of a cascade device according to claim 1, characterized in that: When the timing corresponding to each symbol ends, decoding is performed according to the current timing value of the timing.
3. The method for processing electrical IRIG-B code timing signals of a cascade device according to claim 1, characterized in that: The method of decoding according to the timing value when the timing corresponding to the code element is stopped to obtain the decoded data of the code element includes: judging the type of the code element according to the comparison between the timing value when the timing corresponding to the code element is stopped and the high level duration time of different types of code elements of the electrical IRIG-B code.
4. The method for processing electrical IRIG-B code timing signals of a cascade device according to claim 1, characterized in that: Also includes: Before performing step 1), the electrical IRIG-B code timing signal sent to the cascade device is preprocessed, and the preprocessing includes phase reversal and glitch filtering.
5. The method for processing electrical IRIG-B code timing signals of a cascade device according to claim 1, characterized in that: The steps 1)-3) are implemented by FPGA modules respectively arranged at each cascade device.
6. The method for processing electrical IRIG-B code timing signals of a cascade device according to claim 1 or 2, characterized in that: Also includes: After the decoded data of each code element is obtained accordingly, a time synchronization interrupt is triggered, and time information corresponding to the decoded data of each code element is sent out, so that the cascade device can complete the time synchronization according to the time information.
7. The method for processing electrical IRIG-B code timing signals of a cascade device according to claim 4, characterized in that: The glitch width targeted by the glitch filtering is determined according to the timing accuracy requirement of the timing signal.
8. The method for processing electrical IRIG-B code timing signals of a cascade device according to claim 1, characterized in that: The method of determining the end of the timing signal includes: when a time length corresponding to the total number of code elements included in a frame of the timing signal has passed, determining that the timing signal has ended.
