Temperature compensation method and system for optical Gray code encoder based on NTC resistance network

The voltage divider circuit designed with an NTC resistor network matches the temperature drift law of the PD signal, solving the problems of high complexity and high cost of temperature compensation in optical encoders, and achieving high-precision, real-time temperature compensation.

CN121067941APending Publication Date: 2025-12-05CONTROLWAY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511342650.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Existing temperature compensation methods for optical encoders are complex, expensive, and have poor real-time performance. Temperature drift of the PD signal in Gray code encoders leads to large errors, affecting high-precision applications.

Method used

A voltage divider circuit is designed using an NTC resistor network. The temperature drift pattern of the PD signal is matched by hardware circuitry and integrated into the signal comparison circuit. The resistance value is adjusted to counteract the temperature effect, resulting in a stable rectangular wave output.

Benefits of technology

It achieves low-cost, high-precision real-time temperature compensation, reducing encoder temperature drift error to within ±0.5%, and is highly adaptable to a wide range of temperatures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121067941A_ABST
    Figure CN121067941A_ABST
Patent Text Reader

Abstract

The invention discloses an optical Gray code encoder temperature compensation method and system based on an NTC resistance network, and the method comprises the steps: calibrating a PD signal drift law in a working temperature range, designing an NTC voltage division circuit matched with the law, and integrating the NTC voltage division circuit to a comparator, thereby achieving the real-time offset of the PD signal temperature drift. According to the scheme, the defects that in the prior art, complexity is high and cost is high are overcome, compensation precision within + / -0.5% is achieved only through basic electronic elements, the response speed reaches the microsecond level, cost is reduced by 60% or above, the method is suitable for wide-temperature-range scenes ranging from-40 DEG C to 85 DEG C, and a low-cost and high-precision temperature compensation solution is provided for precise measurement of high-end equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical encoder technology, specifically to a method and system for temperature compensation of optical Gray code encoders based on NTC resistor networks, and particularly to a high-precision compensation technology that achieves real-time cancellation of PD signal temperature drift through hardware circuitry. Background Technology

[0002] As a core component of precision displacement measurement, the temperature stability of optical encoders directly affects the positioning accuracy of high-end equipment such as industrial robots and CNC machine tools. Although absolute optical encoders using Gray code encoding have a natural fault-tolerance advantage due to their single-bit transition characteristics, errors caused by temperature disturbances still limit their application in high-precision scenarios.

[0003] In the existing technology, the temperature compensation methods of photoelectric absolute encoders mainly have the following drawbacks: multi-reading head error elimination, vernier encoding and other schemes increase the hardware complexity to achieve compensation, resulting in a significant increase in system cost; software algorithm schemes such as dynamic storage compensation rely on complex calculations, have poor real-time performance and have response delays; some schemes use temperature sensors such as PT100 combined with analog circuit compensation, which not only increases the system complexity, but also introduces additional power consumption and calibration costs.

[0004] Existing Gray code encoders work by comparing the output signal of a photodetector (PD) with a fixed reference level to generate a digital switching signal. However, PD devices exhibit significant temperature drift: when the reference level is adjusted to achieve a 50% duty cycle for the output square wave at room temperature, temperature changes cause the PD signal amplitude to drift. Since the fixed reference level cannot be adjusted synchronously, this leads to the comparator's output square wave duty cycle deviating from the standard range, and may even cause logic errors. This temperature drift exhibits a non-linear but monotonic variation across the entire temperature range, further increasing the difficulty of compensation.

[0005] Therefore, in view of the shortcomings of the existing technology, it is necessary to design a temperature compensation method for optical Gray code encoders based on NTC resistor networks to solve the above problems. Summary of the Invention

[0006] To address the technical bottlenecks of existing temperature compensation schemes, such as high complexity, high cost, and poor real-time performance, this invention provides a temperature compensation method and system for optical Gray code encoders based on NTC resistor networks. By directly matching the temperature drift pattern of PD signals through hardware circuits, low-cost and high-precision real-time temperature compensation is achieved.

[0007] To achieve the above and other related objectives, the technical solution provided by this invention is: a temperature compensation method for an optical Gray code encoder based on an NTC resistor network, comprising the following steps:

[0008] S1: Select multiple temperature points within the encoder's operating temperature range, measure the PD signal output at each temperature point, use the PD signal output at room temperature as the reference data, calculate the ratio of the PD signal output at each temperature point to the reference data, and determine the drift law of the PD signal with temperature.

[0009] S2: Design an NTC resistor network voltage divider circuit based on the drift law, so that its output voltage change is consistent with the drift law of the PD signal with temperature;

