Frequency signal acquisition system and method
Through the cooperation of the signal acquisition module and the control unit, the rising and falling edge interrupts are used to generate a trigger signal, and the frequency is calculated by combining the timer to solve the problem of high-frequency signal acquisition accuracy, and high-precision and high-reliability frequency signal acquisition and direction judgment are achieved, reducing costs.
Patent Information
- Application Number
- CN202411574475.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2044-11-06
AI Technical Summary
The prior art is affected by the main frequency factors of the control unit chip when collecting high-frequency signals, resulting in the acquisition accuracy not meeting the requirements, the high-precision acquisition needs cannot be met, and the signal direction judgment and frequency diagnosis cannot be achieved.
Through the cooperation of the signal acquisition module and the control unit, the trigger signal is generated by the rising and falling edge interrupts, the frequency is calculated by combining the timer, the frequency separation and diagnosis is performed by combining the signal conditioning module and the signal diagnosis module, and the direction comparison module is used to judge the signal direction, so as to achieve high-precision acquisition and diagnosis.
It realizes high-precision high-frequency signal acquisition, with the accuracy error controlled at 2‰, and supports waveform direction judgment and frequency diagnosis of multiple synchronous signals, reducing costs and increasing the reliability of the acquisition value.
Smart Images

Figure CN119087036B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of signal acquisition, and in particular to a frequency signal acquisition system and method. Background Art
[0002] Currently, in the field of signal acquisition, two commonly used methods for acquiring frequency signals are period measurement and frequency measurement. Period measurement is commonly used to measure low-frequency signals, while frequency measurement is commonly used for high-frequency signals. While frequency measurement can measure high-frequency signals, it often fails to meet acquisition accuracy requirements. For example, when acquiring a 10 MHz signal using frequency measurement, the error in the acquired frequency signal can exceed 1% due to the limitations of the chip's main frequency. This high error accuracy fails to meet acquisition requirements. Therefore, it is important to consider how to capture high-frequency signals without being affected by the chip's main frequency, ensuring that the acquired frequency signal meets the accuracy range, and enabling signal direction determination and frequency diagnosis. Summary of the Invention
[0003] In response to the above problems, the present disclosure provides a frequency signal acquisition system and method, which can not only realize the acquisition of frequency signals through a signal acquisition module and a control unit, but also obtain the actual frequency of the frequency signal through a trigger signal generated by the signal acquisition module, thereby avoiding the influence of the main frequency of the control unit, thereby significantly improving the acquisition accuracy of the frequency signal and solving the above problems. The present disclosure supports high-precision high-frequency signal acquisition, direction judgment, frequency diagnosis and redundant design. The frequency signal acquisition system and method provided by the present disclosure not only acquire frequency signals with high accuracy and low cost, but also support waveform direction judgment of multiple channels of the same frequency signals and support frequency diagnosis functions.
[0004] According to a first aspect of the present disclosure, a frequency signal acquisition system is provided, the system comprising a signal acquisition module, configured to receive a frequency signal and a predetermined time signal at an input end of the signal acquisition module, respectively, and to generate a trigger signal when the received frequency signal satisfies a predetermined condition within a predetermined time; and a control unit, configured to be communicatively connected to the signal acquisition module to provide the predetermined time signal to the signal acquisition module and receive a trigger signal from the signal acquisition module, thereby determining the frequency of the received frequency signal through the trigger signal, wherein the predetermined condition comprises a rising edge interrupt of the received frequency signal and a falling edge interrupt of the received frequency signal.
[0005] In one embodiment, the control unit is further configured to: start the timer for the standard frequency signal and the timer for the received frequency signal when the trigger signal corresponding to the rising edge interrupt is received for the first time; and turn off the timer for the standard frequency signal and the timer for the received frequency signal when the trigger signal corresponding to the falling edge interrupt is received.
[0006] In one embodiment, the control unit is further configured to: based on the frequency of the standard frequency signal, calculate the actual frequency of the received frequency signal using a time-frequency formula according to the data recorded by the timer for the standard frequency signal and the data recorded by the timer for the received frequency signal.
[0007] In one embodiment, the frequency signal acquisition system further includes: a signal conditioning module configured to receive the frequency signal and separate one or more frequency-divided frequency signals having the same frequency as the received frequency signal from the received frequency signal; and a signal diagnosis module configured to include a channel selection unit and selectively receive the frequency-divided frequency signal or the frequency diagnosis signal having a fixed frequency from the signal conditioning module through the channel selection unit.
[0008] In one embodiment, the signal diagnosis module is further configured to: be communicatively connected with the control unit to receive the frequency division frequency signal from the signal conditioning module and the predetermined diagnostic time signal from the control unit at the input end of the signal diagnosis module, respectively; generate a trigger signal when the frequency division frequency signal meets the predetermined condition within the predetermined diagnostic time of the predetermined diagnostic time signal; and send the trigger signal to the control unit to obtain the actual frequency division frequency corresponding to the frequency division frequency signal through the trigger signal.
[0009] In one embodiment, the signal diagnosis module is further configured to: receive a frequency diagnosis signal and the predetermined diagnosis time signal from the control unit at the input end of the signal diagnosis module, respectively; generate a trigger signal when the frequency diagnosis signal meets the predetermined condition within the predetermined diagnosis time of the predetermined diagnosis time signal; and send the trigger signal to the control unit to obtain the actual diagnostic frequency corresponding to the frequency diagnosis signal through the trigger signal.
[0010] In one embodiment, the control unit is further configured to: calculate the frequency difference between the actual frequency of the received frequency signal and the actual frequency division frequency corresponding to the frequency division frequency signal; calculate the diagnostic frequency difference between the fixed frequency of the frequency diagnostic signal and the actual diagnostic frequency corresponding to the frequency diagnostic signal; and determine whether the actual frequency of the received frequency signal is correct based on the frequency difference and the diagnostic frequency difference.
[0011] In one embodiment, the frequency signal acquisition system further includes: a direction comparison module configured to communicate with the control unit to receive a first frequency signal and a second frequency signal having the same frequency; generate a trigger signal having a high level or a low level when the first frequency signal and the second frequency signal satisfy a predetermined relationship; and send the trigger signal to the control unit, thereby determining the direction through the trigger signal.
[0012] In one embodiment, the control unit is further configured to: receive the trigger signal from the direction comparison module and identify the level corresponding to the trigger signal; when it is identified that the triggered signal corresponds to a high level, update the direction state value to 1; and when it is identified that the triggered signal corresponds to a low level, update the direction state value to 0.
[0013] According to a second aspect of the present disclosure, a method is provided, comprising connecting a frequency signal acquisition system to at least one frequency signal source; acquiring the frequency signal through a signal acquisition module and generating a corresponding trigger signal; and receiving the trigger signal through a control unit, and determining an actual frequency corresponding to the frequency signal through the trigger signal.
[0014] According to a third aspect of the present disclosure, a computing device for frequency signal acquisition is provided, comprising one or more processors; and a memory storing computer-executable instructions, which, when executed by the one or more processors, cause the one or more processors to perform the method according to the second aspect of the present disclosure.
[0015] According to a fourth aspect of the present disclosure, a non-transitory storage medium having computer-executable instructions stored thereon is provided. When the computer-executable instructions are executed by a computer, the computer executes the method according to the second aspect or the third aspect of the present disclosure.
[0016] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements.
[0018] Figure 1 A schematic diagram of a frequency signal acquisition system according to an embodiment of the present disclosure is shown.
[0019] Figure 2 A schematic diagram of a frequency signal acquisition system according to another embodiment of the present disclosure is shown.
[0020] Figure 3 A schematic diagram of a frequency signal acquisition system according to another embodiment of the present disclosure is shown.
[0021] Figure 4 A schematic diagram showing an exemplary circuit of a frequency signal acquisition system according to the present disclosure is shown.
[0022] Figure 5 A flow chart of a method for using a frequency signal acquisition system according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0023] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0024] As used herein, the term "including" and its variations represent an open inclusion, i.e., "including but not limited to." Unless otherwise stated, the term "or" means "and / or." The terms "one example embodiment" and "an embodiment" mean "at least one example embodiment." The term "another embodiment" means "at least one additional embodiment." Other explicit and implicit definitions may be included below.
[0025] As mentioned above, while frequency measurement methods can acquire high-frequency signals, they are affected by the control unit's chip frequency. This can result in acquisition accuracy not meeting the required accuracy range, leading to inaccurate results that fail to meet operational requirements. To meet the accuracy requirements for high-frequency signal acquisition, related technologies have proposed solutions based on field-programmable gate arrays (FPGAs) combined with microprocessors (MCUs). This involves acquiring the input frequency signal through the FPGA and transmitting the acquired frequency value to the MCU, which then processes the frequency value. While this method improves frequency acquisition accuracy, the higher cost of the FPGA increases overall costs.
[0026] Therefore, how to collect high-frequency signals without being affected by the main frequency of the microprocessor chip and maintain low cost while ensuring that the signal acquisition meets the accuracy range becomes a consideration.
[0027] Based on the foregoing, the present disclosure provides an improved frequency signal acquisition system and method, which, through a signal acquisition module and a control unit, can not only acquire high-frequency signals, but also obtain the actual frequency of the frequency signal through a trigger signal generated by the signal acquisition module, thereby avoiding the influence of the chip main frequency of the control unit, thereby significantly improving the acquisition accuracy of the frequency signal, and solving the above problems. The frequency signal acquisition system according to various embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the actual frequency signal acquisition system may also have other components, but in order to avoid obscuring the focus of the present disclosure, these other components are not discussed in the present disclosure and are not shown in the accompanying drawings.
[0028] Figure 1 FIG. 4 shows a frequency signal acquisition system according to some embodiments of the present disclosure. Figure 1 As shown, the frequency signal acquisition system provided by the present disclosure includes: a signal acquisition module, configured to receive a frequency signal and a predetermined time signal at its input end respectively, and generate a trigger signal when the frequency signal meets a predetermined condition within a predetermined time; and a control unit, configured to be communicatively connected with the signal acquisition module, provide a predetermined time signal to the signal acquisition module, and receive a trigger signal from the signal acquisition module, so as to determine the frequency of the frequency signal through the trigger signal, wherein the predetermined condition includes a rising edge interrupt of the frequency signal and a falling edge interrupt of the frequency signal.
[0029] The control unit is further configured to simultaneously start the timer for the standard frequency signal and the timer for the frequency signal upon first receiving a trigger signal corresponding to a rising edge interrupt; and to simultaneously stop the timer for the standard frequency signal and the timer for the frequency signal upon receiving a trigger signal corresponding to a falling edge interrupt. After the timer for the frequency signal is started, it counts the number of trigger signals received within a predetermined time. Furthermore, the timer for the standard frequency signal directly calculates the number of standard frequency signals within the predetermined time based on the frequency of the standard frequency signal.
[0030] The control unit is further configured to calculate the actual frequency of the frequency signal using a time-frequency formula based on the frequency of the standard frequency signal and the data recorded by the timer for the standard frequency signal and the data recorded by the timer for the frequency signal.
[0031] The frequency signal acquisition system may further include a signal separation module configured to receive the frequency signal and separate one or more frequency-divided signals having the same frequency as the frequency signal from the frequency signal.
[0032] Alternatively, as Figure 1As shown, the frequency signal acquisition system may also include a signal conditioning module, which is configured to reduce the amplitude of the frequency signal so that the waveform of the frequency signal during the step-up or step-down delay is smaller. The signal conditioning module reduces the amplitude of the frequency signal to protect the back-end circuit. Moreover, the input voltage range of the back-end logic device is usually limited and small. Reducing the amplitude of the frequency signal can ensure that the back-end logic device effectively receives and recognizes the conditioned frequency signal. The signal conditioning module can be a high-speed operational amplifier, a high-speed comparator or a high-speed logic device, and its communication speed meets 5-10 times the frequency of the frequency signal, thereby ensuring that the frequency signal passes through without being filtered, and ensuring that the back-end logic device does not have recognition errors during the recognition process, thereby ensuring the accuracy of frequency acquisition.
[0033] Diagnosing the frequency values obtained after sampling the input frequency signal is a crucial function. This is because after confirming that the collected frequency values are correct after diagnosis, they can be used as a safeguard to increase the accuracy and reliability of the collected values. However, none of the aforementioned methods can diagnose the collected frequency values.
[0034] Therefore, if Figure 2 As shown, the frequency signal acquisition system may further include a signal diagnosis module, which includes a channel selection unit configured to selectively receive the divided frequency signal or the frequency diagnosis signal with a fixed frequency from the signal separation module through the channel selection unit.
[0035] The signal diagnosis module is also configured to be communicatively connected with the control unit, and to receive at its input end a frequency division frequency signal from the signal separation module and a predetermined diagnostic time signal from the control unit; to generate a trigger signal when the frequency division frequency signal meets the aforementioned predetermined conditions within the predetermined diagnostic time; and to send the trigger signal to the control unit, thereby using the control unit to obtain the actual frequency division frequency corresponding to the frequency division frequency signal through the trigger signal.
[0036] The signal diagnosis module is also configured to receive a frequency diagnosis signal and a predetermined diagnosis time signal from the control unit at its input end respectively; generate a trigger signal when the frequency diagnosis signal meets the aforementioned predetermined conditions within the predetermined diagnosis time; and send the trigger signal to the control unit, so that the control unit obtains the actual diagnostic frequency corresponding to the frequency diagnosis signal through the trigger signal.
[0037] The control unit is further configured to respectively calculate the frequency difference between the actual frequency and the actual divided frequency and the diagnostic frequency difference between the frequency of the frequency diagnostic signal and the actual diagnostic frequency; and determine that the actual frequency is correct when both the frequency difference and the diagnostic frequency difference are within a predetermined range.
[0038] Exemplarily, the predetermined range may be 2‰. As described above, if the frequency difference between the actual frequency and the actual frequency division ratio satisfies 2‰, and the diagnostic frequency difference also satisfies 2‰, then the actual frequency value of the diagnostic frequency signal is correct. If the frequency difference between the actual frequency and the actual frequency division ratio is much greater than 2‰, and the diagnostic frequency difference is also much greater than 2‰, then the diagnostic signal diagnostic module fails. If the frequency difference between the actual frequency and the actual frequency division ratio satisfies 2‰, and the diagnostic frequency difference does not satisfy 2‰, then the diagnostic frequency diagnostic signal fails. If the frequency difference between the actual frequency and the actual frequency division ratio is much greater than 2‰, and the diagnostic frequency difference satisfies 2‰, then the diagnostic signal acquisition module fails. At this point, the signal diagnostic module can provide the frequency signal acquisition function, thereby realizing the frequency signal acquisition redundancy function, and at the same time the control unit sends a signal that the signal acquisition module has failed.
[0039] Moreover, those skilled in the art are aware that neither the period measurement method, the frequency measurement method, nor the FPGA+MCU frequency signal acquisition method can determine the direction of the two input signals (i.e., which input signal waveform reaches the rising edge interrupt first). Figure 3 As shown, the frequency signal acquisition system provided by the present disclosure also includes a direction comparison module, which can receive multiple frequency signals with the same frequency and compare which frequency signal's rising edge reaches the interruption first among the two input frequency signals.
[0040] Specifically, if Figure 3 As shown, the direction comparison module is configured to communicate with the control unit and receive a first frequency signal and a second frequency signal having the same frequency; generate a trigger signal having a high level or a low level when the first frequency signal and the second frequency signal satisfy a predetermined relationship; and send the trigger signal to the control unit, thereby determining the direction through the trigger signal.
[0041] The predetermined relationship includes the case where the first frequency signal reaches the rising edge interrupt first and the case where the second frequency signal reaches the rising edge interrupt first. Specifically, when the first frequency signal reaches the rising edge interrupt first, the direction comparison module generates a trigger signal with a high level; when the second frequency signal reaches the rising edge interrupt first, the direction comparison module generates a trigger signal with a low level. The direction comparison module can also be configured to be communicatively connected to the signal separation module, receive the corresponding frequency-divided signal separated by the signal separation module from different frequency signals having the same frequency, and use the corresponding frequency-divided signal as the aforementioned first frequency signal and second frequency signal.
[0042] The control unit is also configured to receive a trigger signal from the direction comparison module and identify the level corresponding to the trigger signal; when it is identified that the triggered signal corresponds to a high level, the direction state value is updated to 1; and when it is identified that the triggered signal corresponds to a low level, the direction state value is updated to 0.
[0043] According to the frequency signal acquisition system described above, for simultaneous signal acquisition, diagnosis and direction judgment of two frequency signals with the same frequency, the frequency signal acquisition system provided by the present disclosure can be as follows: Figure 4 As shown, the system includes a signal conditioning module, a signal separation module, two signal acquisition modules, two signal diagnosis modules, a direction comparison module, and a control unit. To simultaneously acquire, diagnose, and determine the direction of multiple signals with the same frequency, the number of signal acquisition modules, signal diagnosis modules, and direction comparison modules can be adjusted accordingly. This will not be further detailed here.
[0044] Compared with the existing technology, the present invention supports high-precision high-frequency signal acquisition, direction judgment, frequency diagnosis and redundant design. The frequency signal acquisition system and method provided by the present invention not only acquire frequency signals with high accuracy and low cost, but also support waveform direction judgment of multiple co-frequency frequency signals and support frequency diagnosis function. The present invention solves the problem of completing the acquisition of high-frequency signals without being affected by the main frequency of the control unit chip, and the acquisition accuracy error is controlled at 2‰. In addition, it can also realize the judgment of the direction of multiple co-frequency frequency signals and the diagnosis of input frequency signals, and has a wide range of application scenarios.
[0045] In order to realize the acquisition of high-frequency signals, frequency signal diagnosis and the determination of the waveform direction when multiple channels of the same frequency signal are input, software design and hardware circuit design support are required. Figure 4 The circuit design of the frequency signal acquisition system shown can be as follows Figure 5 As shown. Figure 5 As shown, the frequency signal acquisition system provided by the present disclosure consists of two dual D flip-flops, a single D flip-flop, a fixed crystal oscillator, a single-pole double-throw switch, a signal separation circuit (not shown), and an MCU. The dual D flip-flops are used for frequency signal acquisition and diagnosis, while the single D flip-flop is used for direction determination.
[0046] The connection method of the above devices is as follows: the CLK1 pin of the dual D flip-flop serves as the input pin for the frequency signals Fa and Fb (i.e., the frequency signals to be collected). The D1 pin of the dual D flip-flop is connected to the GPIO pin of the MCU to receive the predetermined time signal from the MCU (i.e., the time input of the preset gate). The corresponding Q1 pin of the dual D flip-flop is also connected to the GPIO pin of the MCU (the GPIO pin corresponding to the MCU timer) to send the generated trigger signal to the MCU. After receiving the trigger signal, the MCU will calculate the actual frequency value corresponding to the frequency signals Fa and Fb. Figure 4 As shown, the connected lines ①②③ and lines ④⑤⑥ form a signal acquisition module for acquiring frequency signals Fa and Fb with equal precision.
[0047] Furthermore, the CLK2 pin of the dual D flip-flop is connected to a single-pole double-throw switch, which is selectively connected to a separation circuit or a crystal oscillator unit to receive the same-frequency and divided-frequency signals (Fa1 and Fb1) separated by the separation circuit or the frequency diagnostic signal Fa generated by the crystal oscillator unit. The D2 pins of the dual D flip-flops are each connected to a GPIO pin of the MCU to receive a predetermined diagnostic time signal (i.e., a preset gate time input) from the MCU. The corresponding Q2 pins of the dual D flip-flops are also connected to a GPIO pin of the MCU (the GPIO pin corresponding to the MCU timer) to send a trigger signal to the MCU. At this point, lines ⑦, ⑧, ⑨, ⑩, and ⑪ form the signal diagnostic module for frequency signal Fa, while lines ⑫, ⑬, ⑭, ⑮, and ⑯ form the signal diagnostic module for frequency signal Fb. Fa1 and Fb1 are the same-frequency and divided-frequency signals separated by the signal separation module, and Fa is the frequency diagnostic signal output by the fixed crystal oscillator.
[0048] After receiving the trigger signal, the MCU calculates the actual frequency division ratio corresponding to the frequency division ratio signals Fa1 and Fb1, and the actual diagnostic frequency corresponding to the frequency diagnosis signal Fa. Taking the frequency signal Fa as an example, the MCU can also store and compare the actual frequency and the actual frequency division ratio, as well as the theoretical diagnosis and actual diagnosis frequency values, to obtain the following results.
[0049] Compare the actual frequency values of the frequency signal Fa and the frequency division signal Fa1. If the difference satisfies 2‰, and the difference between the calculated actual diagnostic frequency value and the input crystal oscillator value satisfies 2‰, then the frequency value result of the diagnostic frequency signal Fa is correct.
[0050] Comparing the actual frequency values of the frequency signal Fa and the frequency-divided signal Fa1, if the difference is significantly greater than 2‰, and the difference between the calculated actual diagnostic frequency value and the input crystal oscillator value is within 2‰, then the diagnostic acquisition circuit has failed and is outside the normal value range. In this case, the diagnostic circuit can provide acquisition functions, which also realizes the frequency acquisition redundancy function and alerts the acquisition circuit to the presence of a fault signal.
[0051] Compare the actual frequency values of the frequency signal Fa and the divided frequency signal Fa1. If the difference satisfies 2‰, and the difference between the calculated actual diagnostic frequency value and the input crystal oscillator value is much greater than 2‰, then the actual frequency value of the diagnostic frequency signal is correct, but the crystal oscillator signal is faulty.
[0052] Compare the collected frequency values of the frequency signal Fa and the frequency-divided signal Fa1. If the difference is much greater than 2‰, and the difference between the calculated actual diagnostic frequency value and the input crystal oscillator value is much greater than 2‰, then the diagnosis circuit is diagnosed to be faulty. The diagnosis process for the frequency signal Fb is similar to that for the frequency signal Fa.
[0053] At the same time, the CLK pin of the single D flip-flop is connected to the Fa channel, and the D pin is connected to the Fb channel to receive two frequency signals of the same frequency, and the Q pin of the single D flip-flop is connected to the GPIO port of the MCU. At this time, ⑰⑱⑲ forms a direction comparison module, Fa2 can be the frequency signal of the same frequency divided by the frequency signal Fa separated by the separation circuit, and Fb2 can be the frequency signal of the same frequency divided by the frequency signal Fb separated by the separation circuit. If the waveform of the frequency signal Fa input to the CLK pin of the D flip-flop is ahead of the waveform of the frequency signal Fb input to the D pin, the output value of the Q output pin remains in a high level state. If the waveform of the frequency signal Fa input to the CLK pin of the D flip-flop lags behind the waveform of the frequency signal Fb input to the D pin, the output value of the Q output pin remains in a low level state. The forward and reverse rotation of the motor can be detected based on the direction judgment, and the motor can be controlled to perform corresponding operations based on the operating status of the motor.
[0054] Compared with the frequency signal acquisition methods of the period measurement method and the frequency measurement method, the present invention can acquire high-precision signals without being limited by the influence of the chip main frequency of the control unit. By combining hardware external circuits and software algorithms, the frequency acquisition of high-frequency signals (such as frequency signals above 10M) can be achieved, and the acquisition accuracy error does not exceed 2‰. It can also realize the waveform direction judgment of multi-channel frequency signals and functional diagnosis of the frequency of the input frequency signal, thereby increasing the reliability of the acquired frequency value.
[0055] Compared to the FPGA+MCU frequency signal acquisition method, the present invention does not require FPGA support when acquiring signals, yet can still achieve high-frequency signal acquisition with an acquisition accuracy error of no more than 2‰. It can also determine the waveform direction of multiple frequency signals and perform frequency value diagnosis on the input frequency signal, increasing the reliability of the acquired frequency value. Furthermore, compared to the FPGA+MCU combination, the present invention significantly reduces the cost of use.
[0056] The frequency signal acquisition system disclosed herein implements high-frequency signal acquisition, direction determination, and frequency signal diagnosis through a combination of hardware circuits and software. The MCU and D-type flip-flop design enable high-precision, high-frequency frequency signal acquisition, waveform direction determination of two frequency signals of the same frequency, and diagnosis of the acquired frequency signals. It should be understood that the frequency signal acquisition system provided herein can be appropriately expanded. For example, the system utilizes multiple flip-flops to enable the acquisition, diagnosis, and direction determination of four, six, or other multiple frequency signals. Furthermore, the dual flip-flops in the present disclosure can be replaced by two single flip-flops.
[0057] The present disclosure also provides a method for using the aforementioned frequency signal acquisition system, comprising connecting the frequency signal acquisition system to at least one frequency signal source; acquiring the frequency signal through a signal acquisition module and generating a corresponding trigger signal; and receiving the trigger signal through a control unit, and determining the actual frequency corresponding to the frequency signal through the trigger signal.
[0058] During frequency signal acquisition, the signal acquisition module receives a predetermined time input from the control unit and waits for a rising-edge interrupt on the frequency signal input (i.e., a D-type flip-flop connected to the Q pin input interrupt) to generate a trigger signal, which then activates the control unit's timer for the standard frequency signal and the timer for the frequency signal. Subsequently, within a predetermined time, the signal acquisition module waits for a falling-edge interrupt on the frequency signal input (i.e., a D-type flip-flop connected to the Q pin input interrupt) to generate a trigger signal, causing the control unit to deactivate the timers for the standard frequency signal and the timer for the frequency signal. The timer then records the calculated value of the standard frequency signal and the count value of the frequency signal. Finally, after the predetermined time has elapsed, the actual frequency value of the frequency signal is calculated and stored according to the time-frequency formula.
[0059] During the process of diagnosing the frequency signal, a predetermined diagnostic time signal is input to the signal acquisition module and the signal diagnosis module at the same time through the control unit. The signal acquisition module receives the frequency signal input, and the signal diagnosis module receives the frequency division frequency signal input through the channel selection unit (for example, switching the single-pole double-throw switch to a signal separation module that can separate the signal with the same frequency from the frequency signal). Subsequently, the signal acquisition module and the signal diagnosis module wait for the rising edge interrupt of the frequency signal and the frequency division frequency signal respectively (that is, the dual D flip-flop is connected to the Q1 and Q2 pin input interrupt) to generate corresponding trigger signals, thereby starting the timer for the standard frequency signal, the timer for the frequency signal, and the timer for the frequency division frequency signal.
[0060] Subsequently, the signal acquisition module and the signal diagnosis module wait for the falling edge interrupt of the frequency signal and the frequency-division signal, respectively (i.e., the dual D flip-flops are connected to the Q1 and Q2 pins for input interrupts) to generate corresponding trigger signals, thereby shutting down the timers for the standard frequency signal, the frequency signal, and the frequency-division signal. The calculated value of the standard frequency signal and the count values of the frequency signal and the frequency-division signal are recorded. Furthermore, the actual frequency values of the frequency signal and the frequency-division signal are calculated and saved according to the time-frequency formula.
[0061] Next, the control unit simultaneously inputs a predetermined diagnostic time signal to the signal acquisition module and the signal diagnosis module, the signal acquisition module receives the frequency signal input, and the signal diagnosis module receives the frequency diagnosis signal input through the channel selection unit (for example, switching the single-pole double-throw switch to a diagnostic signal source that can generate a frequency diagnostic signal with a fixed frequency). Subsequently, the signal acquisition module and the signal diagnosis module wait for the rising edge interrupt of the frequency signal and the frequency diagnosis signal respectively (that is, the dual D flip-flop is connected to the Q1 and Q2 pin input interrupt) to generate corresponding trigger signals, thereby starting the timer for the standard frequency signal, the timer for the frequency signal, and the timer for the frequency diagnosis signal in the control unit.
[0062] The signal acquisition module and signal diagnosis module then wait for the falling edge interrupts of the frequency signal and frequency diagnosis signal, respectively (i.e., the dual D flip-flops are connected to the Q1 and Q2 pins for input interrupts) to generate corresponding trigger signals, thereby shutting down the timers for the standard frequency signal, the frequency signal, and the frequency diagnosis signal. The calculated value of the standard frequency signal and the count values of the frequency signal and frequency diagnosis signal are recorded. Furthermore, the actual frequency value of the frequency diagnosis signal is calculated and saved according to the time-frequency formula.
[0063] Based on the calculated actual frequency value of the frequency signal, the actual frequency value of the frequency division signal, and the actual frequency value of the frequency diagnosis signal, the control unit compares the difference between the actual frequency value of the frequency signal and the frequency division signal, as well as the diagnostic difference between the actual frequency value of the frequency diagnosis signal and the theoretical frequency value. If the actual frequency value difference meets 2‰ and the diagnostic difference also meets 2‰, the actual frequency value of the diagnostic frequency signal is correct. If the actual frequency value difference is much greater than 2‰ and the diagnostic difference is also much greater than 2‰, the diagnostic signal diagnosis module has a fault. If the actual frequency value difference meets 2‰, but the diagnostic difference does not meet 2‰, the diagnostic frequency diagnosis signal has an error. If the actual frequency value difference is much greater than 2‰, but the diagnostic difference meets 2‰, the diagnostic signal acquisition module has a fault. In this case, the signal diagnosis module can provide the frequency signal acquisition function, thereby achieving frequency signal acquisition redundancy, and the control unit simultaneously sends a signal that the signal acquisition module has a fault.
[0064] Through the above method, the frequency signal acquisition system provided by the present disclosure can realize the acquisition and diagnosis of frequency signals. In addition, when the signal acquisition module fails, a redundant design is provided, and the signal diagnosis module is used as the signal acquisition module.
[0065] During the direction determination process, the direction comparison module receives inputs of a first frequency signal and a second frequency signal having the same frequency. Simultaneously, the control unit detects changes in the level of the direction comparison module's output signal. When the control unit detects a high level for the direction comparison module's output signal, it determines that the waveform of the first frequency signal leads the waveform of the second frequency signal and updates the direction status value to 1 (corresponding, for example, to forward rotation of the motor). When the control unit detects a low level for the direction comparison module's output signal, it determines that the waveform of the first frequency signal lags the waveform of the second frequency signal and updates the direction status value to 0 (corresponding, for example, to reverse rotation of the motor).
[0066] Through the above method, this solution can achieve high-precision frequency signal acquisition, waveform direction determination of multiple frequency signals, and non-intrusive diagnosis. Moreover, this solution can realize redundant frequency signal acquisition, that is, if the acquisition circuit fails, the frequency value collected by the diagnostic circuit can also be used.
[0067] The present disclosure also provides a computing device for frequency signal acquisition, which includes one or more processors and a memory storing computer-executable instructions. When the computer-executable instructions are executed by the one or more processors, the one or more processors execute the method according to any of the aforementioned embodiments of the present disclosure.
[0068] The present disclosure also provides a non-transitory storage medium having computer-executable instructions stored thereon, which, when executed by a computer, causes the computer to perform the method according to any of the aforementioned embodiments of the present disclosure.
[0069] Those skilled in the art will appreciate that the present disclosure is not limited to the above-described embodiments, and that the present disclosure may be implemented in many other forms without departing from its spirit and scope. Therefore, the examples and embodiments shown are to be considered illustrative rather than restrictive, and that the present disclosure is capable of encompassing various modifications and substitutions without departing from the spirit and scope of the present disclosure as defined in the appended claims.
Claims
1. A frequency signal acquisition system, characterized in that: include: a signal acquisition module configured to receive a frequency signal and a predetermined time signal at an input end of the signal acquisition module, respectively, and generate a trigger signal when the received frequency signal satisfies a predetermined condition within a predetermined time, wherein the signal acquisition module is a dual D flip-flop; A control unit is configured to be in communication with the signal acquisition module to provide the predetermined time signal to the signal acquisition module and receive a trigger signal from the signal acquisition module, thereby determining the frequency of the received frequency signal through the trigger signal, wherein the predetermined condition includes a rising edge interrupt of the received frequency signal and a falling edge interrupt of the received frequency signal, wherein the control unit is an MCU, and the control unit is further configured to calculate a frequency difference between the actual frequency of the received frequency signal and the actual divided frequency corresponding to the divided frequency signal, calculate a diagnostic frequency difference between the fixed frequency of the frequency diagnostic signal and the actual diagnostic frequency corresponding to the frequency diagnostic signal, and determine the actual frequency of the received frequency signal based on the frequency difference and the diagnostic frequency difference. Whether the frequency is correct, wherein the difference between the actual frequency values of the frequency signal and the divided frequency signal is determined, if the difference meets the threshold, and the difference between the calculated actual diagnostic frequency value and the input crystal oscillator value meets the threshold, then the frequency value result of the diagnostic frequency signal is correct, if the difference is much larger than the threshold, and the difference between the calculated actual diagnostic frequency value and the input crystal oscillator value meets the threshold, then the diagnostic acquisition circuit has a fault, if the difference meets the threshold, and the difference between the calculated actual diagnostic frequency value and the input crystal oscillator value is much larger than the threshold, then the actual frequency value result of the diagnostic frequency signal is correct, but the crystal oscillator signal has a fault, if the difference is much larger than the threshold, and the difference between the calculated actual diagnostic frequency value and the input crystal oscillator value is much larger than the threshold, then the diagnostic circuit has a fault; a signal conditioning module configured to receive the frequency signal and separate one or more frequency-divided signals having the same frequency as the received frequency signal from the received frequency signal; a signal diagnosis module configured to include a channel selection unit and selectively receive the frequency-divided signal or the frequency diagnosis signal with a fixed frequency from the signal conditioning module through the channel selection unit, wherein the signal diagnosis module is a dual D flip-flop; as well as A direction comparison module is configured to be communicatively connected with the control unit to receive a first frequency signal and a second frequency signal having the same frequency, generate a trigger signal having a high level or a low level when the first frequency signal and the second frequency signal satisfy a predetermined relationship, and send the trigger signal to the control unit, thereby determining the direction through the trigger signal, wherein the direction comparison module is a single D flip-flop.
2. The frequency signal acquisition system according to claim 1, characterized in that: The control unit is further configured to: When a trigger signal corresponding to the rising edge interrupt is received for the first time, starting a timer for the standard frequency signal and a timer for the received frequency signal; and When a trigger signal corresponding to the falling edge interrupt is received, the timer for the standard frequency signal and the timer for the received frequency signal are turned off.
3. The frequency signal acquisition system according to claim 2, characterized in that: The control unit is further configured to: Based on the frequency of the standard frequency signal, the actual frequency of the received frequency signal is calculated using a time-frequency formula according to the data recorded by the timer for the standard frequency signal and the data recorded by the timer for the received frequency signal.
4. The frequency signal acquisition system according to claim 1, characterized in that: The signal diagnosis module is further configured to: being communicatively connected with the control unit to receive the frequency division signal from the signal conditioning module and the predetermined diagnosis time signal from the control unit at the input end of the signal diagnosis module; generating a trigger signal when the frequency division signal satisfies the predetermined condition within a predetermined diagnosis time of the predetermined diagnosis time signal; as well as The trigger signal is sent to the control unit to obtain an actual division frequency corresponding to the division frequency signal through the trigger signal.
5. The frequency signal acquisition system according to claim 4, characterized in that: The signal diagnosis module is further configured to: receiving a frequency diagnosis signal and the predetermined diagnosis time signal from the control unit at an input end of the signal diagnosis module; generating a trigger signal when the frequency diagnosis signal satisfies the predetermined condition within a predetermined diagnosis time of the predetermined diagnosis time signal; as well as The trigger signal is sent to the control unit to obtain an actual diagnostic frequency corresponding to the frequency diagnostic signal through the trigger signal.
6. The frequency signal acquisition system according to claim 1, characterized in that: The control unit is further configured to: receiving the trigger signal from the direction comparison module and identifying a level corresponding to the trigger signal; When it is identified that the triggered signal corresponds to a high level, the direction state value is updated to 1; as well as When it is identified that the triggered signal corresponds to a low level, the direction state value is updated to 0.
7. A method for using the frequency signal acquisition system according to any one of claims 1 to 6, characterized in that: The method comprises: connecting the frequency signal acquisition system to at least one frequency signal source; Collecting the frequency signal through the signal acquisition module and generating a corresponding trigger signal; and The trigger signal is received by a control unit included in the frequency signal acquisition system, so as to determine the actual frequency corresponding to the received frequency signal through the trigger signal.
8. A computing device for frequency signal acquisition, characterized in that: The computing device comprises: one or more processors; and A memory storing computer executable instructions that, when executed by the one or more processors, cause the one or more processors to perform the method of claim 7.
9. A non-transitory storage medium having computer-executable instructions stored thereon, characterized in that: The computer executable instructions, when executed by a computer, cause the computer to perform the method according to claim 7.
Citation Information
Patent Citations
High-precision frequency acquisition method and device based on FPGA
CN110954745A
Frequency signal acquisition circuit and diagnosis method
CN117929839A
Rotation-angle information acquisition system for steering wheel
CN203216450U