Sensor full-link calibration method, system and device based on hierarchical decoupling
Patent Information
- Application Number
- CN202610866473.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-08-18
AI Technical Summary
而现有的传感器校准方法主要有单点校准和两点校准,前者仅在校准零点位置进行修正,后者在零点和满量程两个点进行校准并通过线性插值计算中间值,二者均无法校正非线性误差,精度低,无法根据实际需求现场调整校准参数,必须重新烧录固件,且现场低精度调整后易丢失工厂精密标定结果
响应于传感器全链路校准功能开启动作,获取待校准传感器的原始AD采样信号;根据硬件校准参数集合利用分段参数选择规则确定所述原始AD采样信号的校准分段和不同校准分段对应的分段校准参数,并根据所述校准分段和对应的所述分段校准参数对所述原始AD采样信号执行硬件线性校准,得到标准电信号;在接收到上位机下发的校准配置指令的情况下,提取所述校准配置指令中的应用校准参数集合和线性映射参数集合;根据所述应用校准参数集合对所述标准电信号执行应用误差校准,得到补偿电信号;根据所述线性映射参数集合利用两点线性映射算法将所述补偿电信号转换为对应工程物理量,得到并存储校准结果,其中,所述对应工程物理量应用于工业现场的过程控制。通过分段校准提高了非线性传感器的校准精度,并且通过硬件线性校准、应用误差校准以及物理量映射分层解耦校准的形式,实现了保证出厂基准精度的情况下高精度的现场校准。
Smart Images