[0010] S3: Integrate the NTC resistor network voltage divider circuit into the signal comparison circuit of the encoder, so that the output voltage of the NTC resistor network voltage divider circuit is compared with the PD signal output by the encoder in the signal comparison circuit, and a rectangular square wave is output.

[0011] S4: By adjusting the resistance value in the voltage divider circuit of the NTC resistor network, the matching degree of the compensation curve is finely adjusted to reduce the error caused by temperature affecting the encoder.

[0012] The preferred technical solution is as follows: In S1, the multiple temperature points include -20℃, 0℃, 25℃, 50℃, and 70℃, with the PD signal output at 25℃ serving as the reference data.

[0013] The preferred technical solution is as follows: In S2, an SDNT series NTC thermistor is selected, and the NTC thermistor is connected in series and parallel with resistor one and resistor two respectively. The reference voltage is connected, and the voltage divider point is connected to the potentiometer output to the inverting input terminal of the comparator. The temperature response slope of the NTC is adjusted by the series / parallel resistors.

[0014] The preferred technical solution is as follows: In S3, when the comparator circuit is integrated, the output voltage of the NTC resistor network voltage divider circuit is connected to the inverting input terminal of the comparator via a potentiometer, and the PD signal output by the encoder is connected to the positive input terminal of the comparator. At room temperature, the potentiometer is adjusted so that the input potential of the comparator is located at the middle position of the PD signal, and a square wave with a duty cycle close to 50% is output.

[0015] The preferred technical solution is as follows: In step S4, by adjusting the resistance values ​​of resistor one and resistor two or by adding an adjustable resistor, the drift rate of the PD signal is matched, the drift of the PD signal is offset, and a stable Gray code signal is output.

[0016] A system based on the above-mentioned optical Gray code encoder temperature compensation method includes:

[0017] Temperature characteristic measurement module, used to acquire PD signals and generate drift law model;

[0018] The NTC resistor network module consists of an NTC thermistor and a standard resistor forming a voltage divider circuit to output a compensation voltage.

[0019] The signal comparison module integrates NTC output and PD signal input to generate a compensated square wave;

[0020] The parameter calibration module is used to adjust the NTC network resistor parameters and optimize compensation accuracy.

[0021] Due to the application of the above technical solution, the beneficial effects of this invention are as follows:

[0022] 1. High-precision compensation

[0023] It directly matches the relationship between PD signal and temperature through hardware circuitry, without relying on software algorithms, offering strong real-time performance and a compensation response speed in the microsecond range.

[0024] 2. Low cost and easy to implement

[0025] It requires only a small number of NTC resistors and standard circuit components, without the need for additional sensors or complex processing modules, reducing costs by more than 60%.

[0026] 3. Strong adaptability

[0027] By adjusting the NTC circuit parameters, it can be adapted to the temperature characteristics of different encoder models, and is suitable for environments ranging from 0℃ to 55℃ to -40℃ to 85℃.

[0028] 4. Improved stability

[0029] After compensation, the temperature drift error of the encoder is reduced to within ±0.5%, significantly improving long-term reliability in industrial scenarios. Attached Figure Description

[0030] Figure 1 This is a circuit schematic diagram of the NTC compensation circuit integrated into the comparator, which is involved in this invention.

[0031] Figure 2 This is a circuit diagram for measuring the sample PD signal, which is involved in this invention.

[0032] Figure 3 This is a schematic diagram illustrating the temperature variation of the PD signal involved in this invention.

[0033] Figure 4 This is a schematic diagram comparing the output variation curve of the temperature compensation circuit involved in this invention with the measured average value. Detailed Implementation

[0034] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification.

[0035] Please see Figures 1-4It should be noted that in the description of this invention, the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product is in use. These terms are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance. The terms "horizontal," "vertical," and "suspended," etc., do not indicate that the component must be absolutely horizontal or suspended, but can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted.

[0036] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0037] like Figure 1 As shown, according to an overall technical concept of the present invention, a temperature compensation method for an optical Gray code encoder based on an NTC resistor network is provided, comprising the following steps:

[0038] S1: PD signal temperature drift characteristic calibration (The "PD signal" output by the encoder usually refers to a pulse plus direction signal, which is a common output signal form of the encoder in the field of motion control. It is mainly used to transmit the position (or displacement) and direction information of motion.)

[0039] Multiple characteristic temperature points are selected within the encoder's operating temperature range. The original PD signal output at each temperature point is measured. Using the PD signal at room temperature as a reference, the ratio of the PD signal at each temperature point to the reference value is calculated, and a drift law model of the PD signal with temperature variation is established. The characteristic temperature points include at least -20℃, 0℃, 25℃, 50℃, and 70℃, with the PD signal at 25℃ used as the reference data.

