An ammonia nitrogen sensor dynamic error compensation method, ammonia nitrogen sensor and system

By combining the Arrhenius equation and Kalman filtering, the problem of zero-point drift of the ammonia nitrogen sensor electrode was solved, realizing automatic compensation and accurate measurement of the ammonia nitrogen sensor, and improving the stability and lifespan of the sensor.

CN122448943APending Publication Date: 2026-07-24ZHONGSHUI WEIZHI SENSING TECHNOLOGY (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610549290.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-23
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

The zero point of the ammonia nitrogen sensor is prone to drift during long-term operation, resulting in inaccurate measurements. Existing technologies cannot achieve unattended long-term stable operation and cannot effectively predict and correct drift.

Method used

An electrode zero-point drift rate model was established using the Arrhenius equation, and automatic tracking and compensation were performed using Kalman filtering. Combined with the Nernst equation, accurate measurement of ammonia nitrogen concentration was achieved, and the electrode zero-point drift was corrected in real time using a temperature sensor.

Benefits of technology

This reduces the number of manual calibrations, enables accurate prediction and real-time correction of electrode zero-point drift, and improves the lifespan and data continuity of the ammonia nitrogen sensor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122448943A_ABST
    Figure CN122448943A_ABST
Patent Text Reader

Abstract

The application discloses a method for tracking electrode zero-point drift based on Kalman filtering combined with Arrhenius equation, and belongs to the field of water quality monitoring sensor signal processing. The application establishes a temperature-related electrode aging drift rate model through the Arrhenius equation, embeds the drift law into the state transition process of Kalman filtering, realizes prior prediction of the zero point and posterior correction after observation, can filter out measurement noise and predict long-term aging drift trend at the same time, significantly reduces the frequency of manual calibration, improves the long-term stability and precision of online measurement of an ion selective electrode, and is suitable for unattended long-term operation of water quality monitoring equipment such as ammonia nitrogen sensors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of signal processing technology for water quality monitoring sensors, specifically to a method for zero-point drift compensation of ion-selective electrodes, and more particularly to a dynamic error compensation method for ammonia nitrogen sensors, which realizes long-term automatic tracking and adaptive compensation of electrode zero-point drift. Background Technology

[0002] In online water quality monitoring systems, the sensitive membranes of devices such as ammonia nitrogen sensors and ion-selective electrodes undergo physical aging and chemical degradation during long-term operation, causing the zero-point intercept of the electrode to drift slowly over time. This drift process is significantly affected by water temperature and is characterized by irreversible and monotonic changes.

[0003] Ammonia nitrogen sensors mostly employ the principle of ion-selective electrodes, and their measurements follow the Nernst equation:

[0004] E = E0 + S・lgC

[0005] Where E0 is the zero-point intercept of the electrode, S is the Nernst slope, and C is the ammonia nitrogen concentration.

[0006] During long-term online operation, the electrode zero point E0 is prone to slow shift, mainly due to the following reasons:

[0007] 1. Natural aging of sensitive membrane materials

[0008] The active material of the sensitive membrane undergoes chemical decay and physical structural deterioration over time, leading to changes in surface response characteristics and directly causing a continuous drift of the zero intercept E0.

[0009] 2. The significant effect of temperature on aging rate

[0010] The higher the water temperature, the faster the aging reaction rate of the sensitive membrane, and the more obvious the zero-point drift. Temperature fluctuations will further aggravate the nonlinearity of the drift, making the drift pattern difficult to predict.

[0011] Existing technologies typically have the following shortcomings:

[0012] 1. Relying on manual periodic calibration results in high operation and maintenance costs, poor data continuity, and an inability to achieve long-term unattended stable operation;

[0013] 2. Conventional filtering algorithms can only suppress measurement noise, but cannot predict the trend of temperature-coupled aging drift;

[0014] 3. The drift model and state estimation algorithm are separated, making it impossible to achieve closed-loop control with drift prediction and real-time correction. Summary of the Invention

[0015] In view of this, the present invention provides a dynamic error compensation method for an ammonia nitrogen sensor, an ammonia nitrogen sensor and a system, to solve the problem of zero-point drift of the electrodes in existing ammonia nitrogen sensors.

[0016] This invention provides a dynamic error compensation method for an ammonia nitrogen sensor, wherein the ammonia nitrogen sensor employs an ion-selective electrode, and the dynamic error compensation method for the ammonia nitrogen sensor includes the following steps:

[0017] S1. Obtain the initial electrode zero point;

[0018] S2. Based on the Arrhenius equation, establish an electrode zero-point drift rate model, express the drift rate as a function of temperature, and automatically track and compensate for the electrode zero-point drift to obtain the compensated electrode zero-point intercept.

[0019] S3. Obtain the measured potential;

[0020] S4. Obtain the ammonia nitrogen concentration using the Nernst equation, where the Nernst equation is:

[0021]

[0022] In the formula: This is the measured potential. The zero-point intercept of the electrode. Let Nernst slope be the slope. This represents the ammonia nitrogen concentration.

[0023] Furthermore, the zero-point drift rate model is derived from the Arrhenius equation:

[0024]

[0025] In the formula:

[0026] : Zero-point drift rate at the current temperature;

[0027] Pre-exponential factor, which is related to the properties of the sensitive membrane material;

[0028] Apparent activation energy of sensitive membrane aging;

[0029] Ideal gas constant, with a value of 8.314 J / (mol・K);

[0030] Absolute temperature ;

[0031] : Current temperature in Celsius.

[0032] Furthermore, the constants in the above formulas are combined into composite constants. and Simplified to:

[0033]

[0034] in, , This is the recombination constant related to the properties of the sensitive membrane.

[0035] Furthermore, the automatic tracking and compensation of electrode zero-point drift is performed using a discrete time step accumulation method, with the sensor performing this during the sampling period. The intercept drift within is .

[0036] Furthermore, Kalman filtering is applied to the electrode zero-point drift compensation in step S2.

[0037] Furthermore, the Kalman filtering for electrode zero-point drift compensation specifically involves:

[0038] S21. Define the state variables of the Kalman filter. For the first True zero-point intercept of the electrode at any moment ;

[0039] S22, Based on drift rate and sampling period Construct the state prior prediction equation:

[0040]

[0041] And perform error covariance prediction:

[0042] in, For process noise covariance;

[0043] S23. Based on the observed values Calculate the Kalman gain:

[0044]

[0045] in, To measure the noise covariance, the observed values Electrode baseline data from the water quality stabilization period were used;

[0046] S24. Update the optimal zero-point estimate. and update the error covariance. .

[0047] Furthermore, the optimal zero-point estimate obtained in step S24 is... Substituting the zero-point intercept of the real-time electrode into the Nernst equation, the true ammonia nitrogen concentration can be calculated by reverse calculation.

[0048] The present invention also provides an ammonia nitrogen sensor, which uses the method described above to compensate for the zero point of the electrode.

[0049] The present invention also provides a water quality monitoring system, which includes an ammonia nitrogen sensor, a temperature sensor, and a microprocessor. The temperature sensor is used to measure the water temperature, and the microprocessor is used to execute the above-described dynamic error compensation method to compensate for the zero point of the ammonia nitrogen sensor electrode.

[0050] The present invention also provides a computer-readable storage medium storing a computer program or instructions, characterized in that the computer program or instructions are programmed or configured to execute the above-described dynamic error compensation method for ammonia nitrogen sensors by a processor.

[0051] The beneficial effects of this invention are:

[0052] (1) The Arrhenius equation is used to realize the electrode zero-point drift caused by the chemical aging law of temperature coupling of ion-selective electrodes, which greatly reduces the number of manual calibrations;

[0053] (2) Kalman filtering is used to filter the electrode zero-point drift compensation, and noise suppression and drift compensation are achieved at the same time. It can accurately predict the zero-point drift trend, rather than just passive filtering.

[0054] (3) The simplified model has a small computational load, making it suitable for real-time operation of microcontrollers;

[0055] (4) The closed-loop estimation structure is stable and can effectively suppress drift accumulation and extend the service life of the electrode. Attached Figure Description

[0056] The features and advantages of the invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the invention in any way. In the drawings:

[0057] Figure 1 A flowchart of a dynamic error compensation method for an ammonia nitrogen sensor according to Embodiment 1 of the present invention is shown;

[0058] Figure 2 The flowchart of Kalman filtering for electrode zero-point drift compensation in Embodiment 1 of the present invention is shown. Specific Implementation

[0059] 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.

[0060] In this embodiment of the invention, the term "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.

[0061] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0062] In this embodiment of the invention, the term "multiple" refers to two or more, and other quantifiers are similar.

