A method and device for generating IRIG-B (AC) code based on soft time-frequency

Through a soft time-frequency based method, the MCU's DMA, timer and DAC are used to generate IRIG-B(AC) codes, which solves the problems of high hardware cost and inflexible debugging, and realizes low-cost and efficient IRIG-B(AC) ) code is generated.

CN115499096BActive Publication Date: 2024-08-30CHENGDU JINNUOXIN HIGH-TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211060410.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2024-08-30
Estimated Expiration
2042-08-30

AI Technical Summary

Technical Problem

The existing technology has the problems of high hardware cost and inflexible debugging when generating IRIG-B (AC) codes. Traditional methods require stable IRIG-B (DC) signals or rely on FPGA+ROM+analog-to-digital conversion circuits.

Method used

Using a method based on soft time and frequency, the DMA, timer and DAC of the MCU are used to generate the data group to be transported. By decomposing the IRIG-B (AC) symbol and the sinusoidal signal, the corresponding amplitude level signal is calculated and output to reduce hardware requirements. .

Benefits of technology

It reduces hardware costs, reduces hardware requirements, improves development efficiency and packaging, and facilitates secondary development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115499096B
    Figure CN115499096B
Patent Text Reader

Abstract

The present invention discloses a method and device for generating IRIG‑B (AC) codes based on soft time and frequency, and belongs to the technical field of time unification. A method for generating IRIG‑B (AC) codes based on soft time and frequency, comprising: configuring peripherals of an MCU, wherein the peripherals of the MCU include DMA, a timer, and a DAC; the MCU generates a data group to be transported according to the IRIG‑B (AC) code; the DMA responds to the overflow interrupt of the timer to sequentially transport each data in the data group to be transported to the data domain of the DAC; and the DCA outputs a level signal of a corresponding amplitude according to the data in its data domain. The method of the present invention has lower hardware cost and saves development investment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of time unification, and in particular relates to a method and device for generating an IRIG-B (AC) code based on soft time and frequency. Background Art

[0002] There are two main traditional ways to generate IRIG-B (AC): (1) IRIG-B (DC) is converted into IRIG-B (AC) through a conversion device, such as Figure 1 (2) Use FPGA+ROM+analog-to-digital conversion circuit and other peripheral circuits to realize the generation of IRIG-B (AC), as shown in Figure 2 As shown. The above two IRIG-B (AC) generation methods are the main methods used in the time and frequency field. Although these two technologies are relatively mature, they also have certain defects. In method (1), since the conversion device itself cannot generate IRIG-B (AC) independently, a stable IRIG-B (DC) signal is required. Method (2) uses FPGA+ROM+analog-to-digital conversion circuit. Although it can generate IRIG-B (AC) independently, it is not the best choice in terms of hardware cost, and the debugging method is not as flexible as MCU. Summary of the invention

[0003] The object of the present invention is to overcome the deficiencies of the prior art and to provide a method and device for generating IRIG-B (AC) codes based on soft time-frequency.

[0004] The objective of the present invention is achieved through the following technical solutions:

[0005] According to a first aspect of the present invention, a method for generating an IRIG-B (AC) code based on soft time-frequency comprises:

[0006] Configuring the peripherals of the MCU, wherein the peripherals of the MCU include DMA, timer and DAC;

[0007] The MCU generates the data group to be transported according to the IRIG-B (AC) code;

[0008] The DMA responds to the overflow interrupt of the timer and sequentially transfers each data in the data group to be transferred to the data domain of the DAC;

[0009] DCA outputs a level signal of corresponding amplitude according to the data in its data domain.

[0010] Furthermore, the MCU generates a data group to be transferred according to the IRIG-B (AC) code, including:

[0011] After completing the configuration of its peripherals, the MCU generates two data groups to be transferred according to the IRIG-B (AC) code.

[0012] Furthermore, the method for generating the data group to be transferred includes:

[0013] Decompose the IRIG-B (AC) code into multiple code elements;

[0014] Decompose each code element into multiple sinusoidal signals;

[0015] Generate a plurality of corresponding data for each sinusoidal signal;

[0016] Group all data into a data group to be transferred.