[0040] S2: NTC Resistor Network Design

[0041] Based on the PD signal drift pattern obtained in step S1, a voltage divider circuit composed of NTC thermistors is designed. The temperature response slope of the NTC is adjusted by connecting standard resistors in series and parallel, so that the temperature change curve of the circuit's output voltage is consistent with the PD signal drift curve. Specifically, SDNT series NTC thermistors (10K resistance at 25℃, B value 3380K) are selected. The NTC thermistors are connected in series and parallel with resistors R1 and R2 respectively and then connected to a reference voltage source. The voltage divider point is connected to the inverting input of the comparator through a potentiometer. The temperature response slope is adjusted by adjusting the resistance values ​​of R1 and R2.

[0042] S3: Compensation circuit integration

[0043] The NTC resistor network voltage divider circuit designed in step S2 is integrated into the signal comparison circuit of the encoder, so that the output voltage of the NTC circuit and the PD signal are compared in real time in the comparator; the output voltage of the NTC voltage divider circuit is connected to the inverting input terminal of the comparator via a potentiometer, and the PD signal is connected to the positive input terminal of the comparator; at room temperature, the potentiometer is adjusted so that the input potential of the comparator is located at the middle position of the PD signal, and the output is a rectangular square wave with a duty cycle close to 50%.

[0044] S4: Full Temperature Range Parameter Calibration

[0045] By adjusting the fixed resistor value in the NTC resistor network or connecting an adjustable resistor, the matching degree between the compensation curve and the PD signal drift curve is finely adjusted to ensure that the error is minimized across the entire temperature range of -20℃ to 70℃, thereby reducing the encoder temperature drift error to within ±0.5%.

[0046] Accordingly, the present invention also provides a temperature compensation system for an optical Gray code encoder based on an NTC resistor network, comprising:

[0047] Temperature characteristic measurement module: used to acquire the raw PD signal at characteristic temperature points and generate a drift law model;

[0048] NTC resistor network module: It consists of NTC thermistors and standard resistors connected in series and parallel, and outputs a compensation voltage that matches the drift pattern of the PD signal;

[0049] Signal comparison module: integrates NTC resistor network and PD signal input, outputs temperature-compensated rectangular square wave;

[0050] Parameter calibration module: used to adjust the NTC network resistance parameters and optimize the compensation accuracy across the entire temperature range.

[0051] Example 1:

[0052] Step 1: Temperature Characteristic Calibration

[0053] In a temperature-controlled environment, the drift of the original signal (current or voltage) output by the encoder PD is measured at multiple temperature points (e.g., -20℃, 0℃, 25℃, 50℃, 70℃) to establish a functional relationship between the PD signal and temperature.

[0054] For example Figure 2 As shown, to better reflect the temperature drift characteristics of the PD, three Gray code encoders were selected, and the PD signal variation of the three samples was measured. Since the PD output current signal is relatively small, a resistor of R=1K was connected to ground at each output port of the PD. By detecting the voltage at the detection point, the variation of the PD signal can be obtained.

[0055] In this example, to gain a more comprehensive understanding of the changes in the PD signal, a relatively large temperature range was selected: -40℃ to 85℃, with measurements taken at a total of 7 temperature points. The product was placed in a temperature chamber, and in addition to setting the temperature chamber to the target temperature, a high-precision thermometer was used to simultaneously detect the actual temperature inside the temperature chamber. During data acquisition, the actual temperature was used as the standard.

[0056] The following are the measured voltage values ​​obtained from the three products. The measured room temperature is 23.6℃. Using this temperature data as a benchmark, the ratio of the data at other temperature points of each signal to the room temperature data is calculated, which can yield a relatively intuitive normalized signal change pattern.

[0057]

[0058] Table 1: Voltage Variation at 7 Temperature Points When a 1K Resistor is Connected to Product 1PD

[0059]

[0060] Table 2: Voltage Variation at 7 Temperature Points When a 1K Resistor is Connected to the 2PD Product

[0061]

[0062] Table 3: Voltage Variation at 7 Temperature Points When an External 1K Resistor is Connected to the 3PD Product

[0063] The data above shows that the PD signal changes significantly with temperature, and the PD signal also shows an upward trend as the temperature increases.

[0064] The average value of the test results is taken, and the fitted curve is obtained using mathematical software such as MATLAB. Figure 3 The overall trend is approximately parabolic.

[0065] Step 2: NTC Circuit Design

