Sensor signal processing method with inverse proportion relationship

By employing a fixed-point and golden section fitting method in an inverse proportional sensor, the problem of high-precision parameter fitting of the sensor under limited resources is solved, achieving zero error and low-resource computation at fixed points.

CN120651285BActive Publication Date: 2026-06-30FIRSTRATE SENSOR

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FIRSTRATE SENSOR
Filing Date
2025-06-06
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In the existing technology, the parameter fitting method of inverse proportional sensor requires a lot of computing resources and it is difficult to achieve zero error at fixed points. Especially when resources are limited in MCU or microcontroller, the traditional least squares method has large calculation errors and is not suitable for the high precision requirements of zero and threshold points.

Method used

An inverse function fitting method based on fixed points and the golden section method is adopted. By determining at least two fixed points, the relationship between the parameters to be determined is established. The initial values ​​are adjusted in combination with the golden section method to minimize the error, reduce the amount of calculation and improve the accuracy at fixed points.

Benefits of technology

It achieves high-precision parameter fitting at fixed points, reduces computational resource requirements, is suitable for resource-constrained MCU or microcontroller environments, and achieves zero error at zero and threshold points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120651285B_ABST
    Figure CN120651285B_ABST
Patent Text Reader

Abstract

This invention discloses a sensor signal processing method with an inverse proportional relationship, comprising the following steps: S100: determining at least two fixed points in the inverse proportional relationship function of the inverse proportional sensor; S200: making the curve of the inverse proportional relationship function to be fitted pass through the above two fixed points, thereby establishing the relationship between the undetermined parameters in the inverse proportional relationship function; S300: giving an initial value for any undetermined parameter, determining the fitting result under this given initial value according to the relationship between the undetermined parameters in the inverse proportional relationship function; S400: obtaining the error between the true value and the fitted value of the inverse proportional relationship function at a third point different from the two fixed points, and adjusting the given initial value of the undetermined parameter to minimize the error; S500: determining the fitting curve corresponding to the minimized error as the final fitting curve. This method reduces computational load, fits suitable parameters with lower resources, and achieves higher accuracy at fixed points.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to sensors, specifically to a class of sensors with inverse proportional relationships, and in particular to signal processing methods for such sensors. Background Technology

[0002] Sensors can sense and detect physical, chemical, or biological quantities in the environment and convert them into readable output signals, which are usually electrical signals for subsequent processing and analysis. The process of converting physical, chemical, or biological quantities into readable signals usually requires a function. Function fitting refers to the process of finding the optimal function between the measured quantity and the output quantity through several data points.

[0003] In existing technology, there exists a type of sensor where the output quantity is inversely proportional to the measured quantity. For example, photoelectric inverse proportional sensors utilize the inverse relationship between luminous flux (or light intensity) and the output electrical signal. For instance, in a specific optical path, the degree of obstruction by the object being measured (such as thickness or density) affects the light intensity received by the photosensitive element (such as a photoresistor or photodiode), thereby changing its resistance or current. When the object's thickness increases, the transmitted light intensity decreases, the resistance of the photosensitive element increases (or the current decreases), and the output signal becomes inversely proportional to the thickness. This is applied to thickness measurement, such as online thickness detection of paper and metal foil. Another example is the capacitive inverse proportional sensor, where the capacitance value is inversely proportional to the distance between the plates. When the measured physical quantity (such as displacement or pressure) causes a change in the plate distance, the capacitance value becomes inversely proportional to that physical quantity. For example, pressure acting on an elastic diaphragm reduces the plate distance, increases the capacitance value, and the output signal (such as voltage) is inversely proportional to the pressure (requiring circuit conversion). It can be applied to displacement detection in precision machining or to the sensing of acceleration through capacitance changes in MEMS (microelectromechanical systems) accelerometers.

[0004] The functional relationship between the measured quantity and the output quantity of this type of sensor with an inverse proportional relationship can be expressed as y = (c / (x+a)) - b, where y is the output quantity, x is the measured quantity, and a, b, and c are parameters to be determined. In practice, the values ​​of parameters a, b, and c need to be determined by function fitting to minimize the error between the fitted function output quantity and the true output quantity. This fitting method is generally the least squares method. However, the calculation of the sum of squares in least squares results in huge amounts of data, forcing engineers to set up double or 64-bit variable storage, which occupies a large amount of MCU or microcontroller memory and is prone to errors. On the other hand, the error calculated by the least squares method is the global average error. Although the overall error is minimized, there may be errors at every point. Some measurement sensors require high accuracy or even zero error at certain fixed points (such as zero point and threshold point), which is difficult to achieve with the traditional least squares method. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a sensor signal processing method with an inverse proportional relationship.