[0017] Furthermore, the MCU generates a data group to be transferred according to the IRIG-B (AC) code, including:

[0018] After the MCU completes the configuration of its peripherals, it generates two data groups to be transferred according to the IRIG-B (AC) code;

[0019] After receiving a transfer completion interrupt from the DMA, the MCU determines whether the generation of all the data groups to be transferred has been completed. If the generation of all the data groups to be transferred has not been completed, the MCU generates a data group to be transferred in response to the transfer completion interrupt.

[0020] Furthermore, the method for generating the data group to be transferred includes:

[0021] Decompose the IRIG-B (AC) code into multiple code elements;

[0022] Decompose each code element into multiple sinusoidal signals;

[0023] Generate a plurality of corresponding data for each sinusoidal signal;

[0024] Group part of the data into a data group to be moved.

[0025] Furthermore, the DMA generates a transfer completion interrupt after completing the transfer of a data group to be transferred.

[0026] Furthermore, a plurality of corresponding data are generated for each sinusoidal signal, including:

[0027] The data corresponding to the sinusoidal signal is calculated according to the following formula:

[0028]

[0029] Where A is the amplitude; ω is the angular frequency; is the initial phase; the value range of t is 0ms~1ms.

[0030] According to a second aspect of the present invention, a soft time-frequency based IRIG-B (AC) code generation device comprises:

[0031] MCU, used to generate a data group to be transported according to the IRIG-B (AC) code;

[0032] Timer;

[0033] DMA, used for responding to the overflow interrupt of the timer to sequentially transfer each data in the data group to be transferred to the data domain of the DAC;

[0034] DAC is used to output a level signal of corresponding amplitude according to the data in its data domain.

[0035] Furthermore, the MCU is used to generate two data groups to be transferred according to the IRIG-B (AC) code after the peripheral configuration is completed, and the peripherals of the MCU include DMA, timer and DAC.

[0036] Furthermore, the DMA is also used to generate a transfer completion interrupt after completing the transfer of a data group to be transferred;

[0037] The MCU is used to generate two data groups to be transferred according to the IRIG-B (AC) code after the configuration of its peripherals is completed, and to determine whether the generation of all data groups to be transferred has been completed after receiving a transfer completion interrupt from the DMA. If the generation of all data groups to be transferred has not been completed, the MCU generates a data group to be transferred in response to the transfer completion interrupt. The peripherals of the MCU include DMA, timer and DAC.

[0038] The beneficial effects of the present invention are:

[0039] (1) The hardware of the traditional solution requires FPGA+ARM+DA conversion circuit+external amplifier circuit, while the method of the present invention saves FPGA and external DA conversion circuit. The method of the present invention has low hardware requirements, reduces hardware costs, and saves development investment;

[0040] (2) The method of the present invention is based on MCU software development, has good encapsulation, and is convenient for secondary development. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 Schematic diagram of converting IRIG-B (DC) to IRIG-B (AC) through a conversion device;

[0042] Figure 2 It is a schematic diagram of using FPGA+ROM+analog-to-digital conversion circuit and other peripheral circuits to realize the generation of IRIG-B (AC);

[0043] Figure 3 A flowchart of an embodiment of a method for generating an IRIG-B (AC) code based on soft time-frequency in the present invention;

[0044] Figure 4 Schematic diagram of code element 0 of IRIG-B (AC) code;

[0045] Figure 5 Schematic diagram of symbol 1 of the IRIG-B (AC) code;

[0046] Figure 6 Schematic diagram of code element P of IRIG-B (AC) code;

[0047] Figure 7 is a schematic diagram of a periodic sinusoidal signal;

[0048] Figure 8 This is the data analysis diagram of symbol 0 of the IRIG-B (AC) code;

[0049] Fig. 9 A schematic diagram of the composition data of code element 0 of the IRIG-B (AC) code;

[0050] Fig.10 A schematic diagram of data handling;

[0051] Fig.11 A waveform diagram of the IRIG-B (AC) code. DETAILED DESCRIPTION

[0052] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0053] See also Figure 3-Figure 11 This embodiment provides a method and device for generating an IRIG-B (AC) code based on soft time-frequency:

[0054] An embodiment of a method for generating an IRIG-B (AC) code based on soft time-frequency provided by the present invention comprises: Figure 3 As shown, a method for generating an IRIG-B (AC) code based on soft time-frequency includes:

[0055] S100. Configure the peripherals of the MCU, where the peripherals of the MCU include DMA, timer and DAC.

[0056] That is, initialize DMA, timer and DAC. For example, set the interrupt and working clock of the timer, set the working clock of the DAC, set the working clock, interrupt, data length and handling trigger mode of the DMA, etc. DMA stands for Direct Memory Access, which means direct memory access; DAC stands for analog-to-digital converter.

[0057] S200.MCU generates the data group to be transported according to the IRIG-B (AC) code.

[0058] In one embodiment, the MCU generates a data group to be carried according to the IRIG-B (AC) code, including: the MCU generates two data groups to be carried according to the IRIG-B (AC) code after the peripheral configuration is completed. In this embodiment, all data corresponding to an IRIG-B (AC) code are composed of a data group to be carried, and only one data group to be carried needs to be generated in the process of generating an IRIG-B (AC) code. In one embodiment, one of the two data groups to be carried generated after initialization is used as the current data group to be carried, and the other data group to be carried is used as a spare data group to be carried. When the carrying operation is performed, the data in the current data group to be carried is carried to the data domain of the DAC; after the current data group to be carried is carried, a carrying completion interrupt is generated, at which time the previous spare data group to be carried is switched to the current data group to be carried, and then a data group to be carried is generated as a spare data group to be carried.

[0059] In this embodiment, the method for generating the data group to be transported includes: decomposing the IRIG-B (AC) code into multiple code elements; decomposing each code element into multiple sinusoidal signals; generating multiple corresponding data for each sinusoidal signal; and combining all the data into a data group to be transported.

[0060] In one embodiment, the MCU generates a data group to be transferred according to the IRIG-B (AC) code, including: the MCU generates two data groups to be transferred according to the IRIG-B (AC) code after the peripheral configuration is completed; the MCU determines whether the generation of all data groups to be transferred has been completed after receiving a transfer completion interrupt from the DMA, if the generation of all data groups to be transferred has not been completed, the MCU generates a data group to be transferred in response to the transfer completion interrupt; wherein the DMA generates a transfer completion interrupt after completing the transfer of a data group to be transferred.

[0061] In this embodiment, part of the data corresponding to an IRIG-B (AC) code is formed into a data group to be transported, for example, data corresponding to a sinusoidal signal corresponding to an IRIG-B (AC) code is formed into a data group to be transported. In this embodiment, a plurality of data groups to be transported need to be generated in the process of generating an IRIG-B (AC) code, wherein the first data group to be transported is generated immediately after the peripheral configuration of the MCU is completed, and in the subsequent process, when the generation of all data groups to be transported is not completed, a data group to be transported is generated each time a transport completion interrupt is received. Since an IRIG-B (AC) code is divided into a plurality of data groups to be transported, the occupancy of the internal RAM resources of the MCU is reduced, and it is particularly suitable for MCUs with tight RAM resources.

[0062] In this embodiment, the method for generating the data group to be transported includes: decomposing the IRIG-B (AC) code into multiple code elements; decomposing each code element into multiple sinusoidal signals; generating multiple corresponding data for each sinusoidal signal; and forming part of the data into a data group to be transported, for example, forming the data corresponding to a sinusoidal signal into a data group to be transported.

[0063] In one embodiment, generating a plurality of corresponding data for each sinusoidal signal includes: calculating the data corresponding to the sinusoidal signal according to the following formula:

[0064]

[0065] Where A is the amplitude; ω is the angular frequency; is the initial phase; the value range of t is 0ms~1ms.

[0066] S300. The DMA responds to the overflow interrupt of the timer and sequentially transfers each data in the data group to be transferred to the data field of the DAC.

[0067] Specifically, each time an overflow interrupt is triggered, DMA moves one of the data to be moved in its data domain to the data domain of DAC, and each move is incremental. For example, when DMA moves buf, it first moves buf[0], then moves buf[1], and their subscripts increase accordingly.