[0066] Based on the PD signal drift pattern, a voltage divider circuit for the NTC resistor network is designed to match the output voltage versus temperature curve with the PD signal drift curve. For example, using SDNT series NTC thermistor 1 (10K resistance at 25℃, B value 3380K), NTC resistor 1 is connected in series and parallel with ordinary 30K resistors 2 and 3, respectively, and connected to a 3.3V reference voltage. The voltage divider point is connected to potentiometer 4, and the output is sent to the inverting input of comparator 5. The temperature response slope of the NTC is adjusted by connecting series / parallel resistors.

[0067] When designing a voltage divider circuit, to calculate the specific values ​​of the two resistors, MATLAB is used to first establish a formula for calculating the resistance value of the NTC resistor as a function of temperature:

[0068] functionR=calculateNTC(T,B,R0,T0)

[0069] ifnargin<4

[0070] T0=25;

[0071] end

[0072] T_K = T + 273.15;

[0073] T0_K = T0 + 273.15;

[0074] R=R0.*exp(B.*(1. / T_K-1 / T0_K));

[0075] end

[0076] Then, the resistance values ​​are determined using the least squares method with constraints, based on the relationship between the two ordinary resistors and the NTC resistor.

[0077] R_ref=calculateNTC(23.6,3380,10000,25);

[0078] U=@(p,T)(p(2). / (((R1.*(1)). / (R1+p(1)))+p(2))). / (p(2). / (((R_ref.*p(1)). / (R_ref+p(1)))+p(2)));

[0079] T=t;

[0080] ydata=ave;

[0081] options=optimset('MaxFunEvals',800,'MaxIter',500);

[0082] p0=[1,5];

[0083] lb=[0.1,0.1];

[0084] ub=[];

[0085] [p,resnorm]=lsqcurvefit(U,p0,T,ydata,lb,ub);

[0086] The fitted parameters for both resistors are approximately 31K. In actual circuits, commonly used resistor values ​​should be selected, so two 30K resistors are used for initial temperature compensation. Substituting these resistor values ​​into... Figure 1 From the electrical relationships in the simulation, a comparison diagram can be obtained. Figure 4 ).

[0087] Figure 4 In the figure, the circles represent the measured average values, and the line segments represent the output change curves of the temperature compensation circuit after fitting the selected compensation parameters. It can be seen from the figure that the output voltage change trend and numerical relationship of the temperature compensation circuit tend to be consistent with the change of the PD signal.

[0088] Step 3: Comparator Circuit Integration

[0089] The NTC circuit is connected to the encoder's signal comparison circuit. The NTC output voltage is connected to potentiometer 4 and output to the inverting input of comparator 5. The PD output signal is connected to the non-inverting input of comparator 5, allowing the NTC output voltage to be compared with the PD output signal, resulting in a rectangular square wave. At room temperature, by adjusting potentiometer 4 connected to the NTC circuit, the potential input to the comparator is positioned at the midpoint of the PD signal, resulting in a rectangular square wave with a duty cycle close to 50% after comparison. When the temperature changes, the NTC voltage and the PD output signal change proportionally, ensuring that the output square wave does not undergo significant changes or distortion.

[0090] Step 4: Parameter Calibration

[0091] By adjusting the fixed resistor value in the NTC circuit or adding an adjustable resistor, the matching degree of the compensation curve can be fine-tuned to ensure that the error is minimized over the entire temperature range.

[0092] Multisim simulation can be used to obtain the changes in reference voltage under various resistor ratios:

[0093]

[0094] Table 4: Variation of reference voltage under different resistance ratios

[0095] The data above shows the effect of the resistance values ​​of the two resistors on different temperatures:

[0096] The change in series resistance has a significant impact on high temperatures (above 25°C); the smaller the resistance, the higher the voltage in the high-temperature range.

[0097] The change in parallel resistance has a significant impact on low temperatures (below 25℃); the smaller the resistance, the higher the voltage in the low-temperature range.

[0098] Based on the above patterns, and combined with the voltage change measurement results when both resistors are 30K, parameter adjustments and calibrations can be performed. Since the target operating temperature range of this encoder product is 0℃ to 55℃, subsequent tests will mainly measure the voltage within this temperature range and at nearby temperatures.

[0099] The following table shows the relevant measurement results:

[0100]

[0101] Table 5: Voltage Variation at Different Temperatures

