Method and apparatus for measuring time
By sampling in parallel within the echo measurement channel and the reference clock measurement channel, and calibrating the reference clock and echo pulse signals in real time, the limitations of measurement speed and accuracy in existing technologies are solved, achieving more efficient time measurement and calibration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU RUIMENG TECH
- Filing Date
- 2025-10-16
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, the reference clock measurement in the time measurement circuit of lidar and laser ranging is performed after the echo measurement is completed, which limits the measurement speed and weakens the real-time correlation, thus affecting the calibration accuracy.
Parallel sampling is performed in the echo measurement channel and the reference clock measurement channel. By sampling in parallel within the same time measurement window, the calibration value of the reference clock is determined in real time and the echo pulse signal is calibrated.
It improves the measurement speed of the time measurement circuit and the calibration accuracy of the echo pulse signal, enhances the real-time correlation between measurement channels, and expands the measurement range without increasing calibration time.
Smart Images

Figure CN122506791A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of laser ranging technology, and in particular to a measurement method and apparatus for a time measurement circuit. Background Technology
[0002] Currently, in the application fields of lidar and laser ranging, time-to-digital converters (TDCs) are commonly used for measurement, such as... Figure 1 As shown, echo measurement and reference clock measurement share a single measurement channel, which is time-division multiplexed. After system reset, the echo measurement window is opened, and the delay chain is started by the START pulse signal to sample the echo pulses on the STOP channel one by one. When the expected number of echo pulses is reached, the sampling process ends, and the delay chain and measurement window are closed. Then, after two rising edges of the reference clock, the reference clock measurement window is opened, and the delay chain is started again by the first falling edge of the reference clock within the window. The first and second rising edges of the subsequent reference clock are sampled to obtain two measurement values, cal1 and cal2 (cal2 minus cal1 gives the calibration value of the reference clock). Finally, the delay chain and measurement window are closed at the falling edge of the current reference clock cycle. This completes the entire process of echo measurement and reference clock measurement.
[0003] In existing solutions, because the reference clock measurement is performed after the echo measurement is completed, the time to obtain the reference clock calibration value is relatively late, which limits the measurement speed to some extent. Furthermore, the echo measurement and reference clock measurement are not performed within the same time window, resulting in weak real-time correlation between them. Since the delay chain is significantly affected by power supply voltage and temperature, if the calibration value of the reference clock is used to calibrate the measured echo pulse value, the obtained echo pulse calibration value will also be inaccurate. Summary of the Invention
[0004] In view of this, the present invention provides a measurement method and apparatus for a time measurement circuit, which effectively improves the measurement accuracy and measurement speed of the time measurement circuit.
[0005] The first aspect of the present invention provides a measurement method for a time measurement circuit, comprising:
[0006] After the system is reset, the delay chain is started by the start pulse signal, and the time measurement window is opened simultaneously.
[0007] Within the time measurement window, echo pulse signals are sampled through the echo measurement channel and reference clock signals are sampled through the reference clock measurement channel; wherein, the echo measurement channel and the reference clock measurement channel sample in parallel within the time measurement window;
[0008] The last sampling point of the reference clock is determined based on the reference clock cycle in which the last echo pulse signal is located;
[0009] The calibration value of the reference clock is determined based on the measurement value of the last sampling point and the measurement value of the first sampling point.
[0010] The measured value of the echo pulse signal is calibrated based on the calibration value of the reference clock to obtain the calibration value of the echo pulse signal.
[0011] Optionally, determining the last sampling point of the reference clock based on the reference clock period in which the last echo pulse signal is located includes:
[0012] Determine whether the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles;
[0013] If it is determined that the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles, the time measurement window is maintained until the falling edge of the third reference clock cycle, and the rising edge of the third reference clock cycle is taken as the last sampling point of the reference clock.
[0014] If it is determined that the time difference between the last echo pulse signal and the start pulse signal is not less than two reference clock cycles, the rising edge of the reference clock cycle in which the last echo pulse signal is located is taken as the last sampling point of the reference clock.
[0015] Optionally, after taking the rising edge of the reference clock cycle in which the last echo pulse signal occurs as the last sampling point of the reference clock, the method further includes:
[0016] The time measurement window is maintained until the falling edge of the reference clock cycle corresponding to the last echo pulse signal.
[0017] Optionally, determining the calibration value of the reference clock based on the measured value of the last sampling point and the measured value of the first sampling point of the reference clock includes:
[0018] The quotient of the measurement difference and the number of cycles of the reference clock is used as the calibration value of the reference clock; wherein, the measurement difference is the difference between the measurement value of the last sampling point and the measurement value of the first sampling point; and the minimum number of cycles of the reference clock is 2.
[0019] Optionally, calibrating the measured value of the echo pulse signal based on the calibration value of the reference clock to obtain the calibration value of the echo pulse signal includes:
[0020] The quotient of the measured value of the echo pulse signal and the calibration value of the reference clock is used as the calibration value of the echo pulse signal.
[0021] Optionally, the time difference between the last echo pulse signal and the start pulse signal must meet the measurement range limit and time positioning accuracy; wherein, the measurement range limit is set by a register, and the time positioning accuracy is set according to the minimum resolvable time unit.
[0022] Optionally, after calibrating the measured value of the echo pulse signal based on the calibration value of the reference clock to obtain the calibration value of the echo pulse signal, the method further includes:
[0023] The calibration value of the echo pulse signal is stored in a memory; wherein the memory stores the calibration values of the echo pulse signals of multiple echo measurement channels alternately.
[0024] Optionally, the measurement method of the time measurement circuit further includes:
[0025] Receive echo pulse signal read request.
[0026] The echo pulse signal reading request includes the starting address of the target echo measurement channel.
[0027] The calibration value of the echo pulse signal of each target echo measurement channel is read in ascending order of the first address of the target echo measurement channel.
[0028] A second aspect of the present invention provides a measuring device for a time measuring circuit, comprising:
[0029] The startup unit is used to start the delay chain by the start pulse signal after the system is reset, and to simultaneously open the time measurement window.
[0030] A sampling unit is configured to sample an echo pulse signal through an echo measurement channel and a reference clock signal through a reference clock measurement channel within the time measurement window; wherein the echo measurement channel and the reference clock measurement channel sample in parallel within the time measurement window;
[0031] The sampling point determination unit is used to determine the last sampling point of the reference clock based on the reference clock period in which the last echo pulse signal is located.
[0032] The first calibration unit is used to determine the calibration value of the reference clock based on the measured value of the last sampling point and the measured value of the first sampling point of the reference clock.
[0033] The second calibration unit is used to calibrate the measured value of the echo pulse signal based on the calibration value of the reference clock, so as to obtain the calibration value of the echo pulse signal.
[0034] Optionally, the sampling point determination unit includes:
[0035] The judgment unit is used to determine whether the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles.
[0036] The sampling point determination subunit is used to maintain the time measurement window until the falling edge of the third reference clock cycle if it is determined that the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles, and take the rising edge of the third reference clock cycle as the last sampling point of the reference clock.
[0037] The sampling point determination subunit is further configured to, if it is determined that the time difference between the last echo pulse signal and the start pulse signal is not less than two reference clock cycles, take the rising edge of the reference clock cycle in which the last echo pulse signal is located as the last sampling point of the reference clock.
[0038] Optionally, the measuring device of the time measuring circuit further includes:
[0039] A time measurement window control unit is used to maintain the time measurement window until the falling edge of the reference clock cycle corresponding to the last echo pulse signal.
[0040] Optionally, the first calibration unit includes:
[0041] The first calculation unit is used to take the quotient of the measurement difference and the number of cycles of the reference clock as the calibration value of the reference clock; wherein the measurement difference is the difference between the measurement value of the last sampling point and the measurement value of the first sampling point; and the minimum number of cycles of the reference clock is 2.
[0042] Optionally, the second calibration unit includes:
[0043] The second calculation unit is used to take the quotient of the measured value of the echo pulse signal and the calibration value of the reference clock as the calibration value of the echo pulse signal.
[0044] Optionally, the time difference between the last echo pulse signal and the start pulse signal must meet the measurement range limit and time positioning accuracy; wherein, the measurement range limit is set by a register, and the time positioning accuracy is set according to the minimum resolvable time unit.
[0045] Optionally, the measuring device of the time measuring circuit further includes:
[0046] A storage unit is used to store the calibration value of the echo pulse signal into a memory; wherein the memory stores the calibration values of the echo pulse signals of multiple echo measurement channels alternately.
[0047] Optionally, the measuring device of the time measuring circuit further includes:
[0048] A receiving unit is configured to receive an echo pulse signal readout request; wherein the echo pulse signal readout request includes the starting address of the target echo measurement channel;
[0049] The reading unit is used to read the calibration value of the echo pulse signal of each target echo measurement channel in ascending order of the first address of the target echo measurement channel.
[0050] As can be seen from the above scheme, the present invention provides a measurement method and apparatus for a time measurement circuit. By designing a separate reference clock measurement channel in addition to the echo measurement channel, the echo measurement channel and the reference clock measurement channel are sampled in parallel within the same time measurement window. Compared with the prior art, where the reference clock measurement is performed after the echo measurement ends, the parallel sampling method of the echo measurement channel and the reference clock measurement channel effectively improves the measurement speed of the time measurement circuit. Furthermore, by sampling the echo measurement channel and the reference clock measurement channel in parallel within the same time measurement window, the present invention also effectively enhances the real-time correlation between the two measurement channels, thereby improving the accuracy of the calibration value of the echo pulse signal. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0052] Figure 1 This is a timing diagram of a measurement method using a time measurement circuit in the prior art.
[0053] Figure 2 A detailed flowchart of a measurement method for a time measurement circuit provided in an embodiment of the present invention;
[0054] Figure 3 A timing diagram of a measurement method for a time measurement circuit provided in another embodiment of the present invention;
[0055] Figure 4 A schematic diagram illustrating the limitation of the measurement range in a calibration mode, as provided in another embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram of a time measurement circuit according to another embodiment of the present invention. Detailed Implementation
[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0059] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0060] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0061] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0062] This invention provides a measurement method for a time measurement circuit, such as... Figure 2 As shown, the specific steps include:
[0063] S201. After the system is reset, the delay chain is started by the start pulse signal, and the time measurement window is opened simultaneously.
[0064] like Figure 3 The diagram shown is a timing diagram of a measurement method for a time measurement circuit provided in an embodiment of the present invention. sys_rstn is the system reset signal, START is the start pulse signal, STOP is the echo measurement channel sampling echo pulse signal, and clk_ref is the reference clock measurement channel sampling reference clock signal.
[0065] Specifically, after the system is reset, the delay chain is started by the start pulse signal, and the time measurement window is opened simultaneously. The echo measurement channel and the reference clock measurement channel start working at the same time, and they sample the echo pulse signal and the reference clock signal respectively.
[0066] S202. Within the time measurement window, sample the echo pulse signal through the echo measurement channel and sample the reference clock signal through the reference clock measurement channel.
[0067] The echo measurement channel and the reference clock measurement channel are sampled in parallel within the time measurement window.
[0068] Currently, in existing technologies, the reference clock measurement is performed after the echo measurement is completed, such as... Figure 1 As shown, the time for obtaining the reference clock calibration value is relatively late, which limits the measurement speed to some extent. That is, in the existing time measurement circuit calibration mode, calibration is only initiated after the actual number of received echoes equals the set number of echoes, and then the result is calculated. If the number of echoes is less than the set number, the measurement result will be set as invalid even if echoes were received. This is difficult to apply in scenarios with multiple echoes and an uncertain number of echoes. This invention, because it uses a parallel sampling method, does not need to wait for all configured echoes to be received before initiating calibration. Instead, calibration begins simultaneously with the measurement, ensuring that the measured value remains valid even when the actual number of echoes is less than the set number of echoes.
[0069] S203. Determine the last sampling point of the reference clock based on the reference clock period in which the last echo pulse signal is located.
[0070] The first sampling point of the reference clock is the rising edge of the second reference clock cycle.
[0071] In the practical application of this invention, the reference clock period of the last echo pulse signal can be determined by the time difference between the last echo pulse signal and the start pulse signal, but this is not limited here.
[0072] Understandably, if the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles, meaning there is no complete second reference clock cycle, the rising edge position of the third reference clock cannot be determined. Therefore, the measurement value of the second sampling point cannot be obtained. Consequently, step S204 in this invention cannot be executed.
[0073] Therefore, in another embodiment of the present invention, if the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles, the duration measurement window is maintained until the falling edge of the third reference clock cycle, and the rising edge of the third reference clock cycle is taken as the last sampling point of the reference clock. If the time difference between the last echo pulse signal and the start pulse signal is not less than two reference clock cycles, the rising edge of the reference clock cycle in which the last echo pulse signal is located is taken as the last sampling point of the reference clock.
[0074] Optionally, in another embodiment of the present invention, after taking the rising edge of the reference clock cycle in which the last echo pulse signal is located as the last sampling point of the reference clock, the time measurement window is maintained until the falling edge of the reference clock cycle corresponding to the last echo pulse signal.
[0075] S204. Determine the calibration value of the reference clock based on the measured value of the last sampling point and the measured value of the first sampling point.
[0076] In the practical application of this invention, the quotient of the measurement difference and the number of cycles of the reference clock can be used as the calibration value of the reference clock, but this is not limited to the following:
[0077] The measurement difference is the difference between the measurement value of the last sampling point and the measurement value of the first sampling point; the minimum number of reference clock cycles is 2.
[0078] like Figure 3 As shown, if the last echo pulse signal (i.e. Figure 3 If the time difference between the stop_last signal and the START pulse signal is within two reference clock cycles, the time measurement window is maintained until the falling edge of the third reference clock. At this time, the reference clock measurement channel only acquires two measurement values (i.e., ...). Figure 3 In the case of cal1 and cal2), the calibration value of the reference clock is cal2-cal1. If the time difference between the last echo pulse signal and the START pulse signal is more than 2 reference clock cycles, the time measurement window is maintained until the falling edge of the reference clock cycle corresponding to the last echo pulse signal. At this time, the reference clock measurement channel will collect 3 or more measurement values. Assuming that N measurement values are actually collected, the difference between the last measurement value caln and the first measurement value cal1 of the reference clock measurement channel is taken as the target measurement value, that is, the target measurement value = (caln-cal1), and the number of difference terms is N-1. At this time, the calibration value of the reference clock is (caln-cal1) / (N-1). The core idea is to calculate the average of the differences between the two measurement values. By taking the average value, the measurement error can be reduced, thereby improving the accuracy of the reference clock calibration value.
[0079] Assuming the N measured values are cal1, cal2, ..., caln, the average value of the reference clock calibration value is: [(cal2-cal1)+(cal3-cal2)+(cal4-cal3)+...+(caln-cal(n-1))] / (N-1). Simplifying this formula, we get (caln-cal1) / (N-1), which is the calibration value of the reference clock in this invention.
[0080] Furthermore, existing technologies only have two measurement values (such as...). Figure 1 As shown, only one calibration value (cal2-cal1) of the reference clock can be obtained. Due to the existence of measurement error, the measurement accuracy is limited by only one calibration value of the reference clock. The present invention uses parallel sampling through the echo measurement channel and the reference clock measurement channel within a time measurement window, so that the reference clock measurement channel can obtain more measurement values. By averaging, a higher accuracy calibration value of the reference clock can be obtained compared with the prior art.
[0081] S205. The measured value of the echo pulse signal is calibrated based on the calibration value of the reference clock to obtain the calibration value of the echo pulse signal.
[0082] In the prior art, the calibration value of the echo pulse signal = the measured value of the echo pulse signal / the calibration value of the reference clock.
[0083] Continuing with the above examples, the method of the present invention for calculating the calibration value of the reference clock can effectively improve the accuracy of the calibration value of the reference clock.
[0084] Therefore, it is understood that when the calibration value of the reference clock of the present invention is more accurate than the calibration value of the reference clock in the prior art, if the calibration value of the reference clock of the present invention is used to calibrate the measured value of the echo pulse, the accuracy of the calibration value of the echo pulse signal obtained will also be significantly improved compared with the calibration value of the echo pulse signal obtained in the prior art.
[0085] In the calibration mode using time measurement circuits in existing technology, such as Figure 4 As shown, the measurement range is usually limited to 2*Tref, meaning the time difference between the last echo pulse signal and the start pulse signal must be within 2*Tref. Figure 4 In the diagram, T0 is the START start pulse signal, T1 is the echo leading edge time, T2 is at 2*Tref, T3 is the echo trailing edge time, T4 is the overflow time location, and T5 is the 2*Tref after frequency reduction.
[0086] However, when measuring distant targets or close-range strong targets, the falling edge of the pulse will exceed 2*Tref due to pulse expansion. According to the current practice, the measurement range is limited to 2*Tref. The only way to extend the measurement range is to reduce the reference frequency. In this way, although the falling edge can be measured, the calibration time is also delayed by 2 times, resulting in a 2-fold increase in measurement time.
[0087] Therefore, this invention expands the measurement range limit to a maximum of 32*Tref in calibration mode, eliminating the need to reduce the reference frequency and extending the measurement range. However, this results in an additional redundant time between 2*Tref and 32*Tref. At this point, the overflow time range can be precisely located using time positioning accuracy based on the actual measurement range (the time difference between the last echo pulse signal and the start pulse signal, T3-T0), thus further limiting the measurement range through time positioning accuracy.
[0088] The measurement range limit is set by the register, the time positioning accuracy is set according to the minimum resolvable time unit, the measurement range limit can be expanded to a maximum of 32*Tref, and the minimum resolvable time unit (Least Significant Bit, LSB) can be, but is not limited to, 10ns, which is not limited here.
[0089] In practical applications of this invention, by simultaneously amplifying the measured value of the echo pulse signal and the calibration value of the reference clock by 16 times, the measurement range can be expanded from 2Tref to 32*Tref. This satisfies the measurement range requirements without significantly increasing the measurement time due to doubling the calibration time.
[0090] Currently, the most common applications of lidar are single-echo and dual-echo scenarios. The memory arrangement in existing technologies is shown in Table 1 (Stopx_y represents the x-th channel, and y represents the y-th echo result of channel x). Even in the single-echo case, at least two address transmissions are required to read the value from the result register. Furthermore, the more channels there are, the more addresses need to be transmitted.
[0091] Table 1
[0092] BX Stop1_1 Stop1_2 Stop1_3 Stop1_4 Stop1_5 Stop1_6 Stop1_7 Stop1_8 Stop1_9 Stop1_10 s CX Stop2_1 Stop2_2 [[ID=
[0093] When dealing with multi-channel time measurement circuits, taking an 8-channel time measurement circuit as an example, if the same layout is used, the memory arrangement is as shown in Table 2:
[0094] Table 2
[0095]
[0096] It can be seen that even with a single echo, more than 8 address transmissions are required to read 8 result registers. Therefore, to achieve incremental continuous reading and improve data reading speed, this invention designs the memory storage method: the calibration values of echo pulse signals from multiple echo measurement channels are stored alternately, as shown in Table 3. After storing stop1_1 (the calibration value of the first echo pulse signal of echo measurement channel 1), stop2_1 (the calibration value of the first echo pulse signal of echo measurement channel 2) is directly stored, until the calibration value of the first echo pulse signal of the last echo measurement channel, stopx_1, is stored. Table 3 is based on... Taking 8 echo measurement channels as an example, the calibration value of the first echo pulse signal of the last echo measurement channel is stop8_1. After storing stop8_1, there are no more calibration values of the first echo pulse signal of the echo measurement channel to be stored. Therefore, the calibration value of the second echo pulse signal is stored starting from echo measurement channel 1, that is, stop1_2 to stop8_2, and so on, until the calibration value of the y-th echo pulse signal of echo measurement channel 8 is stored. Table 3 uses the maximum value of y as an example of 8, that is, the calibration value of the y-th echo pulse signal of the last echo measurement channel 8 is stop8_8.
[0097] Table 3
[0098] Stop2_5 Stop3_5 Stop4_5 Stop5_5 Stop6_5 Stop7_5 Stop8_5 Stop1_6 Stop2_6 Stop3_6 Stop4_6 Stop5_6 Stop6_6 Stop7_6 Stop8_6 EX Stop1_7 Stop2_7 Stop3_7 Stop4_7 Stop5_7 Stop6_7 Stop7_7 Stop8_7 Stop1_8 Stop2_8 Stop3_8 Stop4_8 Stop5_8 Stop6_8 Stop7_8 Stop8_8 FX Stop1_9 Stop2_9 Stop3_9 Stop4_9 Stop5_9 Stop6_9 Stop7_9 Stop8_9 Stop1_10 Stop2_10 Stop3_10 Stop4_10 Stop5_10 Stop6_10 Stop7_10 Stop8_10
[0099] According to the storage method of the present invention, when using a large number of single-echo or dual-echo configurations in lidar applications, it is only necessary to read the calibration value of the echo pulse signal of each target echo measurement channel in ascending order of the first address of the target echo measurement channel after receiving the first address of the target echo measurement channel. This saves the time spent reading data and effectively increases the measurement frequency.
[0100] Taking Table 3 as an example, by alternately reading the measurement results (calibration values of echo pulse signals) from stop1 to stop8, this invention can simultaneously obtain the first measurement result of 8 channels at the fastest speed, namely stop1_1, stop2_1, stop3_1, stop4_1, stop5_1, stop6_1, stop7_1, and stop8_1. Unlike existing technologies, which require reading the first to eighth measurement results of stop1 channel before reading the first to eighth measurement results of stop2 channel, and so on, it is not necessary to obtain the first measurement result of stop3 channel. It can be seen that to obtain the first measurement result of stop3 channel, a total of 16 measurement results from stop1 and stop2 need to be obtained. However, with the storage method of this invention, when reading, to obtain the first measurement result of stop3 channel, only stop1_1 and stop2_1 need to be obtained first.
[0101] As can be seen from the above scheme, the present invention provides a measurement method for a time measurement circuit. By designing a separate reference clock measurement channel in addition to the echo measurement channel, the echo measurement channel and the reference clock measurement channel are sampled in parallel within the same time measurement window. Compared with the prior art, where the reference clock measurement is performed after the echo measurement ends, the parallel sampling method of the echo measurement channel and the reference clock measurement channel effectively improves the measurement speed of the time measurement circuit. Furthermore, by sampling the echo measurement channel and the reference clock measurement channel in parallel within the same time measurement window, the present invention also effectively enhances the real-time correlation between the two measurement channels, thereby improving the accuracy of the calibration value of the echo pulse signal.
[0102] Another embodiment of the present invention provides a measuring device for a time measuring circuit, such as... Figure 5 As shown, it specifically includes:
[0103] The startup unit 501 is used to start the delay chain by the start pulse signal after the system is reset, and to simultaneously open the time measurement window.
[0104] The sampling unit 502 is used to sample the echo pulse signal through the echo measurement channel and the reference clock signal through the reference clock measurement channel within the time measurement window.
[0105] The echo measurement channel and the reference clock measurement channel are sampled in parallel within the time measurement window.
[0106] The sampling point determination unit 503 is used to determine the last sampling point of the reference clock based on the reference clock period in which the last echo pulse signal is located.
[0107] Optionally, in another embodiment of the present invention, one implementation of the sampling point determination unit 503 includes:
[0108] The judgment unit is used to determine whether the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles.
[0109] Optionally, in another embodiment of the present invention, the time difference between the last echo pulse signal and the start pulse signal needs to meet the measurement range limit and time positioning accuracy; wherein, the measurement range limit is set by a register, and the time positioning accuracy is set according to the minimum resolvable time unit.
[0110] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0111] The sampling point determination subunit is used to maintain the time measurement window until the falling edge of the third reference clock cycle if it is determined that the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles, and then take the rising edge of the third reference clock cycle as the last sampling point of the reference clock.
[0112] The sampling point determination subunit is also used to determine the last sampling point of the reference clock if it is determined that the time difference between the last echo pulse signal and the start pulse signal is not less than two reference clock cycles.
[0113] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0114] Optionally, in another embodiment of the present invention, one implementation of the measuring device for the time measuring circuit includes:
[0115] The time measurement window control unit is used to maintain the time measurement window until the falling edge of the reference clock cycle corresponding to the last echo pulse signal.
[0116] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0117] The first calibration unit 504 is used to determine the calibration value of the reference clock based on the measured value of the last sampling point and the measured value of the first sampling point of the reference clock.
[0118] Optionally, in another embodiment of the present invention, one implementation of the first calibration unit 504 includes:
[0119] The first calculation unit is used to take the quotient of the measurement difference and the number of cycles of the reference clock as the calibration value of the reference clock.
[0120] The measurement difference is the difference between the measurement value of the last sampling point and the measurement value of the first sampling point; the minimum number of reference clock cycles is 2.
[0121] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0122] The second calibration unit 505 is used to calibrate the measured value of the echo pulse signal based on the calibration value of the reference clock, so as to obtain the calibration value of the echo pulse signal.
[0123] For details on the specific operation of the units disclosed in the above embodiments of the present invention, please refer to the corresponding method embodiments, such as... Figure 2 As shown, it will not be elaborated further here.
[0124] Optionally, in another embodiment of the present invention, one implementation of the second calibration unit 505 includes:
[0125] The second calculation unit is used to take the quotient of the measured value of the echo pulse signal and the calibration value of the reference clock as the calibration value of the echo pulse signal.
[0126] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0127] Optionally, in another embodiment of the present invention, one implementation of the measuring device for the time measuring circuit includes:
[0128] The storage unit is used to store the calibration value of the echo pulse signal into the memory.
[0129] The memory uses a method of alternatingly storing the calibration values of echo pulse signals from multiple echo measurement channels.
[0130] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0131] Optionally, in another embodiment of the present invention, one implementation of the measuring device for the time measuring circuit includes:
[0132] The receiving unit is used to receive echo pulse signal readout requests.
[0133] The echo pulse signal readout request includes the starting address of the target echo measurement channel.
[0134] The reading unit is used to read the calibration value of the echo pulse signal of each target echo measurement channel in ascending order of the first address of the target echo measurement channel.
[0135] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0136] As can be seen from the above scheme, the present invention provides a measurement device for a time measurement circuit. By designing a separate reference clock measurement channel in addition to the echo measurement channel, the echo measurement channel and the reference clock measurement channel are sampled in parallel within the same time measurement window. Compared with the prior art, where the reference clock measurement is performed after the echo measurement ends, the parallel sampling method of the echo measurement channel and the reference clock measurement channel effectively improves the measurement speed of the time measurement circuit. Furthermore, by sampling the echo measurement channel and the reference clock measurement channel in parallel within the same time measurement window, the present invention also effectively enhances the real-time correlation between the two measurement channels, thereby improving the accuracy of the calibration value of the echo pulse signal.
[0137] Another embodiment of the present invention provides a computer program product, which, when executed, is used to perform the measurement method of the time measurement circuit described above.
[0138] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, it performs the functions defined in the methods of the embodiments of the present invention.
[0139] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in this invention is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely exemplary forms for implementing the invention.
[0140] While several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0141] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the present invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with technical features of the present invention (but not limited to) that have similar functions.
Claims
1. A measurement method for a time measurement circuit, characterized in that, include: After the system is reset, the delay chain is started by the start pulse signal, and the time measurement window is opened simultaneously. Within the time measurement window, echo pulse signals are sampled through the echo measurement channel and reference clock signals are sampled through the reference clock measurement channel; wherein, the echo measurement channel and the reference clock measurement channel sample in parallel within the time measurement window; The last sampling point of the reference clock is determined based on the reference clock cycle in which the last echo pulse signal is located; The calibration value of the reference clock is determined based on the measurement value of the last sampling point and the measurement value of the first sampling point. The measured value of the echo pulse signal is calibrated based on the calibration value of the reference clock to obtain the calibration value of the echo pulse signal.
2. The measurement method of the time measurement circuit according to claim 1, characterized in that, The step of determining the last sampling point of the reference clock based on the reference clock period in which the last echo pulse signal is located includes: Determine whether the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles; If it is determined that the time difference between the last echo pulse signal and the start pulse signal is less than two reference clock cycles, the time measurement window is maintained until the falling edge of the third reference clock cycle, and the rising edge of the third reference clock cycle is taken as the last sampling point of the reference clock. If it is determined that the time difference between the last echo pulse signal and the start pulse signal is not less than two reference clock cycles, the rising edge of the reference clock cycle in which the last echo pulse signal is located is taken as the last sampling point of the reference clock.
3. The measurement method of the time measurement circuit according to claim 2, characterized in that, After taking the rising edge of the reference clock cycle in which the last echo pulse signal occurs as the last sampling point of the reference clock, the method further includes: The time measurement window is maintained until the falling edge of the reference clock cycle corresponding to the last echo pulse signal.
4. The measurement method of the time measurement circuit according to claim 2, characterized in that, The step of determining the calibration value of the reference clock based on the measured value of the last sampling point and the measured value of the first sampling point includes: The quotient of the measurement difference and the number of cycles of the reference clock is used as the calibration value of the reference clock; wherein, the measurement difference is the difference between the measurement value of the last sampling point and the measurement value of the first sampling point; and the minimum number of cycles of the reference clock is 2.
5. The measurement method of the time measurement circuit according to claim 1, characterized in that, The calibration of the measured value of the echo pulse signal based on the calibration value of the reference clock to obtain the calibration value of the echo pulse signal includes: The quotient of the measured value of the echo pulse signal and the calibration value of the reference clock is used as the calibration value of the echo pulse signal.
6. The measurement method of the time measurement circuit according to claim 1, characterized in that, The time difference between the last echo pulse signal and the start pulse signal must meet the measurement range limit and time positioning accuracy; wherein, the measurement range limit is set by a register, and the time positioning accuracy is set according to the minimum resolvable time unit.
7. The measurement method of the time measurement circuit according to claim 1, characterized in that, After calibrating the measured value of the echo pulse signal based on the calibration value of the reference clock to obtain the calibration value of the echo pulse signal, the method further includes: The calibration value of the echo pulse signal is stored in a memory; wherein the memory stores the calibration values of the echo pulse signals of multiple echo measurement channels alternately.
8. The measurement method of the time measurement circuit according to claim 7, characterized in that, Also includes: Receive an echo pulse signal readout request; wherein, the echo pulse signal readout request includes the starting address of the target echo measurement channel; The calibration value of the echo pulse signal of each target echo measurement channel is read in ascending order of the first address of the target echo measurement channel.
9. A measuring device for a time measuring circuit, characterized in that, include: The startup unit is used to start the delay chain by the start pulse signal after the system is reset, and to simultaneously open the time measurement window. A sampling unit is configured to sample an echo pulse signal through an echo measurement channel and a reference clock signal through a reference clock measurement channel within the time measurement window; wherein the echo measurement channel and the reference clock measurement channel sample in parallel within the time measurement window; The sampling point determination unit is used to determine the last sampling point of the reference clock based on the reference clock period in which the last echo pulse signal is located. The first calibration unit is used to determine the calibration value of the reference clock based on the measured value of the last sampling point and the measured value of the first sampling point of the reference clock. The second calibration unit is used to calibrate the measured value of the echo pulse signal based on the calibration value of the reference clock, so as to obtain the calibration value of the echo pulse signal.
10. The measuring device for the time measuring circuit according to claim 9, characterized in that, Also includes: A storage unit is used to store the calibration value of the echo pulse signal into a memory; wherein the memory stores the calibration values of the echo pulse signals of multiple echo measurement channels alternately.