[0068] S400.DCA outputs a level signal of corresponding amplitude according to the data in its data domain.

[0069] In one embodiment, taking the STM32-F4xx series MCU as the core control device as an example, the timer is configured (initialized) as shown in Table 1, the DAC is configured as shown in Table 2, the DMA is configured as shown in Table 3, and the database is configured as shown in Table 4.

[0070] Table 1

[0071]

[0072] Table 2

[0073]

[0074] Table 3

[0075]

[0076] Table 4

[0077]

[0078] There are three types of code elements in the IRIG-B (AC) code, namely code element 0, code element 1 and code element P. Code element 0 is as follows: Figure 4 As shown, code element 1 is Figure 5 As shown, the code element P is Figure 6 As shown. An IRIG-B (AC) code signal consists of 100 code elements, and one code element consists of 10 sinusoidal signals. Since one code element is 10ms, the period of a sinusoidal signal is 1ms. In order to improve the smoothness of the analog signal, in this embodiment, a sinusoidal signal is divided into 5000 time slices for control, so that each sinusoidal signal is divided into 5000 parts in the time domain, as shown in FIG. Figure 7 Generally speaking, the greater the number of equal parts of a sinusoidal signal, the smoother the resulting signal.

[0079] like Figure 8 As shown in the figure, a code element 0 is composed of 10 sinusoidal signals with different amplitudes and a period of 1ms. The number of values ​​of a sinusoidal signal is 5000. Considering the limited RAM resources inside the MCU, only one set of 5000 data domains is used to store data in this embodiment, and the 5000 data corresponding to the current index are stored respectively. The database format is data

[5000] . Let the 5000 data of the large wave be Y1 and the 5000 data of the small wave be Y0, then the data of code element 0 is as follows Fig. 9 shown.

[0080] If you need to send code element 0, you need to send two large waves with an amplitude of 3V and eight small waves with an amplitude of 1V. The formula for the sine signal is:

[0081]

[0082] Where A is the amplitude, which takes the value of 1 or 3. When it takes the value of 1, the mathematical function of the wavelet is obtained, and when it takes the value of 3, the mathematical function of the wavelet is obtained; ω is the angular frequency, T = 1ms; is the initial phase; the value range of t is 0ms~1ms, the step of t is 0.2us, and it increases from 0ms to 1ms successively, so that 5000 values ​​of x(t) can be obtained.

[0083] like Fig.10 As shown, after the data group to be transferred is generated, the TIM2 interrupt drives the DMA to transfer the data content to the DAC, so that the DAC outputs a level signal of the corresponding amplitude, and finally 5000 points are combined into a sine signal. According to this method, the database corresponding to code element 0 is transferred to the DAC in sequence, so that the DAC generates a code element 0 signal. Code element 1 and code element P can be sent in the same way. Then, the data to be sent is encoded according to the encoding format of the B code. According to the above method, the IRIG-B (AC) code can be generated. Fig.11 A waveform diagram of the IRIG-B (AC) code.

[0084] An embodiment of an IRIG-B (AC) code generating device based on soft time and frequency provided by the present invention includes: an IRIG-B (AC) code generating device based on soft time and frequency, including an MCU, a timer, a DMA and a DAC. The MCU is used to generate a data group to be transferred according to the IRIG-B (AC) code; the DMA is used to respond to the overflow interrupt of the timer to transfer each data in the data group to be transferred to the data domain of the DAC in sequence; the DAC is used to output a level signal of a corresponding amplitude according to the data in its data domain.

[0085] In one embodiment, the MCU is used to generate two data groups to be transferred according to the IRIG-B (AC) code after the peripherals of the MCU are configured. The peripherals of the MCU include DMA, timer and DAC.

[0086] In one embodiment, the DMA is also used to generate a transfer completion interrupt after completing the transfer of a data group to be transferred; the MCU is used to generate two data groups to be transferred according to the IRIG-B (AC) code after its peripheral configuration is completed, and to determine whether the generation of all data groups to be transferred has been completed after receiving a transfer completion interrupt from the DMA. If the generation of all data groups to be transferred has not been completed, the MCU generates a data group to be transferred in response to the transfer completion interrupt, and the peripherals of the MCU include DMA, timer and DAC.