[0102] The ratio of the PD output to the temperature change is the target ratio of the temperature compensation circuit. First, it is measured with two 30K resistors. It can be seen that the NTC voltage change is too small when the temperature decreases. Adjust the NTC parallel resistor 2 to 27K and keep the series resistor 3 unchanged so that the rate of decrease of the NTC voltage divider circuit output voltage with the temperature decrease is consistent with the PD signal, thus canceling the PD signal drift and outputting a stable Gray code signal.

[0103] Performance verification: A Gray code encoder was tested in the range of -10℃ to 70℃. Without compensation, the angle error reached ±2°. After compensation, the angle error was reduced to ±0.05°, and the power consumption did not increase significantly.

[0104] The essential difference from existing technologies

[0105] Hardware compensation architecture innovation: Breaking through the existing technology's reliance on multiple reading heads, complex sensors, or software algorithms for compensation, this paper proposes for the first time a pure hardware real-time compensation scheme based on NTC resistor networks. By utilizing the negative temperature coefficient characteristics of NTC and the dynamic matching of PD signal drift, a direct cancellation mechanism of "temperature sensing and electrical compensation" is achieved.

[0106] Low-cost implementation path: It only uses basic components such as NTC thermistors, standard resistors and potentiometers, without the need for additional temperature sensors or complex processing chips. Compared with existing solutions, the cost is reduced by more than 60%, solving the industry pain point of excessively high temperature compensation costs for high-end encoders.

[0107] Nonlinear drift adaptation technology: By flexibly adjusting the temperature response slope of the NTC through a series and parallel resistor network, its nonlinear output characteristics are accurately matched with the nonlinear temperature drift law of the PD signal, breaking through the accuracy bottleneck of traditional linear compensation schemes.

[0108] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A temperature compensation method for optical grid Gray code encoders based on NTC resistor networks, characterized in that, The method comprises the following steps: S1: selecting multiple temperature points in the working temperature range of the encoder, measuring the PD signals output at each temperature point, taking the PD signal output at the normal temperature point as the reference data, calculating the ratio of the PD signal output at each temperature point to the reference data, and determining the drift rule of the PD signal with temperature; S2: designing an NTC resistance network voltage dividing circuit according to the drift rule, so that the output voltage change of the NTC resistance network voltage dividing circuit is consistent with the drift rule of the PD signal with temperature; S3: integrating the NTC resistance network voltage dividing circuit into the signal comparison circuit of the encoder, comparing the output voltage of the NTC resistance network voltage dividing circuit with the PD signal output by the encoder in the signal comparison circuit, and outputting a rectangular square wave; S4: adjusting the resistance value in the NTC resistance network voltage dividing circuit to fine-tune the compensation curve matching degree and reduce the error of the encoder caused by temperature influence.

2. The NTC resistor network based optical trellis Gray code encoder temperature compensation method according to claim 1, characterized in that: In the S1, the multiple temperature points include-20℃, 0℃, 25℃, 50℃, and 70℃, and the PD signal output at 25℃ is taken as the reference data.

3. The NTC resistor network based optical trellis Gray code encoder temperature compensation method of claim 1, wherein: In the S2, the SDNT series NTC thermistor is selected, the NTC thermistor is connected in series and parallel with resistor one and resistor two, the reference voltage is connected, the voltage dividing point is connected to the potentiometer output to the reverse input end of the comparator, and the temperature response slope of the NTC is adjusted through the series / parallel resistance.

4. The NTC resistor network based optical trellis Gray code encoder temperature compensation method of claim 1, wherein: In the S3, when the comparison circuit is integrated, the output voltage of the NTC resistance network voltage dividing circuit is connected to the reverse input end of the comparator through the potentiometer, the PD signal output by the encoder is connected to the positive input end of the comparator, the potentiometer is adjusted at normal temperature to make the input potential of the comparator located at the middle position of the PD signal, and a square wave with a duty cycle close to 50% is output.

5. The NTC resistor network based optical trellis Gray code encoder temperature compensation method of claim 1, wherein: In the S4, the resistance values of the resistor one and the resistor two are adjusted or an adjustable resistor is added to match the PD signal drift rate, offset the PD signal drift, and output a stable Gray code signal.

6. A system for temperature compensation based on the optical grid Gray code encoder of any of claims 1-5, characterized in that, It comprises: a temperature characteristic measurement module for collecting PD signals and generating a drift rule model; an NTC resistance network module for constructing a voltage dividing circuit by NTC thermistors and standard resistors and outputting a compensation voltage; a signal comparison module for integrating the NTC output and the PD signal input and generating a compensation square wave; a parameter calibration module for adjusting the NTC network resistance parameters and optimizing the compensation accuracy.

Citation Information

Cited By

  • Precision detection method and system for photoelectric encoder

    CN122217382A