Figure CN122590967A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial data acquisition and signal processing technology, and in particular to a sensor adaptive calibration method, system and device based on hierarchical decoupling. Background Technology
[0002] In fields such as industrial automation, process control, and smart instrumentation, accurate acquisition of sensor signals is fundamental to the normal operation of the system. Due to factors such as the nonlinear characteristics of the sensors themselves, temperature drift, and aging, the raw acquired signals often contain significant errors and require calibration. Existing sensor calibration methods mainly include single-point calibration and two-point calibration. The former only corrects at the zero-point calibration location, while the latter calibrates at both the zero point and full scale and calculates the intermediate value through linear interpolation. Neither of these methods can correct nonlinear errors, has low accuracy, and cannot adjust calibration parameters on-site according to actual needs. It is necessary to re-flash the firmware, and low-precision on-site adjustments are prone to losing the precise factory calibration results. Summary of the Invention
[0003] The purpose of this invention is to provide a sensor end-to-end calibration method, system, and device based on hierarchical decoupling, aiming to improve calibration accuracy and enable timely on-site calibration through end-to-end calibration.
[0004] To achieve the above objectives, a first aspect of this disclosure provides a sensor end-to-end calibration method based on hierarchical decoupling, the method comprising: In response to the activation of the sensor end-to-end calibration function, the original AD sampling signal of the sensor to be calibrated is acquired; Based on the hardware calibration parameter set, the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments are determined using segment parameter selection rules. Hardware linear calibration is then performed on the original AD sampling signal according to the calibration segments and the corresponding segment calibration parameters to obtain a standard electrical signal. Upon receiving a calibration configuration instruction from the host computer, extract the set of application calibration parameters and the set of linear mapping parameters from the calibration configuration instruction; The standard electrical signal is subjected to application error calibration based on the application calibration parameter set to obtain a compensated electrical signal; The compensation electrical signal is converted into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, and the calibration result is obtained and stored. The corresponding engineering physical quantity is applied to process control in industrial settings.
[0005] In one possible implementation, determining the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments based on the hardware calibration parameters and segment parameter selection rules includes: Extract the zero-point offset value, segment switching threshold, and segment calibration parameters from the hardware calibration parameter set; Based on the zero-point offset value and the segment switching threshold, the original AD acquisition signal is determined to be a different segment signal, and the corresponding segment calibration parameter is selected.
[0006] In one possible implementation, determining the original AD acquisition signal into different segmented signals based on the zero-point offset value and the segment switching threshold, and determining the corresponding segment calibration parameter to be selected, includes: The original AD sampling signal whose difference from the zero offset value does not exceed the segment switching threshold is determined as the first segment signal, and the first segment calibration parameter is selected. The original AD sampling signal whose difference from the zero offset value exceeds the segment switching threshold is determined as the second segment signal. If the third segment calibration parameter is determined to be invalid, the second segment calibration parameter is determined to be selected. If the third segment calibration parameter is determined to be valid, then it is determined whether the second segment signal is a signal generated by the sensor to be calibrated in the target mode. If it is determined that the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, then the second segment calibration parameter is selected. If it is determined that the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, then the third segment calibration parameter is selected.
[0007] In one possible implementation, determining whether the second segmented signal is a signal generated by the sensor to be calibrated in the target mode includes: If the zero-point offset value is less than the segment switching threshold, and the difference between the second segment signal and the zero-point offset value is less than the zero-point offset value, then the second segment signal is determined to be the signal generated by the sensor to be calibrated in the first target mode. If the zero-point offset value is greater than the segment switching threshold, and the difference between the second segment signal and the zero-point offset value is greater than the zero-point offset value, then the second segment signal is determined to be the signal generated by the sensor to be calibrated in the second target mode. The target mode includes a first target mode and a second target mode.
[0008] In one possible implementation, performing application error calibration on the standard electrical signal according to the application calibration parameter set to obtain a compensated electrical signal includes: Extract user-defined gain and offset parameters from the application calibration parameter set; Determine whether the gain parameter is valid. If the gain parameter is determined to be invalid, then assign the gain coefficient to a preset safe default value. Calculate the difference between the standard electrical signal and the offset parameter; The product of the difference and the gain coefficient is calculated to obtain the compensated electrical signal.
[0009] In one possible implementation, the step of converting the compensation electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters includes: Extract the range of the sensor to be calibrated from the set of linear mapping parameters; The mapping start point parameter and the mapping end point parameter are determined based on the range and the compensation electrical signal, wherein the mapping start point parameter includes the minimum value of the compensation electrical signal and the minimum value of the range, and the mapping end point parameter includes the maximum value of the compensation electrical signal and the maximum value of the range; The mapping coefficients are determined based on the mapping start-point parameter and the mapping end-point parameter; The compensation electrical signal is converted into a corresponding engineering physical quantity based on the mapping coefficient.
[0010] In one possible implementation, before converting the compensated electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, the method further includes: Determine the type of the sensor to be calibrated; Based on the type, a corresponding special processing is performed on the compensation electrical signal to remove different physical characteristics of different types of sensors to be calibrated. The special processing includes at least cold junction compensation, wire break detection, and Steinhart-Hart calculation.
[0011] In one possible implementation, upon receiving a calibration configuration instruction from a host computer, extracting the application calibration parameter set and the linear mapping parameter set from the calibration configuration instruction further includes: The extracted set of application calibration parameters and linear mapping parameters for updating are temporarily stored in the temporary parameter area; Trigger the parameter refresh flag to update the application calibration parameter set and the linear mapping parameter set; The updated set of application calibration parameters and linear mapping parameters will be used for calibration during the next sensor calibration.
[0012] A second aspect of this disclosure provides a sensor end-to-end calibration system based on hierarchical decoupling, characterized in that the system comprises: The data acquisition module is configured to acquire the raw AD sampling signal of the sensor to be calibrated in response to the activation of the sensor end-to-end calibration function. The hardware linear calibration module is configured to determine the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments based on the hardware calibration parameter set and the segment calibration parameters, and to perform hardware linear calibration on the original AD sampling signal according to the calibration segments and the corresponding segment calibration parameters to obtain a standard electrical signal. The configuration instruction receiving module is configured to extract the application calibration parameter set and the linear mapping parameter set from the calibration configuration instruction when it receives a calibration configuration instruction from the host computer. An application error calibration module is configured to perform application error calibration on the standard electrical signal according to the application calibration parameter set to obtain a compensated electrical signal. The physical quantity mapping module is configured to convert the compensation electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, and to obtain and store the calibration result, wherein the corresponding engineering physical quantity is applied to process control in the industrial field.
[0013] A third aspect of this disclosure provides an electronic device, comprising: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspects.
[0014] This invention provides a sensor end-to-end calibration method, system, and device based on hierarchical decoupling. Compared with existing technologies, it has the following advantages: In response to the activation of the sensor end-to-end calibration function, the original AD sampling signal of the sensor to be calibrated is acquired. Based on the hardware calibration parameter set and using segmented parameter selection rules, calibration segments of the original AD sampling signal and corresponding segmented calibration parameters for different calibration segments are determined. Hardware linear calibration is then performed on the original AD sampling signal according to the calibration segments and their corresponding segmented calibration parameters to obtain a standard electrical signal. Upon receiving a calibration configuration command from the host computer, the application calibration parameter set and linear mapping parameter set are extracted from the calibration configuration command. Application error calibration is then performed on the standard electrical signal according to the application calibration parameter set to obtain a compensated electrical signal. Finally, the compensated electrical signal is converted into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the linear mapping parameter set. The calibration result is obtained and stored, where the corresponding engineering physical quantity is applied to process control in the industrial field. Segmented calibration improves the calibration accuracy of the nonlinear sensor, and through hardware linear calibration, application error calibration, and hierarchical decoupling calibration of physical quantity mapping, high-precision field calibration is achieved while maintaining the factory reference accuracy.
[0015] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating a sensor end-to-end calibration method based on hierarchical decoupling, according to an embodiment in the specification.
[0017] Figure 2 A block diagram of a sensor end-to-end calibration system based on hierarchical decoupling is shown in the embodiment of the specification.
[0018] Figure 3 This is a block diagram of a sensor end-to-end calibration device based on hierarchical decoupling, as shown in the embodiments of the specification. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0020] This application provides a sensor end-to-end calibration method based on hierarchical decoupling. Figure 1 This is a flowchart illustrating a sensor end-to-end calibration method based on hierarchical decoupling, according to one embodiment. The method includes: In step S11, in response to the activation of the sensor end-to-end calibration function, the original AD sampling signal of the sensor to be calibrated is acquired; The original AD sampling signal is the initial signal obtained after the weak analog signal (such as voltage, current, or resistance change) output by the sensor's sensitive element is converted by an analog-to-digital converter (ADC). In this embodiment, when the user triggers the sensor end-to-end calibration function via host computer software or hardware buttons, the sensor excitation circuit, which is in a dormant state, is awakened to ensure the sensor is in normal working condition. The sensor channel to be calibrated is then opened, and after the signal stabilizes, the analog-to-digital conversion process is initiated. The ADC module quantizes the analog signal output by the sensor to generate the original binary digital code, thus obtaining the original AD sampling signal. The acquired original AD sampling signal is stored in a specific buffer in memory, and the current data acquisition state is locked to prevent data from being overwritten or tampered with due to subsequent task scheduling or interruption response.
[0021] In step S12, the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments are determined according to the hardware calibration parameter set and the segment parameter selection rules. Hardware linear calibration is then performed on the original AD sampling signal according to the calibration segments and the corresponding segment calibration parameters to obtain a standard electrical signal. The hardware calibration parameter set refers to a complete set of data generated by the manufacturer on the production line after calibration using a high-precision standard source. It is typically stored in a read-only protected area of non-volatile memory and includes at least zero-point offset values, segment switching thresholds, and segment calibration parameters. The segment parameter selection rules define how to divide the full range into multiple intervals and automatically match the most suitable calibration parameters for each interval based on the degree of deviation of the current signal from zero, thereby improving calibration accuracy. The segment calibration parameters refer to linear transformation coefficients optimized for a specific measurement interval. Unlike a single global parameter, the segment calibration parameters contain multiple independent sets of slopes and intercepts.
[0022] In this embodiment, the zero-point offset value, segment switching threshold, and segment calibration parameters are extracted from the hardware calibration parameter set. Based on the zero-point offset value and the segment switching threshold, the original AD acquisition signal is determined to be a different segment signal. For example, the original AD sampling signal whose difference from the zero-point offset value does not exceed the segment switching threshold is determined as the first segment signal, and the first segment calibration parameter is selected. The original AD sampling signal whose difference from the zero-point offset value exceeds the segment switching threshold is determined as the second segment signal. If the third segment calibration parameter is determined to be invalid, then the selected segment calibration parameter is selected. The second segment calibration parameter is used; if the third segment calibration parameter is determined to be valid, it is determined whether the second segment signal is a signal generated by the sensor to be calibrated in the target mode. If the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, the second segment calibration parameter is selected. If the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, the third segment calibration parameter is selected. Hardware linear calibration is performed on the original AD sampling signals of different segments according to the selected corresponding segment calibration parameter to obtain a standard electrical signal.
[0023] In step S13, upon receiving a calibration configuration instruction from the host computer, the set of application calibration parameters and the set of linear mapping parameters in the calibration configuration instruction are extracted. The host computer refers to the main control device in the industrial control system responsible for monitoring, managing, and configuring the slave devices (such as sensors and actuators). It is typically an industrial personal computer, programmable logic controller, or human-machine interface terminal, establishing a communication connection with the sensor via a standard industrial bus. The calibration configuration instruction refers to a data frame containing a specific data structure, packaged and sent by the host computer software. This instruction includes the specific parameters to be modified, as well as the parameter address index, checksum, and read / write permission information to ensure the accuracy and security of data transmission. The application calibration parameter set refers to the set of parameters used for fine-tuning in the field environment. These parameters are typically set by field engineers according to specific operating conditions to compensate for on-site installation stress, cable voltage drop, or system cumulative errors. This set includes at least user-defined offset parameters and user-defined gain parameters, which are non-core adjustable parameters. The linear mapping parameter set refers to the set of parameters used to define the sensor's engineering range. These parameters are used to convert the calibrated electrical signal into an engineering physical quantity readable by the end user. This set includes at least the minimum and maximum values of the engineering physical quantity, i.e., the range; modifying these parameters can change the sensor's measurement range and engineering units.
[0024] In this embodiment of the disclosure, the industrial communication interface is continuously monitored. When a calibration configuration command is received from the host computer, the data frame is first unpacked, and the frame header, device address, and cyclic redundancy check code are verified to ensure that the data has not been damaged or tampered with during transmission. After the verification is passed, the extracted data content is parsed according to the parameter identifier carried in the command. If the identifier points to the application error calibration, it is identified as the application calibration parameter set, and the offset parameter and gain parameter are extracted. If the identifier points to the linear mapping, it is identified as the linear mapping parameter set, and the range is extracted.
[0025] In step S14, the standard electrical signal is subjected to application error calibration according to the application calibration parameter set to obtain a compensated electrical signal; The application error calibration refers to the compensation process for non-ideal factors in actual application scenarios. The compensation electrical signal refers to the electrical signal after being corrected by the application calibration parameter set.
[0026] In this embodiment of the disclosure, the currently effective application calibration parameter set is read from the erasable non-volatile memory unit and a standard electrical signal is obtained. The user-defined gain parameter and offset parameter in the application calibration parameter set are extracted. First, zero-point correction is performed, that is, the offset parameter is subtracted from the standard electrical signal. The result after zero-point correction is multiplied by the gain coefficient to correct the sensitivity drift caused by the field environment factors. The final result obtained after the above multiplication and subtraction operations is confirmed as the compensation electrical signal. The compensation electrical signal is latched in memory as the calibration result of the current step.
[0027] In step S15, the compensation electrical signal is converted into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the linear mapping parameter set, and the calibration result is obtained and stored. The corresponding engineering physical quantity is applied to process control in the industrial field.
[0028] The two-point linear mapping algorithm refers to a conversion method based on a linear proportional relationship. Utilizing the mathematical principle that two points determine a straight line, it establishes a correspondence between the "input electrical signal range" and the "output physical quantity range," accurately converting any input electrical signal value into a corresponding physical quantity value. The final engineering physical quantity refers to a user-oriented value, directly usable in control systems or display interfaces, and containing standard international units or industry-standard units. For example, converting a millivolt signal to degrees Celsius, or a milliampere signal to megapascals.
[0029] In this embodiment, the type of sensor connected to the current working channel is identified, and the corresponding range configuration parameters are retrieved from the storage unit according to the type. A corresponding unit suffix, such as Celsius or Megapascal, is selected. Mapping start-point parameters and mapping end-point parameters are determined based on the range configuration parameters. The mapping start-point parameters include the minimum value of the compensation electrical signal and the corresponding minimum value of the range, while the mapping end-point parameters include the maximum value of the compensation electrical signal and the corresponding maximum value of the range. Mapping coefficients are determined based on the mapping start-point parameters and the mapping end-point parameters. The compensation electrical signal is then converted into the final engineering physical quantity value based on the mapping coefficients.
[0030] The method in the above technical solution acquires the original AD sampling signal of the sensor to be calibrated in response to the activation of the sensor end-to-end calibration function; determines the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments based on the hardware calibration parameter set and segment parameter selection rules; performs hardware linear calibration on the original AD sampling signal according to the calibration segments and the corresponding segment calibration parameters to obtain a standard electrical signal; upon receiving a calibration configuration instruction from the host computer, extracts the application calibration parameter set and the linear mapping parameter set from the calibration configuration instruction; performs application error calibration on the standard electrical signal according to the application calibration parameter set to obtain a compensated electrical signal; and converts the compensated electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the linear mapping parameter set, obtains and stores the calibration result, wherein the corresponding engineering physical quantity is applied to process control in the industrial field. By employing segmented hardware linear calibration and selecting the optimal calibration segment based on signal characteristics, the accuracy and adaptability of sensor calibration are improved. Through a unified calibration framework, calibration starts from the original AD acquisition value, enhancing the flexibility of sensor calibration and supporting the calibration of multiple sensors. Layered calibration supports hierarchical parameter management, enabling on-site application calibration to be performed at any time and solving the problem of irreversible on-site debugging.
[0031] In one possible implementation, step S12, determining the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments based on the hardware calibration parameters and segment parameter selection rules, includes: Extract the zero-point offset value, segment switching threshold, and segment calibration parameters from the hardware calibration parameter set; Based on the zero-point offset value and the segment switching threshold, the original AD acquisition signal is determined to be a different segment signal, and the corresponding segment calibration parameter is selected.
[0032] The zero-point offset value refers to the actual output value measured when the sensor should theoretically output zero, i.e., under reference conditions such as no load and normal temperature. The segment switching threshold refers to the boundary value used to define different calibration segments.
[0033] In this embodiment, the difference between the original AD sampling signal and the zero-point offset value is calculated to determine whether the difference exceeds a segment switching threshold. The original AD sampling signal whose difference from the zero-point offset value does not exceed the segment switching threshold is identified as the first segment signal, and the first segment calibration parameter is selected. The original AD sampling signal whose difference from the zero-point offset value exceeds the segment switching threshold is identified as the second segment signal. If the third segment calibration parameter is determined to be invalid, the second segment calibration parameter is selected. If the third segment calibration parameter is determined to be valid, it is determined whether the second segment signal is generated by the sensor to be calibrated in the target mode. If the second segment signal is determined not to be generated by the sensor to be calibrated in the target mode, the second segment calibration parameter is selected. If the second segment signal is determined not to be generated by the sensor to be calibrated in the target mode, the third segment calibration parameter is selected.
[0034] Based on the linear transformation relationship, the original AD sampling signal is subtracted from the zero-point offset value, multiplied by the target slope k, and then added to the target intercept b to calculate the calibrated value, thus obtaining the standard electrical signal value. The formula for hardware linear calibration can be y = k_i × (x - x0) + b_i Where x is the original AD sampling signal, x0 is the zero offset value, i is the calibration segment index, k_i, b_i: the slope and intercept of the i-th segment, and y is the calibrated standard electrical signal value (such as mV or mA).
[0035] The above technical solution achieves high-precision calibration by dividing the sensor range into three regions, each using independent calibration parameters. It also offers good flexibility, supporting automatic configuration of two or three segments to adapt to different accuracy requirements.
[0036] In one possible implementation, in step S12, determining the original AD acquisition signal into different segmented signals based on the zero-point offset value and the segment switching threshold, and determining the corresponding segment calibration parameter to be selected, includes: The original AD sampling signal whose difference from the zero offset value does not exceed the segment switching threshold is determined as the first segment signal, and the first segment calibration parameter is selected. The original AD sampling signal whose difference from the zero offset value exceeds the segment switching threshold is determined as the second segment signal. If the third segment calibration parameter is determined to be invalid, the second segment calibration parameter is determined to be selected. If the third segment calibration parameter is determined to be valid, then it is determined whether the second segment signal is a signal generated by the sensor to be calibrated in the target mode. If it is determined that the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, then the second segment calibration parameter is selected. If it is determined that the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, then the third segment calibration parameter is selected.
[0037] The first segment calibration parameters are applicable to the linear parameters of the small-signal region, i.e., the first segment of the signal. Since the sensor typically exhibits the best linearity in the small-signal region, these parameters are usually configured as high-resolution, low-noise fine-tuning parameters. The second segment calibration parameters are applicable to the linear parameters of the large-signal region, i.e., the second segment of the signal. The third segment calibration parameters are optional special-region calibration parameters, primarily used to address the nonlinear saturation characteristics of the sensor at the large-signal limit, or special responses in specific directions such as negative pressure or reverse travel.
[0038] In this embodiment, the zero-point offset value x0, the segment switching threshold T, the first segment calibration parameter (k0, b0), the second segment calibration parameter (k1, b1), and the third segment calibration parameter (k2, b2) are extracted. Simultaneously, the target mode of the sensor to be calibrated is determined, and the absolute deviation Δx between the original AD sampling signal x and the zero-point offset value is calculated as Δx = |x - x0|. If Δx ≤ T, it is determined to be the first segment signal, and the first segment calibration parameter is directly selected. If Δx > T, it is determined to be the second segment signal, and the validity of the third segment calibration parameter is determined. Typically, the slope coefficient of the third segment calibration parameter is determined. If k is not zero, the third segment is considered unconfigured or invalid. If the third segment calibration parameter is determined to be invalid, the second segment calibration parameter is selected for calibration. If k is not zero, the third segment calibration parameter is determined to be valid. Then, it is determined whether the second segment signal is the signal generated by the sensor to be calibrated in the target mode. If the second segment signal is determined not to be the signal generated by the sensor to be calibrated in the target mode, the second segment calibration parameter is selected. If the second segment signal is determined not to be the signal generated by the sensor to be calibrated in the target mode, the third segment calibration parameter is selected.
[0039] In one possible implementation, step S12, determining whether the second segmented signal is a signal generated by the sensor to be calibrated in the target mode, includes: If the zero offset value is less than the segmented switching threshold, and the difference between the second segmented signal and the zero offset value is less than the zero offset value, then determine that the second segmented signal is the signal generated by the to-be-calibrated sensor in the first target mode; If the zero offset value is greater than the segmented switching threshold, and the difference between the second segmented signal and the zero offset value is greater than the zero offset value, then determine that the second segmented signal is the signal generated by the to-be-calibrated sensor in the second target mode; Among them, the target mode includes the first target mode and the second target mode.
[0040] Among them, the first target mode is a mode in which the sensor output increases as the input increases, that is, the rising line mode. In the first target mode, the third segmented calibration parameter is used for negative expansion. The second target mode is a mode in which the sensor output decreases as the input increases, that is, the falling line mode. In the second target mode, the third segmented calibration parameter is used for positive expansion.
[0041] In the embodiments of the present disclosure, for example, if |x - x0| ≤ |x_threshold|, it is determined as the first segmented signal, and the first segmented calibration parameter kb[1] is determined to be selected. If |x - x0| > |x_threshold|, it is determined as the second segmented signal, and the third segmented calibration parameter is invalid, and the second segmented calibration parameter kb[2] is determined to be selected. If |x - x0| > |x_threshold| and the third segmented calibration parameter is valid, it is further determined whether it is an extended segment. If it is determined to be an extended segment, then the third hardware calibration parameter kb[2] is determined to be selected. If |x - x0| > |x_threshold| and k3 ≠ 0, that is, the third hardware calibration parameter is valid, it is further determined whether it is an extended segment. The extended segment needs to meet any one of the following conditions: 1. Rising line mode: zeroOri < oriValKb and oriVal < zeroOri; 2. Falling line mode: zeroOri > oriValKb and oriVal > zeroOri, where zeroOri is the zero offset value and oriVal is the difference between the original AD sampling signal and the zero offset value.
[0042] Among them, x is the original AD sampling signal, x0 is zeroOri, that is, the zero offset value, i is the calibration segment index such as 1, 2, k_i, b_i are the slope and intercept of the (i + 1)-th segment. For example, kb[0] is the slope k_1 and intercept b_1 of the first hardware calibration parameter of the first segment, and |x_threshold| is the absolute value of the segmented switching threshold.
[0043] The above technical solution, through the optional setting of the third segment calibration parameter, can handle sensors with hysteresis characteristics or bidirectional nonlinearity, improving the accuracy and flexibility of sensor calibration, and is suitable for a variety of sensors with different characteristics.
[0044] In one possible implementation, step S14, performing application error calibration on the standard electrical signal according to the application calibration parameter set to obtain a compensated electrical signal, includes: Extract user-defined gain and offset parameters from the application calibration parameter set; Determine whether the gain parameter is valid. If the gain parameter is determined to be invalid, then assign the gain coefficient to a preset safe default value. Calculate the difference between the standard electrical signal and the offset parameter; The product of the difference and the gain coefficient is calculated to obtain the compensated electrical signal.
[0045] In this embodiment of the disclosure, the set of application calibration parameters can be obtained in real time through the industrial fieldbus interface, the user-defined offset parameters and gain parameters can be extracted, and application error calibration can be performed based on the offset parameters and gain parameters. The formula for application error calibration can be y_comp = (y_hw - usrOffset) × usrGain, where y_hw is the standard electrical signal value after hardware linear calibration, such as mV or mA, usrOffset is the offset parameter, usrGain is the gain parameter, and the default safe value of the gain parameter is 1.
[0046] The above technical solution eliminates errors caused by sensor discreteness or on-site environmental factors in application through specific application error calibration, enabling on-site engineers to conveniently adjust calibration parameters.
[0047] In one possible implementation, step S15, which involves converting the compensation electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, includes: Extract the range of the sensor to be calibrated from the set of linear mapping parameters; The mapping start point parameter and mapping end point parameter are determined based on the range and the compensation electrical signal, wherein the mapping start point parameter includes the minimum value of the compensation electrical signal and the minimum value of the range, and the mapping end point parameter includes the maximum value of the compensation electrical signal and the maximum value of the range; The mapping coefficients are determined based on the mapping start-point parameter and the mapping end-point parameter; The compensation electrical signal value is converted into the corresponding engineering physical quantity value according to the mapping coefficient.
[0048] In this embodiment of the disclosure, the formula for the two-point linear mapping algorithm can be y_eng = k_map × (y_comp - x_min) + y_min, where k_map = (y_max - y_min) / (x_max - x_min) are mapping coefficients, y_comp is the compensation standard electrical signal, (x_min, y_min) are the mapping start parameters, x_min is the minimum value of the compensation electrical signal, and y_min is the minimum value of the corresponding range, such as the mapping start parameters (4mA, 0MPa); (x_max, y_max) are the mapping end parameters, x_max is the maximum value of the compensation electrical signal, and y_max is the maximum value of the corresponding range, such as the mapping end parameters (20mA, 60MPa).
[0049] For example, the compensation electrical signal 4-20mA of the pressure transmitter can be mapped to the corresponding range 0-100bar; the compensation electrical signal 0-10V of the level sensor can be mapped to the corresponding range 0-5m.
[0050] The above technical solution uses a specific two-point linear mapping algorithm to convert the compensation electrical signals of different sensors into corresponding engineering physical quantities. When changing sensors with different ranges, only the mapping parameters need to be modified, without having to re-perform complex nonlinear calibration. Furthermore, the design of separating the definition of electrical signals from physical quantities improves the modularity of the system.
[0051] In one possible implementation, before converting the compensated electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, the method further includes: Determine the type of the sensor to be calibrated; Based on the type, a corresponding special processing is performed on the compensation electrical signal to remove different physical characteristics of different types of sensors to be calibrated. The special processing includes at least cold junction compensation, wire break detection, and Steinhart-Hart calculation.
[0052] The cold junction compensation specifically refers to a compensation technique for thermocouple sensors. Thermocouples measure the thermoelectric potential difference between the hot junction (measuring point) and the cold junction (connection terminal). Since the ADC cannot be directly connected to the thermocouple tip, the known cold junction temperature must be measured, and the hot junction temperature deduced through a mathematical model. The open-circuit detection is a safety monitoring mechanism. When the sensor lead is broken, has poor contact, or the resistance exceeds a reasonable range, the system can identify this abnormal state, preventing erroneous measured values from misleading the control system. For current-type sensors, it typically detects whether the loop current is zero; for resistance-type sensors, it typically detects whether the resistance is infinite. The Steinhart-Hart calculation is a high-precision temperature conversion formula for thermistors (NTC / PTC). Because the resistance of the thermistor exhibits a drastic exponential nonlinear relationship with temperature, simple linear interpolation cannot meet the accuracy requirements. The Steinhart-Hart equation, through three coefficients (A, B, C), can describe this exponential relationship with extreme precision.
[0053] For example, if the type of sensor to be calibrated is determined to be a thermocouple sensor, the cold junction ambient temperature measured by an auxiliary temperature sensor installed near the terminal block, such as an NTC (Negative Temperature Coefficient) or an RTD (Resistance Temperature Detector), is read. According to the thermocouple calibration table, such as type K or type S, the cold junction temperature is converted into the corresponding equivalent thermoelectric potential. The compensation electrical signal is added to the above equivalent thermoelectric potential to obtain the total potential representing the temperature difference between the hot junction and zero degrees, i.e., the special compensation electrical signal. The next step, two-point linear mapping, is performed based on the special compensation electrical signal.
[0054] If the sensor type is determined to be an NTC or PTC thermistor, the compensation electrical signal is interpreted as the actual resistance value of the current sensor, and substituted into the Steinhart-Hart coefficients (A, B, C) for calculation. The formula can be: 1 / T = A + B ln(R) + C (ln(R))^3, where T is the Kelvin temperature and R is the resistance value, converts the calculated special compensation electrical signal into Celsius temperature.
[0055] If the sensor type is determined to be a weighing sensor, the compensation electrical signal is divided by the 24-bit analog-to-digital converter half-range reference to normalize it to a proportionality coefficient relative to the full-scale range. Then, this proportionality coefficient is divided by the programmable gain factor to eliminate numerical expansion caused by hardware amplification and restore the actual relative strength of the signal. The result from the previous step is divided by the reference voltage reference to convert the dimensionless proportionality coefficient into a physically meaningful voltage value. The resulting voltage value is multiplied by the differential signal correction factor, typically half, to obtain the special compensation electrical signal. This special compensation electrical signal is then converted into the corresponding engineering physical quantity.
[0056] The above technical solution supports calibration of multiple sensor types by performing special processing on different types of sensors, and is easy to expand; adding a new sensor type only requires adding a new processing branch.
[0057] In one possible implementation, step S13, upon receiving a calibration configuration instruction from the host computer, further includes extracting the application calibration parameter set and the linear mapping parameter set from the calibration configuration instruction, and includes: The extracted set of application calibration parameters and linear mapping parameters for updating are temporarily stored in the temporary parameter area; Trigger the parameter refresh flag to update the application calibration parameter set and the linear mapping parameter set; The updated set of application calibration parameters and linear mapping parameters will be used for calibration during the next sensor calibration.
[0058] The temporary parameter area refers to a specific storage region allocated within the system's random access memory (RAM) to temporarily store new parameters received from the communication interface that have not yet taken effect. This region is physically or logically isolated from the current parameter area used by the calibration algorithm, serving as a data buffer. The parameter refresh flag is a software-controlled binary status flag. When new parameters are ready and stored in the temporary parameter area, the system sets this flag to a valid state. The calibration algorithm checks this flag at the beginning of each work cycle; once a valid signal is detected, it performs the parameter loading operation. The next sensor calibration refers to the conventional data processing flow executed by the system according to a fixed sampling period, such as 1000 times per second. This application utilizes the periodicity to complete parameter switching before the end of the current cycle and the beginning of the next cycle, thus achieving seamless transition.
[0059] In this embodiment, the physical and data link layer channels connecting the sensor device and the host computer (such as PLC, industrial control computer, HMI, etc.) are established through an industrial communication interface. This interface is compatible with various mainstream industrial bus standards, including but not limited to RS485 bus based on serial communication, CAN bus based on differential signals, and TCP / IP protocol suite based on Ethernet. Upon receiving a configuration command from the host computer, the configuration command data frame is first unpacked, and the frame header, device address, and CRC checksum are verified. After successful verification, the application calibration parameter set and linear mapping parameter set used for updating are temporarily stored in a temporary parameter area. After confirming that the data has been completely written to the temporary parameter area, software logic sets the specific parameter refresh flag to a valid state. At this time, the calibration cycle continues to use the old parameters for data acquisition and calculation. At the start of the sampling period during the next sensor calibration, when the parameter refresh flag is detected to be valid, new parameters are read from the temporary parameter area to replace the old parameters, and the refresh flag is cleared. The updated parameters are then immediately used to process the new original AD sampling signal.
[0060] The above technical solution enables on-site engineers to conveniently adjust calibration parameters through a parameter interaction mechanism. The parameter changes take effect immediately without requiring a device restart or interruption of data acquisition.
[0061] In one possible implementation, the hardware calibration parameters are stored in a first storage area, the application calibration parameters and the linear mapping parameters are stored in a second storage area, the first storage area is a read-only protected area, the second storage area is an erasable and rewritable area, and the first storage area and the second storage area are isolated from each other in terms of physical address or logical permissions.
[0062] The first storage area (read-only protected area) refers to a non-volatile storage space used to store the core factory calibration data of the sensor, i.e., parameters related to hardware linear calibration. In this invention, this area is preferably a specific sector of the EEPROM (Electrically Erasable Programmable Read-Only Memory) or Flash memory integrated inside the microcontroller, or set to read-only state at system startup via hardware fuse bits or software write protection mechanism (WRP). Once the data in this area is written, it cannot be erased or modified in normal operating mode. The second storage area (erasable and writable area) refers to a non-volatile storage space used to store user configuration and field adjustment data, i.e., the application calibration parameters and the linear mapping numbers. In this invention, this area is preferably a general sector in the EEPROM or Flash memory that is not write-protected. This area supports frequent erase and write operations via communication commands during system operation to save parameters that change with operating conditions. The physical address refers to the fact that the first and second storage areas are located on different hardware memory chips, or in different physical address segments of the same chip, and the hardware decoding circuit ensures that the CPU cannot access them out of bounds. The logical permission isolation refers to setting different access permissions through the operating system (OS) or memory management unit (MMU) even though the data is stored in the same physical medium. For example, the first area can be set to privileged mode (Supervisor Mode) and the second area can be set to user mode (User Mode) to prevent application code from accidentally tampering with the underlying data.
[0063] In this embodiment, the storage medium is planned during the system hardware design phase. The last few sectors of the Flash memory are designated as a first storage area for storing hardware calibration parameters; the first sectors of the independent EEPROM chip or Flash are designated as a second storage area for storing application error calibration and linear mapping parameters. In the system software, two independent structure pointers are defined, each mapped to a physical address in one of these two areas. At the production line testing station, a high-precision standard source is used to calibrate the sensor on the calibration fixture across the entire temperature range and scale. The calculated zero-point offset value, hardware calibration parameters, and segment switching threshold are written to the first storage area using a dedicated programmer or encrypted communication protocol. After writing, a "write protection enable" command is executed, setting the lock bit of the area to make it a read-only protected area. After the equipment is delivered to the user, the field engineer issues configuration instructions via host computer software. The system parses the instructions to obtain the offset parameters, gain parameters, and mapping start and end point parameters. The system calls the erase / write driver function of the EEPROM or Flash to write these data to the second storage area. Because this area is not write-protected, write operations can be performed normally. When reading hardware calibration parameters, the CPU accesses the first memory area via privileged instructions. Any attempt to write data to this area will be rejected by the hardware or trigger an abnormal interrupt, thus physically preventing erroneous operations. When reading application calibration parameters and linear mapping parameters, the CPU accesses the second memory area via ordinary instructions, allowing normal read and write operations.
[0064] The above technical solution protects core underlying parameters through partitioned and layered storage, avoiding damage to factory accuracy caused by on-site debugging. Furthermore, the parameters are ready to use immediately after writing, enabling rapid on-site calibration.
[0065] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0066] In one embodiment, such as Figure 2 As shown, a sensor end-to-end calibration device based on hierarchical decoupling is provided, comprising: The data acquisition module 210 is configured to acquire the original AD sampling signal of the sensor to be calibrated in response to the activation of the sensor end-to-end calibration function. The hardware linear calibration module 220 is configured to determine the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments based on the hardware calibration parameter set and the segment calibration parameters, and to perform hardware linear calibration on the original AD sampling signal according to the calibration segments and the corresponding segment calibration parameters to obtain a standard electrical signal. The configuration instruction receiving module 230 is configured to extract the application calibration parameter set and the linear mapping parameter set from the calibration configuration instruction when it receives a calibration configuration instruction from the host computer. The application error calibration module 240 is configured to perform application error calibration on the standard electrical signal according to the application calibration parameter set to obtain a compensated electrical signal. The physical quantity mapping module 250 is configured to convert the compensation electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, and to obtain and store the calibration result, wherein the corresponding engineering physical quantity is applied to process control in the industrial field.
[0067] In one possible implementation, the hardware linear calibration module 220 is configured as follows: Extract the zero-point offset value, segment switching threshold, and segment calibration parameters from the hardware calibration parameter set; Based on the zero-point offset value and the segment switching threshold, the original AD acquisition signal is determined to be a different segment signal, and the corresponding segment calibration parameter is selected.
[0068] In one possible implementation, the hardware linear calibration module 220 is configured as follows: The original AD sampling signal whose difference from the zero offset value does not exceed the segment switching threshold is determined as the first segment signal, and the first segment calibration parameter is selected. The original AD sampling signal whose difference from the zero offset value exceeds the segment switching threshold is determined as the second segment signal. If the third segment calibration parameter is determined to be invalid, the second segment calibration parameter is determined to be selected. If the third segment calibration parameter is determined to be valid, then it is determined whether the second segment signal is a signal generated by the sensor to be calibrated in the target mode. If it is determined that the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, then the second segment calibration parameter is selected. If it is determined that the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, then the third segment calibration parameter is selected.
[0069] In one possible implementation, the hardware linear calibration module 220 is configured as follows: If the zero-point offset value is less than the segment switching threshold, and the difference between the second segment signal and the zero-point offset value is less than the zero-point offset value, then the second segment signal is determined to be the signal generated by the sensor to be calibrated in the first target mode. If the zero-point offset value is greater than the segment switching threshold, and the difference between the second segment signal and the zero-point offset value is greater than the zero-point offset value, then the second segment signal is determined to be the signal generated by the sensor to be calibrated in the second target mode. The target mode includes a first target mode and a second target mode.
[0070] In one possible implementation, the application error calibration module 240 is configured as follows: Extract user-defined gain and offset parameters from the application calibration parameter set; Determine whether the gain parameter is valid. If the gain parameter is determined to be invalid, then assign the gain coefficient to a preset safe default value. Calculate the difference between the standard electrical signal and the offset parameter; The product of the difference and the gain coefficient is calculated to obtain the compensated electrical signal.
[0071] In one possible implementation, the physical quantity mapping module 250 is configured as follows: Extract the range of the sensor to be calibrated from the set of linear mapping parameters; The mapping start point parameter and the mapping end point parameter are determined based on the range and the compensation electrical signal, wherein the mapping start point parameter includes the minimum value of the compensation electrical signal and the minimum value of the range, and the mapping end point parameter includes the maximum value of the compensation electrical signal and the maximum value of the range; The mapping coefficients are determined based on the mapping start-point parameter and the mapping end-point parameter; The compensation electrical signal is converted into a corresponding engineering physical quantity based on the mapping coefficient.
[0072] In one possible implementation, the system further includes: The sensor processing module is configured to determine the type of the sensor to be calibrated; Based on the type, a corresponding special processing is performed on the compensation electrical signal to remove different physical characteristics of different types of sensors to be calibrated. The special processing includes at least cold junction compensation, wire break detection, and Steinhart-Hart calculation.
[0073] In one possible implementation, the configuration instruction receiving module 230 is configured as follows: The extracted set of application calibration parameters and linear mapping parameters for updating are temporarily stored in the temporary parameter area; Trigger the parameter refresh flag to update the application calibration parameter set and the linear mapping parameter set; The updated set of application calibration parameters and linear mapping parameters will be used for calibration during the next sensor calibration.
[0074] In one possible implementation, the system further includes: The partitioned storage module is configured such that the hardware calibration parameters are stored in a first storage area, and the application calibration parameters and the linear mapping parameters are stored in a second storage area. The first storage area is a read-only protected area, and the second storage area is an erasable / writable area. The first and second storage areas are physically isolated from each other or logically.
[0075] Specific limitations regarding the hierarchical decoupling-based sensor end-to-end calibration system can be found in the limitations of the hierarchical decoupling-based sensor end-to-end calibration method described above, and will not be repeated here. Each module in the aforementioned hierarchical decoupling-based sensor end-to-end calibration system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independent of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the corresponding operations of each module.
[0076] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described in the foregoing embodiments.
[0077] This disclosure also provides an electronic device, including: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of any of the methods described in the foregoing embodiments.
[0078] Figure 3The sensor end-to-end calibration device 100 based on hierarchical decoupling, as shown, includes a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, for example, via a bus 1002. Optionally, the sensor end-to-end calibration device 100 based on hierarchical decoupling may further include a communication component, which can be used for data interaction between the device 100 and other devices, such as sending or receiving data. It should be noted that in actual scheduling, the communication component is not limited to one, and the structure of this sensor end-to-end calibration device 100 based on hierarchical decoupling does not constitute a limitation on the embodiments of this application.
[0079] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 1001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0080] Bus 1002 may include a pathway for transmitting information between the aforementioned components. Bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 1002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0081] The memory 1003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing program code and capable of being read by a computer, without limitation herein.
[0082] The memory 1003 is used to store program code for executing embodiments of the present disclosure, and its execution is controlled by the processor 1001. The processor 1001 is used to execute the program code stored in the memory 1003 to implement the steps shown in the aforementioned embodiment of a sensor end-to-end calibration method based on hierarchical decoupling.
[0083] This disclosure also provides a computer-readable storage medium storing program code. When the program code is executed by a processor, it can implement the steps and corresponding content of the aforementioned embodiment of a sensor end-to-end calibration method based on hierarchical decoupling.
[0084] The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of the present disclosure, various changes, modifications, substitutions and variations can be made to these embodiments, and all such changes, modifications, substitutions and variations fall within the protection scope of the present disclosure.
[0085] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction, and such combinations should also be considered as part of this disclosure. To avoid unnecessary repetition, this disclosure will not further describe the various possible combinations. The technical scope of this application is not limited to the contents of the specification, but must be determined according to the scope of the claims.
Claims
1. A sensor end-to-end calibration method based on hierarchical decoupling, characterized in that, The method includes: In response to the activation of the sensor end-to-end calibration function, the original AD sampling signal of the sensor to be calibrated is acquired; Based on the hardware calibration parameter set, the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments are determined using segment parameter selection rules. Hardware linear calibration is then performed on the original AD sampling signal according to the calibration segments and the corresponding segment calibration parameters to obtain a standard electrical signal. Upon receiving a calibration configuration instruction from the host computer, extract the set of application calibration parameters and the set of linear mapping parameters from the calibration configuration instruction; The standard electrical signal is subjected to application error calibration based on the application calibration parameter set to obtain a compensated electrical signal; The compensation electrical signal is converted into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, and the calibration result is obtained and stored. The corresponding engineering physical quantity is applied to process control in industrial settings.
2. The method according to claim 1, characterized in that, The step of determining the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments based on the hardware calibration parameters and the segment parameter selection rules includes: Extract the zero-point offset value, segment switching threshold, and segment calibration parameters from the hardware calibration parameter set; Based on the zero-point offset value and the segment switching threshold, the original AD acquisition signal is determined to be a different segment signal, and the corresponding segment calibration parameter is selected.
3. The method according to claim 2, characterized in that, The step of determining the original AD acquisition signal into different segmented signals based on the zero-point offset value and the segmented switching threshold, and determining the corresponding segmented calibration parameters to be used, includes: The original AD sampling signal whose difference from the zero offset value does not exceed the segment switching threshold is determined as the first segment signal, and the first segment calibration parameter is selected. The original AD sampling signal whose difference from the zero offset value exceeds the segment switching threshold is determined as the second segment signal. If the third segment calibration parameter is determined to be invalid, the second segment calibration parameter is determined to be selected. If the third segment calibration parameter is determined to be valid, then it is determined whether the second segment signal is a signal generated by the sensor to be calibrated in the target mode. If it is determined that the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, then the second segment calibration parameter is selected. If it is determined that the second segment signal is not a signal generated by the sensor to be calibrated in the target mode, then the third segment calibration parameter is selected.
4. The method according to claim 3, characterized in that, Determining whether the second segmented signal is a signal generated by the sensor to be calibrated in the target mode includes: If the zero-point offset value is less than the segment switching threshold, and the difference between the second segment signal and the zero-point offset value is less than the zero-point offset value, then the second segment signal is determined to be the signal generated by the sensor to be calibrated in the first target mode. If the zero-point offset value is greater than the segment switching threshold, and the difference between the second segment signal and the zero-point offset value is greater than the zero-point offset value, then the second segment signal is determined to be the signal generated by the sensor to be calibrated in the second target mode. The target mode includes a first target mode and a second target mode.
5. The method according to claim 1, characterized in that, The step of performing application error calibration on the standard electrical signal according to the application calibration parameter set to obtain a compensated electrical signal includes: Extract user-defined gain and offset parameters from the application calibration parameter set; Determine whether the gain parameter is valid. If the gain parameter is determined to be invalid, then assign the gain coefficient to a preset safe default value. Calculate the difference between the standard electrical signal and the offset parameter; The product of the difference and the gain coefficient is calculated to obtain the compensated electrical signal.
6. The method according to claim 1, characterized in that, The step of converting the compensated electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the linear mapping parameter set includes: Extract the range of the sensor to be calibrated from the set of linear mapping parameters; The mapping start point parameter and the mapping end point parameter are determined based on the range and the compensation electrical signal, wherein the mapping start point parameter includes the minimum value of the compensation electrical signal and the minimum value of the range, and the mapping end point parameter includes the maximum value of the compensation electrical signal and the maximum value of the range; The mapping coefficients are determined based on the mapping start-point parameter and the mapping end-point parameter; The compensation electrical signal is converted into a corresponding engineering physical quantity based on the mapping coefficient.
7. The method according to claim 1, characterized in that, Before converting the compensated electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, the method further includes: Determine the type of the sensor to be calibrated; Based on the type, a corresponding special processing is performed on the compensation electrical signal to remove different physical characteristics of different types of sensors to be calibrated. The special processing includes at least cold junction compensation, wire break detection, and Steinhart-Hart calculation.
8. The method according to claim 1, characterized in that, Upon receiving a calibration configuration command from a host computer, the step of extracting the application calibration parameter set and the linear mapping parameter set from the calibration configuration command further includes: The extracted set of application calibration parameters and linear mapping parameters for updating are temporarily stored in the temporary parameter area; Trigger the parameter refresh flag to update the application calibration parameter set and the linear mapping parameter set; The updated set of application calibration parameters and linear mapping parameters will be used for calibration during the next sensor calibration.
9. A sensor end-to-end calibration system based on hierarchical decoupling, characterized in that, The system includes: The data acquisition module is configured to acquire the raw AD sampling signal of the sensor to be calibrated in response to the activation of the sensor end-to-end calibration function. The hardware linear calibration module is configured to determine the calibration segments of the original AD sampling signal and the segment calibration parameters corresponding to different calibration segments based on the hardware calibration parameter set and the segment calibration parameters, and to perform hardware linear calibration on the original AD sampling signal according to the calibration segments and the corresponding segment calibration parameters to obtain a standard electrical signal. The configuration instruction receiving module is configured to extract the application calibration parameter set and the linear mapping parameter set from the calibration configuration instruction when it receives a calibration configuration instruction from the host computer. An application error calibration module is configured to perform application error calibration on the standard electrical signal according to the application calibration parameter set to obtain a compensated electrical signal. The physical quantity mapping module is configured to convert the compensation electrical signal into a corresponding engineering physical quantity using a two-point linear mapping algorithm based on the set of linear mapping parameters, and to obtain and store the calibration result, wherein the corresponding engineering physical quantity is applied to process control in the industrial field.
10. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-8.