[0087] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.

Claims

1. A method for generating IRIG-B (AC) codes based on soft time-frequency, characterized in that: include: Configuring the peripherals of the MCU, wherein the peripherals of the MCU include DMA, timer and DAC; The MCU generates the data group to be transported according to the IRIG-B (AC) code; The DMA responds to the overflow interrupt of the timer and sequentially transfers each data in the data group to be transferred to the data domain of the DAC; The DAC outputs a level signal of corresponding amplitude according to the data in its data domain; The method for generating the data group to be transported comprises: Decompose the IRIG-B (AC) code into multiple code elements; Decompose each code element into multiple sinusoidal signals; Generate a plurality of corresponding data for each sinusoidal signal; All or part of the data are grouped into a data group to be transported; Generate multiple corresponding data for each sinusoidal signal, including: The data corresponding to the sinusoidal signal is calculated according to the following formula: Where A is the amplitude; is the angular frequency; is the initial phase; the value range of t is 0ms~1ms.

2. The method for generating IRIG-B (AC) code based on soft time-frequency according to claim 1, characterized in that: The MCU generates a data group to be transferred according to the IRIG-B (AC) code, including: After completing the configuration of its peripherals, the MCU generates two data groups to be transferred according to the IRIG-B (AC) code.

3. The method for generating IRIG-B (AC) codes based on soft time-frequency according to claim 1, characterized in that: The MCU generates a data group to be transferred according to the IRIG-B (AC) code, including: After the MCU completes the configuration of its peripherals, it generates two data groups to be transferred according to the IRIG-B (AC) code; After receiving a transfer completion interrupt from the DMA, the MCU determines whether the generation of all the data groups to be transferred has been completed. If the generation of all the data groups to be transferred has not been completed, the MCU generates a data group to be transferred in response to the transfer completion interrupt.

4. The method for generating IRIG-B (AC) code based on soft time-frequency according to claim 1, characterized in that: DMA generates a transfer completion interrupt after completing the transfer of a data group to be transferred.

5. An IRIG-B (AC) code generation device based on soft time-frequency, characterized in that: include: MCU, used to generate a data group to be transported according to the IRIG-B (AC) code; Timer; DMA, used for responding to the overflow interrupt of the timer to sequentially transfer each data in the data group to be transferred to the data domain of the DAC; DAC, used for outputting a level signal of corresponding amplitude according to the data in its data domain; The method for generating the data group to be transported comprises: Decompose the IRIG-B (AC) code into multiple code elements; Decompose each code element into multiple sinusoidal signals; Generate a plurality of corresponding data for each sinusoidal signal; Group all or part of the data into a data group to be transported; Generate multiple corresponding data for each sinusoidal signal, including: The data corresponding to the sinusoidal signal is calculated according to the following formula: Where A is the amplitude; is the angular frequency; is the initial phase; the value range of t is 0ms~1ms.

6. The IRIG-B (AC) code generation device based on soft time-frequency according to claim 5, characterized in that: The MCU is used to generate two data groups to be transferred according to the IRIG-B (AC) code after the peripherals of the MCU are configured. The peripherals of the MCU include DMA, timer and DAC.

7. The IRIG-B (AC) code generation device based on soft time-frequency according to claim 5, characterized in that: The DMA is also used to generate a transfer completion interrupt after completing the transfer of a data group to be transferred; The MCU is used to generate two data groups to be transferred according to the IRIG-B (AC) code after the configuration of its peripherals is completed, and to determine whether the generation of all data groups to be transferred has been completed after receiving a transfer completion interrupt from the DMA. If the generation of all data groups to be transferred has not been completed, the MCU generates a data group to be transferred in response to the transfer completion interrupt. The peripherals of the MCU include DMA, timer and DAC.

Citation Information

Patent Citations

  • Method for controlling and producing AC code of IRIG-B as time synchronization standard by FPGA (field programmable gata array)

    CN102023566A

  • IRIG-B (Inter Range Instrumentation Group) encoding and decoding system and method based on FPGA (Field Programmable Gate Array)

    CN103346804A