A self-calibration compensation method for analog devices
Patent Information
- Application Number
- CN202311183100.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-09-13
AI Technical Summary
软件方法大多通过在运行程序中修正校准系数(偏差系数和增益系数)进行实现,通过对精准源进行测量,计算校准的偏差系数和增益系数,其中,数据的读取、记录以及校准系数的计算都需要人工干预,效率不高
[0024]本发明模拟器件的自校准补偿方法,设计了独立的自校准补偿程序,通过自校准补偿程序对模拟器件进行自动校准补偿,校准补偿后的校准系数可用于运行程序。一方面,该方法从软件层面出发,不需要额外的硬件辅助电路,成本较低、通用性高;另一方面,该方法可以实现模拟器件的自动校准补偿,人工参与度低、自动化程度高、效率高。此外,本发明方法通过单独编写自校准补偿程序来完成,这样可以减小模拟器件的运行程序的代码量,为模拟器件的运行节省存储空间。
Smart Images

Figure CN117215280B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of calibration and compensation of analog devices, and specifically relates to a self-calibration and compensation method for analog devices. Background Technology
[0002] In industrial control systems, various parameters (such as electrical and magnetic variables) need to be measured to ensure the rapid, accurate, and stable operation of the entire system. Sensors, as crucial devices for measuring these parameters, are essential for the precise control of industrial systems. Generally, the analog components in sensors experience parameter changes due to temperature drift, time drift, or other uncontrollable factors during use. Considering the impact of these factors on sensor accuracy, calibration and compensation of the analog components within the sensor are critical.
[0003] Existing calibration compensation methods can be divided into software and hardware methods. Hardware methods require additional auxiliary circuitry for sensor calibration compensation, which is costly and requires specific compensation circuitry for different devices, lacking universality. Software methods mostly achieve this by correcting calibration coefficients (deviation coefficients and gain coefficients) within the running program. This involves measuring a precise source and calculating the calibration deviation and gain coefficients. However, data reading, recording, and calibration coefficient calculation all require manual intervention, resulting in low efficiency. Summary of the Invention
[0004] To address the problems existing in the calibration and compensation methods of the prior art, this invention proposes a self-calibration and compensation method for analog devices. This method does not require additional hardware auxiliary circuits, has low cost and high versatility, and can realize automatic calibration and compensation of analog devices, with a high degree of automation and high efficiency.
[0005] This invention is achieved through the following technical solution:
[0006] A self-calibration compensation method for analog devices, comprising:
[0007] S1, Write the self-calibration compensation program into the analog device;
[0008] S2, The self-calibration compensation program is used to automatically calibrate and compensate the analog device to obtain calibration coefficients, and the calibration coefficients are stored.
[0009] S3, erase the self-calibration compensation program in the analog device and write a running program into the analog device; the running program uses the calibration coefficient to calibrate and compensate the parameters measured by the analog device during operation.
[0010] Preferably, step S2 specifically includes the following steps:
[0011] Step 1: Select the instrument wiring method and the calibration channel of the analog device; the instrument wiring method refers to the wiring method of the instrument connected to the analog device during operation;
[0012] Step 2: Connect a precision source to the calibration channel of the analog device according to the instrument wiring method selected in Step 1, measure the parameters of the precision source, and store the measurement results; repeat the parameter measurement of the precision source several times, and store the measurement results.
[0013] Step 3: Based on the measurement results obtained in Step 2 and the actual values of the corresponding precision source parameters pre-written in the self-calibration compensation program, calculate the calibration coefficients and store the calculated calibration coefficients.
[0014] Furthermore, it also includes:
[0015] Step 4: Connect the precision source to the calibration channel of the analog device according to the instrument wiring method selected in Step 1, and test the calibration accuracy of the analog device when using the calibration coefficient; if the calibration accuracy meets the preset requirements, proceed to S3; otherwise, return to Step 2.
[0016] Furthermore, in step 1, the calibration channel of the analog device is one or more.
[0017] Furthermore, in step 2, the obtained measurement results are stored, specifically by storing the measurement results in the storage space pre-allocated for the corresponding precision source.
[0018] Furthermore, in step 2, the obtained measurement results are stored, specifically by automatically allocating storage space to store the obtained measurement results.
[0019] Furthermore, in step 2, when measuring the parameters of the precise source, amplitude limiting and de-jitter filtering are performed.
[0020] Furthermore, in step 2, the number of precision sources is greater than two; in step 3, the calibration coefficient is calculated, specifically: the range of the analog device is segmented according to the parameters of the precision sources to obtain several calibration intervals, and the calibration coefficient is calculated for each calibration interval.
[0021] Furthermore, a delimiter is set at the beginning of the storage address range of the calibration coefficient corresponding to each calibration segment interval, and a check code is set at the end of the storage address range.
[0022] Preferably, the calibration coefficients are stored in a FLASH chip in the analog device.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] This invention discloses a self-calibration compensation method for analog devices. It designs an independent self-calibration compensation program to automatically calibrate and compensate the analog device. The calibration coefficients after calibration and compensation can be used to run the program. On one hand, this method is software-based, requiring no additional hardware auxiliary circuits, resulting in lower cost and higher versatility. On the other hand, this method enables automatic calibration and compensation of analog devices with low manual intervention, high automation, and high efficiency. Furthermore, this invention achieves this by writing a separate self-calibration compensation program, which reduces the amount of code in the analog device's running program and saves storage space for the analog device's operation.
[0025] Furthermore, the method of the present invention only requires manual access to different precision sources, while other processes such as the measurement and storage of precision source parameters and the calculation and storage of calibration coefficients are completed automatically, resulting in high efficiency.
[0026] Furthermore, after measuring the parameters of the precision source, the present invention automatically allocates storage space for storage based on the measurement results, which can further improve the degree of automation and increase efficiency.
[0027] Furthermore, when performing parameter measurements of a precise source, this invention employs amplitude limiting and de-jitter filtering, which reduces external interference and allows the measurement results to better reflect the actual operating state of the analog device.
[0028] Furthermore, the method of the present invention employs a segmented calibration approach, which results in higher calibration accuracy.
[0029] Furthermore, the method of the present invention uses delimiters and check codes to enhance reliability when storing calibration coefficients. When external viruses modify calibration coefficients, it can accurately identify the problem and switch to a backup scheme, thereby enhancing the reliability of the analog device. Attached Figure Description
[0030] Figure 1 This is a flowchart of the self-calibration compensation method for the analog device of the present invention;
[0031] Figure 2 This is a schematic diagram illustrating the storage of calibration coefficients in FLASH memory in an embodiment of the present invention;
[0032] Figure 3 This is a flowchart of the self-calibration compensation method for analog devices in an embodiment of the present invention. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0034] The term “comprising” and any variations thereof are intended to cover non-exclusive inclusion, such that a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are expressly listed, but may include other steps or units that are not expressly listed or that are inherent to such process, method, product or apparatus.
[0035] This invention primarily utilizes the self-calibration compensation method for analog quantity measurements in analog devices, enabling high-precision measurements. Considering that analog devices are mostly calibrated and compensated during factory testing and maintenance, during which time they are in a non-operating state, a separate self-calibration compensation program can be written. This program differs from the operating program of the analog device. The commonality between the two is that the calibration coefficients (deviation coefficient and gain coefficient) for both calibration and compensation are stored at the same address in the FLASH chip of the analog device. Thus, the calibration coefficients after calibration and compensation can be used in the operating program. The aforementioned analog device includes a microcontroller unit (MCU), an ADC (Analog-to-Digital Converter) chip, an FPGA (Field Programmable Gate Array) chip (for trusted systems), and peripheral circuits. The microcontroller unit contains a FLASH chip. Separating the self-calibration compensation program from the operating program reduces the amount of code in the operating program and decreases the memory footprint of the analog device.
[0036] Please see Figure 1 The self-calibration compensation method for analog devices of the present invention includes:
[0037] S1, Write a self-calibration compensation program into the analog device;
[0038] S2, The self-calibration compensation program is used to automatically calibrate and compensate the analog device to obtain calibration coefficients, and the calibration coefficients are stored.
[0039] S3, erase the self-calibration compensation program in the analog device and write a running program into the analog device; the running program uses the calibration coefficient to calibrate and compensate the parameters measured by the analog device during operation.
[0040] S2 specifically includes the following steps:
[0041] Step 1: Select the instrument wiring method and the calibration channel of the analog device to be calibrated and compensated; the instrument wiring method refers to the wiring method of the instrument connected to the analog device during operation.
[0042] Step 2: Connect a precision source to the calibration channel of the analog device to be calibrated and compensated according to the instrument wiring method selected in Step 1, measure the parameters of the precision source, and store the measurement results; repeat the parameter measurement of the precision source several times to obtain several measurement results and store them.
[0043] Step 3: Based on the measurement results obtained in Step 2 and the actual values of the corresponding precise source parameters pre-written in the self-calibration compensation program, calculate the calibration coefficients and store the calculated calibration coefficients.
[0044] It may further include: Step 4, connecting the precision source to the calibration channel of the analog device to be calibrated and compensated according to the instrument wiring method selected in Step 1, and testing the calibration accuracy of the analog device when using the calibration coefficient; if the calibration accuracy meets the preset requirements, then proceed to S3; otherwise, return to Step 2.
[0045] In step 1, the calibration channel of the analog device to be calibrated and compensated can be one or more, that is, calibration and compensation can be performed by a single calibration channel or by multiple calibration channels simultaneously.
[0046] In step 2, after the parameters of the precision source are measured, the measurement results can be stored in two different ways. One is to store the measurement results in the storage space pre-allocated for the corresponding precision source, and the other is to automatically allocate storage space according to the measurement results. Both methods have their advantages. The first method can ensure that the measurement results are stored in the correct location, while the second method is more efficient.
[0047] In step 2, when measuring the parameters of the precision source, amplitude limiting and de-jitter filtering are performed to more closely approximate the actual operating state of the analog device and improve calibration accuracy.
[0048] In step 2, the number of precision sources is greater than two, thereby enabling segmented calibration and improving calibration accuracy. A delimiter is set at the beginning of the storage address interval of the calibration coefficient corresponding to each calibration segment interval, and a check code is set at the end of the storage address interval to improve reliability.
[0049] In step 2, the precision source may be, for example, a resistance source.
[0050] Example
[0051] The following example, using the self-calibration compensation of a temperature acquisition simulation device in a thermal power plant, illustrates the implementation steps of the calibration compensation proposed in this invention. The temperature acquisition simulation device in a thermal power plant reflects the ambient temperature by measuring the resistance value of field instruments. Therefore, during calibration compensation, different resistance sources are connected for calibration compensation. Furthermore, considering that field instruments may have three-wire or four-wire wiring methods, the calibration compensation process of this invention is divided into four main steps: instrument selection, measurement, calibration coefficient calculation, and accuracy testing.
[0052] Please see Figure 3 The following is a detailed introduction to these four steps:
[0053] 1) Instrument selection steps:
[0054] a. Selection of instrument wiring method, such as choosing PT100 three-wire connection method;
[0055] b. Select the calibration channel of the analog device that needs calibration compensation. An analog device has multiple calibration channels. Each calibration channel can be calibrated and compensated individually, or multiple calibration channels can be calibrated and compensated simultaneously.
[0056] 2) Measurement steps:
[0057] a. Connect the resistance source to the calibration channel of the selected analog device according to the instrument wiring method selected in step 1). Measure the resistance source parameters (i.e., resistance value) and store the measurement results. The self-calibration compensation program pre-allocates storage space for the measurement results of different resistance sources. Each resistance source is connected for 2 seconds because a limiting and debouncing filtering stage is added during the measurement process. This reduces external interference, and the measurement results better reflect the actual operating state of the analog device. The actual resistance value of the resistance source is pre-written into the self-calibration compensation program.
[0058] b. Connect other resistance sources one after another to measure parameters until all the preset resistance sources in the self-calibration compensation program have been measured.
[0059] It's important to note that the measurement task provides two methods: one involves manually changing the actual values of the resistance source parameters in the self-calibration compensation program during the measurement process, so that the measurement result is stored in the corresponding resistance source's storage space; the other is automatic allocation of storage space based on the measurement result. For example, if resistance sources of 5 ohms, 10 ohms, 15 ohms, etc., are set, and if 7.5 ohms ≤ measurement result ≤ 12.5 ohms, then the result is allocated to the storage space corresponding to the 10 ohm resistance source, and so on. The first method is less efficient but avoids errors in storing measurement results. The second method is more efficient and is only suitable when the analog device has a small deviation or when the number of resistance sources is small.
[0060] The relationship between the resistance and temperature of field instruments is approximately linear. A common method is to select two resistance sources within the temperature range for calibration and compensation. This invention, however, employs a self-calibrating compensation program for automatic calibration, resulting in higher efficiency. Therefore, during calibration, multiple resistance sources are selected within the temperature range for segmented calibration. This involves dividing the temperature range of the analog device into segments to obtain several calibration intervals, and then calibrating each of these intervals separately, leading to higher calibration accuracy.
[0061] 3) Calibration coefficient calculation steps:
[0062] a. Based on the measurement results obtained in step 2) and the actual resistance value of the resistance source, calculate the calibration coefficients (i.e., deviation coefficients and gain coefficients) in segments;
[0063] b. Write the calculation results of the calibration coefficients into the FLASH chip.
[0064] Figure 2 This is a storage diagram of the calibration coefficients in the FLASH chip. The address range for storing the calibration coefficients is shared by the self-calibration compensation program and the running program. The number of calibration segments can be selected based on accuracy requirements and the linearity of the curve. A better linearity allows for fewer segments, while a poorer linearity allows for more segments. The minimum is one calibration segment, meaning calibration is performed using two resistance sources. The curve refers to the input-output relationship curve of the field instrument.
[0065] In addition, to increase the reliability of the calibration coefficients, a delimiter is set at the beginning of the storage address range of the calibration coefficients corresponding to each calibration segment interval, and a check code is set at the end of the storage address range, thereby increasing the security and reliability of the system operation.
[0066] 4) Accuracy testing steps:
[0067] Connect the test resistor within the temperature range to the calibration channel of the selected analog device according to the instrument wiring method selected in step 1) to test the calibration accuracy. Wait 2-3 seconds. If the flag position is 1 (LED is lit), the test is passed. Erase the self-calibration compensation program of the analog device and burn the running program. Otherwise, if the flag position is 0, the test is failed. Restart step 2).
[0068] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A self-calibration compensation method for analog devices, characterized in that, include: S1, Write the self-calibration compensation program into the analog device; S2, The self-calibration compensation program is used to automatically calibrate and compensate the analog device to obtain calibration coefficients, and the calibration coefficients are stored. The address range for storing calibration coefficients is a shared range between the self-calibration compensation program and the running program; S3, erase the self-calibration compensation program in the analog device, and write a running program into the analog device; the running program uses the calibration coefficient to calibrate and compensate the parameters measured by the analog device during operation; S2 specifically includes the following steps: Step 1: Select the instrument wiring method and the calibration channel of the analog device; the instrument wiring method refers to the wiring method of the instrument connected to the analog device during operation; Step 2: Connect a precision source to the calibration channel of the analog device according to the instrument wiring method selected in Step 1, measure the parameters of the precision source, and store the measurement results; repeat the parameter measurement of the precision source several times to obtain several measurement results and store them. Step 3: Based on the measurement results obtained in Step 2 and the actual values of the corresponding precision source parameters pre-written in the self-calibration compensation program, calculate the calibration coefficients and store the calculated calibration coefficients. Step 4: Connect the precision source to the calibration channel of the analog device according to the instrument wiring method selected in Step 1, and test the calibration accuracy of the analog device when using the calibration coefficient; if the calibration accuracy meets the preset requirements, proceed to S3; otherwise, return to Step 2. In step 2, the number of precision sources is greater than two; in step 3, the calibration coefficient is calculated, specifically: the range of the analog device is segmented according to the parameters of the precision sources to obtain several calibration intervals, and the calibration coefficient is calculated for each calibration interval; a delimiter is set at the beginning of the storage address interval corresponding to the calibration coefficient of each calibration interval, and a check code is set at the end of the storage address interval.
2. The self-calibration compensation method for analog devices according to claim 1, characterized in that, In step 1, the calibration channel of the analog device is one or more.
3. The self-calibration compensation method for analog devices according to claim 1, characterized in that, In step 2, the obtained measurement results are stored, specifically by storing the measurement results in the storage space pre-allocated for the corresponding precision source.
4. The self-calibration compensation method for analog devices according to claim 1, characterized in that, In step 2, the obtained measurement results are stored. Specifically, storage space is automatically allocated to store the obtained measurement results.
5. The self-calibration compensation method for analog devices according to claim 1, characterized in that, In step 2, when measuring the parameters of the precision source, amplitude limiting and de-jitter filtering are performed.
6. The self-calibration compensation method for analog devices according to claim 1, characterized in that, The calibration coefficients are stored in the FLASH chip of the analog device.
Citation Information
Patent Citations
Calibration method of detection device and method for acquiring detection device calibration file
CN108139957A
Program updating method, device and system of encoder
CN112988172A
Simulation measurement circuit parameter self-calibration method
CN116224196A