[0063] Example 1

[0064] This embodiment provides a dynamic error compensation method for an ammonia nitrogen sensor. The ammonia nitrogen sensor employs an ion-selective electrode, and the dynamic error compensation method for the ammonia nitrogen sensor includes the following steps:

[0065] S1. Obtain the initial electrode zero point;

[0066] S2. Based on the Arrhenius equation, establish an electrode zero-point drift rate model, express the drift rate as a function of temperature, and automatically track and compensate for the electrode zero-point drift to obtain the compensated electrode zero-point intercept.

[0067] S3. Obtain the measured potential;

[0068] S4. The ammonia nitrogen concentration is obtained through the Nernst equation, where the Nernst equation is:

[0069]

[0070] In the formula: This is the measured potential. The zero-point intercept of the electrode. Let Nernst slope be the slope. This represents the ammonia nitrogen concentration.

[0071] In step S2, the zero-point drift rate model is derived from the Arrhenius equation:

[0072]

[0073] In the formula:

[0074] : Zero-point drift rate at the current temperature;

[0075] Pre-exponential factor, which is related to the properties of the sensitive membrane material;

[0076] Apparent activation energy of sensitive membrane aging;

[0077] Ideal gas constant, with a value of 8.314 J / (mol・K);

[0078] Absolute temperature ;

[0079] : Current temperature in Celsius.

[0080] To implement the dynamic error compensation method of this embodiment, a temperature sensor is also included for real-time measurement of the water temperature, i.e., the current temperature in Celsius.

[0081] To facilitate edge computing by the microcontroller, the constants in the Arrhenius formula above are combined into composite constants. and Simplified to:

[0082]

[0083] in, , The recombination constant is related to the properties of the sensitive membrane.

[0084] The recombination constant corresponding to the sensitive membrane , It can be determined through experiments or set based on empirical values.

[0085] In step S2, the automatic tracking and compensation of the zero-point drift of the electrode is performed using a discrete time step accumulation method. The sensor operates within the sampling period. The intercept drift within is .

[0086] The Nernst equation after electrode zero-point compensation is:

[0087]

[0088] Furthermore, to filter measurement noise, the dynamic error compensation method in this embodiment also performs Kalman filtering on the electrode zero-point drift compensation in step S2. The Kalman filtering specifically includes the following steps:

[0089] S21. Define the state variables of the Kalman filter. For the first True zero-point intercept of the electrode at any moment ;

[0090] S22, Based on drift rate and sampling period Construct the state prior prediction equation:

[0091]

[0092] Among them, sampling period The time limit can be selected according to the actual environmental conditions, such as 6 hours, 12 hours or 24 hours, etc.

[0093] And perform error covariance prediction:

[0094] in, The process noise covariance represents the nonlinear random error of the physical aging model;

[0095] The initial error covariance is between 25 and 400, for example, 100, 200, or 300; the process noise covariance... =0.001~0.01, for example, 0.005;

[0096] S23. Based on the observed values Calculate the Kalman gain:

[0097] in, To measure the noise covariance, representing the interference of converted noise and water wave fluctuations;

[0098] Among them, the observed values Using baseline electrode data from a stable water quality period (e.g., low-disturbance nighttime hours), the entry into a water quality stabilizer can be determined as follows: The processor sets a time window (e.g., 2 AM to 4 AM) and continuously monitors the variance of the measured potential fluctuations. When the variance continuously falls below a set threshold, the water body is considered to have entered a low-disturbance stable period. At this time, the average potential value within this window is taken as the baseline observation value. .

[0099] Measurement noise covariance =0.01~0.25, for example, 0.05;

[0100] S24. Update the optimal zero-point estimate. and update the error covariance. .

[0101] After completing one iteration, the process repeats in the next sampling cycle to achieve continuous tracking of zero-point drift.

[0102] Substituting the true zero intercept after Kalman filtering into the Nernst equation yields:

[0103]

[0104] Therefore, the true ammonia nitrogen concentration measured after electrode zero-point drift compensation and Kalman filtering to eliminate noise is:

[0105]

[0106] Example 2

[0107] This embodiment provides a water quality monitoring system, which includes an ammonia nitrogen sensor, a temperature sensor, and a processor. The temperature sensor is used to measure the water temperature, and the processor is used to execute the above-mentioned dynamic error compensation method to compensate for the zero-point drift of the ammonia nitrogen sensor electrodes.

[0108] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the computer device, connecting all parts of the computer device through various interfaces and lines.

[0109] Memory can be used to store computer programs and / or models. The processor performs various functions of the computer device by running or executing the computer programs and / or models stored in the memory, and by accessing data stored in the memory. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system and at least one application program required for a function (e.g., sound playback, image playback, etc.); the data storage area can store data created based on the use of the mobile phone (e.g., audio data, video data, etc.). Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, SmartMedia Cards (SMC), Secure Digital (SD) cards, Flash Cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.

[0110] It should be understood that each block of a flowchart and / or block diagram, and combinations of blocks in a flowchart and / or block diagram, can be implemented by a computer program. These computer programs can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that instructions executable by the processor of the computer or other programmable data processing device generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0111] These computer programs may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0112] These computer programs may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0113] This embodiment also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute the above-described dynamic error compensation method for ammonia nitrogen sensors via a processor.

[0114] Similarly, for details not covered in this embodiment, please refer to Embodiment 1, Embodiment 2, and... Figure 1 , Figure 2 The specific details will not be repeated here.

[0115] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for dynamic error compensation of an ammonia nitrogen sensor, characterized in that, The ammonia nitrogen sensor employs an ion-selective electrode, and the dynamic error compensation method for the ammonia nitrogen sensor includes the following steps: S1. Obtain the initial electrode zero point; S2. Based on the Arrhenius equation, establish an electrode zero-point drift rate model, express the drift rate as a function of temperature, automatically track and compensate for electrode zero-point drift, and obtain the compensated electrode zero-point intercept. S3. Obtain the measured potential; S4. Obtain the ammonia nitrogen concentration using the Nernst equation, where the Nernst equation is: In the formula: This is the measured potential. The zero-point intercept of the electrode. Let Nernst slope be the slope. This represents the ammonia nitrogen concentration.

2. The dynamic error compensation method for an ammonia nitrogen sensor according to claim 1, characterized in that, The zero-point drift rate model is derived from the Arrhenius equation: In the formula: : Zero-point drift rate at the current temperature; Pre-exponential factor, which is related to the properties of the sensitive membrane material; Apparent activation energy of sensitive membrane aging; Ideal gas constant, with a value of 8.314 J / (mol・K); Absolute temperature ; : Current temperature in Celsius.

3. The dynamic error compensation method for an ammonia nitrogen sensor according to claim 2, characterized in that, Combine the constants in the above formula into a composite constant. and Simplified to: in, , This is the composite constant related to the properties of the sensitive membrane.

4. The dynamic error compensation method for an ammonia nitrogen sensor according to claim 2, characterized in that, The automatic tracking and compensation of electrode zero-point drift is performed using a discrete time step accumulation method, with the sensor operating within the sampling period. The intercept drift within is .

5. The dynamic error compensation method for an ammonia nitrogen sensor according to claim 4, characterized in that, Kalman filtering is applied to the electrode zero-point drift compensation in step S2.

6. The dynamic error compensation method for an ammonia nitrogen sensor according to claim 5, characterized in that, The Kalman filtering for electrode zero-point drift compensation specifically involves: S21. Define the state variables of the Kalman filter. For the first Real zero-point intercept of the electrode at any moment ; S22, Based on drift rate and sampling period Construct the state prior prediction equation: And perform error covariance prediction: in, For process noise covariance; S23. Based on the observed values Calculate the Kalman gain: in, To measure the noise covariance, the observed values Electrode baseline data from the water quality stabilization period were used; S24. Update the optimal zero-point estimate. and update the error covariance. .

7. The dynamic error compensation method for an ammonia nitrogen sensor according to claim 6, characterized in that, The optimal zero-point estimate obtained in step S24 Substituting the zero-point intercept of the real-time electrode into the Nernst equation, the true ammonia nitrogen concentration can be calculated by reverse calculation.

8. An ammonia nitrogen sensor, characterized in that: The ammonia nitrogen sensor uses the dynamic error compensation method for ammonia nitrogen sensors as described in any one of claims 1-7 to compensate for the zero point of the electrodes.

9. A water quality monitoring system, characterized in that, The water quality monitoring system includes an ammonia nitrogen sensor, a temperature sensor, and a microprocessor. The temperature sensor is used to measure the water temperature, and the microprocessor is used to execute the dynamic error compensation method for the ammonia nitrogen sensor according to any one of claims 1-7 to compensate for the zero point of the ammonia nitrogen sensor electrodes.

10. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute the dynamic error compensation method for the ammonia nitrogen sensor according to any one of claims 1 to 7 via a processor.