[0006] A sensor signal processing method with an inverse proportional relationship includes the following steps: S100: determining at least two fixed points in the inverse proportional relationship function of the inverse proportional relationship sensor; S200: making the curve of the inverse proportional relationship function to be fitted pass through the two fixed points, thereby establishing the relationship between the undetermined parameters in the inverse proportional relationship function; S300: giving an initial value for any undetermined parameter, determining the fitting result under this given initial value according to the relationship between the undetermined parameters in the inverse proportional relationship function; S400: obtaining the error between the true value and the fitted value of the inverse proportional relationship function at a third point different from the two fixed points, and adjusting the given initial value of the undetermined parameter to minimize the error; S500: determining the fitting curve corresponding to the minimized error as the final fitting curve.

[0007] Furthermore, the inverse proportional sensor has an inverse proportional function of the following form: y = (c / (x+a)) - b, where y is the output quantity, x is the measured quantity, and a, b, and c are parameters to be determined; the output error of the inverse proportional sensor signal at the fixed point is zero; the coordinates of the two fixed points are (y1, x1) and (y2, x2), then: a = [y2*x2 - y1*x1 + b*(x2 - x1)] / (y1 - y2); c = (y1 + b)*(x1 + a); at this time, the relationship between a, b, and c is established; the intersection interval of multiple products obtained by testing the products is used as the initial value of any parameter to be determined; the initial value of the given parameter to be determined is adjusted by the golden section method to minimize the error.

[0008] The beneficial effects of this invention are: This invention proposes an inverse function fitting method based on fixed points and the golden section method, which aims to reduce the amount of computation, fit suitable parameters with lower resources, and achieve higher accuracy at fixed points. Compared with the least squares method used directly, it has a smaller computational error and is more suitable for sensor calibration. Attached Figure Description

[0009] Figure 1 Flowchart of the fitting method of this invention;

[0010] Figure 2 A coordinate schematic diagram of the fitting method of this invention;

[0011] Figure 3 Flowchart of the golden ratio method. Detailed Implementation

[0012] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings, so that the above and other objects, features, and advantages of the present invention will become clearer. In all the drawings, the same reference numerals indicate the same parts. The drawings are not intentionally drawn to scale; the focus is on illustrating the main points of the invention.

[0013] The inverse proportional sensor of the present invention can be, for example, a photoelectric inverse proportional sensor or a capacitive inverse proportional sensor, but the present invention is not limited thereto and can also be other types of inverse proportional sensors.

[0014] When performing data fitting, the least squares method is often used to find the best-fitting parameters that minimize the sum of squared errors. For the function y = (c / (x+a)) - b, its sampling point error e_i = yi + bc / (xi+a), finding the minimum value of sum(e_i^2) requires numerical optimization algorithms, such as the Levenberg-Marquardt algorithm, to calculate the optimal parameter values ​​to complete the fitting.

[0015] Calculating sum(e_i^2) directly might require the Levenberg-Marquardt algorithm, but implementing this algorithm in C requires external libraries, resulting in a large amount of code and high computational resource consumption. For sensor products developed using MCUs or microcontrollers, memory resources are limited, making this approach unsuitable for practical applications. Furthermore, the least squares method calculates the error as a total average, potentially introducing error at every point, while some measurement sensors require high accuracy at zero and fixed points.

[0016] This invention employs an inverse function fitting method based on fixed points and the golden section method to solve the above problems, aiming to reduce computational load, fit suitable parameters with lower resources, and achieve higher accuracy at fixed points, such as... Figure 1 As shown, the method of the present invention specifically includes the following steps.

[0017] S100: Determine at least two fixed points in the inverse proportional function of the inverse proportional sensor.

[0018] For the inverse proportional function y=(c / (x+a))-b, there are only three parameters. Theoretically, at least three points are needed to calculate a, b, and c. Increasing the number of fitting points can avoid deviations caused by the data acquisition process and improve the fitting accuracy.

[0019] Taking a capacitive inverse proportional sensor as an example, its capacitance C = (c / (d+a)) - b, and the capacitance C is inversely proportional to the distance d between the plates. When the measured physical quantity (such as displacement or pressure) causes a change in the distance d between the plates, the capacitance value is inversely proportional to that physical quantity.

[0020] To achieve higher precision at fixed points, at least two fixed points need to be determined. At these two points, there must be a precise correspondence between the capacitance value C and the substrate spacing d (with an error essentially zero). Figure 2 The two points (y1, x1) and (y2, x2) can be special points such as zero points or threshold points, thus ensuring the measurement accuracy of special points.

[0021] S200: Make the curve of the inverse proportional function to be fitted pass through the two fixed points mentioned above, thereby establishing the relationship between the undetermined parameters in the inverse proportional function.

[0022] For the function y = (c / (x+a)) - b, a, b, and c are three undetermined parameters, such as Figure 2 As shown, after determining two fixed points (y1, x1) and (y2, x2), and ensuring that the curve S1 to be fitted passes strictly through these two points, we have:

[0023] a=[y2*x2-y1*x1+b*(x2-x1)] / (y1-y2);

