CN114006620B - IRIG alternating-current B code decoding method and system with automatic adjustment function - Google Patents

IRIG alternating-current B code decoding method and system with automatic adjustment function Download PDF

Info

Publication number
CN114006620B
CN114006620B CN202111256926.3A CN202111256926A CN114006620B CN 114006620 B CN114006620 B CN 114006620B CN 202111256926 A CN202111256926 A CN 202111256926A CN 114006620 B CN114006620 B CN 114006620B
Authority
CN
China
Prior art keywords
level
signal
code
irig
decoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111256926.3A
Other languages
Chinese (zh)
Other versions
CN114006620A (en
Inventor
刘忠华
许强
张宗艺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIDOU TIANHUI (BEIJING) TECHNOLOGY CO LTD
Original Assignee
BEIDOU TIANHUI (BEIJING) TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIDOU TIANHUI (BEIJING) TECHNOLOGY CO LTD filed Critical BEIDOU TIANHUI (BEIJING) TECHNOLOGY CO LTD
Priority to CN202111256926.3A priority Critical patent/CN114006620B/en
Publication of CN114006620A publication Critical patent/CN114006620A/en
Application granted granted Critical
Publication of CN114006620B publication Critical patent/CN114006620B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M9/00Parallel/series conversion or vice versa

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Dc Digital Transmission (AREA)

Abstract

The invention provides an IRIG alternating current B code decoding method and system with an automatic adjusting function, which have the advantages that a technology of receiving various signal modes and self-adaptive decoding is taken into consideration, the method can be self-adaptive to the format of the national military standard IRIG-B (GJB 2991A-2008) and the time synchronization system IRIG-B code (DLT 1100.1-2009) of a power system, when an IRIG-B code signal is input externally, the type of the current IRIG-B code is automatically identified, targeted decoding processing is carried out, when the code changes in the input process, the system can also automatically identify whether the code changes, and after logical identification, the system can automatically switch to a corresponding decoding strategy.

Description

IRIG alternating-current B code decoding method and system with automatic adjustment function
Technical Field
The invention belongs to the technical field of signal processing, and relates to a signal decoding technology. In particular to a technology for adaptively decoding 2 kinds of alternating current IRIG-B codes for military use and civil use.
Background
The B code is mainly characterized in that the time frame rate is one frame per second, the carried information quantity is large, and pulse signals, BCD coded time information and control function information can be obtained after decoding; the resolution is high, and because each code element of the B code direct current code (DC code) is a pulse signal, the B code direct current code (DC code) can realize time synchronization with higher precision (microsecond magnitude), but because the frequency spectrum of the pulse signal is rich, a narrow-band channel cannot be transmitted, the B code direct current code (DC code) is only suitable for being transmitted to a user at a short distance by a cable, and for the users of remote time system equipment and only associated with the narrow-band channel, a DC code modulation method can be adopted, namely the DC code is modulated into an alternating current code (AC code) to be transmitted, and a standardized interface of the two time codes is arranged in a plurality of time system equipment.
The conventional decoding technology is realized by adopting a high-speed AD chip and an FPGA mode. The cost is high and the operation is complex. The technology adopts low-cost domestic MUC as a decoding unit, and an auxiliary circuit is an operational amplifier and gate circuit. The device is simple and is already in the localization.
The traditional alternating-current B code time frequency receiving product is customized into a certain specific format when receiving IRIG-B code information, and the problems of single receiving mode and poor receiving compatibility exist. In view of the above-mentioned deficiencies in the prior art, the present invention provides a technique for adaptive decoding with multiple signal receiving modes. The method can be adaptive to the national military standard IRIG-B (GJB 2991A-2008) format and the time synchronization system IRIG-B code (DLT 1100.1-2009) of the power system. When an IRIG-B code signal is input from the outside, the invention autonomously identifies the type of the current IRIG-B code and carries out targeted decoding processing. When the code changes in the input process, the system can also automatically identify whether the code changes, and automatically switch to a corresponding decoding strategy after logical identification.
The invention is technically characterized in that: the method comprises the steps of automatically decoding an input alternating current B code by using a domestic MCU (microprogrammed control Unit) to perform gain control, regulation sampling gate valve, height comparator and other technologies on a signal.
The invention is technically characterized in that: the method can be self-adaptive to IRIG-B code signals of 2 encoding formats, and can be used for intelligently identifying and decoding the IRIG-B code (DLT 1100.1-2009) of the national military standard IRIG-B (GJB 2991A-2008) format and the time synchronization system IRIG-B code (DLT 1100.1-2009) of the power system. When the input coding format is changed, the invention can automatically switch the corresponding decoding strategy.
Disclosure of Invention
The invention provides an IRIG alternating current B code decoding method with an automatic adjusting function, which comprises the following steps:
s1: amplifying the input signal;
s2: determining a sampling threshold level;
s3: carrying out A/D conversion on the signals;
s4: determining a decoding type;
s5: decodes and outputs a time signal.
Further, in step S2, the automatically determining the sampling threshold level by using the timer specifically includes:
s21: initializing a timer and defining an interruption time length, a low level quantity threshold value and a high level quantity threshold value;
s22: detecting the level value of the input signal, confirming that the input signal is in normal high/low level, judging the high/low level and respectively carrying out continuous accumulated counting on the level number:
if the input signal is abnormal, the output is not carried out;
if the input signal is normal, identifying and judging high/low levels and respectively carrying out continuous accumulated counting on the level numbers;
s23: the high/low level count value is determined as follows:
if the continuous accumulated count value of the low level exceeds the threshold value of the low level number, reducing the sampling threshold level, and resetting the high-level counter and the low-level counter;
if the continuous accumulated count value of the high level exceeds the threshold value of the high level quantity, the sampling threshold level is increased, and the high level counter and the low level counter are reset;
s24: reading the increased level number in the last interruption time length, wherein the increased level number is a high level or a low level;
s25: the treatment was carried out as follows:
if the level input by the last interrupt duration is low, saving the value of the high-level counter, and resetting the low-level counter;
if the level input by the previous interrupt duration is high, saving the value of the first level counter, and resetting the high level counter;
s26: the input signal level is read for the next interrupt duration.
Further, in step S22, the criterion for determining whether the input signal is normal is:
and reading the duration of the input signal, comparing the duration with a set normal time length threshold, judging as an abnormal signal if the duration exceeds the normal time length threshold, and judging as a normal signal if the duration does not exceed the normal time length threshold.
Further, in step S4, the method for determining the decoding type includes:
and reading the flag bit or the combination of the flag bits representing the coding type in the code table, and comparing the flag bit or the combination of the flag bits with the stored coding type to determine the decoding type.
The invention also provides an IRIG alternating current B code decoding system with an automatic regulation function, which comprises a PPS generation module and an adaptive decoding module, wherein the PPS generation module is used for processing an input signal and generating standard PPS pulses per second according to the input signal, the adaptive decoding module is used for processing the input signal and reading the input signal and automatically judging the type of the input IRIG alternating current B code signal, decoding the input IRIG alternating current B code and outputting a decoding result, and the IRIG alternating current B code decoding system is characterized in that:
the PPS signal processing device further comprises a signal preprocessing module, wherein the signal preprocessing module divides an input signal into two identical paths of output signals which are respectively input into the PPS generating module and the adaptive decoding module, and the two paths of signals are processed simultaneously.
Furthermore, in the PPS generation module, an operational amplifier is used for superposing the direct current level with the input signal, and a comparator is used for comparing the signal superposed with the direct current level with the threshold voltage to generate a 1KHz reference square wave signal.
Furthermore, in the PPS generation module, a gate circuit in the MCU is used for extracting PPS pulses from the 1KHz reference square wave signal.
Further, in the adaptive decoding module, the low-amplitude signal is removed by an adjustable sampling voltage.
Further, in the adaptive decoding module, a pulse width after a rising edge of the identification signal is used as a control signal, and the threshold voltage in the sampling circuit is adjusted according to the control signal.
Further, the control signal is proportional to the threshold voltage.
The invention uses a domestic MCU to automatically decode the input alternating current B code by the technologies of 'gain control', 'adjusting a sampling gate valve' and 'height comparator' and the like.
The method can be self-adaptive to IRIG-B code signals of 2 coding formats, and intelligently identifies and decodes the national military standard IRIG-B (GJB 2991A-2008) format and the time synchronization system IRIG-B code (DLT 1100.1-2009) of the power system. When the input coding format is changed, the corresponding decoding strategy can be automatically switched.
Drawings
FIG. 1 is an input signal processing schematic of the present invention;
FIG. 2 is a schematic diagram of input signal preprocessing according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of an input signal extraction code process according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of input signal leading edge processing according to one embodiment of the present invention;
FIG. 5 is a schematic diagram of MCU hardware connection according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the AC code extraction of the present invention;
FIG. 7 is a flow chart of a timer according to one embodiment of the present invention;
FIG. 8 is a flowchart of decoding servo and adjusting threshold voltage according to one embodiment of the present invention;
FIG. 9 is a flow diagram of output PPS accuracy processing according to one embodiment of the invention.
Detailed Description
The invention provides an IRIG alternating current B code decoding method and system with an automatic adjusting function, which can intelligently identify and decode the international military standard IRIG-B (GJB 2991A-2008) format and the time synchronization system IRIG-B code (DLT 1100.1-2009) of an electric power system in a mode of replacing a high-speed AD chip and an FPGA. When the input coding format is changed, the invention can automatically switch the corresponding decoding strategy. The technical solution of the present invention will now be further described with reference to examples.
In this embodiment, after the device is turned on, an MCU (Microcontroller Unit) micro control Unit performs initialization processing to wait for a stable and effective external input signal;
after an external signal is input, the signal is stabilized by a follower to be 2 paths of output through an isolation amplifying link, and one path of output passes through an automatic gain adjusting circuit to be converted into a digital signal for decoding. And one path of signal is superposed on the direct current level to carry out high-speed comparison and signal smoothing processing, and the leading edge of the signal is extracted.
After the code value of the input code is extracted, judging the type of the input signal code by identifying the key code value; a decoding strategy is determined. Then, a decoding process is performed. Meanwhile, whether the code of the input IRIG-B code is abnormal or not is constantly detected, and when the code is abnormal, the type of the input signal code is judged; and judging whether to perform policy switching or not. Thereby enabling adaptation of the encoding.
The invention supports AC B code input. Self-adaptive 3: 1. 4: 1. 5:1, and the like.
As shown in fig. 1, for an externally input alternating current B code, a feedback algorithm type automatic adjustment is adopted, multiple voltage amplitudes and amplitude ratios are adapted, and a code is extracted. And the high-speed comparator is adjusted in a feedback digital potentiometer mode, so that the accurate leading edge extraction of code values is realized. And (3) decoding the input IRIG-B code signal by using an MCU (Microcontroller Unit) micro-control Unit. And acquiring the coding information of the input IRIG-B code signal by adopting a time difference rising edge number mode. After the codes are extracted, the self-adaptive processing of the coding polarity is carried out, and the problem of coding phase reversal is solved. And extracting all 100-bit codes and storing coding information. And judging whether the type of the input code is obtained currently. When the type of the code is not explicitly input, the output invalid flag is turned on. The encoding of the input signal is identified. And judging that the code switching occurs, and executing the switching action. And then starting the coding effective operation. And performing corresponding decoding operation for the coding type. And obtaining the final time information.
As shown in fig. 2, in the signal preprocessing module, the main functions of the hardware circuit are: BNC1 is the connector, receives external signal, and resistance R5 and electric capacity C4 filter incoming signal, avoid the interference of high frequency signal. The inductor TR1 plays an isolation role. Capacitor C5 filters the noise signal and capacitor C3 blocks the dc component. Resistors R6 and R11 function to attenuate the input signal if necessary. The diodes D1 and D2 are used for avoiding the damage of the rear-stage circuit due to overlarge input signals. The input alternating current signal is connected to a forward input port of the operational amplifier U1 after passing through the resistor R9, the operational amplifier is configured as a voltage follower circuit, and the enhanced input signal is an input signal 'after being arranged at the test point T1'. The circuit section is used for protecting, isolating and enhancing input signals.
Fig. 3 is a schematic diagram illustrating the principle of extracting codes from an input signal in an adaptive decoding module. The main functions of the hardware circuit are as follows: the 'input signal after being sorted' is accessed to an operational amplifier chip U2, the U2 amplifies the input signal by 1000 times conditionally, and the input sine wave is compared with the threshold voltage output by a chip U4. When the input sine wave signal is greater than the threshold voltage, the output signal is amplified 1000 times, and when the input signal is lower than the threshold voltage, the output signal is 0. The chip U4 is a digital potentiometer and is controlled by the MCU chip. The resistance value can be automatically adjusted according to the decoding effect of the MCU, and the adjustment of the threshold voltage is realized. The signal level output by U2 filters out the negative half-axis of the input signal through a diode D3 and a resistor R12. Amplitude adjustment is then performed by chip U3. And connecting to an acquisition pin of the MCU.
As shown in fig. 4, in the PPS generation module, the main functions of the hardware circuits shown in the figure are: after the direct current component of the 'input signal after finishing' is isolated by a capacitor C23, the input signal is loaded to a 1.67V point of the voltage division of a resistor R13 and a resistor R17, the signal is connected with the forward input of a U6 comparator, 1 MCU controls a digital potentiometer of a U10, the output of the potentiometer is connected with the reverse input of the U6 comparator, and the MCU controls a stronger threshold voltage to realize the adjustment of the front edge precision. The circuit extracts the input 1K carrier wave, and the waveform at the test point T7 is a 1K Hz square wave. However, the waveform at this time may jitter at the leading edge stage because the sine wave zero crossing potential is very gentle, and the comparator may have a plurality of trigger edges due to electrical noise. In order to solve the problem, a U7 non-retriggered monostable trigger is added in the later stage, the pulse width of triggering is controlled, and jitter is eliminated. The shaped 1Khz square wave is subjected to voltage reduction to 3.3V through a buffer chip of U8, and an output signal is connected to an AND gate chip of U11. The other input signal of the chip is from the control IO of the MCU. The MCU opens the door at an accurate moment according to the information of the decoded signal, extracts an accurate pulse per second leading edge of 1Hz from the 1KHz input signal, and then the signal passes through the OR gate of the U12, and the other input signal of the device comes from the control IO of the MCU. And the MCU opens the door at an accurate moment according to the information of the decoded signal, so that the pulse width control of the pulse per second signal is realized. The extracted signal is connected with the connector J1 for external output.
Fig. 5 shows a pin connection mode of the decoding MCU, and the hardware circuit mainly functions as follows: and connecting the MCU part. The invention has low requirements on MCU resources. Most of the chips made in China can meet the requirements. 1 pair of serial ports, 1 input type IO and 8 output type IOs are required. In the figure, the 16-pin and the 17-pin are a pair of serial ports and are responsible for information interaction and output of the extracted time information. 45. The pin is an input type IO and is responsible for judging input decoding information. Pins 42, 43 and 44 are output type IO and control the decoding threshold digital potentiometer. Pins 41, 39 and 40 are output type IO and control to extract the leading edge digital potentiometer. Pins 33 and 34 are output type IO and control the timing sequence of an AND gate.
In the MCU, a computer program written according to the alternating current B code decoding mode recorded in the invention is burnt, and the MCU determines the threshold height of the sampling voltage according to the pulse width of the signal, so that the dynamic range of the input signal is dynamically identified, and the automatic decoding of the alternating current B code is realized.
As shown in fig. 6, the waveform of the ac B code has a signal frequency of 1Khz, 8 consecutive high levels are codes P, 5 consecutive high levels are codes 1, and 2 consecutive high levels are codes 0, and a decoding digital potentiometer is used in the circuit to form a comparison threshold level. And initializing the MUC main program, and extracting the setting parameters stored in the internal FLASH. And calling FLASH parameters to configure and decode the amplitude of the digital potentiometer. The program internally starts to make a decision on the 'decoded IO' of the output signal. If the pulse width is a rising edge, the pulse width is judged, and the acquisition threshold level is automatically adjusted according to the pulse span. If the threshold is too high, the pulse cannot be compared or the pulse width is lower than 0.1ms; too low a threshold will result in a large number of consecutive pulses or high levels. The program automatically adjusts the sampling threshold by decoding the code value. Therefore, the problem that the conventional alternating current B code technology is single in sampling level and cannot be adaptive to various proportions of the amplitude of the alternating current B code sine wave is solved. Because the sampling threshold of the invention is adaptively adjusted, no matter 3: 1. 4: 1. 5:1, etc. in various proportions.
As shown in FIG. 7, the MCU internally starts a 20us interrupt timer. The timer clock cycles off at high speed. The input B-code decoded signal is judged. After the defibrillation processing, if the input B code level is found to be low, the low level counter is added to judge whether the signal is low continuously, if the signal is low for a long time, 1 is no signal input, and the threshold value of 2 is too low and is lower than the waveform of the whole input signal. And activating a mark, adjusting the 'acquisition threshold level' by the main program, and activating a processing program for judging whether the input signal is interrupted. If not, judging whether the signal is a normal signal, if not, normally counting the time length for processing, if so, storing the duration time length of the high level, clearing various flag bits and returning to the circulation. If the detected B code level is confirmed to be high after the defibrillation, the high level counter is added by itself, whether the signal is continuously high or not is judged, and if the signal is low for a long time, the threshold value is over-high and is higher than the waveform of the whole input signal. And activating a mark, adjusting the 'acquisition threshold level' by the main program, and activating a processing program for judging whether the input signal is interrupted. If not, judging whether the signal is a normal signal, if not, normally counting the time length for processing, if so, storing the duration time length of the low level, clearing various flag bits, and returning to the circulation.
The function of the program in this section is: and B code level is acquired at high speed, and logic and positive and negative pulse widths of input signals are captured.
FIG. 8 illustrates the processing of the main program to decode servo and adjust thresholds. After the MCU is initialized, the main program circularly judges the processing flag bit of the timer for the interface signal. When a 'rising edge mark' is obtained, the time between the falling edge and the rising edge is judged for judging the distance of a wavelet. This spacing determines the type of code received. If the time is less than 1ms, the input signal is proved to be a conventional input signal, then the continuity of the signal is judged, if more than 12 small square waves are received, the level of the 'acquisition threshold level' is low, a large number of sine wave signals are extracted, a mark bit is opened, a threshold adjusting circuit is activated, and the decoded threshold voltage is increased. Otherwise, returning to decoding judgment and continuously extracting the code value. If the distance between the decoded falling edges is more than 9ms, the code value is in error, a long-time falling edge appears, the decoding is invalid, and a clear valid flag bit indicates that the error occurs. If the decoded falling edge interval is between 1 and 9ms, a reasonable pulse interval is obtained, and the number of the pulses extracted before can be judged. If the number of the effective pulses obtained before is 2 or 5, the decoding values of '0' or '1' are filled in respectively, and then the effective pulses are transmitted to a decoding program to carry out code value extraction. If the number of the effective pulses obtained before is 8, the decoding value P is filled, the judgment is relatively complex, the continuous number of P needs to be interpreted, if the first P is received, the mark is recorded, the decoding is directly carried out, if 2 continuous P are received, the mark indicates that the head mark of the signal is received, and if more than 2P are received, the input signal is wrong. An error handling function is invoked. The decoding program extracts the encoded content bit by bit in the order of encoding. And calling a corresponding decoding program aiming at the data value of the special zone bit. After decoding a frame of data, return to the main loop.
The main program simultaneously monitors the falling edge marks and detects the width from each rising edge to the falling edge. If this value is less than 0.1ms, it indicates that the sampled threshold voltage is too high, resulting in too narrow a pulse width being acquired. In this case, the risk of frame loss is likely to occur, the flag bit is activated, and the sampling threshold level is appropriately adjusted. If the width between the rising edge and the falling edge is greater than 0.3ms, it indicates that the threshold voltage of the sampling is too low, resulting in too wide a width of the acquired pulse. In this case, the risk of code scrambling is easily generated, the flag bit is activated, and the sampled threshold level is appropriately fine-tuned upward.
The function of the program in this section is: and judging the coding content contained in the previous section of small square wave according to the distance between each section of small square wave, and extracting the code. Meanwhile, the threshold level is adjusted according to the coding content. And finely adjusting the threshold level according to the width of each small square wave.
Fig. 9 is a flowchart to be executed to improve the decoding output accuracy. And after the program is initialized, calling the precision threshold stored in the MCU for output. And the program starts to wait for the serial port message with the output precision adjusted. And inputting an adjusting value every time, and adjusting the precision threshold voltage by one grade. The accuracy threshold voltage is 100 levels in total. And after the adjustment is finished, storing the modified adjustment value into the FLASH.
The function of the program in the section is as follows: and the signal precision is adjusted before delivery by matching with hardware.
According to the coding mode of the IRIG-B code, after the system receives 2 continuous P states, the position pointer of the code value extraction function returns to zero, and the code value is formally extracted. And (4) circulating the code value extracting function for 100 times, and completely extracting the IRIG-B code information with the period of one second. And storing the extracted information into a corresponding array. The decoding function then sorts the contents of the array. Code values and their definitions are tabulated.
Figure BDA0003324396200000071
Figure BDA0003324396200000081
Figure BDA0003324396200000091
The program combines general second, minute, hour, day information. And special treatment is performed on the international military standard IRIG-B (GJB 2991A-2008) format and the time synchronization system IRIG-B code (DLT 1100.1-2009) of the power system.
The special treatment is characterized by comprising the following steps:
step 1: extracting the ten-digit mark of 43 digits. When the national military standard codes, the bit will alternately appear as "0" and "1", and when the power standard is met, the bit will be constant as 0. This results in that determining that 43 bits are constant at 0 is a sufficient condition to determine whether the current input signal is a power standard.
Step 2: extracting 45-48 bits of year information. When the "tens of years flag" =1, it indicates tens of years, and conversely, it indicates units of years. When the national military standard is coded, the position alternately shows the year information. Theoretically, the analysis of this data may be all 0's or not zero. But when power is standard this bit will be constant at 0. This is sufficient to determine whether or not the current input signal is a power standard if the 45 to 48 bits are constantly 0.
And step 3: data from 50-53 and 55-58 are extracted and combined with the adult information. When coded in the military standard, this bit will be constantly 0. But this bit will not be acknowledged when the power standard is present. It is sufficient condition to determine whether the current input signal is the national military standard code if the data bits of the determinations 50 to 53 and 55 to 58 are constant at 0.
And 4, step 4: and judging the known condition according to the coding type judgment code.
And 5: when the normal code enters, the program enters a judging and counting stage. And immediately clearing the statistics of the effective quantity of the other decoding mode after entering, accumulating the effective quantity of the input codes, and changing the decoding mode of the current code when 5 codes are accumulated.
And 6: and processing the code switching by the program. When the input signal is switched, the counting result of the 43bit read by the program will be changed. When 5 pieces are accumulated, the decoding mode of the current code is changed. The procedure is restored to the normal decoding state of step 5.
And 7: and processing the coding error by the program. When the input signal is switched, various conditions of the program cannot be met, and the last else paragraph is entered. The flag indicating that the decoding type is valid is cleared to avoid erroneous codes.
And step 8: and (5) verification after the decoding judgment is finished. The above 7 steps enable the identification of the type of encoding. A series of verifications of the encoded content follows. The method has the advantages that the validity of the signal is further judged, the switching condition of the input signal is processed effectively, and the error information in the switching process is prevented from being printed with effective marks and output to the outside to generate errors. And secondly, identifying the legality of the input signal and eliminating error codes.
And step 9: if the program considers that it is currently in the state of decoding the power standard B code, 45-48 bits, non-0 data is present, and 50-60 bits are 0. It indicates that there is a high probability that the currently input encoding format has changed. And marking a corresponding error mark to indicate that the receiving state is abnormal. And when the time information is output externally, the mark that the signal is invalid is added. On the contrary, when the program considers that the program is currently in the state of decoding the national military standard B code, 0 data appears when the 45-48 bits, and non-0 data appears when the 50-60 bits. Indicating that the input signal has switched to the power standard. And marking a corresponding error mark to indicate that the receiving state is abnormal. And when the time information is output externally, the mark that the signal is invalid is added.
Step 10: and after the judgment of the type of the coding identification and the verification of the coding effectiveness are carried out, aiming at the type of the coding. The encoding is normally decoded.
In addition, before actually outputting the time information, the embodiment also arranges the signals to be output:
step 1: and judging whether the mode is a national military standard mode, if so, restoring the source time transmitted according to the UTC0 format into the time information of the structural body.
Step 2: the B-code signal is a set of data per second, and when the quasi-second time of the frame is detected, the quasi-second time of the second has elapsed, so to speak, the current detection is always the last second that has elapsed. Therefore, to output the 1PPS signal, the output can be performed only at the next second on-time edge time +1 second; since the one second output is added, a time carry function is involved. The program firstly constructs a Void CalcSecond () function to convert the received time information into 64-bit second information (Gregorian second) starting from the Gregorian meta year, then performs +1 operation (B _ BCodeTimeModule. NTPsacond + +) on the Gregorian second, and then constructs a Void dealIntegERTime () function to convert the Gregorian second into the information of year, month, day, hour, minute and second.
And step 3: because the national military standard IRIG-B (GJB 2991A-2008) format and the time source selection of the time synchronization system IRIG-B code (DLT 1100.1-2009) of the power system are different. The time code adopted by the GJB 2991A-2008 is UTC time. And the time synchronization system IRIG-B code (DLT 1100.1-2009) of the power system adopts Beijing time. With a fixed time difference of 8 hours. Therefore, after the encoding extraction is completed, the input time information is also required to be sorted. If the current format is judged to be the national military standard IRIG-B (GJB 2991A-2008) format, the time information of the structural body is converted into unsigned 64-bit data, and then 8 hours are added to the data to convert the data into Beijing time. If the current time synchronization system IRIG-B code (DLT 1100.1-2009) is the power system, then no processing is required because it is the Beijing time itself.
The method and the system for decoding the IRIG alternating B code with the automatic adjustment function provided by the present invention are described in detail above, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be changes in the specific implementation and application scope, and the content of the present specification should not be construed as a limitation to the technical solution of the present invention.

Claims (9)

1. An IRIG alternating current B code decoding method with an automatic regulation function comprises the following steps:
s1: amplifying the input signal;
s2: automatically determining a sampling threshold level using a timer:
s21: initializing a timer and defining an interruption time length, a low level quantity threshold value and a high level quantity threshold value;
s22: detecting the level value of the input signal, confirming that the input signal is in normal high/low level, judging the high/low level and respectively carrying out continuous accumulated counting on the level number:
if the input signal is abnormal, the output is not carried out;
if the input signal is normal, identifying and judging high/low levels and respectively carrying out continuous accumulated counting on the level numbers;
s23: the high/low level count value is determined as follows:
if the continuous accumulated count value of the low level exceeds the threshold value of the low level number, reducing the sampling threshold level, and resetting the high-level counter and the low-level counter;
if the continuous accumulated count value of the high level exceeds the threshold value of the high level quantity, the sampling threshold level is increased, and the high level counter and the low level counter are reset;
s24: reading the increased level number in the last interruption time length, wherein the increased level number is a high level or a low level;
s25: the treatment was carried out as follows:
if the level input by the last interrupt duration is low, saving the value of the high-level counter, and resetting the low-level counter;
if the level input by the previous interrupt duration is high, saving the value of the first level counter, and resetting the high level counter;
s26: reading the input signal level within the next interrupt duration;
s3: carrying out A/D conversion on the signals;
s4: determining a decoding type;
s5: decodes and outputs the time signal.
2. The method for decoding IRIG ac B code with auto-tuning function according to claim 1, wherein the criterion for determining whether the input signal is normal in step S22 is:
and reading the duration of the input signal, comparing the duration with a set normal time length threshold, judging as an abnormal signal if the duration exceeds the normal time length threshold, and judging as a normal signal if the duration does not exceed the normal time length threshold.
3. The method for decoding IRIG ac B code with auto-tuning function according to claim 1, wherein in step S4, the method for determining the decoding type is:
and reading the flag bit or the combination of the flag bits representing the coding type in the code table, and comparing the flag bit or the combination of the flag bits with the stored coding type to determine the decoding type.
4. The utility model provides an IRIG exchanges B sign indicating number decoding system that possesses automatic regulating function, includes PPS and produces module and self-adaptation decoding module, PPS produces the module and processes input signal, is used for producing standard per second PPS pulse according to input signal, self-adaptation decoding module handles input signal, is used for reading input signal and automatic judgement IRIG exchanges B sign indicating number signal type of input, exchanges B sign indicating number and decodes and output decoding result to input IRIG, its characterized in that:
the PPS signal processing device further comprises a signal preprocessing module, wherein the signal preprocessing module divides an input signal into two identical paths of output signals which are respectively input into the PPS generating module and the adaptive decoding module, and the two paths of signals are processed simultaneously.
5. The IRIG AC B code decoding system with automatic regulation function of claim 4, wherein in the PPS generation module, an operational amplifier is used to superpose the DC level with the input signal, and a comparator is used to compare the signal superposed with the DC level with the threshold voltage to generate a 1KHz reference square wave signal.
6. The IRIG AC B code decoding system with automatic regulation function of claim 5, wherein in the PPS generation module, a gate circuit in MCU is used to extract PPS pulse from 1KHz reference square wave signal.
7. The IRIG AC B-code decoding system with automatic adjusting function according to claim 4, wherein the adaptive decoding module removes low-amplitude signals by adjustable sampling voltage.
8. The IRIG ac B-code decoding system with automatic adjustment function according to claim 7, wherein in the adaptive decoding module, a pulse width after a rising edge of a signal is identified as a control signal, and a threshold voltage in the sampling circuit is adjusted according to the control signal.
9. The IRIG ac B-code decoding system with auto-tuning function of claim 8, wherein the control signal is proportional to the threshold voltage.
CN202111256926.3A 2021-10-27 2021-10-27 IRIG alternating-current B code decoding method and system with automatic adjustment function Active CN114006620B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111256926.3A CN114006620B (en) 2021-10-27 2021-10-27 IRIG alternating-current B code decoding method and system with automatic adjustment function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111256926.3A CN114006620B (en) 2021-10-27 2021-10-27 IRIG alternating-current B code decoding method and system with automatic adjustment function

Publications (2)

Publication Number Publication Date
CN114006620A CN114006620A (en) 2022-02-01
CN114006620B true CN114006620B (en) 2023-01-17

Family

ID=79924423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111256926.3A Active CN114006620B (en) 2021-10-27 2021-10-27 IRIG alternating-current B code decoding method and system with automatic adjustment function

Country Status (1)

Country Link
CN (1) CN114006620B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118646507A (en) * 2024-08-13 2024-09-13 中核核电运行管理有限公司 Clock protocol conversion method and system

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101738931A (en) * 2009-12-24 2010-06-16 华北电力大学 IRIG-B (Inter-Range Instrumentation Group-B) code time hack device and time hack method thereof
CN102420609A (en) * 2011-11-22 2012-04-18 北京遥测技术研究所 Novel IRIG (Inter Range Instrumentation Group)-B alternating current code intelligent decoding method
CN102621954A (en) * 2012-03-22 2012-08-01 上海许继电气有限公司 Self-adaptive multi-signal-source time synchronization card device for smart grid and message analysis system
CN102624391A (en) * 2012-04-08 2012-08-01 安徽继远电网技术有限责任公司 High-precision IRIG-B code timing and decoding board
CN102880045A (en) * 2012-09-17 2013-01-16 南京澳德思电气有限公司 Synchronous clock time output system based on global positioning system (GPS), compass satellite, optical fiber B code and high-accuracy constant-temperature crystal oscillator
CN104639174A (en) * 2013-11-06 2015-05-20 施耐德电器工业公司 Unified low-temperature-drift conditioning circuit for IRIG-B code source signals
CN105300408A (en) * 2015-10-15 2016-02-03 中国人民解放军63636部队 Photoelectric theodolitee time synchronization accuracy detection system and detection method
CN205490492U (en) * 2016-01-15 2016-08-17 广东水利电力职业技术学院 Polarity adaptive IRIG -B sign indicating number decoding device
CN107577140A (en) * 2017-09-14 2018-01-12 国电南瑞科技股份有限公司 A kind of synchronised clock management module based on FPGA
CN109004937A (en) * 2018-07-13 2018-12-14 北京七维航测科技股份有限公司 A kind of high-precision B code generation method and module
CN109617553A (en) * 2018-12-28 2019-04-12 武汉依迅电子信息技术有限公司 Exchange IRIG-B coding/decoding method and device
CN110224702A (en) * 2019-05-24 2019-09-10 北斗天汇(北京)科技有限公司 Timing code IRIG-B adaptive decoding device and coding/decoding method
CN112751569A (en) * 2020-12-25 2021-05-04 北京航星机器制造有限公司 Alternating current B code decoding circuit and decoding method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102142720B (en) * 2011-04-29 2013-03-06 珠海市鸿瑞软件技术有限公司 Network communication recorder and network communication record analysis system
CN103199865B (en) * 2012-01-10 2016-06-15 武汉凯默电气有限公司 A kind of light adaptive serial port decoding circuit
CN104102124B (en) * 2014-06-30 2017-04-19 中国西电电气股份有限公司 FPGA-based IRIG-B code decoder and decoding method thereof
US9813173B2 (en) * 2014-10-06 2017-11-07 Schweitzer Engineering Laboratories, Inc. Time signal verification and distribution
CN105743585B (en) * 2016-01-25 2018-03-20 山东网聪信息科技有限公司 A kind of smooth IRIG B and FT3 codes intelligent detecting method of reseptance and device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101738931A (en) * 2009-12-24 2010-06-16 华北电力大学 IRIG-B (Inter-Range Instrumentation Group-B) code time hack device and time hack method thereof
CN102420609A (en) * 2011-11-22 2012-04-18 北京遥测技术研究所 Novel IRIG (Inter Range Instrumentation Group)-B alternating current code intelligent decoding method
CN102621954A (en) * 2012-03-22 2012-08-01 上海许继电气有限公司 Self-adaptive multi-signal-source time synchronization card device for smart grid and message analysis system
CN102624391A (en) * 2012-04-08 2012-08-01 安徽继远电网技术有限责任公司 High-precision IRIG-B code timing and decoding board
CN102880045A (en) * 2012-09-17 2013-01-16 南京澳德思电气有限公司 Synchronous clock time output system based on global positioning system (GPS), compass satellite, optical fiber B code and high-accuracy constant-temperature crystal oscillator
CN104639174A (en) * 2013-11-06 2015-05-20 施耐德电器工业公司 Unified low-temperature-drift conditioning circuit for IRIG-B code source signals
CN105300408A (en) * 2015-10-15 2016-02-03 中国人民解放军63636部队 Photoelectric theodolitee time synchronization accuracy detection system and detection method
CN205490492U (en) * 2016-01-15 2016-08-17 广东水利电力职业技术学院 Polarity adaptive IRIG -B sign indicating number decoding device
CN107577140A (en) * 2017-09-14 2018-01-12 国电南瑞科技股份有限公司 A kind of synchronised clock management module based on FPGA
CN109004937A (en) * 2018-07-13 2018-12-14 北京七维航测科技股份有限公司 A kind of high-precision B code generation method and module
CN109617553A (en) * 2018-12-28 2019-04-12 武汉依迅电子信息技术有限公司 Exchange IRIG-B coding/decoding method and device
CN110224702A (en) * 2019-05-24 2019-09-10 北斗天汇(北京)科技有限公司 Timing code IRIG-B adaptive decoding device and coding/decoding method
CN112751569A (en) * 2020-12-25 2021-05-04 北京航星机器制造有限公司 Alternating current B code decoding circuit and decoding method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
IRIG-B(AC)时间码分配器设计;王赞超等;《电子设计工程》;20200405(第07期);355-360 *
Practical Polar Code Construction For Degraded Multiple-Relay Networks;Bin Duo等;《中国通信》;20170415(第04期);281-287 *

Also Published As

Publication number Publication date
CN114006620A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
CN104301006B (en) A kind of multichannel slow frequency hopping signal anti-interference process system
CN114006620B (en) IRIG alternating-current B code decoding method and system with automatic adjustment function
US6937683B1 (en) Compact digital timing recovery circuits, devices, systems and processes
US9628264B2 (en) Host communication circuit, client communication circuit, communication system and communication method
CN108023846B (en) Method, circuit, device and computer program product for detecting FSK modulation signal
CN101493674A (en) B code demodulating and decoding method and apparatus thereof
CN104935311B (en) A kind of data signal isolator and corresponding pulsewidth decoding method
DE3854805D1 (en) Device for demodulating a biphase signal
CN101321015B (en) Full-digital pulse position modulation signal receiver and receiving method
CA1154165A (en) Manchester decoder
US4276650A (en) Method of synchronizing a quadphase receiver and clock synchronization device for carrying out the method
CN108512552A (en) A kind of the decoding system and coding/decoding method of Manchester code
CN103595421A (en) A decoder for TYPE A basic data rate signals transmitted by a decoding card
CN110224702B (en) Time code IRIG-B self-adaptive decoding device and decoding method
CN107171737A (en) Optical chip and authentication device for optic communication
CN113375503B (en) Method and system for laser induced active interference resistance
EP0082575B1 (en) An energy-synchronised demodulator circuit
US6272184B1 (en) Non-coherent frequency shift keying detection scheme
CN101847200A (en) Groove identification device of RFID (Radio Frequency Identification Device) label chip
CN102932103A (en) Data transmission rate self-adaptive receiving method based on digital substation
CN103595422B (en) Decode the decoder for the type A high data rate signals that card is sent
CN211406003U (en) Decoding system of Manchester code
CN104242950A (en) Synchronous decoder for low-speed BPSK signal
CN211018863U (en) Decoding system of BMC (baseboard management controller) code
CN102006083B (en) Method for decoding phase code

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant