A time-of-flight ranging temperature calibration method and device, and ranging equipment
By measuring the temperature drift error at different temperatures before leaving the factory and establishing a corresponding relationship table, the ranging results are calibrated using a compensation coefficient, thus solving the problem of time-of-flight ranging error caused by temperature changes and improving ranging accuracy.
Patent Information
- Application Number
- CN202211699713.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-12-28
AI Technical Summary
The ranging error caused by temperature changes in time-of-flight ranging equipment is mainly due to the change in crystal oscillator frequency with temperature, which affects the accuracy of time difference calculation.
Before leaving the factory, the actual distance is measured at multiple different temperatures to establish a table of temperature drift error correspondence. The distance measurement results are calibrated by compensation coefficient to reduce the error caused by temperature changes.
It effectively reduces the impact of temperature changes on ranging results and improves the measurement accuracy of ranging equipment under various temperature environments.
Smart Images

Figure CN115980716B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of distance measurement calibration, in particular to a time-of-flight distance measurement temperature calibration method, device and distance measurement equipment. BACKGROUND
[0002] The time-of-flight module is a device for distance measurement based on laser reflection. The laser transmitter in the time-of-flight module emits laser, which is reflected after contacting an object. The single photon avalanche diode in the time-of-flight module receives the reflected laser. The time difference between the time of emitting the laser and the time of receiving the laser is calculated to determine the distance between the time-of-flight module and the object. However, since the time difference is calculated according to the vibration frequency of the crystal oscillator, the frequency of the crystal oscillator changes with temperature, which causes the calculated time difference to change. Ultimately, when the distance between the time-of-flight module and the object is constant, the actual distance measured by the time-of-flight module changes with temperature, thereby causing distance measurement error. SUMMARY
[0003] The present application aims to provide a time-of-flight distance measurement temperature calibration method, device and distance measurement equipment, which can effectively reduce the error caused by temperature change to the distance measurement result.
[0004] To solve the above technical problems, the present application provides a time-of-flight distance measurement temperature calibration method, which comprises:
[0005] Before leaving the factory, a specific position is selected, whose true distance is S. By measuring the corresponding distances at multiple different temperatures T1...Tn, S1, S2...Sn are obtained, thereby obtaining the corresponding temperature drift errors ⊿S1...⊿Sn. The measured corresponding temperatures, distances and temperature drift errors form a first corresponding relationship table, which is stored in the measurement equipment;
[0006] During measurement, the current environmental temperature Ti and the measured distance Li from the target object are obtained;
[0007] The compensation coefficient Mi corresponding to the current environmental temperature Ti is calculated, wherein the compensation coefficient M = calibrated distance / calibrated distance, and Mi = S / (S-⊿Si), i is an integer in 1-n. If the current environmental temperature Ti is one of T1...Tn, the ⊿Si is obtained by directly querying the first corresponding relationship table. If the current environmental temperature Ti is not any one of T1...Tn and is located between T1 and Tn, the ⊿Si is calculated and obtained through the first corresponding relationship table;
[0008] According to the calibrated distance = the distance before calibration * the compensation factor, the target object's calibrated distance Li' = the distance of the target object Li * the compensation factor Mi is obtained, and the calibrated distance Li' is output.
[0009] Preferably, the S1, S2...Sn are obtained by measuring the corresponding distances at a plurality of different temperatures T1...Tn, and the corresponding temperature drift errors are obtained.
[0010] A group of temperatures T1...Tn and corresponding distances S1, S2...Sn are measured, each temperature Ti corresponds to a distance Si, and T1...Tn increases regularly.
[0011] The temperature drift error of each distance is calculated, and the temperature drift error is Si = S - Si.
[0012] Preferably, the S1, S2...Sn are obtained by measuring the corresponding distances at a plurality of different temperatures T1...Tn, and the corresponding temperature drift errors are obtained.
[0013] A group of temperatures T1...Tn and corresponding distances S1, S2...Sn are measured, each temperature Ti corresponds to a distance Si, and T1...Tn increases regularly, and the corresponding temperature drift errors are obtained.
[0014] According to the first corresponding relationship table, n distances S1, S2...Sn are plotted into a scatter plot, wherein the abscissa represents the temperature and the ordinate represents the distance.
[0015] n scatter points are connected to form n-1 line segments, and the n-1 line segments are fitted to form m line segments; m is much smaller than n.
[0016] The slopes K1...Km of the m line segments are calculated, and the second corresponding relationship table is formed by the slope Kj of the m line segments, the node temperature Tj on the same direction end of the line segment, and the measured distance Sj corresponding to the node temperature Tj, wherein j is an integer from 1 to m.
[0017] Using the second corresponding relationship table, the temperature drift error of the measured distance corresponding to each node temperature is calculated.
[0018] The slope Kj of the m line segments, the node temperature Tj on the same direction end of the line segment, the measured distance Sj corresponding to the node temperature Tj, and the temperature drift error corresponding to the measured distance Sj are stored in the measuring device in a third corresponding relationship table.
[0019] Preferably, if the current temperature Ti is not one of T1...Tn but is between T1 and Tn, then the ΔSi is obtained by the first corresponding relationship table, and specifically includes the following steps:
[0020] The third corresponding relationship table is searched to determine the slope corresponding to the line segment on which the current environmental temperature Ti is located.
[0021] According to the temperature drift error corresponding to the current environmental temperature Ti=(the current environmental temperature Ti-the right end point temperature of the line segment on which the current environmental temperature Ti is located)*the slope corresponding to the line segment+the temperature drift error corresponding to the right end point temperature of the line segment, the temperature drift error corresponding to the current temperature ΔSi is calculated.
[0022] Preferably, the n scattered points are connected into n-1 line segments, and the n-1 line segments are fitted into m line segments, and specifically include the following steps:
[0023] The slopes k1...kn-1 of the n-1 line segments are calculated.
[0024] A preset slope threshold k_th is determined.
[0025] The slope difference between any two adjacent line segments is compared with the preset slope threshold k_th.
[0026] If the slope difference between the n+1th line segment and the nth line segment is less than the preset slope threshold k_th, then the two line segments are fitted into a new line segment as a new n+1th line segment, and the slope difference between the new n+1th line segment and the n+2th line segment is compared; wherein the left end point of the nth line segment is the nth node, and the temperature of the left end point is less than that of the right end point.
[0027] If the slope difference between the n+1th line segment and the nth line segment is greater than or equal to the preset slope threshold k_th, then the two line segments are taken as two different line segments, and the left end point of the n+1th line segment is taken as the n+1th node.
[0028] The adjacent line segments are compared two by two in turn to obtain m nodes.
[0029] The m nodes are connected together to be fitted into m line segments.
[0030] Preferably, the second corresponding relationship table is used to calculate the temperature drift error of the measured distance corresponding to each node temperature, and specifically includes the following steps:
[0031] In each of the node temperatures Tj, the node temperature Tj corresponding to the measured distance Sj closest to the true distance S is taken as a reference temperature;
[0032] Using the second correspondence table, the temperature drift error of the measured distance corresponding to the two nodes of the line segment on which the reference temperature lies is calculated;
[0033] Based on the temperature drift error calculated by the two nodes of the line segment on which the reference temperature lies, the temperature drift error of the adjacent nodes calculated by the two nodes of the line segment on which the reference temperature lies is calculated, until the temperature drift errors of m nodes are obtained.
[0034] Preferably, the preset slope threshold k_th = 0.1 ± 0.05.
[0035] Preferably, the measured distances S1, S2...Sn are proportional to the temperature.
[0036] The application also provides a temperature calibration device based on time-of-flight ranging, comprising:
[0037] A memory for storing a computer program;
[0038] A processor for executing the computer program to realize the steps of the temperature calibration method based on time-of-flight ranging as described above.
[0039] Preferably, a ranging device comprises a ranging device body and a temperature calibration device based on time-of-flight ranging as described above;
[0040] The ranging device body and the temperature calibration device based on time-of-flight ranging are connected.
[0041] The application provides a time-of-flight ranging temperature calibration method and device and a ranging device, and relates to the ranging calibration field. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the prior art and the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0043] Figure 1 A flow chart of a time-of-flight ranging temperature calibration method provided by the present application is shown in the figure.
[0044] Figure 2 A ranging principle diagram of the ranging device is shown in the figure.
[0045] Figure 3 A histogram of the time-of-flight distribution of the photons is shown in the figure.
[0046] Figure 4 A schematic diagram of a temperature-distance relationship curve provided by the present application is shown in the figure.
[0047] Figure 5 A schematic diagram of an abstracted line segment of the temperature-distance relationship curve provided by the present application is shown in the figure.
[0048] Figure 6 A structural schematic diagram of a time-of-flight ranging temperature calibration device provided by the present application is shown in the figure. DETAILED DESCRIPTION
[0049] The core of this invention is to provide a temperature calibration method, apparatus, and ranging device for time-of-flight ranging, which can effectively reduce the error in ranging results caused by temperature changes.
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0051] The time-of-flight module includes a vertical cavity surface emitting laser (VCSEL), a single photon avalanche diode (SPAD), and a time-to-digital converter (TDC). The SPAD generates a current signal as soon as it receives a photon, and the TDC records the time of the current signal to obtain the photon's time of flight (VCSEL emits a photon → photon hits an object → photon returns → SPAD detects the photon).
[0052] Time-of-flight ranging refers to ranging based on the time it takes for a photon to be emitted from a laser emitter and received by a SPAD. For details, please refer to [link / reference needed]. Figure 2 , Figure 2 This is a schematic diagram of the ranging principle of the ranging device. The VCSEL emits laser pulses; the pulsed photons reflect backward upon contact with the object. The SPAD receives the reflected photons. The TDC records the time difference between the photons received by the SPAD and the laser emission from the VCSEL. Statistics are collected every picosecond starting from when the VCSEL emits the laser, and the number of photons received by the SPAD is plotted as a histogram. Please refer to [reference needed]. Figure 3 , Figure 3 This is a histogram of the photon flight time distribution. Since most photons emitted by the VCSEL return upon hitting the detected object, the time period in the histogram with the highest number of received photons is considered (e.g., ...). Figure 3 The position at approximately 30 ps in the image (where the number of photons returning is the highest) represents the time t that photons travel between the module and the object. Finally, the distance between the module and the object is calculated based on the speed of light c: d = c * t / 2.
[0053] However, since the TDC counts time according to the vibration frequency of the crystal oscillator, the vibration frequency of the crystal oscillator changes with temperature, and the TDC calculates the vibration period according to the frequency f and the vibration frequency c of the crystal oscillator as time t, and the calculation formula is t=c / f. When the temperature changes, the vibration frequency f of the crystal oscillator changes, and then the time t changes, which causes the TDC to be unable to calculate the accurate time, thereby affecting the final ranging result. For example, assuming that the actual distance between the ranging device and the object is 1200mm, and the actual flight time of the photon is 8000ps, if the vibration period t of the crystal oscillator increases to 1.1 times of the original due to the change of the environmental temperature, the flight time of the photon recorded by the TDC is 8000*1.1=8800ps, and the distance measured by the ranging device based on the flight time with error is d=c*t / 2=0.3*8800 / 2=1320mm, which causes a large error between the distance measured by the ranging device and the actual distance.
[0054] To solve the above technical problems, please refer to Figure 1 , Figure 1 A flowchart of a temperature calibration method based on time-of-flight ranging provided by the present application, the temperature calibration method comprising:
[0055] Before leaving the factory, a specific position is selected, and the actual distance thereof is S. By measuring the corresponding distances at a plurality of different temperatures T1...Tn, S1, S2...Sn are obtained, and the corresponding temperature drift errors ⊿S1...⊿Sn are obtained. The measured corresponding temperature, distance and temperature drift error form a first corresponding relationship table which is stored in the measuring device;
[0056] S1: During measurement, the current environmental temperature Ti and the measured distance Li between the target object are obtained;
[0057] S2: The compensation coefficient Mi corresponding to the current environmental temperature Ti is calculated, wherein the compensation coefficient M=calibrated distance / calibration distance, and Mi=S / (S-⊿Si) is obtained, i is an integer in 1-n; if the current environmental temperature Ti is one of T1...Tn, ⊿Si is obtained by directly querying the first corresponding relationship table; if the current environmental temperature Ti is not any one of T1...Tn and is located between T1 and Tn, ⊿Si is obtained by calculation through the first corresponding relationship table;
[0058] S3: According to the calibrated distance=calibration distance*compensation coefficient, the calibrated distance Li' of the target object is obtained, which is Li*compensation coefficient Mi, and the calibrated distance Li' is outputted.
[0059] Considering that the temperature change will cause the vibration period to change, from the above example, when the temperature change causes the vibration period of the crystal oscillator to increase to 1.1 times of the original, the difference between the distance measured by the distance measuring device and the actual distance is also 1.1 times (1320 vs. 1200), according to the characteristics of the multiple relationship, in actual application, the multiple at each temperature can be determined to compensate the actual distance measured by the distance measuring device.
[0060] The multiple above is called compensation coefficient M, before actual application, the multiple at each temperature needs to be determined, specifically, a fixed specific position is selected and the distance measuring device is fixed, the actual distance between the two is known, by continuously adjusting the ambient temperature around the distance measuring device, after each adjustment, the distance measuring device measures the distance between the distance measuring device itself and the specific position, to obtain the distance measured at different temperatures, then the actual distance is subtracted from each measured distance to obtain the distance difference corresponding to each temperature, which is the temperature drift error. For example, please refer to Figure 2 , Figure 2 A relationship between temperature and distance measuring result provided by the present application is shown in the schematic diagram, the distance measuring device is placed in the oven, and a reflecting plate is set as the distance measuring target, assuming that the actual distance S between the distance measuring device and the reflecting plate is 1200mm, T1 is set as -40 degrees Celsius to control the distance measuring device to measure the distance S1 between the distance measuring device itself and the specific position, to obtain 1139.21mm, then the temperature is continuously increased as the new test environment (for example, every 5 degrees Celsius can be used as the new test environment), the distance corresponding to each temperature environment is continuously tested until Tn=90 degrees Celsius, at 90 degrees Celsius, the distance Sn measured by the distance measuring device is 1236.62mm. Then the difference between the actual distance 1200mm and the distance S1-Sn at each temperature environment is calculated to obtain the temperature drift error corresponding to each temperature, for example, the temperature drift error at -40 degrees Celsius is 1200 minus 1139.21 equal to 60.79. After obtaining the temperature drift error corresponding to each temperature, the corresponding relationship between each temperature and the measured distance and the temperature drift error corresponding to the temperature is established, these corresponding relationships are constructed into a first corresponding relationship table and stored in the distance measuring device, see Table 1, so as to be used in actual application.
[0061] As a preferred embodiment, the measured distances S1, S2...Sn are proportional to the temperature.
[0062]
[0063]
[0064]
[0065] Table 1: Temperature-distance relationship table
[0066] In practical applications, the ranging device also needs to obtain the ambient temperature Ti around the ranging device when measuring the distance Li. The temperature can be obtained by a temperature sensor arranged on the ranging device. The compensation coefficient corresponding to the current ambient temperature Ti is calculated first, so as to compensate the measured distance Li. Specifically, according to the above multiple relationship, the multiple (compensation coefficient) is equal to the real distance divided by the measured distance at Ti temperature, and further equal to the real distance divided by (the real distance plus the temperature drift distance at Ti temperature). Since the measured distance and the real distance at each temperature have been obtained as a reference during factory testing, the real distance and the measured distance during factory testing can be used in practical application scenarios. If the current ambient temperature Ti in the practical application scenario is equal to one of the temperatures T1-Tn used during factory testing, the temperature drift distance Si corresponding to the temperature Ti during factory testing can be directly used to calculate the compensation coefficient. For example, when the current temperature Ti is 20 degrees Celsius, if the temperature drift error corresponding to 20 degrees Celsius has been tested during factory testing, the temperature drift error corresponding to 20 degrees Celsius can be directly obtained in the first corresponding relationship table. If the current ambient temperature Ti is not equal to one of T1-Tn, the temperature drift error corresponding to Ti needs to be calculated by using the first corresponding relationship table.
[0067] After obtaining the temperature drift error Si corresponding to the current ambient temperature, the real distance during factory testing is used as S, and the compensation coefficient Mi corresponding to the current ambient temperature is calculated by Mi=S / (S- Si). The change coefficient of the crystal oscillator frequency at different temperatures is reflected by the compensation coefficient Mi. Finally, after obtaining the compensation coefficient Mi, according to the above multiple relationship, only the measured distance Li of the ranging device needs to be multiplied by the compensation coefficient Mi, and the real distance between the ranging device and the measured object can be obtained.
[0068] In summary, before the ranging device is shipped, the distances S1-Sn at different temperatures T1-Tn are measured to obtain the temperature drift errors ⊿S1-⊿Sn at different temperatures, and a first corresponding relationship table is formed and stored in the measuring device. In actual application, the current ambient temperature Ti and the distance Li between the ranging device and the object are obtained. If Ti is one of T1-Tn, the corresponding temperature drift error ⊿Si is directly found from the first corresponding relationship table. Otherwise, the temperature drift error ⊿Si of Ti needs to be calculated according to the relationship table. Then, the compensation coefficient of Li is determined based on Mi=S / (S-⊿Si), and Li*Mi is obtained as the final output distance. By introducing the temperature-related compensation coefficient, the distance measured by the ranging device is compensated according to the current ambient temperature, which can effectively reduce the error caused by temperature changes and improve the measurement accuracy of the ranging device in various temperature environments.
[0069] On the basis of the above embodiments:
[0070] As a preferred embodiment, by measuring the corresponding distances at a plurality of different temperatures T1...Tn, S1, S2...Sn are obtained, and the corresponding temperature drift errors ⊿S1...⊿Sn are obtained. Specifically, it includes:
[0071] A group of temperatures T1...Tn and corresponding distances S1, S2...Sn are measured. Each temperature Ti corresponds to a distance Si, and T1...Tn increases regularly.
[0072] The temperature drift error ⊿S1...⊿Sn of each distance is calculated, where the temperature drift error ⊿Si=S-Si.
[0073] In order to improve the efficiency of the factory test, in this application, a lower temperature can be selected as the starting value during the factory test, and the first ranging of the ranging device is started at T1, and the distance S1 corresponding to the temperature T1 is obtained. Then, the temperature is increased by X degrees Celsius (such as 1 degree Celsius or 5 degrees Celsius) as T2 based on T1, and the second ranging of the ranging device is started, and the distance S2 corresponding to the temperature T2 is obtained. In this way, the temperature is continuously increased and the distance after each increase is measured until the temperature of the current test is equal to the pre-set temperature threshold or the number of tests reaches the pre-set number. The temperature of the last test is Tn, and the distance corresponding to Tn is Sn. After the test is completed, since the real distance S between the ranging device and the measured object is known, and both of them do not move during the test, for example, the distance between them can be measured by mechanical tools or other instruments that are not affected by temperature when leaving the factory. Therefore, by subtracting the real distance from the measured distances S1-Sn, the temperature drift errors ⊿S1-⊿Sn at different temperatures can be obtained. Based on this, the efficiency of the factory test can be improved.
[0074] As a preferred embodiment, by measuring the corresponding distances at multiple different temperatures T1...Tn, S1, S2...Sn are obtained, and the corresponding temperature drift errors ⊿S1...⊿Sn are obtained. The corresponding temperature, distance and temperature drift error are formed into a first corresponding relationship table and stored in the measuring device, which specifically includes:
[0075] A group of temperatures T1...Tn and corresponding distances S1, S2...Sn are measured, each temperature Ti corresponds to a distance Si, T1...Tn increases regularly, and the corresponding temperature drift errors ⊿S1...⊿Sn are obtained. The corresponding temperature, distance and temperature drift error are formed into a first corresponding relationship table and stored in the measuring device;
[0076] According to the first corresponding relationship table, n distances S1, S2...Sn are plotted into a scatter plot, wherein the horizontal coordinate represents the temperature and the vertical coordinate represents the distance;
[0077] n scatter points are connected into n-1 line segments, and n-1 line segments are fitted into m line segments; m is much smaller than n;
[0078] The slopes K1...Km of the m line segments are calculated, and the slope Kj of the m line segment, the node temperature Tj on the same direction end (both left end or right end) of the line segment and the measured distance Sj corresponding to the node temperature Tj are formed into a second corresponding relationship table and stored in the measuring device, wherein j is an integer from 1 to m;
[0079] Using the second corresponding relationship table, see Table 2, the temperature drift error ⊿S1...⊿Sm of the measured distance corresponding to each node temperature is calculated;
[0080] The slope Kj of the m line segments, the node temperature Tj on the same direction end of the line segment, the measured distance Sj corresponding to the node temperature Tj, and the temperature drift error corresponding to the measured distance Sj are stored in the measurement device in the third corresponding relationship table, as shown in Table Three.
[0081] K Temperature (°C) Measurement distance (mm) Temperature drift error (mm) K1 -40 1139.21 -60.6 K2 -20 1151.83 -48 K3 15 1181.31 -18.6 K4 25 1192.18 -7.7 K5 50 1211.46 11.55 K6 70 1229.41 29.55 K7 90 1236.62 36.75
[0082] Table Two
[0083] Serial number K value Temperature (°C) Measurement distance (mm) Temperature drift error (mm) K1 0.63 -40 1139.21 -60.6 K2 0.84 -20 1151.83 -48 K3 1.09 15 1181.31 -18.6 K4 0.77 25 1192.18 -7.7 K5 0.90 50 1211.46 11.55 K6 0.36 70 1229.41 29.55 K7 0.50 90 1236.62 36.75
[0084] Table Three
[0085] In order to save storage resources and improve efficiency, in this application, considering that a large number of tests are required to obtain the temperature drift distance corresponding to different temperatures during factory testing, it can be understood that since the distance at the current temperature needs to be tested once for each change in temperature, the smaller the amplitude of each change in temperature, the more tests are required, the more distances are obtained, and the higher the accuracy in actual application. However, too much data will cause the distance measuring device to spend a lot of time searching for the required data in these data during actual application, and storing these data will also require a large amount of storage space. Therefore, after obtaining the first corresponding relationship table, a coordinate system with temperature as the horizontal coordinate and measured distance as the vertical coordinate is established, and the points T1-S1, T2-S2, …, Tn-Sn in the first corresponding relationship table are labeled on the coordinate system one by one. Then, connect any two adjacent points to obtain n-1 line segments. Further, in the n-1 line segments, multiple line segments that are adjacent and have similar slopes are combined into one line segment, all of which are combined into a certain line segment, to obtain m line segments. m is usually much smaller than n-1, for example, combined into the leftmost or rightmost line segment, as shown in the following figure. Figure 5
[0086] After merging the line segments, since the number of line segment endpoints is much smaller than the number recorded in the original first correspondence table, in order to ensure the accuracy of calibration, a new correspondence table needs to be established. Specifically, the slopes K1~Km corresponding to the m line segments are calculated. The method used to calculate the slope can be based on the temperature and measured distance of the two endpoints of the line segment. For example, when the true distance is 1200mm, the slope of the line segment from -40 degrees Celsius to -20 degrees Celsius is calculated. If the measured distance at -40 degrees Celsius is 1139.21mm and the measured distance at -20 degrees Celsius is 1151.83mm, then: (1) 1139.21 = (-40) * K + B; (2) 1151.83 = (-20) * K + B; B is a constant, and the slope K of this line segment can be calculated from equation (1) and equation (2) as K = 0.63. Based on this, the slope of each line segment is calculated, as shown in Table 3. A correspondence is established between the slope Kj and the temperature Tj at one end (e.g. the left end) of each line segment and its corresponding temperature Sj, where j represents any number from 1 to m. Further, on this basis, the temperature drift error is introduced. If each node in the m line segments already has a correspondence in the original first correspondence table, then the temperature drift error of each node in the original first correspondence table is taken out to establish a correspondence between temperature, measured distance, temperature drift error, and slope, and each correspondence is established as a new correspondence table and stored in the distance measuring device. If there are newly created nodes among the nodes of the m line segments (for example, the staff changes the nodes with decimal parts to nodes with only integer parts for easy management), then the temperature drift error of these newly created nodes needs to be calculated, specifically by calculating the temperature drift error based on the slope of the line segment where the node is located and the temperature drift error of the nodes of the adjacent line segments. Based on this, by reducing the number of nodes and introducing the correspondence between the slope and the temperature drift error, a more accurate compensation coefficient Mi can be obtained, and the storage resource consumption is also reduced, improving the efficiency.
[0087] As a preferred embodiment, if the current temperature Ti is not one of T1...Tn, but is between T1 and Tn, then ⊿Si is obtained through the first correspondence table, specifically including:
[0088] Looking up the third correspondence table to determine the slope corresponding to the line segment where the current environmental temperature Ti is located;
[0089] According to the temperature drift error corresponding to the current environmental temperature Ti = (current environmental temperature Ti - temperature of the right end of the line segment where the current environmental temperature is located) * slope corresponding to the line segment + temperature drift error corresponding to the right end of the line segment, the temperature drift error corresponding to the current temperature ⊿Si is calculated.
[0090] In order to improve the accuracy, in this application, considering that the ambient temperature in actual application may not be tested at the factory test, therefore, in the third corresponding relationship table, there is no temperature drift error directly corresponding to the current ambient temperature, at this time, in order to accurately calculate the temperature drift error corresponding to the current ambient temperature, the temperature drift error of the node temperature on the line segment where the current ambient temperature is located is needed to be used for calculation. For example, it is assumed that the real distance of a specific position is 1200mm at the factory test, the ranging device in the actual application scene measures the distance of an object with a distance of 500mm from itself, the distance measured by the ranging device is 487.32mm, the current ambient temperature Ti is 10 degrees Celsius, the line segment where it is located is 0-15 degrees Celsius, the slope is 1.09, and the temperature drift error at 15 degrees Celsius is-18.6mm. Based on this, the temperature drift error corresponding to the current ambient temperature Ti is calculated as-24.05mm, that is, (10-15)*1.09+(-18.6). Further, the compensation coefficient M at 10 degrees Celsius is calculated as 1200 / (1200-24.05) which is approximately equal to 1.02045, and the measured distance 487.32 is multiplied by 1.02045 to obtain 497.28mm, so that the error is reduced by about 10mm; if the real distance between the object and the ranging device is also 1200m, the distance measured by the ranging device is 1175.54mm, according to the above compensation coefficient M=1.02045, the calibrated distance is equal to 1175.54*1.02045=1198.59, and the error is reduced by about 23mm, which greatly improves the measurement accuracy.
[0091] As a preferred embodiment, n scattered points are connected into n-1 line segments, and n-1 line segments are fitted into m line segments, as shown in Figure 5 , which specifically includes:
[0092] The slopes k1...kn-1 of the n-1 line segments are calculated.
[0093] A preset slope threshold k_th is determined.
[0094] The slope difference between any two adjacent line segments is compared with the preset slope threshold k_th.
[0095] If the slope difference between the n+1th line segment and the nth line segment is less than the preset slope threshold k_th, the two line segments are fitted into a new line segment as a new n+1th line segment, and the slope difference between the new n+1th line segment and the n+2th line segment is continued to be compared; wherein the left end point of the nth line segment is the nth node, and the temperature of the left end point is less than the temperature of the right end point.
[0096] If the slope difference between the n+1th line segment and the nth line segment is greater than or equal to the preset slope threshold k_th, the two line segments are regarded as two different line segments, and the left end point of the n+1th line segment is regarded as the n+1th node;
[0097] The adjacent line segments are compared in pairs to obtain m nodes;
[0098] The m nodes are connected together to fit m line segments.
[0099] In order to ensure the compensation accuracy after merging the line segments, in the present application, similar line segments, i.e. line segments with similar slopes, need to be merged when merging the line segments. Therefore, a preset slope threshold is set according to the requirements of actual application. If the slope difference between two adjacent line segments is less than the preset slope threshold, the two line segments are merged, otherwise the independence of the two line segments is maintained. Specifically, the leftmost line segment in the coordinate system is taken as the starting point. It is determined whether the slope difference between the leftmost line segment and the second line segment is less than the preset slope threshold. If yes, the second line segment is merged into the leftmost line segment. Then it is determined whether the slope difference between the leftmost line segment and the third line segment is less than the preset slope threshold. If the slope difference between the leftmost line segment and the second line segment is not less than the preset slope threshold, it is determined whether the slope difference between the second line segment and the third line segment is less than the preset slope threshold. This process is repeated until the rightmost line segment is determined. Finally, m line segments are obtained. Based on this, by setting the preset slope threshold, the compensation accuracy after merging the line segments can be ensured.
[0100] As a preferred embodiment, the preset slope threshold k_th = 0.1 ± 0.05.
[0101] In order to ensure the compensation accuracy after merging the line segments, the preset slope threshold cannot be set too large, otherwise the number of merged line segments and nodes will be too small, and the temperature drift error corresponding to the current environment temperature cannot be calculated. The actual preset slope threshold can be determined according to the actual situation. Setting the preset slope threshold to 0.1 can reduce the number of line segments as much as possible while ensuring accuracy.
[0102] As a preferred embodiment, the temperature drift error of the measured distance corresponding to each node temperature is calculated by using the second correspondence table, specifically including:
[0103] Among the node temperatures Tj, the node temperature corresponding to the measured distance Sj closest to the true distance S is taken as the reference temperature;
[0104] The temperature drift error of the measured distance corresponding to the two nodes of the line segment on which the reference temperature is located is calculated by using the second correspondence table.
[0105] The temperature drift error of the two nodes of the line segment on which the reference temperature is located is calculated, and the temperature drift error of the adjacent nodes calculated by the two nodes of the line segment on which the reference temperature is located is calculated until the temperature drift error of the m nodes is obtained.
[0106] In order to obtain accurate temperature drift error, in the present application, when calculating the temperature drift error at each node, a reference temperature needs to be used for calculation. The reference temperature refers to the temperature at which the ranging result obtained by the ranging device is closest to the true distance. The reference temperature is usually between 20 and 35 degrees Celsius, and the specific reference temperature needs to be selected according to the temperature-distance relationship curve in the present application. Figure 4 Therefore, the temperature drift error of the node closest to the reference temperature is calculated, that is, the temperature drift error of the two nodes of the line segment on which the reference temperature is located. For other nodes, because the other nodes are not on the same line segment as the reference temperature, if the reference temperature is still used to calculate the temperature drift error of the other nodes, the obtained temperature drift error will be inaccurate. Therefore, the nodes on the same line segment whose temperature drift error has been calculated are used to calculate the other nodes, that is, the two nodes on the same line segment as the reference temperature. In addition to being on the same line segment as the reference temperature, the two nodes are also on the same line segment as the other node of the adjacent line segment. Therefore, the temperature drift error of the other node of the adjacent line segment can be calculated based on the two nodes, and the nodes on the more adjacent line segment can be calculated based on this. It is equivalent to taking the line segment on which the reference temperature is located as the center to calculate each node in turn to the left and right of the horizontal coordinate of the coordinate system. Each time the temperature drift error of the node is calculated is based on the last calculated node. Based on this, accurate temperature drift error can be obtained.
[0107] For example, please refer to Table 3. It is determined that the reference temperature is 35 degrees Celsius, the measured distance is 1200.43 mm, and the line segment on which the reference temperature is located is the line segment with a slope of 0.77 and a range of 25-70 degrees Celsius. Then, the temperature drift error of (25 degrees Celsius, measured distance 1192.18 mm) and (50 degrees Celsius, measured distance 1211.46 mm) is calculated first:
[0108] At 25 degrees Celsius, the temperature drift error = (current temperature-reference temperature)*K = (25-35)*0.77 = -7.7 mm.
[0109] At 50 degrees Celsius, the temperature drift error = (current temperature-reference temperature)*K = (50-35)*0.77 = 11.55 mm.
[0110] Further, the two branches adjacent to the line segment are the line segment with a slope of 1.09 and a range of 15-25 degrees Celsius and the line segment with a slope of 0.36 and a range of 50-70 degrees Celsius, and the temperature drift error of (15 degrees Celsius, measured distance is 1181.31 mm) and (70 degrees Celsius, measured distance is 1229.41 mm) needs to be calculated:
[0111] At 15 degrees Celsius, the temperature drift error = (current temperature - adjacent node temperature) * K + adjacent node temperature drift distance = (15-25) * 1.09 + (-7.7) = -18.6 mm.
[0112] At 70 degrees Celsius, the temperature drift error = (current temperature - adjacent node temperature) * K + adjacent node temperature drift distance = (70-50) * 0.9 + 11.55 = 29.55 mm.
[0113] The line segment adjacent to the line segment with a slope of 0.36 and a range of 50-70 degrees Celsius is the line segment with a slope of 0.36 and a range of 70-90 degrees Celsius, and the temperature drift error of the node at 90 degrees Celsius is:
[0114] At 90 degrees Celsius, the temperature drift error = (current temperature - adjacent node temperature) * K + adjacent node temperature drift distance = (90-70) * 0.36 + (29.55) = 36.75 mm.
[0115] The line segment adjacent to the line segment with a slope of 1.09 and a range of 15-25 degrees Celsius is the line segment with a slope of 0.84 and a range of -20-15 degrees Celsius, and the line segment adjacent to the line segment with a slope of 0.84 and a range of -20-15 degrees Celsius is the line segment with a slope of 0.63 and a range of -40- -20 degrees Celsius, and the temperature drift error of the two nodes is:
[0116] At -20 degrees Celsius, the temperature drift error = (current temperature - adjacent node temperature) * K + adjacent node temperature drift distance = (-20-15) * 0.84 + (-18.6) = -48 mm.
[0117] At -40 degrees Celsius, the temperature drift error = (current temperature - adjacent node temperature) * K + adjacent node temperature drift distance = (-40-(-20)) * 0.63 + (-48) = -60.6 mm.
[0118] Since the TDC calculates time according to the vibration period of the crystal oscillator, the vibration period of the crystal oscillator will become longer with the increase of temperature, the time calculated by the TDC for the same scale time will become longer with the increase of temperature, and finally the distance S calculated according to the time calculated by the TDC will become longer with the increase of temperature. When the factory test is performed, if the test temperature is gradually increased from a lower temperature, the measured distances S1-Sn are an increasing sequence, please refer to Figure 4 , Figure 4 a schematic diagram of a temperature-distance relationship curve provided by the present application. If it is found that S1-Sn do not comply with the increasing rule, it may indicate that the ranging device itself or the device for adjusting the ambient temperature has failed, and the normal operation of the device during the factory test is ensured through the principle.
[0119] Please refer to Figure 6 , Figure 6 a structural schematic diagram of a temperature calibration device based on time-of-flight ranging provided by the present application, comprising:
[0120] a memory 21 for storing a computer program;
[0121] a processor 22 for executing the computer program to realize the steps of the temperature calibration method based on time-of-flight ranging as described above.
[0122] For a detailed introduction of the temperature calibration device based on time-of-flight ranging provided by the present application, please refer to the above-mentioned embodiments of the temperature calibration method based on time-of-flight ranging, which will not be repeated here.
[0123] The present application also provides a ranging device comprising a ranging device body and a temperature calibration device based on time-of-flight ranging as described above;
[0124] The ranging device body and the temperature calibration device based on time-of-flight ranging are connected.
[0125] For a detailed introduction of the ranging device provided by the present application, please refer to the above-mentioned embodiments of the temperature calibration method based on time-of-flight ranging, which will not be repeated here.
[0126] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between various embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.
[0127] Those skilled in the art will further realize that the mechanisms of the various examples described herein are capable of being implemented using any number of combinations of the described features. Accordingly, these examples are not limited to the mechanisms described herein, but rather, the intent is to cover all modifications and alternatives equivalent thereto. The preceding description of the examples is illustrative, and not restrictive. Many other examples will be apparent to those of skill in the art upon reviewing the above description. The scope of the examples should, therefore, be determined not with reference to the above description, but instead should be given to the appended claims, along with their full scope of equivalents.
[0128] The above description of disclosed examples is intended to be illustrative, and not restrictive. Many other examples will be apparent to those of skill in the art upon reviewing the above description. The scope of the examples should, therefore, be determined not with reference to the above description, but instead should be given to the appended claims, along with their full scope of equivalents.
Claims
1. A temperature calibration method based on time-of-flight ranging, characterized in that, The temperature calibration method comprises: Before leaving the factory, a specific position whose real distance is S is selected, and by measuring the corresponding distances at multiple different temperatures T1...Tn, S1, S2...Sn are obtained, so that the corresponding temperature drift errors ΔS1...ΔSn are obtained, and a first corresponding relationship table of the measured corresponding temperature, distance and temperature drift error is stored in the measuring device; During measurement, the current environmental temperature Ti and the measured distance Li from the target object are obtained; The compensation coefficient Mi corresponding to the current environmental temperature Ti is calculated, wherein the compensation coefficient Mi=calibrated distance / calibration distance, Mi=S / (S-ΔSi), i is an integer in 1~n; if the current environmental temperature Ti is one of T1...Tn, the ΔSi is obtained by directly querying the first corresponding relationship table; if the current environmental temperature Ti is not one of T1...Tn, but is between T1 and Tn, the ΔSi is obtained by calculating the first corresponding relationship table; According to the calibrated distance=calibration distance*compensation coefficient, the calibrated distance Li' of the target object is obtained, Li'=distance Li of the target object*compensation coefficient Mi, and the calibrated distance Li' is outputted; The method for obtaining S1, S2...Sn by measuring the corresponding distances at multiple different temperatures T1...Tn, so as to obtain the corresponding temperature drift errors ΔS1...ΔSn, and storing the first corresponding relationship table of the measured corresponding temperature, distance and temperature drift error in the measuring device, specifically comprises: A group of temperatures T1...Tn and corresponding distances S1, S2...Sn are measured, each temperature Ti corresponds to a distance Si, T1...Tn increases regularly, so as to obtain the corresponding temperature drift errors ΔS1...ΔSn, and the first corresponding relationship table of the measured corresponding temperature, distance and temperature drift error is stored in the measuring device; According to the first corresponding relationship table, n distances S1, S2...Sn are plotted into a scatter plot, wherein the abscissa represents the temperature and the ordinate represents the distance; n scatter points are connected into n-1 line segments, and the n-1 line segments are fitted into m line segments; m is much smaller than n; The slopes K1...Km of the m line segments are calculated, and a second corresponding relationship table of the slope Kj of the m line segments, the node temperature Tj on the same direction end of the line segment and the measured distance Sj corresponding to the node temperature Tj is stored in the measuring device, wherein j is an integer in 1~m; Using the second corresponding relationship table, the temperature drift error ΔS1...ΔSm of the measured distance corresponding to each node temperature is calculated; The slope Kj of the m line segments, the node temperature Tj on the same direction end of the line segment, the measured distance Sj corresponding to the node temperature Tj and the temperature drift error corresponding to the measured distance Sj are formed into a third corresponding relationship table and stored in the measuring device.
2. The temperature calibration method of claim 1, wherein, The temperature drift error is obtained by measuring the corresponding distances at different temperatures T1...Tn, obtaining S1, S2...Sn, and obtaining the corresponding temperature drift error ⊿S1...⊿Sn, specifically comprising: Measuring T1...Tn at a group of temperatures and the corresponding distances S1, S2...Sn, each temperature Ti corresponds to a distance Si, T1...Tn increases regularly; Calculate the temperature drift error of each distance ⊿S1...⊿Sn, wherein the temperature drift error ⊿Si=S-Si.
3. The temperature calibration method of claim 1, wherein, If the current environment temperature Ti is not one of T1...Tn, but is located between T1 and Tn, then ⊿Si is obtained by the first corresponding relationship table, specifically comprising: Looking up the third corresponding relationship table to determine the slope corresponding to the line segment on which the current environment temperature Ti is located; According to the current environment temperature Ti corresponding to the temperature drift error = (the current environment temperature Ti-the current environment temperature on the right end point temperature of the line segment) * the slope corresponding to the line segment + the temperature drift error corresponding to the right end point temperature of the line segment, the temperature drift error ⊿Si corresponding to the current temperature is calculated.
4. The temperature calibration method of claim 1, wherein, The n-1 line segments are fitted into m line segments, specifically comprising: Calculate the slope k1...kn-1 of n-1 line segments; Determine the preset slope threshold k_th; Compare the slope difference between any two adjacent line segments with the preset slope threshold k_th; If the slope difference between the n+1th line segment and the nth line segment is less than the preset slope threshold k_th, then the two line segments are fitted into a new line segment as the new n+1th line segment, and the slope difference between the new n+1th line segment and the n+2th line segment is compared; wherein the left end point of the nth line segment is the nth node, and the temperature of the left end point is less than that of the right end point; If the slope difference between the n+1th line segment and the nth line segment is greater than or equal to the preset slope threshold k_th, then the two line segments are regarded as two different line segments, and the left end point of the n+1th line segment is regarded as the n+1th node; Compare the adjacent line segments two by two to obtain m nodes; Connect the m nodes together to fit m line segments.
5. The temperature calibration method of claim 4, wherein, The temperature drift error of the measured distance corresponding to each node temperature is calculated by using the second corresponding relationship table, specifically comprising: Among the node temperatures Tj, the node temperature Tj corresponding to the measured distance Sj is closest to the node temperature corresponding to the true distance S as the reference temperature; Using the second corresponding relationship table, the temperature drift error of the measured distance corresponding to the two nodes of the line segment on which the reference temperature is located is calculated; Based on the temperature drift error calculated by the two nodes of the line segment on which the reference temperature is located, the temperature drift error of the adjacent nodes calculated by the two nodes of the line segment on which the reference temperature is located is calculated, until the temperature drift error of the m nodes is obtained.
6. The temperature calibration method of claim 4, wherein, The preset slope threshold k_th=0.1±0.
05.
7. The temperature calibration method of any one of claims 1 to 6, wherein, The measured distance S1, S2...Sn is proportional to the temperature.
8. A time-of-flight ranging based temperature calibration apparatus, characterized by, Comprising: Memory for storing computer programs; A processor for implementing the steps of the time-of-flight ranging based temperature calibration method as claimed in any one of claims 1 to 7 when executing the computer program.
9. A ranging device, characterized by A time-of-flight ranging based temperature calibration apparatus as claimed in claim 8, comprising a ranging device body. The ranging device body and the time-of-flight ranging based temperature calibration apparatus are connected.
Citation Information
Patent Citations
Distance compensation method, device and equipment for TOF module
CN110896474A