A method and system for measuring the frequency signal of a resonant temperature sensor
Patent Information
- Application Number
- CN202610935895.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-09-15
AI Technical Summary
[0007]为此,本发明所要解决的技术问题在于克服现有技术中观测时间较长、动态响应较慢以及测量稳定性不足的问题
本发明所述的谐振式温度传感器频率信号测量方法,采用边沿预测与反馈跟踪机制,对谐振式温度传感器输出的周期信号进行逐周期动态跟踪。通过对已测信号边沿进行周期估计和相位递推,预测下一次信号边沿位置,减少对长时间频率计数或多周期平均的依赖,显著缩短了单次测量的观测时间,从而提高谐振式温度传感器信号读取速度;同时,利用已测得的边沿时间信息对后续边沿进行预测,并通过实际测量误差对预测结果进行反馈修正,能够在较短观测时间内获得输入周期信号的周期和相位变化信息,从而改善传统测量方式响应较慢的问题;并使得预测脉冲的边沿位置能够持续逼近实际信号边沿位置,在缩短观测时间的同时保证了测量结果的稳定性和可靠性。
Smart Images

Figure CN122753584A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sensor signal readout and time measurement technology, and in particular to a method and system for measuring the frequency signal of a resonant temperature sensor. Background Technology
[0002] Resonant temperature sensors typically utilize the characteristic that the natural frequency of a resonator changes with temperature to achieve temperature measurement. Compared to traditional voltage-type or resistive temperature sensors, the output of a resonant temperature sensor is usually expressed as a time-domain signal such as frequency, period, or phase, which facilitates subsequent digital circuit processing and has certain application value in the fields of temperature measurement and digital sensor readout.
[0003] Currently, common methods for measuring the output signal of resonant temperature sensors include frequency counting, period measurement, multi-period averaging, and phase-locked loop (PLL) tracking. Frequency counting typically involves counting the number of signal cycles within a fixed gate time to obtain frequency information; period measurement measures the signal period by measuring the time interval between adjacent signal edges; multi-period averaging reduces random errors by extending the measurement time; and the PLL method tracks the frequency or phase changes of the input signal through a loop. While existing technologies can measure the output signal of resonant temperature sensors, they still have certain limitations. Frequency counting and multi-period averaging methods usually rely on long observation times, which limits the measurement response speed when the temperature changes rapidly or the system requires real-time readings. Although period measurement has a shorter measurement time, the results of a single measurement are easily affected by clock resolution, signal edge jitter, and quantization errors, resulting in insufficient measurement stability. The PLL method can achieve continuous tracking, but the system structure is relatively complex, and the loop locking and re-tracking processes affect the system's dynamic response speed.
[0004] Most existing methods focus on passively measuring the edge of a signal that has already occurred or multiple complete cycles, and the measurement results depend on a certain observation window. When the observation time is shortened, the impact of random errors and quantization errors on the measurement results increases; when the observation time is extended, the system's response speed to changes in the sensor output signal decreases. Therefore, there is a certain trade-off between measurement speed and measurement stability in existing measurement methods.
[0005] Furthermore, when using digital platforms such as FPGAs to measure resonant signals, it is typically necessary to use a time-to-digital converter to measure the signal edges or to use a delay chain to generate a controllable delay signal. However, the delay resources within an FPGA are not ideally uniformly distributed; delay differences exist between different delay units, and delay characteristics can be affected by factors such as device fabrication, operating voltage, and ambient temperature. Without effective calibration and compensation mechanisms, edge measurement errors or delay control errors can easily occur, further impacting the accuracy and stability of the resonant temperature sensor signal readings.
[0006] Therefore, existing technologies lack a rapid measurement system that can complete the reading of resonant temperature sensor signals within a short observation time while simultaneously ensuring measurement speed and stability. Summary of the Invention
[0007] Therefore, the technical problem to be solved by the present invention is to overcome the problems of long observation time, slow dynamic response and insufficient measurement stability in the prior art.
[0008] To solve the above-mentioned technical problems, the present invention provides a method for measuring the frequency signal of a resonant temperature sensor, comprising: S1: The periodic signal generated in real time by the resonant temperature sensor based on the temperature in the environment to be detected is used as the signal to be measured; S2: In the current period, based on the start edge and end edge of the signal under test, obtain the current estimated period of the signal under test; S3: Based on the actual arrival time of the starting edge of the current cycle and the sum of the phase prediction errors of the current estimated cycle and the previous cycle, obtain the predicted arrival time of the starting edge of the next cycle. S4: In the next cycle, the target delay is obtained based on the difference between the predicted arrival time of the reference sampling clock signal and the start edge of the signal under test. S5: Select the target delay tap in the delay chain based on the target delay amount, delay the reference sampling clock signal, and obtain the delay pulse signal of the next cycle; S6: Obtain the difference between the actual arrival time of the delayed pulse signal and the start edge of the signal under test in the next cycle, and use it as the phase prediction error of the current cycle; S7: Based on the phase prediction error of the current cycle, correct the current estimated cycle to obtain the target cycle; based on the target frequency corresponding to the target cycle, obtain the temperature value corresponding to the target frequency in the preset frequency-temperature mapping relationship, and use it as the measurement result of the current cycle; S8: Using the next cycle as the current cycle, return to step S2 to continue measuring the next cycle, thereby achieving real-time monitoring of the ambient temperature to be tested.
[0009] Preferably, in the current period, based on the start edge and end edge of the signal under test, the current estimated period of the signal under test is obtained, including: Clock period based on reference sampling clock signal Obtain the number of complete clock cycles of the signal under test in the current period. ; Using a TDC delay chain, when the start edge of the signal under test is detected, a fine-time measurement of the current period is performed, and the fine-time of the end edge of the current period is calculated. With the starting edge fine time The difference is used to obtain the delay compensation amount. , represented as ; Calculate the product of the number of complete clock cycles in the current period and the clock cycle, add it to the delay compensation amount, and obtain the current estimated period of the signal under test. , is represented as: .
[0010] Preferably, using a TDC delay chain, fine-time measurement of the current period is performed when the start edge of the signal under test is detected, including: After the signal under test enters the TDC delay chain, it passes through multiple series-connected delay taps, and a corresponding delay state is generated at each delay tap. Each delayed state is sampled based on the reference sampling clock signal to form hot code data characterizing the propagation position of the signal edge; Based on the number 1 method, the hot code data is decoded to obtain the fine time of the termination edge and the fine time of the start edge of the current cycle.
[0011] Preferably, before selecting the target delay tap in the delay chain based on the target delay amount, the delay chain is further calibrated, including: storing the position of each delay tap and the corresponding actual delay time as a delay calibration lookup table based on the actual delay time of the output signal of each delay tap in the delay chain relative to the reference sampling clock signal.
[0012] Preferably, in the current cycle, a target delay tap is selected in the delay chain based on the target delay amount, and the reference sampling clock signal is delayed and output to obtain the delayed pulse signal for the next cycle, including: Based on the target delay amount, select the delay tap position that is closest to the target delay amount in the delay calibration lookup table as the target delay tap; The reference sampling clock signal is input into the delay chain, and the delayed signal is taken out from the target delay tap as the delayed pulse signal for the next cycle.
[0013] Preferably, based on the target frequency corresponding to the target period, and within a preset frequency-temperature mapping relationship, the temperature value corresponding to the target frequency is obtained as the measurement result of the current period, including: Acquiring target period Corresponding target frequency , is represented as: ; Obtain the temperature value corresponding to the target frequency. , is represented as: ; in, This represents a function that represents the preset frequency-temperature mapping relationship.
[0014] Preferably, obtaining the preset frequency temperature mapping function includes: selecting multiple temperature calibration points within the operating temperature range of the resonant temperature sensor; placing the resonant temperature sensor and a standard thermometer in the same constant temperature environment; for each temperature calibration point, recording the standard temperature value and the resonant frequency output by the resonant temperature sensor after the temperature stabilizes; and using the least squares method to fit the preset frequency temperature mapping function based on multiple sets of standard temperature values and resonant frequencies.
[0015] This embodiment also provides a measurement system based on the resonant temperature sensor frequency signal measurement method described above, including: The time-to-digital converter module is used to obtain the current estimated period of the signal under test, the actual arrival time of the start edge, and the actual arrival time of the start edge of the delayed pulse signal. The phase prediction module is used to obtain the target delay based on the difference between the predicted arrival time of the reference sampling clock signal and the start edge of the signal under test. A digital delay control module is used to generate a delayed pulse signal based on a target delay amount. The phase error calculation unit calculates the phase prediction error of the current period based on the difference between the actual arrival time of the start edge of the signal under test and the delayed pulse signal. The feedback compensation module corrects the current estimated period based on the phase prediction error of the current period to obtain the target period; The measurement result output module, based on the target frequency corresponding to the target period, obtains the temperature value corresponding to the target frequency in a preset frequency-temperature mapping relationship, and uses it as the measurement result for the current period.
[0016] Preferably, the time-to-digital conversion module includes: The first TDC delay chain takes the signal to be measured output by the resonant temperature sensor in the environment under test as input, and obtains the fine time of the termination edge and the fine time of the start edge of the current period in the signal to be measured. The second TDC delay chain takes the delayed pulse signal as input and obtains the fine time of the termination edge and the fine time of the start edge of the current period in the delayed pulse signal. A coarse counter is used to obtain the number of complete clock cycles of the signal under test in the current period. The period estimation unit calculates the product of the number of complete clock cycles in the current period and the clock period, adds it to the delay compensation amount, and obtains the current estimated period of the signal under test.
[0017] Preferably, the digital delay control module includes: The control unit is used to generate tap control selection signals based on the target delay amount; A tap selection unit is used to select a target tap in the tap delay chain based on a tap control selection signal. The tap delay chain takes the reference sampling clock signal as input and uses the target tap to delay the reference sampling clock signal to generate a delayed pulse signal; The delay output unit is used to extract the generated delayed pulse signal.
[0018] Compared with the prior art, the above-described technical solution of the present invention has the following advantages: The frequency signal measurement method for resonant temperature sensors described in this invention employs an edge prediction and feedback tracking mechanism to dynamically track the periodic signal output by the resonant temperature sensor cycle by cycle. By estimating the period and recursively extrapolating the phase of the measured signal edge, the position of the next signal edge is predicted, reducing the reliance on long-term frequency counting or multi-cycle averaging, significantly shortening the observation time of a single measurement, and thus improving the signal reading speed of the resonant temperature sensor. Simultaneously, the measured edge time information is used to predict subsequent edges, and the prediction results are corrected by feedback through actual measurement errors. This allows the period and phase change information of the input periodic signal to be obtained within a shorter observation time, thereby improving the slow response problem of traditional measurement methods. Furthermore, it ensures that the edge position of the predicted pulse can continuously approach the actual signal edge position, maintaining the stability and reliability of the measurement results while shortening the observation time.
[0019] This invention employs the "count-1 method" to encode the hot code data obtained from the delay chain sampling. That is, it counts the number of valid "1"s in the hot code as the result of fine-time quantization, rather than relying on a single jump position for decoding. This effectively reduces the impact of the bubble phenomenon caused by factors such as clock skew, setup and hold time conflicts, and inconsistencies in delay units on the fine-time measurement results, and improves measurement stability and robustness.
[0020] This invention introduces a delay calibration mechanism. By measuring the actual delay time of each delay tap level, a lookup table is established to correspond to the target delay amount and the tap position. During system operation, the tap position closest to the target delay amount is selected by looking up the table, effectively compensating for delay non-uniformity caused by process deviations and temperature drift. This improves the output accuracy of the digital delay control module and the system's adaptability under different environmental conditions. Attached Figure Description
[0021] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart of the steps of the resonant temperature sensor frequency signal measurement method of the present invention; Figure 2 This is a schematic diagram illustrating the calculation principle of the current estimated period; Figure 3 This is a schematic diagram of the structure of a resonant temperature sensor frequency signal measurement system; Figure 4 This is a schematic diagram of the time-to-digital conversion module; Figure 5 This is a schematic diagram of the digital delay control module; Figure 6 This is a schematic diagram of the host computer software interface and measurement results of the frequency signal measurement system of the resonant temperature sensor based on FPGA of the present invention. Detailed Implementation
[0022] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0023] Reference Figure 1 The flowchart shown below illustrates the steps of the resonant temperature sensor frequency signal measurement method of the present invention, including steps S1 to S8.
[0024] S1: The periodic signal generated in real time by the resonant temperature sensor based on the temperature in the environment to be detected is used as the signal to be measured.
[0025] S2: In the current period, based on the start and end edges of the signal under test, obtain the current estimated period of the signal under test, including: Clock period based on reference sampling clock signal Obtain the number of complete clock cycles of the signal under test in the current period. ; Using a TDC delay chain, when the start edge of the signal under test is detected, a fine-time measurement of the current period is performed, and the fine-time of the end edge of the current period is calculated. With the starting edge fine time The difference is used to obtain the delay compensation amount. , represented as ; Calculate the product of the number of complete clock cycles in the current period and the clock cycle, add it to the delay compensation amount, and obtain the current estimated period of the signal under test. , is represented as: .
[0026] like Figure 2 The diagram shows the calculation principle of the current estimated period; the time interval between two adjacent edges of the signal under test is determined by the coarse measurement part and the delay compensation part completed by the system clock. Let the number of complete system clock cycles spanned between two adjacent edges of the signal under test be... The system clock period is The delay compensation amount is The period of the signal to be measured It can be represented as: Among them, the amount of delay compensation It can be obtained from the difference between the fine time corresponding to the terminating edge and the fine time corresponding to the starting edge, and the expression is: Therefore, it can be seen that the system obtains coarse time through system clock counting. The compensation time is obtained through the TDC fine measurement unit or digital delay control module. Finally, the period of the signal under test is obtained. This embodiment does not rely solely on the system clock for whole-cycle counting, but combines coarse measurement results with delay compensation results to improve the accuracy of edge time interval calculation and provide a foundation for rapid reading of the resonant temperature sensor output signal.
[0027] Specifically, using the TDC delay chain, when the start edge of the signal under test is detected, fine-time measurement of the current period is performed, including: after the signal under test enters the TDC delay chain, it passes through multiple cascaded delay taps, and a corresponding delay state is generated at each delay tap; each delay state is sampled based on the reference sampling clock signal to form hot code data characterizing the propagation position of the signal edge; based on the number-1 method, the hot code data is decoded to obtain the fine-time of the termination edge and the fine-time of the start edge of the current period.
[0028] Specifically, in this embodiment, the TDC delay chain can be composed of a tapped delay chain, a sampling register, and an encoder. After the signal edge enters the tapped delay chain, a corresponding delay state is formed at different delay taps; the sampling register samples the delay chain state under the action of the system clock to form hot code data. Due to the influence of factors such as clock skew, setup and hold time conflicts, and inconsistencies in delay units in actual FPGA delay chains, bubble phenomena may occur in the sampled hot code, that is, local abnormal code values appear between consecutive 0s and 1s. To reduce the interference of bubble on the fine-time decoding results, the encoder in this embodiment uses the count-1 method for encoding, that is, the corresponding fine-time quantization result is obtained by counting the number of valid "1"s in the hot code, rather than relying solely on a single transition position for decoding. In this way, the influence of local bubble on the final measurement result can be reduced, and the stability and robustness of TDC fine-time measurement can be improved.
[0029] S3: Based on the actual arrival time of the starting edge of the current cycle and the sum of the phase prediction errors of the current estimated cycle and the previous cycle, obtain the predicted arrival time of the starting edge of the next cycle.
[0030] S4: In the next cycle, the target delay is obtained based on the difference between the predicted arrival time of the reference sampling clock signal and the start edge of the signal under test.
[0031] S5: Select the target delay tap in the delay chain based on the target delay amount, delay the reference sampling clock signal, and obtain the delay pulse signal of the next cycle.
[0032] Furthermore, in practical implementation, since the delay times of each delay unit in the tapped delay chain may not be completely consistent, the system can pre-calibrate the delay chain to establish a correspondence between the target delay amount and the tap position. During system operation, the control unit selects the tap position closest to the target delay amount based on the calibration results, thereby reducing the impact of delay chain non-uniformity on the delay output result, improving the generation accuracy of the predicted pulse signal A, and enabling it to gradually align with the actual edge of the signal to be measured B.
[0033] Specifically, before selecting the target delay tap in the delay chain based on the target delay amount, this embodiment further includes delay calibration of the delay chain, including: storing the position of each delay tap and the corresponding actual delay time as a delay calibration lookup table based on the actual delay time of the output signal of each delay tap in the delay chain relative to the reference sampling clock signal.
[0034] In this embodiment, during the current cycle, a target delay tap is selected in the delay chain based on the target delay amount, and the reference sampling clock signal is delayed and output to obtain the delayed pulse signal for the next cycle, including: Based on the target delay amount, select the delay tap position that is closest to the target delay amount in the delay calibration lookup table as the target delay tap; The reference sampling clock signal is input into the delay chain, and the delayed signal is taken out from the target delay tap as the delayed pulse signal for the next cycle.
[0035] S6: Obtain the difference between the actual arrival time of the delayed pulse signal and the start edge of the signal under test in the next cycle, and use it as the phase prediction error of the current cycle.
[0036] S7: Based on the phase prediction error of the current cycle, correct the current estimated cycle to obtain the target cycle; based on the target frequency corresponding to the target cycle, obtain the temperature value corresponding to the target frequency in the preset frequency-temperature mapping relationship, and use it as the measurement result of the current cycle.
[0037] Specifically, obtaining the temperature value corresponding to the target frequency includes: Acquiring target period Corresponding target frequency , is represented as: ; Obtain the temperature value corresponding to the target frequency. , is represented as: ; in, This represents a function that represents the preset frequency-temperature mapping relationship.
[0038] Specifically, obtaining the preset frequency temperature mapping function includes: selecting multiple temperature calibration points within the operating temperature range of the resonant temperature sensor; placing the resonant temperature sensor and a standard thermometer in the same constant temperature environment; for each temperature calibration point, recording the standard temperature value and the resonant frequency output by the resonant temperature sensor after the temperature stabilizes; and using the least squares method to fit the preset frequency temperature mapping function based on multiple sets of standard temperature values and resonant frequencies.
[0039] S8: Using the next cycle as the current cycle, return to step S2 to continue measuring the next cycle, thereby achieving real-time monitoring of the ambient temperature to be tested.
[0040] Reference Figure 3 The diagram shown is a structural schematic of a resonant temperature sensor frequency signal measurement system. Based on the above embodiments, in this embodiment of the invention, a resonant temperature sensor frequency signal measurement system is provided, comprising: The time-to-digital converter module is used to obtain the current estimated period of the signal under test, the actual arrival time of the start edge, and the actual arrival time of the start edge of the delayed pulse signal. The phase prediction module is used to obtain the target delay based on the difference between the predicted arrival time of the reference sampling clock signal and the start edge of the signal under test. A digital delay control module is used to generate a delayed pulse signal based on a target delay amount. The phase error calculation unit calculates the phase prediction error of the current period based on the difference between the actual arrival time of the start edge of the signal under test and the delayed pulse signal. The feedback compensation module corrects the current estimated period based on the phase prediction error of the current period to obtain the target period; The measurement result output module, based on the target frequency corresponding to the target period, obtains the temperature value corresponding to the target frequency in a preset frequency-temperature mapping relationship, and uses it as the measurement result for the current period.
[0041] This embodiment utilizes a time-to-digital converter to accurately measure the edges of the sensor's output frequency signal. Combined with digital delay control and phase prediction compensation methods, it achieves rapid reading and error correction of the resonant temperature sensor's frequency signal. Through time measurement, delay control, and feedback compensation, this embodiment dynamically tracks the period and phase changes of the sensor's output signal, thereby improving the real-time performance and stability of the resonant temperature sensor's signal reading.
[0042] Specifically, the time-to-value conversion module includes: The first TDC delay chain takes the signal to be measured output by the resonant temperature sensor in the environment under test as input, and obtains the fine time of the termination edge and the fine time of the start edge of the current period in the signal to be measured. The second TDC delay chain takes the delayed pulse signal as input and obtains the fine time of the termination edge and the fine time of the start edge of the current period in the delayed pulse signal. A coarse counter is used to obtain the number of complete clock cycles of the signal under test in the current period. The period estimation unit calculates the product of the number of complete clock cycles in the current period and the clock period, adds it to the delay compensation amount, and obtains the current estimated period of the signal under test.
[0043] Specifically, such as Figure 4 The diagram shows the structure of a time-to-digital converter (TDC) module used to delay and measure the edge positions of pulse signal A and the signal under test B. This module includes an edge detection unit, a trigger control unit, a coarse counter, two TDC delay chains, a sampling register, an encoder, and a timestamp synthesis unit. The system clock input coarse counter records the number of complete system clock cycles, enabling coarse time measurement. Delayed pulse signal A and the signal under test B enter their respective TDC delay chains. When a valid edge is detected, the trigger control unit initiates a fine measurement process to measure the position of the signal edge within the current system clock cycle.
[0044] Specifically, the digital delay control module includes: The control unit is used to generate tap control selection signals based on the target delay amount; A tap selection unit is used to select a target tap in the tap delay chain based on a tap control selection signal. The tap delay chain takes the reference sampling clock signal as input and uses the target tap to delay the reference sampling clock signal to generate a delayed pulse signal; The delay output unit is used to extract the generated delayed pulse signal.
[0045] like Figure 5 The diagram shows the structure of a digital delay control module, used to generate corresponding delayed pulse signals based on phase prediction results. This module includes a control unit, a tapped delay chain, a tap selection unit, and a delay output unit. After the feedback compensation module outputs the target delay amount, the control unit generates a tap selection control signal based on the target delay amount. The tap selection unit selects the corresponding tap position in the tapped delay chain, causing the input pulse to be output after a specified delay. This output pulse is the delayed pulse signal A used for alignment and comparison with the signal under test (B). The output of the digital delay control module is connected to the TDC_A delay chain in the time-to-digital converter module. TDC_A is used to measure the edge position of the delayed pulse signal A. The signal under test (B) is input to another TDC_B delay chain. By comparing the measurement results of TDC_A and TDC_B, the system can obtain the time error between the predicted pulse and the actual signal under test.
[0046] In this embodiment, during phase prediction, the system predicts the arrival position of the next edge based on the previous actual edge time and the current period estimation result. The digital delay control module generates a delayed pulse signal A according to the prediction result and measures the edge position of the predicted pulse through TDC_A; the actual edge position of the signal to be measured, B, is measured through TDC_B. The phase error calculation unit compares the measurement result of TDC_B with the measurement result of TDC_A to obtain the error between the delayed predicted pulse A and the signal to be measured, B; this error is fed back to the feedback compensation module to correct the subsequent target delay amount, so that the subsequently generated delayed pulse signal A gradually aligns with the actual edge of the signal to be measured, B. Through this closed-loop feedback process, the system can continuously track the periodic signal to be measured within a short observation time.
[0047] Specifically, this embodiment of the invention uses an FPGA to complete timing control, data processing, parameter updates, and measurement result output between various modules. During system operation, the FPGA first measures the edges of the input signal using a time-to-digital converter to obtain the timing information of the current edge. Subsequently, the system estimates the period of the input signal based on the continuous edge measurement results and predicts the arrival position of the next signal edge based on the current phase error. The digital delay control module outputs a corresponding delay signal based on the prediction result to control the predicted phase. When the next actual edge arrives, the time-to-digital converter measures the actual edge position again and compares it with the predicted edge position to obtain the phase error. This error is fed back to the feedback compensation module to correct subsequent prediction results, thus forming a closed-loop measurement process of "edge measurement—phase prediction—delay control—error feedback".
[0048] The time-to-digital conversion module in this embodiment uses an internal carry chain within the FPGA to form a tapped delay chain, and combines coarse counting and fine quantization to measure edge time. Coarse counting records the number of complete clock cycles, while fine quantization obtains the position of the signal edge within a single clock cycle. The digital delay control module uses internal delay resources or a delay chain structure within the FPGA, selecting the corresponding delay unit based on the phase prediction result to generate a controllable delay output. To reduce the impact of delay unit non-uniformity, the system establishes a correspondence between the control quantity and the actual delay time through delay calibration and lookup tables. Compared with existing frequency counting methods, multi-cycle averaging methods, or phase-locked loop measurement methods, this invention does not simply rely on a long observation window to obtain frequency results. Instead, it uses the measured edge time information to predict subsequent edges and corrects the prediction results through feedback based on actual measurement errors. This method can obtain the period and phase change information of the input periodic signal within a shorter observation time, thereby improving the slow response problem of traditional measurement methods.
[0049] This invention predicts the position of the next signal edge by estimating the period and recursively extrapolating the phase of the measured signal edge, reducing reliance on long-term frequency counting or multi-period averaging, thereby improving the signal readout speed of a resonant temperature sensor. This invention combines a time-to-digital conversion module and a digital delay control module; the former measures the actual edge position, while the latter generates a predicted delay signal, forming a measurement and control closed loop. This invention utilizes the error between the actual and predicted edge positions to dynamically correct subsequent prediction results, reducing the impact of period estimation errors, quantization errors, and edge jitter on the measurement results. This invention uses an FPGA as the core control and processing unit, enabling time measurement, delay control, phase prediction, and error compensation within the same hardware platform, facilitating parameter adjustment, system debugging, and subsequent functional expansion. Furthermore, addressing the issue of uneven delay units within the FPGA, this invention establishes a lookup table through delay calibration, improving system stability.
[0050] Based on the above embodiments, this invention uses the periodic signal output by a resonant temperature sensor as the measurement object to perform rapid measurement of the resonant temperature sensor based on phase prediction. An external resonant temperature sensor generates a periodic signal that varies with temperature. When this periodic signal is input into the system as the periodic signal to be measured, it is first input to the time-to-digital converter (TDC) module. The TDC module internally sets up two TDC delay chains, which are used to measure the edge positions of the delayed pulse signal A generated by the digital delay control module and the signal to be measured B, respectively. The delayed pulse signal A can be understood as the predicted pulse generated by the system based on the phase prediction result, and the signal to be measured B is the actual periodic signal output by the resonant temperature sensor. The two TDC delay chains perform fine-time measurements on the pulse signal A and the signal to be measured B, respectively. The difference between the two measurement results is the error between the current predicted pulse and the actual signal to be measured. This error is fed back as a compensation error to the phase error calculation unit and the feedback compensation module to correct the next prediction result. Simultaneously, the period of the signal to be measured is estimated based on the continuous edge timestamps, and the period estimation result is sent to the phase prediction and feedback compensation module. The phase prediction and feedback compensation module predicts the arrival position of the next edge of the signal under test based on the current period estimation result and the prediction error of the previous round, and generates a corresponding target delay. The digital delay control module generates a delay pulse, i.e., delay pulse signal A, based on this target delay and sends this pulse signal to the TDC_A delay chain in the time-to-digital converter module for comparison with the measurement result of the signal under test B. Subsequently, the phase error calculation unit obtains the phase prediction error based on the measurement difference between TDC_A and TDC_B, and feeds this error back to the feedback compensation module for prediction correction in the next round. Thus, the system forms a closed-loop measurement process of edge measurement, period estimation, phase prediction, delay control, error comparison, and feedback compensation.
[0051] like Figure 6 The diagram shows the host computer software interface and measurement results of the FPGA-based resonant temperature sensor frequency signal measurement system of this invention, used to verify the high accuracy and stability of the measurement system. The reference signal frequency was set to 10.555555 MHz during the test. Figure 6 The upper left corner prominently displays the current real-time measurement frequency of the system at 10.555575 MHz. The line graph of "Real-time Frequency" in the middle of the image shows the dynamic measurement results of the system during continuous sampling. It can be seen that the measured value fluctuates only slightly around 10.555575 MHz, without any significant shift, indicating excellent measurement stability. The right side of the interface provides detailed statistical analysis data: after 232 samples, the system's mean value is 10.555575 MHz, the standard deviation is only 0.497 Hz, the peak-to-peak value is as low as 2.623 Hz, and the relative PPM deviation remains around +1.892. Meanwhile, Figure 6 The histogram below visually illustrates the data distribution of the measurement frequencies. The results are highly concentrated around the mean and exhibit typical normal distribution characteristics. These rich data indicators fully demonstrate that the frequency measurement system of this invention can not only achieve rapid reading of high-frequency periodic signals, but also possesses extremely high measurement accuracy and noise interference resistance.
[0052] In summary, this embodiment generates a predicted pulse signal A through a digital delay control module, measures the edge positions of the predicted pulse signal A and the measured signal B through two TDC delay chains, and uses the difference between them as the phase prediction error to feed back to the phase prediction and feedback compensation module. Compared with traditional frequency counting methods or multi-cycle averaging methods, this invention reduces the dependence on long observation windows and can obtain the period and phase change information of the measured signal within a shorter measurement time, thereby realizing rapid reading of the output signal of the resonant temperature sensor.
[0053] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0054] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0055] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0056] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0057] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method of measuring a frequency signal of a resonant temperature sensor, characterized by, include: S1: The periodic signal generated in real time by the resonant temperature sensor based on the temperature in the environment to be detected is used as the signal to be measured; S2: In the current period, based on the start edge and end edge of the signal under test, obtain the current estimated period of the signal under test; S3: Based on the actual arrival time of the starting edge of the current cycle and the sum of the phase prediction errors of the current estimated cycle and the previous cycle, obtain the predicted arrival time of the starting edge of the next cycle. S4: In the next cycle, the target delay is obtained based on the difference between the predicted arrival time of the reference sampling clock signal and the start edge of the signal under test. S5: Select the target delay tap in the delay chain based on the target delay amount, delay the reference sampling clock signal, and obtain the delay pulse signal of the next cycle; S6: Obtain the difference between the actual arrival time of the delayed pulse signal and the start edge of the signal under test in the next cycle, and use it as the phase prediction error of the current cycle; S7: Based on the phase prediction error of the current cycle, correct the current estimated cycle to obtain the target cycle; based on the target frequency corresponding to the target cycle, obtain the temperature value corresponding to the target frequency in the preset frequency-temperature mapping relationship, and use it as the measurement result of the current cycle; S8: Using the next cycle as the current cycle, return to step S2 to continue measuring the next cycle, thereby achieving real-time monitoring of the ambient temperature to be tested.
2. The resonant temperature sensor frequency signal measurement method of claim 1, wherein, In the current period, based on the start and end edges of the signal under test, the current estimated period of the signal under test is obtained, including: Clock period based on reference sampling clock signal Obtain the number of complete clock cycles of the signal under test in the current period. ; Using a TDC delay chain, when the start edge of the signal under test is detected, a fine-time measurement of the current period is performed, and the fine-time of the end edge of the current period is calculated. With the starting edge fine time The difference is used to obtain the delay compensation amount. , represented as ; Calculate the product of the number of complete clock cycles in the current period and the clock period, add it to the delay compensation amount, and obtain the current estimated period of the signal under test. , is represented as: .
3. The method for measuring the frequency signal of a resonant temperature sensor according to claim 1, characterized in that, Using a TDC delay chain, fine-time measurements of the current period are performed upon detection of the start edge of the signal under test, including: After the signal under test enters the TDC delay chain, it passes through multiple series-connected delay taps, and a corresponding delay state is generated at each delay tap. Each delayed state is sampled based on the reference sampling clock signal to form hot code data characterizing the propagation position of the signal edge; Based on the number 1 method, the hot code data is decoded to obtain the fine time of the termination edge and the fine time of the start edge of the current cycle.
4. The method for measuring the frequency signal of a resonant temperature sensor according to claim 1, characterized in that, Before selecting the target delay tap in the delay chain based on the target delay amount, the delay chain is further calibrated, including: storing the position of each delay tap and its corresponding actual delay time as a delay calibration lookup table based on the actual delay time of the output signal of each delay tap in the delay chain relative to the reference sampling clock signal.
5. The method for measuring the frequency signal of a resonant temperature sensor according to claim 4, characterized in that, In the current cycle, based on the target delay amount, a target delay tap is selected in the delay chain to delay the reference sampling clock signal and obtain the delayed pulse signal for the next cycle, including: Based on the target delay amount, select the delay tap position that is closest to the target delay amount in the delay calibration lookup table as the target delay tap; The reference sampling clock signal is input into the delay chain, and the delayed signal is taken out from the target delay tap as the delayed pulse signal for the next cycle.
6. The method for measuring the frequency signal of a resonant temperature sensor according to claim 1, characterized in that, Based on the target frequency corresponding to the target period, and within a preset frequency-temperature mapping relationship, the temperature value corresponding to the target frequency is obtained as the measurement result for the current period, including: Acquiring target period Corresponding target frequency , is represented as: ; Obtain the temperature value corresponding to the target frequency. , is represented as: ; in, This represents a function that indicates a preset frequency-temperature mapping relationship.
7. The method for measuring the frequency signal of a resonant temperature sensor according to claim 1, characterized in that, The acquisition of the preset frequency temperature mapping function includes: selecting multiple temperature calibration points within the operating temperature range of the resonant temperature sensor; placing the resonant temperature sensor and a standard thermometer in the same constant temperature environment; for each temperature calibration point, after the temperature stabilizes, recording the standard temperature value and the resonant frequency output by the resonant temperature sensor; and using the least squares method to fit the preset frequency temperature mapping function based on multiple sets of standard temperature values and resonant frequencies.
8. A measurement system based on the frequency signal measurement method of a resonant temperature sensor as described in any one of claims 1 to 7, characterized in that, include: The time-to-digital converter module is used to obtain the current estimated period of the signal under test, the actual arrival time of the start edge, and the actual arrival time of the start edge of the delayed pulse signal. The phase prediction module is used to obtain the target delay based on the difference between the predicted arrival time of the reference sampling clock signal and the start edge of the signal under test. A digital delay control module is used to generate a delayed pulse signal based on a target delay amount. The phase error calculation unit calculates the phase prediction error of the current period based on the difference between the actual arrival time of the start edge of the signal under test and the delayed pulse signal. The feedback compensation module corrects the current estimated period based on the phase prediction error of the current period to obtain the target period; The measurement result output module, based on the target frequency corresponding to the target period, obtains the temperature value corresponding to the target frequency in a preset frequency-temperature mapping relationship, and uses it as the measurement result for the current period.
9. The measurement system according to claim 8, characterized in that, The time-to-digital conversion module includes: The first TDC delay chain takes the signal to be measured output by the resonant temperature sensor in the environment under test as input, and obtains the fine time of the termination edge and the fine time of the start edge of the current period in the signal to be measured. The second TDC delay chain takes the delayed pulse signal as input and obtains the fine time of the termination edge and the fine time of the start edge of the current period in the delayed pulse signal. A coarse counter is used to obtain the number of complete clock cycles of the signal under test in the current period. The period estimation unit calculates the product of the number of complete clock cycles in the current period and the clock period, adds it to the delay compensation amount, and obtains the current estimated period of the signal under test.
10. The measurement system according to claim 8, characterized in that, The digital delay control module includes: The control unit is used to generate tap control selection signals based on the target delay amount; A tap selection unit is used to select a target tap in the tap delay chain based on a tap control selection signal. The tap delay chain takes the reference sampling clock signal as input and uses the target tap to delay the reference sampling clock signal to generate a delayed pulse signal; The delay output unit is used to extract the generated delayed pulse signal.