[0024] c = (y1 + b) * (x1 + a);

[0025] At this point, the relationship between a, b, and c is established.

[0026] S300: Given any initial value of the undetermined parameter, determine the fitting result under this initial value based on the relationship between the undetermined parameters in the inverse proportional function.

[0027] At this point, let's assign an initial value to a parameter (e.g., any one of parameters a, b, and c), such as an initial value for b. This allows us to calculate a and c; subsequently, we can calculate the fitting result y under this initial value. For simplicity, let's assume the curve of this fitting result is... Figure 1 Curve S1 in the diagram.

[0028] For the initial optimal interval of b, the intersection interval of multiple products can be obtained by testing the actual products as the optimal interval, thereby reducing the number of subsequent searches.

[0029] S400: Obtain the error between the true value and the fitted value at the third point, and adjust the initial value of the undetermined parameter to minimize the error.

[0030] After obtaining curve S1, the magnitude of the error can be verified using the third point (y3, x3), such as... Figure 1As shown, for example, when the substrate spacing d takes the value of x3, the true output of the capacitance value C should be y3 at this time, while the output of the fitting curve is y, and the error e is: e = |y3 - y|; thus, it can be seen that as long as the corresponding b value is found to minimize e, the above problem can be transformed into an extreme value problem.

[0031] As Figure 3 shown, the golden section method is a fast way to find the extreme value within a specified interval. The algorithm description of the golden section method is as follows:

[0032] Initialization: Determine the unimodal interval [a, b] and the precision ε, and calculate the initial interior points:

[0033] x1 = b - 0.618×(b - a)

[0034] x2 = a + 0.618×(b - a), and calculate f(x1) and f(x2).

[0035] Iterative reduction of the interval:

[0036] If f(x1) < f(x2), the extreme value is in [a, x2], let b = x2, x2 = x1, and recalculate the new x1 according to 0.618;

[0037] Otherwise, the extreme value is in [x1, b], let a = x1, x1 = x2, and recalculate the new x2 according to 0.618.

[0038] Termination condition: Stop when the interval length < ε, and output (a + b) / 2 as the extreme point.

[0039] Among them, 0.618 is an approximate result. To reduce the error, (sqrt(5.0) - 1) / 2.0 can be used.

[0040] S500: Determine the fitting curve corresponding to the minimized error as the final fitting curve.

[0041] After adjusting the initial values of the undetermined parameters to minimize the error, the optimal given initial values of the parameters can be determined. Through this initial value of the parameter, combined with the relationship between the undetermined parameters in the inverse proportional relationship function established in S200, the values of a, b, and c can be finally calculated, and thus the final fitting curve can be determined.

[0042] Generally, when calibrating sensors, more attention is paid to the accuracy of the zero point and the full scale. This method can place the fitting fixed points on these points, so as to ensure higher accuracy at the specified points. The error calculation of this scheme is relatively simple, and it has obvious advantages in terms of computing resources.

[0043] Many specific details have been set forth in the foregoing description to provide a thorough understanding of the present invention. However, the above description is merely a preferred embodiment of the present invention, and the present invention can be implemented in many other ways different from those described herein. Therefore, the present invention is not limited to the specific embodiments disclosed above. Furthermore, any person skilled in the art can make many possible variations and modifications to the technical solutions of the present invention, or modify them into equivalent embodiments, using the methods and techniques disclosed above, without departing from the scope of the present invention. Any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention, without departing from the content of the present invention, shall still fall within the protection scope of the present invention.

Claims

1. A sensor signal processing method with an inverse proportional relationship, characterized in that, Includes the following steps: S100: Determine at least two fixed points in the inverse proportional function of the inverse proportional sensor; The sensor with the inverse proportional relationship has an inverse proportional relationship function of the following form: y = (c / (x+a)) - b Where y is the output quantity, x is the measured quantity, and a, b, and c are parameters to be determined. At the fixed point, the output error of the sensor signal with the inverse proportional relationship is zero. S200: Make the curve of the inverse proportional function to be fitted pass through the above two fixed points, thereby establishing the relationship between the undetermined parameters in the inverse proportional function; The coordinates of the two fixed points are (y1, x1) and (y2, x2), then: a = [y2*x2 - y1*x1 + b*(x2 - x1)] / (y1 - y2); c = (y1+b)*(x1+a); At this point, the relationship between a, b, and c is established; S300: Given an initial value for any undetermined parameter, determine the fitting result under this given initial value according to the relationship between the undetermined parameters in the inverse proportional relationship function; obtain the intersection interval of multiple products through product testing as the initial value of the undetermined parameter. S400: Obtain the error between the true value and the fitted value of the inverse proportional function at the two different third points, and adjust the initial value of the given undetermined parameter by the golden section method to minimize the error; S500: The fitted curve corresponding to the minimized error is determined as the final fitted curve.