Temperature drift adaptive compensation calibration method and device

CN122962280APending Publication Date: 2026-10-23JIANGXI SANKE NEW ENERGY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611145024.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]本发明的主要目的在于提供一种温漂自适应补偿校准方法及装置,旨在解决现有技术中因温度变化导致零序电流传感器测量精度下降的问题,以及离线校准维护成本高、实时性差的问题

Benefits of technology

(1)在线自适应能力强:无需停机或外加激励源,利用逆变器正常调制中的零矢量区间即可完成校准,实现了真正意义上的在线监测与补偿。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122962280A_ABST
    Figure CN122962280A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of power electronic converter control, and discloses a kind of temperature drift self-adaptive compensation calibration method and device.The method comprises: synchronously collecting the original current data output by zero-sequence current sensor and real-time temperature data;Identify whether inverter is in zero-sequence current theoretical benchmark state, if yes, then generate calibration trigger signal;Extract target current data under zero-sequence current theoretical benchmark state, and compare with theoretical zero-sequence current benchmark value, obtain temperature drift error value;Temperature drift error value is mapped to temperature error compensation table, and the compensation coefficient of corresponding temperature interval in the table is updated by weighting;Original current data is looked up and corrected using the updated temperature error compensation table, and the compensated zero-sequence current measurement value is output.The present application automatically identifies the temperature drift characteristics of zero-sequence current sensor and carries out real-time compensation under the condition that the system does not interrupt operation, and improves the precision of leakage current detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power electronic converter control technology, and in particular to a method and apparatus for adaptive temperature drift compensation calibration. Background Technology In modern industrial and new energy applications, such as photovoltaic inverters, uninterruptible power supplies (UPS), and motor drive systems, zero-sequence current detection is crucial. Zero-sequence current typically reflects the insulation condition of the system, the degree of three-phase imbalance, or grounding faults. To accurately detect zero-sequence current, zero-sequence current sensors are commonly installed in systems, including Hall effect sensors or fluxgate sensors. However, existing current sensors are inevitably affected by ambient temperature and their own heat generation at the physical level. Temperature changes can cause variations in the permeability of the magnetic materials inside the sensor, or cause temperature drift in the output voltage of the Hall element. This temperature drift is particularly critical in zero-sequence current detection because the leakage current signal being detected is usually very weak. If the sensor has a temperature drift error of tens of milliamperes, it can lead to false alarms in the control system or mask the true leakage risk, causing serious safety hazards.

[0002] Traditional solutions mainly fall into two categories: hardware compensation and offline software calibration. Hardware compensation typically requires adding compensation components such as thermistors to the sensor circuit, which not only increases hardware costs and circuit complexity but also makes it difficult to achieve accurate fitting across the entire temperature range. Furthermore, the compensation components themselves are subject to aging issues. Offline software calibration, on the other hand, requires placing the sensor in a temperature-controlled chamber for multi-point testing and generating a compensation table during equipment downtime for maintenance. This method is time-consuming and labor-intensive, cannot adapt to long-term aging and drift of the sensor over time, and cannot be updated in real time during actual equipment operation.

[0003] Therefore, the industry urgently needs a novel method that requires no additional hardware and can adaptively compensate for and calibrate the temperature drift of zero-sequence current sensors online. This method should be able to utilize the inverter's own operating characteristics to automatically capture the sensor's zero-point offset and dynamically update the compensation algorithm without affecting normal operation, thereby ensuring high-precision current sensing capabilities throughout its entire lifespan. Summary of the Invention

[0004] The main objective of this invention is to provide a temperature drift adaptive compensation calibration method and apparatus, which aims to solve the problem of decreased measurement accuracy of zero-sequence current sensors due to temperature changes in the prior art, as well as the problems of high offline calibration and maintenance costs and poor real-time performance.

[0005] To achieve the above objectives, the first aspect of the present invention provides a temperature drift adaptive compensation calibration method, comprising the following steps: During inverter operation, the raw current data output by the zero-sequence current sensor and the real-time temperature data of the surrounding environment are collected simultaneously. Based on the waveform characteristics and amplitude changes of the original current data, it is determined whether the inverter is in the zero-sequence current theoretical reference state. If it is in the zero-sequence current theoretical reference state and the duration meets the preset time threshold, a calibration trigger signal is generated. In response to the calibration trigger signal, target current data under the zero-sequence current theoretical reference state is extracted, and the statistical average value of the target current data is compared with the preset theoretical zero-sequence current reference value to calculate the current temperature drift error value under the current temperature condition. Based on the real-time temperature data, the current temperature drift error value is mapped to a preset temperature error compensation table, and the compensation coefficients of the corresponding temperature range in the temperature error compensation table are weighted and updated according to a preset adaptive update algorithm. During the inverter's non-calibration period, the updated temperature error compensation table is used to look up and correct the real-time acquired raw current data, and the compensated zero-sequence current measurement value is output.

[0006] A second aspect of the present invention provides a temperature drift adaptive compensation calibration device, comprising: The acquisition module is used to simultaneously acquire the raw current data output by the zero-sequence current sensor and the real-time temperature data of the surrounding environment during inverter operation. The identification module is used to identify whether the inverter is in the zero-sequence current theoretical reference state based on the waveform characteristics and amplitude changes of the original current data. If it is in the zero-sequence current theoretical reference state and the duration meets the preset time threshold, a calibration trigger signal is generated. The comparison module is used to extract the target current data under the zero-sequence current theoretical reference state in response to the calibration trigger signal, and compare the statistical average value of the target current data with the preset theoretical zero-sequence current reference value to calculate the current temperature drift error value under the current temperature conditions. The update module is used to map the current temperature drift error value to a preset temperature error compensation table based on the real-time temperature data, and to perform weighted updates on the compensation coefficients of the corresponding temperature range in the temperature error compensation table according to a preset adaptive update algorithm. The compensation module is used to correct the real-time acquired raw current data by looking up the updated temperature error compensation table during the non-calibration period of the inverter, and output the compensated zero-sequence current measurement value.

[0007] Compared with the prior art, the technical solution provided by the present invention has the following beneficial technical effects: (1) Strong online adaptive capability: No need to stop the machine or add an external excitation source, calibration can be completed using the zero vector interval in the normal modulation of the inverter, realizing true online monitoring and compensation.

[0008] (2) High accuracy: By performing weighted filtering and piecewise linear interpolation on multiple calibration data, random interference can be effectively filtered out and minute temperature drift changes can be accurately captured.

[0009] (3) Good robustness: By setting time threshold and amplitude threshold, calibration is only performed when the system is truly stable, thus avoiding miscalibration under dynamic load.

[0010] (4) Full life cycle coverage: The compensation table is stored in non-volatile memory and can record the aging characteristics of the sensor over time, so that it can maintain high accuracy even if the equipment is running for a long time. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of one embodiment of the temperature drift adaptive compensation calibration method in this invention. Figure 2 This is a schematic diagram of one embodiment of the temperature drift adaptive compensation calibration device in this invention. Detailed Implementation

[0012] The terms first, second, third, fourth, etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms include or have, and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0013] Example 1 This embodiment provides an overall implementation plan for an adaptive compensation and calibration method for temperature drift based on an inverter zero-sequence current sensor. The core logic of the adaptive compensation and calibration method of this invention lies in: identifying the special moment when the current is zero during inverter operation, attributing the non-zero value output by the sensor at this time to temperature drift and noise, and then using this deviation value to correct the compensation model, ultimately achieving dynamic correction of the real-time measurement value.

[0014] Please see Figure 1 One embodiment of the temperature drift adaptive compensation calibration method in this invention includes: 101. During inverter operation, the raw current data output by the zero-sequence current sensor and the real-time temperature data of the surrounding environment are collected synchronously. This step primarily involves data synchronization and acquisition. In this step, the system begins acquiring basic data. The inverter's main control chip (such as a DSP or FPGA) samples the output signal of the zero-sequence current sensor at an extremely high frequency through its integrated analog-to-digital converter module.

[0015] Specifically, after the inverter powers on, the control program initializes its internal timer, configuring it to trigger interrupts at fixed intervals. For example, the sampling frequency is set to 20 kHz, meaning a sample is taken every 50 microseconds. Each time an interrupt is triggered, the analog-to-digital converter (ADC) first reads the voltage value from the zero-sequence current sensor after signal conditioning, converts it into a digital value, and records it as the raw current data. Simultaneously, another channel of the ADC, or a single-bus digital temperature sensor, reads the temperature value near the current sensor and records it as real-time temperature data.

[0016] It is crucial to emphasize that the acquisition of current and temperature data must be strictly synchronized. Although temperature changes relatively slowly, during calibration, it is essential to ensure that the calculated temperature drift error corresponds to a specific temperature point in time. Any misalignment in time, such as pairing a current error at a high temperature with a temperature label at a low temperature, will cause the entire compensation model to fail. Therefore, in this embodiment, a dual-channel synchronous sampling technique or a method of sequentially reading data within the same interrupt service routine but marking it with the same timestamp is employed to ensure that each pair of current and temperature data corresponds one-to-one on the time axis.

[0017] 102. Based on the waveform characteristics and amplitude changes of the original current data, identify whether the inverter is in the zero-sequence current theoretical reference state. If it is in the zero-sequence current theoretical reference state and the duration meets the preset time threshold, generate a calibration trigger signal. This step primarily involves state detection to identify and determine the appropriate calibration timing. During inverter operation, the inverter spends most of its time outputting power, and the zero-sequence current includes unbalanced load components. At this time, it's impossible to distinguish between the true zero-sequence current and the sensor's temperature drift. Only when the theoretical zero-sequence current is zero does the sensor reading purely represent error. This embodiment utilizes the characteristics of Space Vector Pulse Width Modulation (SVPWM) technology.

[0018] In SVPWM modulation, there exists a zero-vector state (such as vectors V0 and V7). Under the action of the zero vector, all three arms of the inverter are either connected to the upper bus or all connected to the lower bus. At this time, the line voltage of the motor load or the grid side is instantaneously zero, and the three-phase current is theoretically in a freewheeling or clamped state, so the net current flowing through the zero-sequence current sensor should be zero.

[0019] To identify this moment, step 102 performs real-time analysis on the raw current data acquired in step 101. Internally, the program maintains a sliding window containing data from the N most recent sampling points (e.g., N=10). The system calculates the fluctuation level and absolute value of the current data within this window. The judgment logic is as follows: First, the average of the absolute values ​​of all current data within the window is calculated. If this average is less than a very small preset threshold (e.g., 1% of the rated current), the system is considered to be in a zero-vector state. To avoid false positives (e.g., small currents caused by a real fault), the system also needs to check the duration of this state. If the low-current state persists for more than a preset time threshold (e.g., 500 microseconds), which far exceeds the typical switching transient process, it indicates that the system has indeed entered a stable zero-vector region. At this point, the system confirms that it has found the perfect calibration window and immediately generates a calibration trigger signal.

[0020] 103. In response to the calibration trigger signal, extract the target current data under the zero-sequence current theoretical reference state, and compare the statistical average value of the target current data with the preset theoretical zero-sequence current reference value to calculate the current temperature drift error value under the current temperature conditions. This step primarily involves error calculation. Once the calibration trigger signal is output in step 102, step 103 is initiated. The task of this step is to quantify the current error magnitude.

[0021] In practice, the system will capture a continuous segment of data before or during the calibration trigger signal. This data must be collected within the stable zero vector range confirmed in step 102 to ensure that it does not contain any load components.

[0022] Suppose 100 sampling points are selected. The arithmetic mean of these 100 sampling points needs to be calculated. The reason for calculating the average is to further filter out random high-frequency noise. Although the state has been confirmed in step 102, thermal noise and electromagnetic interference are inevitable in the sensor circuit. A single sampling may have deviations, and the average of multiple samples can more accurately reflect the static offset of the sensor.

[0023] After obtaining the average value, the system compares it with the theoretical zero-sequence current reference value. Ideally, the zero-sequence current should be 0 amperes, so the theoretical reference value is set to 0. However, in some complex grounding systems, there may be a fixed ground capacitance current. In this case, the theoretical reference value can be set to a non-zero fixed constant based on the system parameters (which needs to be determined experimentally beforehand).

[0024] Finally, the theoretical baseline value is subtracted from the calculated average observation value. For example, if the average observation value is 20 mA and the theoretical baseline value is 0 mA, the calculated result is 20 mA. This 20 mA is the current temperature drift error value. A positive value indicates that the sensor reading is too high, and a negative value indicates that the reading is too low. This error value includes all accumulated drift at the current temperature.

[0025] 104. Based on the real-time temperature data, map the current temperature drift error value to a preset temperature error compensation table, and perform weighted updates on the compensation coefficients of the corresponding temperature range in the temperature error compensation table according to a preset adaptive update algorithm. This step mainly implements the mapping of the compensation table and adaptive compensation. After obtaining the key data pair of the current temperature (from step 101) and the current temperature drift error value (from step 103), step 104 is responsible for updating the system's knowledge base—the temperature error compensation table.

[0026] The temperature error compensation table is a data structure stored in the controller's memory. It typically contains two columns: one column represents discrete temperature nodes (e.g., -40℃, -20℃, 0℃, 20℃, 40℃, 60℃, 80℃, 100℃), and the other column represents the compensation coefficient for each temperature node. The physical meaning of the compensation coefficient is: how many milliamps of spurious current the sensor will output at that temperature.

[0027] First, the system identifies the temperature range within which the real-time temperature data falls. For example, if the current real-time temperature is 35℃, it would fall within the range of 20℃ to 40℃. The system doesn't simply replace the values ​​in the table with the currently calculated error values, as single measurements may be subject to chance. An adaptive update algorithm is used here: New compensation coefficient = Old compensation coefficient + Learning rate × (Current temperature drift error value - Predicted value of the old compensation coefficient).

[0028] The learning rate is a decimal less than 1, such as 0.1. This means the system will only correct 10% of the error. This gradual update method has excellent filtering effect, preventing sudden interference data from corrupting the entire compensation table, and also allowing the compensation table to slowly drift to the true value as seasonal temperature changes and sensor aging occur.

[0029] The specific weighted update process not only targets the two endpoints of 20℃ and 40℃, but also adjusts the values ​​of these two endpoints to different degrees based on the proportion of the current temperature of 35℃ within the interval, in order to ensure the continuity and smoothness of the entire temperature-error curve and avoid jumps in compensation values ​​when the temperature crosses the node.

[0030] 105. During the non-calibration period of the inverter, the real-time acquired raw current data is corrected by looking up the updated temperature error compensation table, and the compensated zero-sequence current measurement value is output.

[0031] This step mainly involves real-time compensation to calibrate the zero-sequence current measurement value.

[0032] After the update in step 104, the temperature error compensation table now reflects the latest temperature drift characteristics. Step 105 uses this table to correct the measured values ​​when the inverter is operating normally (non-zero vector state). When the inverter is in normal operating condition, the load current constantly changes. The system continuously collects raw current data and real-time temperature data. For each sampling point, the system performs a table lookup operation.

[0033] For example, at a certain moment, the inverter outputs a large load current, and the sensor reading (raw current data) is 1050 mA. At this time, the temperature sensor measures a temperature of 55°C. The system consults the temperature error compensation table and finds that at 55°C, the sensor drift (compensation coefficient) is approximately 25 mA.

[0034] The system then performs a subtraction operation: Final output value = Original current data - Compensation coefficient. That is: 1050 - 25 = 1025 mA. This 1025 mA is the compensated zero-sequence current measurement value.

[0035] Through this step, the 25 mA spurious zero-sequence current generated by the sensor due to temperature rise is successfully subtracted. For the subsequent protection algorithm, it receives a value close to the actual physical current. If a real ground fault occurs, for example, generating a 50 mA leakage current, superimposed on the drift, the sensor might read 75 mA. After compensation, the system calculates 75 - 25 = 50 mA, still accurately identifying the fault without misjudging or missing a fault due to drift.

[0036] For example, suppose there is a 50-kilowatt photovoltaic inverter operating in an outdoor environment.

[0037] At 8:00 AM, the ambient temperature is 10℃. The inverter starts up. Step 101 begins at this point. Due to the low temperature after startup, the sensor experiences almost no drift. During inverter operation, it occasionally enters a zero-vector state, which is captured in step 102. The temperature drift error calculated in step 103 fluctuates within ±1 mA. Step 104 updates the compensation table with fine adjustments; at this point, the compensation coefficient corresponding to 10℃ in the table is approximately 0.5 mA. Step 105 performs real-time compensation, which has almost no impact on the measurement.

[0038] At noon, under intense sunlight, the temperature inside the inverter chassis rose to 65°C. The sensors were severely overheated, causing temperature drift in the Hall effect sensors.

[0039] Step 101 continues to collect data, showing an increase in temperature.

[0040] Step 102 detects a continuous zero vector interval during the interval of inverter output power.

[0041] Step 103 extracts the data for this range, assuming a reading of 15 mA was obtained. Since the theoretical reference value is 0, the current temperature drift error is considered to be 15 mA.

[0042] Step 104, after consulting the table, reveals that 65℃ falls between 60℃ and 70℃. Assuming the compensation coefficient for 60℃ in the previous table was 8 mA and for 70℃ it was 12 mA, the system uses an adaptive algorithm (e.g., a learning rate of 0.2) to perform a weighted balance between 15 mA and the original predicted value, gradually correcting the compensation coefficient in the 60℃-70℃ range upwards. After multiple zero-vector calibrations, the compensation coefficient near 65℃ eventually stabilizes at around 15 mA.

[0043] In step 105, during subsequent operation, whenever a temperature of 65℃ is detected, 15 mA will be automatically subtracted from the real-time reading. If a real leakage occurs at this time, the sensor reading will be 20 mA, and the system output will be 20 - 15 = 5 mA, accurately reflecting the actual leakage situation.

[0044] At 18:00 in the evening, the temperature begins to drop to 40℃. Since step 104 had already updated the node data for the low-temperature region at noon (because the curve is smooth and continuous, correcting the high-temperature region will also cause minor adjustments in the low-temperature region), or step 104 may have recaptured the zero vector and performed a reverse correction during the temperature drop in the evening, the compensation coefficient corresponding to 40℃ might be 5 mA. Step 105 continues to perform precise compensation based on this value.

[0045] As can be seen from the above process, this embodiment can achieve high-precision calibration across the entire temperature range without manual intervention, perfectly solving the temperature drift problem of the inverter zero-sequence current sensor.

[0046] Example 2 This embodiment, based on Embodiment 1, provides a more detailed explanation of the specific implementation of step 101. The focus of this embodiment is to address noise interference, data alignment, and buffer management issues during high-precision data acquisition, providing a high-quality data source for subsequent calibration algorithms.

[0047] In the context of inverters operating in environments with strong electromagnetic interference, the accuracy of data acquisition directly determines the precision of compensation. Step 101 is not a simple data reading process, but a complex preprocessing procedure involving analog-to-digital conversion, digital filtering, and queue management. The output of this step is cleaned and organized time-series data, where each current data point has a unique timestamp and a corresponding temperature data point. This strict alignment is a prerequisite for the subsequent accurate calculation of the temperature drift coefficient.

[0048] 1011. The analog output signal of the zero-sequence current sensor is continuously sampled by an analog-to-digital converter at a preset first sampling frequency to obtain the original digital current sequence.

[0049] This step is crucial for converting physical signals into digital signals. Zero-sequence current sensors typically output a voltage signal, which is proportional to the measured current. Before entering the analog-to-digital converter (ADC) of the main control chip, this signal is usually amplified and level-shifted by an operational amplifier to suit the ADC's input range (e.g., 0 to 3.3 volts).

[0050] In this step, the system configures the ADC to operate in either continuous scanning mode or synchronous sampling mode triggered by a timer. The preset first sampling frequency is a crucial parameter. According to the Nyquist sampling theorem, the sampling frequency must be higher than twice the highest frequency component of the signal. Considering that the inverter switching frequency is typically in the tens of kilohertz, and that the zero-sequence current may contain high-frequency common-mode noise, this embodiment sets the first sampling frequency to at least 20 times the inverter switching frequency. For example, if the inverter switching frequency is 10 kilohertz, the first sampling frequency can be set to 200 kilohertz or higher.

[0051] In practical implementation, a differential input method is used at the hardware level to suppress common-mode interference. The ADC module holds the input signal on the rising edge of each sampling clock and quantizes it on an internal capacitor array. The quantization accuracy determines the minimum resolution of the system. This embodiment preferably uses a 12-bit or higher precision ADC. This means that, assuming a reference voltage of 3.3 volts, the minimum voltage change that the ADC can detect is approximately 0.8 millivolts. If the sensor sensitivity is 100 millivolts / ampere, the current resolution can reach 8 milliamperes.

[0052] During continuous sampling, the ADC continuously fills the data register with the conversion results. The main control chip automatically moves these data to a designated area in memory through the Direct Memory Access (DMA) controller, thus avoiding the resource waste caused by frequent register reads by the CPU and ensuring the continuity of the data stream. The continuous numerical stream generated in this process constitutes the original digital current sequence. This sequence contains the actual useful signal, the sensor's DC offset (temperature drift), quantization noise, and high-frequency electromagnetic interference.

[0053] 1012. The original current digital sequence is denoised by a digital filter to remove high-frequency noise interference and obtain the filtered current data stream.

[0054] Because the raw current digital sequence acquired by 1011 contains a large amount of high-frequency noise (mainly from the rapid switching action of the inverter's IGBTs), the amplitude of this high-frequency noise may even exceed the actual weak leakage current signal. If not processed, it will lead to misjudgment in subsequent zero-vector identification. Therefore, this sub-step introduces a digital filter for noise reduction.

[0055] In this embodiment, the digital filter selected is a finite impulse response (FIR) low-pass filter or an infinite impulse response (IIR) low-pass filter. The filter design parameters need to be set according to the bandwidth of the useful signal. Since the fault signal in the zero-sequence current usually changes slowly (low frequency), while the switching noise frequency is very high, the filter cutoff frequency is set to less than one-tenth of the switching frequency. The specific processing logic is as follows: The system establishes a filter coefficient array, for example, a coefficient array containing 16 taps. For each newly entered raw current sampling point, the system multiplies it by the corresponding filter coefficients of the previous 15 sampling points, and then adds these 16 products together. The sum is the filtered output value at the current moment. This moving weighted average algorithm mathematically represents the suppression of high-frequency components.

[0056] For example, suppose the original sequence contains a high-frequency spike noise with an amplitude of 100 mA and a frequency of 50 kHz. After being processed by a low-pass filter with a cutoff frequency of 1 kHz, this spike noise will be significantly attenuated, possibly leaving only a few milliamps of residual noise. Meanwhile, the real, temperature-induced DC offset (e.g., 20 mA) superimposed on it will be completely preserved.

[0057] This step smooths out the filtered current data stream, removes glitches, restores the true baseline of the signal, and greatly improves the signal-to-noise ratio, laying the foundation for accurate subsequent calculations.

[0058] 1013. Establish a circular buffer queue, align the filtered current data stream and the synchronously acquired temperature data stream according to the time tag and store them in the circular buffer queue for subsequent steps to call.

[0059] After acquiring and filtering the current signal, the next step is to solve the problem of how to combine this data with temperature data and provide it to the subsequent algorithm modules in an efficient manner.

[0060] First, regarding time alignment. Although temperature changes are very slow relative to current changes, at the moment of calibration, it is necessary to ensure that the current value used to calculate the error is indeed the current value at the current temperature. This embodiment timestamps the current and temperature data by sharing the same interrupt source or the same time base (e.g., the system tick timer SysTick). When the current data is filtered and output, the system simultaneously reads the most recent temperature sample value and combines the two.

[0061] Secondly, regarding the data storage structure. To accommodate continuous operation, the system cannot allocate memory indefinitely to store historical data. Therefore, this embodiment allocates a fixed-size region in memory to construct a circular buffer queue. The specific operation is as follows: The buffer queue is set to a depth of 1024 data units. Each data unit contains two variables: a 32-bit floating-point current value and a 16-bit integer temperature value. When a new data pair (current I_new, temperature T_new) is ready, the system writes it to the unit pointed to by the head pointer, and then the head pointer moves forward one position. If the head pointer reaches the end of the queue, it automatically wraps back to the beginning of the queue (address 0), overwriting the oldest data. This mechanism ensures that the queue always stores all data from the most recent period (e.g., the last 10 seconds).

[0062] When subsequent steps (such as steps 102 and 103) need to analyze data, they do not need to concern themselves with the data writing process; they only need to read the data sequentially using the tail pointer. After reading is complete, the tail pointer moves, indicating that the data has been processed. If the writing speed is faster than the reading speed, the head pointer will catch up with the tail pointer. At this point, the system can adopt strategies such as overwriting old data or issuing a full-load flag.

[0063] This circular buffer mechanism not only saves memory, but more importantly, it provides a time window. Regardless of when the calibration trigger signal arrives, the system can retrieve historical data from several time points prior to the trigger signal from this buffer queue, which is crucial for analyzing the state before the calibration moment.

[0064] Example 3 This embodiment, based on Embodiment 1, provides a more detailed explanation of the specific implementation of step 102. The core technological innovation of this embodiment lies in proposing a dual-criteria mechanism combining sliding window root mean square value calculation and duration verification, which can reliably identify suitable calibration quiet periods from complex modulation waveforms.

[0065] The inverter output current waveform is typically a sine wave or a modulated PWM wave. However, under specific switching conditions (i.e., zero-vector operation), the three-phase current is bypassed or freewheeled, theoretically resulting in zero current flowing through the zero-sequence sensor. However, due to dead-time effects, inconsistent device characteristics, and other reasons, even under zero-vector operation, the current may not be absolutely zero and is usually accompanied by high-frequency oscillations. The goal of step 102 is to find a range with a sufficiently small current amplitude and a sufficiently long duration to eliminate dynamic load interference and ensure that the deviation calculated in step 103 is purely the static temperature drift of the sensor.

[0066] 1021. Calculate the root mean square value of the current amplitude of the original current data within a preset sliding time window in real time.

[0067] This step is the first step in waveform feature extraction. Simply judging the magnitude of the instantaneous value is insufficient, because high-frequency noise may cause the instantaneous value to occasionally exceed the threshold, but this does not mean that the system has escaped the zero vector state. The root mean square (RMS) value reflects the effective energy of the signal over a period of time and is the best indicator for measuring the current amplitude.

[0068] In practice, the system defines a sliding time window in memory. This window contains N consecutive sampling points, and the size of N determines the time span of the calculation. For example, if N is set to 16 and the sampling frequency is 40 kHz, then the time span covered by this window is 0.4 milliseconds.

[0069] Whenever a new sampled data point arrives (provided by step 101), the system places it at the front of the window while removing an older data point from the back of the window. This first-in-first-out mechanism ensures that the window always slides over the latest data stream.

[0070] Next, the system calculates the root mean square (RMS) value of all data within the window. To reduce computational load, this embodiment can employ a simplified approximation algorithm or an incremental algorithm. Accurate RMS calculation requires squaring each point, calculating the average, and finally taking the square root. However, in embedded systems, square root operations are resource-intensive. Therefore, the average of the sum of squares can be calculated, or for signals dominated by pure DC components, the average of the absolute values ​​can be directly calculated as a substitute for the RMS value, with approximate physical meaning.

[0071] For example, the data in the window is: -2, 3, -1, 2, 0, -1, 1, -2 (unit: milliamperes).

[0072] RMS calculation process: Squared: 4, 9, 1, 4, 0, 1, 1, 4.

[0073] Sum of squares: 24.

[0074] Average: 24 / 8 = 3.

[0075] RMS = √3 ≈ 1.732.

[0076] This 1.732 mA is the effective current amplitude for the current window. By continuously calculating this value, the system obtains an amplitude envelope that varies with time.

[0077] 1022. Determine whether the root mean square value of the current amplitude is less than the preset silence threshold. If so, start the timer to accumulate the duration.

[0078] This step introduces a combination of amplitude and timing criteria.

[0079] First, the system sets a quiet threshold. This threshold is determined based on a combination of the inverter's characteristics, the sensor's accuracy, and the allowable error range. It is typically slightly larger than the maximum ripple current that may occur at zero vector. For example, it is set to 5 mA.

[0080] The system compares the real-time RMS value calculated in step 1021 with 5 mA.

[0081] If RMS > 5 mA, it indicates that the system is outputting power or the current is too high, which is obviously unsuitable for calibration. In this case, the system will reset (clear) an internal software timer and return to wait for the next calculation. If RMS ≤ 5 mA, it indicates that the current energy of the system is very low, and it is likely in a zero vector state. In this case, the system starts the software timer to begin accumulating time.

[0082] This timer is typically based on system clock ticks. For example, each clock tick represents 25 microseconds. The timer increments by 1 each time the RMS value is satisfied (RMS ≤ threshold). It's important to note that these checks must be performed continuously. If, during the timing process, the RMS value suddenly exceeds 5 mA (e.g., due to an interference pulse), the system considers the silence interrupted and must immediately reset the timer and restart the accumulation. This continuity requirement is to prevent accidental interference from triggering false calibration, ensuring that the timer is only considered valid when the system is truly stable in a low-current state for an extended period.

[0083] 1023. When the duration reaches the preset time threshold, the inverter is confirmed to be in zero vector switching state, and a high-level signal is output as the calibration trigger signal.

[0084] This step is the final confirmation of the calibration timing. The system presets a time threshold. Setting this threshold requires consideration of two aspects: first, it must be long enough to avoid the transient processes of switching operations (dead time and voltage spikes); second, it cannot be too long, otherwise, with too few calibration points, the data update frequency will be reduced. For inverters with switching frequencies of tens of kilohertz, the zero vector distribution is usually denser, and the time threshold can be set from several hundred microseconds to several milliseconds. For example, it can be set to 1 millisecond.

[0085] When the cumulative value of the software timer in step 1022 reaches 1 millisecond (meaning that the effective amplitude of the current remains below 5 mA for a continuous period of 1 millisecond), the system determines that the inverter is indeed in a stable zero-vector switching state or a no-output state.

[0086] At this point, the system pulls a flag register high (e.g., sets the variable Calibration_Trigger from 0 to 1), or sends an event message to a specific task queue. This high-level signal is the calibration trigger signal. Once issued, this signal is typically held for a specific clock cycle, or until it is responded to and reset by step 103.

[0087] The generation of the trigger signal marks the end of the data acquisition phase (step 101) and the beginning of the error calculation phase (step 103). At this point, the background noise is almost zero, and the read sensor value is the purest zero-point drift, so it needs to be recorded and calculated immediately.

[0088] For example, consider an air conditioner compressor inverter controller whose operating frequency varies between 10 Hz and 100 Hz. The system's sliding window contains 20 sampling points. During operation, the compressor is rotating at high speed, generating a large current. The RMS value calculated in step 1021 might be around 10 amps. This clearly exceeds any reasonable quiescent threshold.

[0089] Subsequently, the controller adjusts the PWM duty cycle according to load demand, entering the zero-vector action range within one carrier cycle. At this time, all the lower transistors of the three-phase bridge arms are turned on, the motor windings freewheel through diodes, and the current gradually decreases. For a brief moment, the current crosses zero and remains low.

[0090] Assume the data for the next 20 consecutive sampling points are: 0.5, -0.8, 0.2, -0.1, 0.3, -0.4… (in milliamperes). The system calculates the RMS value for these points, which is 0.45 milliamperes. This value is very small. The system's preset silence threshold is 2 milliamperes. The current RMS value of 0.45 milliamperes < 2 milliamperes. The condition is met. The system's internal timer, Timer_Stable, starts counting. Assume the system checks the value every 20 microseconds.

[0091] First judgment: 0.45 < 2, timer = 1.

[0092] Second judgment: 0.48 < 2, timer = 2.

[0093] … 50th judgment: 0.52 < 2, timer = 50. The elapsed time is 50 × 20 microseconds = 1000 microseconds = 1 milliampere-second.

[0094] Suppose that during the 51st calibration attempt, a common-mode interference is introduced due to a sudden change in grid voltage, causing the RMS value within the window to suddenly jump to 2.5 mA. At this point, 2.5 > 2, and the condition is not met. The system immediately executes a timer reset operation, clearing Timer_Stable to zero. This calibration attempt fails, and the system must wait for the next zero vector to arrive.

[0095] Upon the arrival of another zero-vector, the interference disappeared. The system continuously monitored an RMS value consistently below 2 mA. The timer incremented from 0: 1, 2, 3… up to 60. 60 × 20 microseconds = 1200 microseconds. The preset time threshold was 1000 microseconds (1 millisecond). At this point, 1200 > 1000, the condition was met. The system determined that the inverter was in a perfect zero-vector switching state. The program executed the instruction Trigger_Flag = 1;. This high-level signal was sent to the control module in step 103. Upon detecting this signal, step 103 immediately froze the current data acquisition state and began extracting data for error calculation, thus successfully capturing this valuable calibration window.

[0096] Example 4 This embodiment, based on embodiments 1 to 3, provides a more detailed explanation of the specific implementation of step 103. The core of this embodiment lies in how to accurately lock onto valid data from massive real-time data streams and eliminate random noise through statistical methods, thereby obtaining a highly reliable temperature drift error value.

[0097] When step 102 issues the calibration trigger signal, it means the system has captured a zero-interference window. However, even within this window, the data is not a perfectly straight line; it still contains quantization noise and minor thermal noise. Therefore, this step is not merely reading a numerical value, but a comprehensive process involving data locking, statistical filtering, and benchmark comparison.

[0098] 1031. Lock historical data of a preset length prior to the moment the calibration trigger signal is received as the target current data.

[0099] This step focuses on the time truncation strategy for data sampling. The generation of the calibration trigger signal typically has a certain lag, as it is generated based on the duration counter in step 1022 reaching a threshold. This means that at the instant the trigger signal is issued, the inverter has actually been in a silent state for a period of time. Therefore, the ideal data is not the instant after the trigger signal is generated, but rather the complete silent process that led to the generation of the trigger signal.

[0100] In practice, the system utilizes the circular buffer queue established in Example 2. When a software interrupt detects a high-level calibration trigger signal, the system immediately records the current head pointer position of the circular buffer queue. Then, it backtracks forward according to the preset data length.

[0101] For example, the preset data length is set to 200 sampling points. The system will count backwards from the current pointer position and retrieve the data from the 200th to the 1st. These 200 data points correspond exactly to the historical interval in step 102 where the timer starts counting from 0 until the time threshold is reached.

[0102] This backtracking locking method has significant advantages: it ensures that the extracted data remains entirely within a known stable range, avoiding the introduction of new state changes that might be introduced during the trigger signal processing delay. These 200 points constitute the target current dataset. To ensure data purity, the system can also perform simple outlier removal on this dataset, such as removing extreme points that deviate too far from the average value, further purifying the data.

[0103] 1032. Calculate the arithmetic mean of all sampling points in the target current data and use it as the observed zero-sequence current value under the current operating condition.

[0104] This step utilizes statistical principles to extract features from the target current dataset. Under the theoretical baseline of zero-sequence current, the ideal signal should be a DC component (i.e., temperature drift bias) plus zero-mean random noise. By calculating the arithmetic mean, according to the law of large numbers, the zero-mean random noise will cancel each other out during the accumulation process, leaving the true DC bias of the signal. The specific calculation logic is as follows: The system initializes an accumulator variable to 0. It iterates through each valid sample point in the target current dataset, adding its value to the accumulator. After iteration, the total value of the accumulator is divided by the number of valid sample points. Weighted averaging or other complex algorithms are not used here because the signal should be stationary within this quiet window, and each sample point should contribute equally to reflecting the DC bias. Arithmetic averaging not only has low computational cost, making it suitable for real-time operation in resource-constrained embedded controllers, but also provides the best suppression of white noise (minimum variance).

[0105] The calculated arithmetic mean is defined as the observed zero-sequence current value. This value has largely eliminated random interference and represents the net reading exhibited by the sensor output under the current temperature and electromagnetic environment. Although this reading includes temperature drift, it is very close to the true physical offset.

[0106] 1033. Subtract the theoretical zero-sequence current reference value from the observed zero-sequence current value, and the difference obtained is the current temperature drift error value.

[0107] This step completes the conversion from observed values ​​to error values. The theoretical zero-sequence current reference value is a preset constant of the system. In an ideal three-phase balanced system, the zero-sequence current should be 0. However, in some practical applications, due to the presence of transformer excitation current or inherent parasitic capacitance, even without a fault, there may be a fixed, known small bias. This bias can be determined through factory testing and stored in the controller, i.e., the theoretical zero-sequence current reference value.

[0108] The system performs a subtraction operation: Current temperature drift error value = Observed zero-sequence current value - Theoretical zero-sequence current reference value. If the calculation result is positive, it indicates that the sensor has experienced a positive offset due to temperature influence (reading is too large); if it is negative, it indicates a negative offset (reading is too small).

[0109] This current temperature drift error value is a signed real number and is the final output of step 103. It not only contains information about the temperature drift but also implicitly includes all the accumulated gain errors caused by the long-term aging of the sensor. This value will serve as the sole basis for updating the compensation table in the subsequent step 104.

[0110] For example, suppose an inverter system is undergoing a calibration process.

[0111] Step 102 outputs a calibration trigger signal at timestamp T=10.005 seconds. The system's preset data length corresponds to 500 microseconds of data (i.e., 20 sampling points, assuming a sampling rate of 40kHz). The system immediately checks the circular buffer queue and locks the 20 data points prior to T=10.005 seconds. These data points record a time period from 10.000 seconds to 10.005 seconds.

[0112] The locked original data sequence (in mA) is: 10.2, 10.5, 9.8, 10.1, 10.3, 10.0, 9.9, 10.4, 10.2, 10.1, 10.3, 9.7, 10.2, 10.5, 10.0, 10.1, 9.8, 10.3, 10.2, 10.4.

[0113] This set of data was confirmed as the target current data.

[0114] The system sums the above 20 data points. The sum calculation process is as follows: 10.2 + 10.5 = 20.7 20.7 + 9.8 = 30.5 …(Intermediate process omitted)… The final sum is 204.2.

[0115] Arithmetic mean = 204.2 / 20 = 10.21 mA.

[0116] This 10.21 mA is the observed zero-sequence current value. It can be seen that although the single-point data fluctuates between 9.7 and 10.5, the average value stabilizes around 10.21, effectively reflecting the true signal level.

[0117] The system checked the parameter configuration and found that the theoretical zero-sequence current reference value for this model of inverter is set to 0.1 mA (taking into account the extremely small inherent leakage current).

[0118] The current temperature drift error is 10.21 - 0.1 = 10.11 mA.

[0119] Alternatively, if the reference value is set to 0, the error is 10.21 mA.

[0120] The system records the result: At the current moment, the zero-sequence current sensor has a positive temperature drift error of +10.11 mA. This value will be directly passed to step 104 for correction of the compensation table.

[0121] Example 5 This embodiment, based on embodiments 1 to 4, provides a more detailed explanation of the specific implementation of step 104. This embodiment primarily addresses how to dynamically correct a nonlinear temperature drift model using online data.

[0122] The temperature drift of a sensor is typically non-linear, potentially decreasing significantly at low temperatures and increasing dramatically at high temperatures. To ensure accurate compensation, this invention employs a temperature error compensation table to store the drift amount at different temperatures. Step 104 involves integrating the discrete error points measured in step 103 into this table using an intelligent algorithm, gradually approximating the curve in the table to the actual drift characteristic curve.

[0123] 1041. Compare the real-time temperature data with each temperature segment node in the temperature error compensation table to determine the temperature range in which the current temperature falls.

[0124] The temperature error compensation table is a discrete dataset consisting of a series of temperature-compensation coefficient key-value pairs. For example, the table defines temperature nodes: -20℃, 0℃, 20℃, 40℃, 60℃, and 80℃. These nodes divide the entire temperature axis into several consecutive intervals.

[0125] When step 104 receives the real-time temperature data and the current temperature drift error value, it first needs to know which part of the table this data should be used to correct.

[0126] The specific comparison logic is as follows: The system traverses the temperature nodes in the compensation table and finds the largest node with a temperature smaller than the current temperature and the smallest node with a temperature larger than the current temperature.

[0127] For example, the real-time temperature data is 35℃.

[0128] The system comparison revealed that 35℃ is greater than 20℃ but less than 40℃.

[0129] Therefore, the current temperature range is determined to be [20℃, 40℃].

[0130] If the real-time temperature is exactly equal to a certain node (e.g., 40℃), it can be directly identified as that node itself, or classified into an adjacent interval.

[0131] Determining the range is crucial because temperature drift is continuous; the drift at 35°C must fall between the drifts at 20°C and 40°C. This step lays the foundation for subsequent local corrections and global smoothing.

[0132] 1042. Calculate the correction step size for this calibration based on the preset learning rate factor. The correction step size is equal to the product of the current temperature drift error value and the learning rate factor.

[0133] Since the error value measured in step 103 may still contain extremely small residual interference, and the sensor characteristics may undergo extremely small creep over time, the newly measured value cannot be directly used to completely cover the old value in the table, otherwise it will cause severe fluctuations in the compensation curve. Therefore, a stepwise approximation strategy is adopted.

[0134] Here, a learning rate factor is introduced, typically a small positive number, such as 0.05 or 0.1. It represents the system's level of confidence in the measurement results. A smaller learning rate results in a slower correction process but stronger resistance to interference; a larger learning rate results in faster correction but is more susceptible to noise. The specific calculation process is as follows: First, to prevent incorrect correction direction, it is necessary to consider not only the measured absolute value but also the predicted value already present in the current table. The correction step size is defined to eliminate bias.

[0135] Suppose we pull the values ​​in the table in the direction of the measurement. Correction step size = learning rate factor × current temperature drift error value (Note: here we need to calculate the deviation in conjunction with the existing values ​​in the table, but to intuitively illustrate the physical meaning of the step size, the step size essentially represents how far I want to go in this correction).

[0136] A more rigorous logic is: Correction step size = Learning rate factor × (Current temperature drift error value - Original interpolation prediction value in the table).

[0137] Assuming a learning rate of 0.1, a measured error of 10 mA, and an original predicted value of 8 mA with a bias of 2 mA, then the correction step size = 0.1 × 2 = 0.2 mA. This means that only 0.2 mA needs to be corrected, leaving 0.2 mA of uncorrected bias for future processing, thereby filtering out possible random errors.

[0138] 1043. The original compensation coefficient value corresponding to the temperature range is algebraically added to the correction step size to generate the updated compensation coefficient, and the compensation coefficients of the adjacent nodes of the temperature range are updated synchronously to keep the curve smooth.

[0139] This step involves data writing and curve smoothing. After determining the interval and step size, the system modifies the compensation table.

[0140] First, update the compensation coefficients at the endpoints of the interval.

[0141] For the interval [20℃, 40℃], the compensation values ​​corresponding to both the 20℃ and 40℃ nodes need to be updated simultaneously. The update magnitude is usually related to the current temperature's position within the interval. If the current temperature is 35℃, which is closer to 40℃, then the correction weight for the 40℃ node should be larger, and the correction weight for the 20℃ node should be smaller. The specific operation is as follows: New value at node 20℃ = Old value at node 20℃ + (Correction step size × Weight A) New value at 40℃ node = Old value at 40℃ node + (Correction step size × Weight B) In this equation, weight A + weight B = 1. For the point 35℃, weight B might be set to 0.75, and weight A to 0.25.

[0142] Secondly, synchronously updating neighboring nodes is to maintain the smoothness of the curve. If only 20℃ and 40℃ are modified, it may cause angles between these two points and the adjacent 0℃ and 60℃ points, which does not conform to physical laws (temperature drift is usually a smooth curve). Therefore, the system can apply a smaller correction step size (e.g., 0.1 times the correction step size) to the 0℃ and 60℃ nodes.

[0143] Ultimately, the original line graph or curve will undergo a slight deformation due to this update, becoming closer to the actual physical properties. After thousands of such online calibrations and updates, the accuracy of the temperature error compensation table will be greatly improved, perfectly replicating the temperature drift characteristics of the sensor.

[0144] For example, suppose the controller maintains the following simplified temperature error compensation table in its memory: Temperature ranges: 0℃, 20℃, 40℃, 60℃ Current compensation values: 0mA, 4mA, 9mA, 16mA Preset learning rate factor: 0.2 Assume the data received in step 103 is: real-time temperature = 50℃, current temperature drift error = 13.5mA. The system scans the temperature nodes and finds that 50℃ is between 40℃ and 60℃. Therefore, the target temperature range is determined to be [40℃, 60℃].

[0145] The system first performs linear interpolation based on the data in the table to predict the theoretical drift at 50℃: (50-40) / (60-40) = 0.5 (location factor) Predicted value = 9mA + (16mA - 9mA) × 0.5 = 9mA + 3.5mA = 12.5mA.

[0146] The current measured error value is 13.5mA.

[0147] Deviation value = 13.5mA - 12.5mA = 1.0mA.

[0148] Calculate the correction step size = learning rate factor × bias value = 0.2 × 1.0mA = 0.2mA.

[0149] This means that the system decides to adjust the compensation curve upward by 0.2mA around 50℃.

[0150] The system has begun updating the nodes.

[0151] The current temperature of 50℃ is exactly in the middle of the interval, so the weight allocation is as follows: 0.5 for the 40℃ node and 0.5 for the 60℃ node.

[0152] For the 40℃ node: The allocated correction amount = 0.2mA × 0.5 = 0.1mA.

[0153] The updated 40℃ node compensation value = original value 9mA + 0.1mA = 9.1mA.

[0154] For the 60℃ node: The allocated correction amount = 0.2mA × 0.5 = 0.1mA.

[0155] The updated 60℃ node compensation value = original value 16mA + 0.1mA = 16.1mA.

[0156] To achieve smoothness, the system also fine-tunes the neighboring 20°C nodes (with a weight set to 0.1): The correction amount at the 20℃ node is 0.2mA × 0.1 = 0.02mA.

[0157] After the update, the compensation value at the 20℃ node is 4mA + 0.02mA = 4.02mA.

[0158] The compensation table after the update becomes: 0℃: 0mA 20℃: 4.02mA 40℃: 9.1mA 60℃: 16.1mA As can be seen, the shape of the meter has undergone a subtle change, becoming closer to the measured characteristic point of 13.5mA. When the temperature is 50℃ next time, the compensation value calculated by the system from the table will be closer to the actual situation than the previous 12.5mA, thus achieving a continuous improvement in accuracy.

[0159] Example 6 This embodiment, based on embodiments 1 to 5, provides a detailed explanation of the implementation of step 105. Step 105 is the final step in the entire method to output value. It applies the temperature drift model learned through complex algorithms to each real-time sampling point, ensuring that the inverter protection system and control system always obtain accurate current information.

[0160] When the inverter is in a non-calibration period (i.e., normal operating state), the system no longer performs tedious error calculations and table updates, but instead enters a high-speed lookup-compensation loop mode. This process must have extremely high real-time performance, typically requiring completion within tens of microseconds to keep pace with the controller's operation. This step uses linear interpolation technology to transform the discrete compensation table into a continuous compensation curve and corrects the original data point by point.

[0161] 1051. When the inverter is in dynamic operation, read the current temperature data and the corresponding raw current data in real time.

[0162] This step prepares the data input for real-time compensation. Dynamic operating state specifically refers to the inverter outputting power, with the three-phase current fluctuating dramatically, and the zero-vector quiescent period described in step 102 not present. In this state, the raw current data includes the actual load current, the actual unbalanced leakage current, and the temperature drift bias that needs to be eliminated.

[0163] The system executes this sub-step in each control cycle (e.g., PWM carrier cycle) or sampling interrupt. The main control chip directly obtains the latest raw current data from the ADC's data register or DMA buffer. Simultaneously, it synchronously acquires the latest real-time temperature data. This temperature data may be a directly read ADC value or a smoothed value after software filtering, depending on the system's response speed requirements.

[0164] For example, during a certain PWM cycle, the digital value corresponding to the current sensor output voltage is 2050 (representing approximately 500 mA of current), while the temperature sensor reading is 1350 (corresponding to 45.5 degrees Celsius). These two values ​​constitute the input vector for this correction operation.

[0165] 1052. Based on the temperature data at the current moment, obtain the real-time compensation value corresponding to the current temperature through a linear interpolation algorithm in the updated temperature error compensation table.

[0166] This step resolves the contradiction between the continuity of temperature and the discreteness of the table. The temperature error compensation table (as described in Example 5) only stores the compensation coefficients at specific temperature nodes (e.g., 40°C, 50°C, 60°C). However, the actual ambient temperature and the sensor's self-heating temperature are continuously changing and may be at non-node positions such as 45.5°C or 58.2°C. Directly rounding and looking up the table would result in a step error.

[0167] Therefore, this embodiment uses a linear interpolation algorithm to solve for the compensation value at any temperature. The specific logic is as follows: Location Range: The system scans the compensation table to find the range where the real-time temperature falls. For example, if the temperature is 45.5℃, it falls within the range [40℃, 50℃].

[0168] Read endpoint values: Read the compensation coefficient (denoted as Comp_Low) corresponding to 40℃ and the compensation coefficient (denoted as Comp_High) corresponding to 50℃.

[0169] Calculate the ratio: Calculate the relative position of the current temperature within the range. Ratio = (Current temperature - Lower limit temperature) / (Upper limit temperature - Lower limit temperature). For 45.5℃, the ratio = (45.5 - 40) / (50 - 40) = 0.55.

[0170] Interpolation calculation: Real-time compensation value = Comp_Low + scale × (Comp_High - Comp_Low).

[0171] This process is equivalent to drawing a straight line between two discrete points, thus obtaining a smooth compensation value at any temperature. This algorithm has low computational complexity, requiring only one subtraction, one multiplication, and one addition, making it very suitable for running in microcontroller interrupt service routines.

[0172] 1053. Subtract the real-time compensation value from the original current data to obtain the zero-sequence current measurement value after eliminating the influence of temperature drift.

[0173] This step is the final step in performing physical corrections. After obtaining the accurate real-time compensation value for the current specific temperature, the system treats it as a spurious interference component. To obtain the true physical current, this interference must be removed from the sensor readings.

[0174] The specific calculation logic is very straightforward: Zero-sequence current measurement value = Original current data - Real-time compensation value. If the sensor has a positive temperature coefficient (the reading increases with temperature), then the real-time compensation value is positive, and the subtraction operation cancels out the increase.

[0175] If the sensor has a negative temperature coefficient (the reading decreases as the temperature increases), then after learning in step 104, the coefficient in the compensation table will become negative. At this time, subtracting a negative value is equivalent to adding an absolute value, thereby bringing the reading back to the normal level.

[0176] The obtained zero-sequence current measurement value is stored in a global variable or sent to the subsequent leakage protection module. At this point, the value has eliminated most of the DC offset caused by temperature, and can accurately reflect the actual leakage current. For example, if the protection threshold is set to 30 mA, without compensation, there may be a 20 mA temperature drift at 50℃, causing a true 10 mA leakage current to be read as 30 mA and triggering a false alarm. After this compensation step, the 20 mA is subtracted, the reading returns to 10 mA, and false shutdown is avoided.

[0177] For example, suppose the inverter is running at full load at a certain moment. The controller's ADC interrupt is triggered. The system reads: Raw current data Raw_Current = 1050 mA (including load imbalance current + temperature drift). Real-time temperature data Temp_Now = 52.0 ℃. The system determines that it is in a dynamic operating state with large current fluctuations, which does not meet the calibration conditions, and directly enters the compensation process.

[0178] The system queries the updated temperature error compensation table from Example 5. Assume the nodes in the table are as follows: 40℃ -> 8.0 mA 50℃ -> 11.0 mA 60℃ -> 15.0 mA The current temperature of 52.0℃ falls within the range [50℃, 60℃].

[0179] Read endpoints: Comp_Low (50℃) = 11.0 mA, Comp_High (60℃) = 15.0 mA.

[0180] Calculate the ratio: Ratio = (52.0 - 50) / (60 - 50) = 2.0 / 10 = 0.2.

[0181] Calculate interpolation: Real-time compensation value = 11.0 + 0.2 × (15.0 - 11.0) = 11.0 + 0.2 × 4.0 = 11.0 + 0.8 = 11.8 mA.

[0182] This means that at 52.0℃, the temperature drift offset generated by the sensor was precisely locked by the model to 11.8 mA.

[0183] The system performs a correction operation: Zero-sequence current measurement value = Raw current data - Real-time compensation value Zero-sequence current measurement = 1050 - 11.8 = 1038.2 mA.

[0184] This 1038.2 mA is sent to the master control program.

[0185] Without compensation, the system would perceive a current of 1050 mA. Since 11.8 mA of this is spurious, long-term accumulation would significantly impact power metering and fault diagnosis. Now, through the method in this embodiment, the output value reflects the actual physical current, ensuring the accuracy of subsequent control algorithms.

[0186] Example 7 This embodiment adds an enhanced step 106 between steps 104 and 105, based on embodiments 1-6 above. This embodiment primarily addresses the compensation stability problem in scenarios with rapid temperature changes (thermal shock). When the ambient temperature fluctuates drastically, the sensor body temperature may hysteresis with the ambient temperature, causing errors in the ambient temperature-based compensation model. Step 106 suppresses this error by dynamically adjusting the sensitivity of the update algorithm.

[0187] In real-world operating conditions, inverters may experience sudden exposure to cold air (such as when a fan starts) or direct sunlight. Under these circumstances, the temperature change rate is extremely high. If a fixed learning rate is still used to update the compensation table, the data in the table may fluctuate wildly because the internal chip temperature of the sensor lags behind the externally measured temperature due to the sensor's thermal capacity. Step 106 intelligently freezes or slows down the update of the compensation table by monitoring the slope of the temperature change, thereby ensuring the robustness of the model.

[0188] 1061. Calculate the rate of temperature change between two adjacent calibration times and the change in the current temperature drift error value.

[0189] This step aims to quantify the drasticness of changes in the system's state.

[0190] The system records the state vector at each successful calibration (i.e., when steps 102-103 are completed), including the temperature at that time and the calculated temperature drift error value.

[0191] When a new calibration is completed, the system compares the current state with the historical state of the last calibration.

[0192] Temperature change rate calculation: The calculation formula is: (current temperature - previous temperature) / (current time - previous time).

[0193] Since inverter calibration is usually not scheduled, the temperature difference can be calculated directly. For example, if the temperature was 25℃ during the last calibration and 35℃ during this calibration, with a time interval of 10 seconds, then the rate of change is 1℃ / second.

[0194] Error change calculation: The calculation formula is: Current temperature drift error value - Previous temperature drift error value. For example, if the previous error was 10mA and the current error is 12mA, the change is 2mA.

[0195] These two parameters reflect whether the system is in a thermal transient process. If the rate of temperature change is extremely high, it indicates that the system is undergoing thermal shock, and the measured error value may not be stable.

[0196] 1062. If the temperature change rate exceeds a preset rate threshold, the update weight in the adaptive update algorithm is reduced according to a preset nonlinear mapping relationship.

[0197] This step is the execution phase of dynamic protection. The system internally presets a rate threshold, such as 0.5℃ / minute or 0.1℃ / second. This threshold is set based on the thermal time constant of the sensor package.

[0198] If the rate of change calculated in step 1061 exceeds this threshold, the system determines that it is currently in a rapid temperature change zone. In this case, the magnetic field inside the sensor may not have reached thermal equilibrium yet, and the error value measured at this time includes thermal hysteresis error. If this value is used directly to significantly modify the table, the transient error will be recorded as a steady-state characteristic, resulting in model distortion.

[0199] Therefore, the system initiates a weight reduction mechanism. This utilizes a non-linear mapping relationship, such as an inverse proportional function or an exponential decay function. The execution logic is as follows: Update weights = Baseline weights × f(x).

[0200] Here, f(x) is a monotonically decreasing function, and x represents the rate of temperature change. As the rate of temperature change x increases, f(x) rapidly approaches 0.

[0201] For example, under normal circumstances, the weight update (learning rate) is 0.1. When the rate of change reaches 1°C / second, f(x) may become 0.1, and the actual weight update drops to 0.01. This means that the system only takes 1% confidence in the measurement results and only makes fine adjustments to avoid large fluctuations in the model.

[0202] 1063. Re-execute the weighted update operation in step 104 using the reduced update weights to suppress measurement oscillations during rapid temperature changes.

[0203] This step applies the adjusted weights to the specific calculations. The system does not skip step 104, but executes step 104 with the corrected parameters.

[0204] Specifically, when performing substep 1042 of step 104, the original fixed learning rate factor is replaced with the reduced updated weight calculated in substep 1062.

[0205] In this way, when the temperature fluctuates drastically, the compensation table is frozen near a steady-state value and will not be erratically changed by transient readings. Only when the temperature stabilizes again and the rate of change is below the threshold will the weights be updated normally, and the system will continue to track potential aging drift of the sensor.

[0206] For example, suppose there is a photovoltaic inverter installed outdoors. A sudden downpour in the afternoon causes the surface temperature of the chassis to drop from 55°C to 40°C within tens of seconds.

[0207] Before the rainstorm, the system completed a calibration at time T1, recording a temperature of 55.0℃ with an error of 15.0mA. After the rainstorm began, the system captured the calibration window again at time T2 (only 30 seconds after T1), recording a temperature of 48.0℃ with an error of 13.0mA.

[0208] System calculation: Temperature change rate = (48.0 - 55.0) / 30 = -7.0 / 30 ≈ -0.23 ℃ / second.

[0209] An absolute value of 0.23 ℃ / second is a fairly large rate of change.

[0210] The change in error value = 13.0 - 15.0 = -2.0 mA.

[0211] The system's preset rate threshold is 0.1 ℃ / second.

[0212] The current rate of 0.23 > 0.1, triggering the weight reduction logic.

[0213] The system calls the nonlinear mapping function: weight coefficient = 1 / (1 + 10 × |rate of change|).

[0214] The calculated weighting coefficient is: 1 / (1 + 10 × 0.23) = 1 / 3.3 ≈ 0.3.

[0215] The original learning rate was 0.1, and the current effective learning rate is 0.1 × 0.3 = 0.03.

[0216] The system's trust in this data has decreased significantly.

[0217] The system uses this extremely small 0.03 as a learning rate to re-execute the update logic in step 104.

[0218] Assume the predicted value in the table is 14.5mA, the actual measured value is 13.0mA, and the deviation is -1.5mA.

[0219] The original correction amount = 0.1 × (-1.5) = -0.15mA.

[0220] The current correction is 0.03 × (-1.5) = -0.045mA.

[0221] The system made only a tiny adjustment to the compensation table (-0.045mA).

[0222] The advantage of this approach is that although the displayed temperature has dropped to 48℃, the internal chip of the sensor may still be hot (due to thermal hysteresis), and the actual drift may still be closer to 14mA rather than 13mA. If the table were drastically revised to reflect 13mA, the error would be discovered again after thermal equilibrium is reached. By updating in small steps, the system successfully suppressed the measurement oscillations caused by this thermal shock, maintaining the stability of the compensation model.

[0223] Example 8 This embodiment adds a system maintenance step 107 after step 105, based on embodiments 1-7 above. This embodiment primarily addresses the issue of long-term data storage. The temperature drift compensation model updated during inverter operation is a valuable asset and must be properly stored to prevent loss during power outages. Step 107 is responsible for securely writing the data to non-volatile memory before a system power failure.

[0224] Data in Random Access Memory (RAM) is immediately lost after a power outage. This means that without intervention, the compensation table will revert to its factory default value every time the inverter is cold-started, rendering previous online optimizations for aging and batch differences meaningless. Step 107 establishes a power-loss detection and data write-back mechanism that utilizes the energy reserve stored in the capacitor to recover core data and write it to Flash or EEPROM in the last few tens of milliseconds before power is cut off.

[0225] 1071. Listen for system power-down or hibernation commands from the controller.

[0226] The inverter's main control system typically monitors the voltage of the auxiliary power supply in real time or receives shutdown commands from the host computer.

[0227] System power failure command: When the auxiliary power supply voltage (such as 12V or 5V) is lower than the normal operating threshold (e.g., drops to 4.5V), the hardware comparator will generate an interrupt signal to the CPU, or the CPU will detect the voltage abnormality during polling.

[0228] Hibernation command: When the system enters low-power standby mode, although the main power supply may not be interrupted, the kernel will stop working in order to save energy, and data must be saved at this time.

[0229] The system maintains a constant monitoring state in the background or during interrupt service routines. Once the system detects that the aforementioned instruction flag has been set, it immediately suspends the current non-critical tasks (such as HMI refresh or communication polling) and prioritizes the data saving process.

[0230] 1072. Upon receiving the system power-down command or hibernation command, all data in the currently updated temperature error compensation table are transferred to non-volatile memory.

[0231] After confirming a power outage, the main control chip utilizes the residual energy in a large-capacity energy storage capacitor (usually a bus capacitor or auxiliary power supply capacitor) to quickly perform a write operation. The non-volatile memory (NVM) can be internal Flash memory or an external EEPROM chip. Specific operations include: Data Packaging: Pack the entire temperature error compensation table (e.g., a floating-point array containing 10 temperature nodes) into a structure.

[0232] Erase: If using Flash, you usually need to erase the old data sectors first (this step is the most time-consuming).

[0233] Programming: Writing new data to a specified address in memory.

[0234] Verification: Read back the data that was just written and compare it with the original data in RAM to ensure that the writing is correct.

[0235] To improve speed, the system may only update the changed parts of the table, or use a dual-backup mechanism to alternate writes to prevent data corruption due to power outages during the write process. Given the extremely short power outage time, this process must undergo very rigorous code optimization, typically requiring completion within 10 milliseconds.

[0236] 1073. During the next power-on initialization phase of the system, historical compensation data is read from the non-volatile memory and overwritten with the initial default value of the temperature error compensation table.

[0237] When the inverter is powered on again, the CPU begins executing initialization code. After the usual hardware peripheral initialization, the program first accesses a specific area in non-volatile memory. The system reads the stored data and performs validity checks (such as checking if all data is 0xFFFF, or if the checksum is correct).

[0238] If the data is valid: the system loads this data directly into the temperature error compensation table variable in RAM, overwriting the initial default value hard-coded in the code. This means that as soon as the inverter starts up, it has the high-precision compensation model that was trained before the last shutdown, without the need for a lengthy relearning process.

[0239] If the data is invalid (e.g., it's the first time a brand new device is running): the system retains the initial default value (usually a straight line with 0 drift or a typical average curve) and begins a new cycle of online learning.

[0240] For example, an inverter that has been running for 3 years has experienced some aging drift in its zero-sequence current sensor, and its compensation meter has evolved into a very accurate state after tens of thousands of online calibrations.

[0241] In the evening, the user turned off the switch in the distribution box, cutting off power to the AC side of the inverter. Subsequently, the inverter's auxiliary power supply began operating in discharge mode, with the voltage slowly decreasing from 12V.

[0242] When the voltage drops to 11V, the low-voltage detection interrupt in the software is triggered. The system flag Power_Down_Flag is set to 1. The main program detects this flag, immediately stops the complex MPPT tracing algorithm, and jumps to Save_Data_Task.

[0243] The system enters Save_Data_Task.

[0244] The current compensation table data in RAM is as follows (partial): -20℃: -1.2 mA 0℃: 0.5 mA 20℃: 2.8 mA … (Total of 10 sets of data) The CPU controls the Flash controller to erase the sector located at address 0x08080000. Assume the capacitors have sufficient power and the voltage remains above 10V.

[0245] The CPU writes the above 10 sets of data sequentially into the region starting at 0x08080000.

[0246] After the write operation is complete, the CPU immediately reads back the data at address 0x08080000 and finds it to be -1.2, consistent with the value in RAM. The data has been successfully saved.

[0247] Subsequently, the voltage continued to drop to the shutdown voltage, and the CPU stopped running.

[0248] The next morning, the user switched on the power.

[0249] When the inverter is powered on, the CPU starts running the main() function.

[0250] During the initialization phase, the code calls the Load_Calibration_Table() function.

[0251] The function reads data from Flash address 0x08080000.

[0252] The readback result is exactly: -20℃ corresponds to -1.2 mA… The verification passed; the data is valid.

[0253] The system assigns these values ​​to the runtime variable Comp_Table.

[0254] After initialization, the inverter begins operation under load. At this point, although it has just been powered on, the system's accuracy in detecting temperature drift has already reached the level of a three-year-old machine, requiring no readjustment. If a real leakage current occurs, the protection system can immediately make a correct judgment based on a precise compensation model, greatly improving the operational safety and reliability of the equipment.

[0255] Please see Figure 2 One embodiment of the temperature drift adaptive compensation calibration device in this invention includes: The acquisition module 10 is used to synchronously acquire the raw current data output by the zero-sequence current sensor and the real-time temperature data of the surrounding environment of the sensor during the operation of the inverter. The identification module 20 is used to identify whether the inverter is in the zero-sequence current theoretical reference state based on the waveform characteristics and amplitude changes of the original current data. If it is in the zero-sequence current theoretical reference state and the duration meets the preset time threshold, a calibration trigger signal is generated. The comparison module 30 is used to respond to the calibration trigger signal, extract the target current data under the zero-sequence current theoretical reference state, compare the statistical average value of the target current data with the preset theoretical zero-sequence current reference value, and calculate the current temperature drift error value under the current temperature conditions. The update module 40 is used to map the current temperature drift error value to a preset temperature error compensation table based on the real-time temperature data, and to perform weighted updates on the compensation coefficients of the corresponding temperature range in the temperature error compensation table according to a preset adaptive update algorithm. The compensation module 50 is used to perform a lookup correction on the real-time acquired raw current data using the updated temperature error compensation table during the non-calibration period of the inverter, and output the compensated zero-sequence current measurement value.

[0256] In one embodiment, the acquisition module 10 is specifically used for: The analog output signal of the zero-sequence current sensor is continuously sampled by an analog-to-digital converter at a preset first sampling frequency to obtain the original digital current sequence. The original current digital sequence is denoised by a digital filter to remove high-frequency noise interference, resulting in a filtered current data stream. A circular buffer queue is established, and the filtered current data stream and the temperature data stream of the sensor's surrounding environment, which are collected synchronously, are aligned by time tags and stored in the circular buffer queue.

[0257] In one embodiment, the identification module 20 is specifically used for: Based on the waveform characteristics and amplitude changes of the original current data, the root mean square value of the current amplitude within a preset sliding time window is calculated in real time. Determine whether the root mean square value of the current amplitude is less than the preset silence threshold. If so, start the timer to accumulate the duration. When the duration reaches the preset time threshold, the inverter is confirmed to be in zero vector switching state, and a high-level signal is output as a calibration trigger signal.

[0258] In one embodiment, the comparison module 30 is specifically used for: The target current data is defined as historical data of a preset length prior to the moment the calibration trigger signal is received. Calculate the arithmetic mean of all sampling points in the target current data and use it as the observed zero-sequence current value under the current operating condition; The difference between the observed zero-sequence current value and the theoretical zero-sequence current reference value is the current temperature drift error value.

[0259] In one embodiment, the update module 40 is specifically used for: The real-time temperature data is compared with each temperature segment node in the temperature error compensation table to determine the temperature range in which the current temperature falls. The correction step size for this calibration is calculated based on the preset learning rate factor, and the correction step size is equal to the product of the current temperature drift error value and the learning rate factor. The original compensation coefficient value corresponding to the temperature range is algebraically added to the correction step size to generate the updated compensation coefficient, and the compensation coefficients of the adjacent nodes of the temperature range are updated synchronously.

[0260] In one embodiment, the compensation module 50 is specifically used for: When the inverter is in dynamic operation, the temperature data and corresponding raw current data are read in real time. Based on the temperature data at the current moment, the real-time compensation value corresponding to the current temperature is obtained from the updated temperature error compensation table using a linear interpolation algorithm. Subtracting the real-time compensation value from the original current data yields the zero-sequence current measurement value after eliminating the influence of temperature drift.

[0261] In one embodiment, the temperature drift adaptive compensation calibration device further includes: The monitoring module is used to listen for system power-down commands or hibernation commands from the controller; upon receiving the system power-down command or hibernation command, it transfers all data in the currently updated temperature error compensation table to non-volatile memory; during the next system power-on initialization phase, it reads historical compensation data from the non-volatile memory and overwrites the initial default value of the temperature error compensation table.

[0262] Since the embodiments of the device part correspond to the embodiments of the above method, please refer to the above method embodiments for the introduction of the temperature drift adaptive compensation calibration device provided by the present invention. The present invention will not be described again here, but it has the same beneficial effects as the above temperature drift adaptive compensation calibration method.

[0263] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0264] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0265] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A temperature drift adaptive compensation calibration method, characterized in that, Includes the following steps: During inverter operation, the raw current data output by the zero-sequence current sensor and the real-time temperature data of the surrounding environment are collected simultaneously. Based on the waveform characteristics and amplitude changes of the original current data, it is determined whether the inverter is in the zero-sequence current theoretical reference state. If it is in the zero-sequence current theoretical reference state and the duration meets the preset time threshold, a calibration trigger signal is generated. In response to the calibration trigger signal, target current data under the zero-sequence current theoretical reference state is extracted, and the statistical average value of the target current data is compared with the preset theoretical zero-sequence current reference value to calculate the current temperature drift error value under the current temperature condition. Based on the real-time temperature data, the current temperature drift error value is mapped to a preset temperature error compensation table, and the compensation coefficients of the corresponding temperature range in the temperature error compensation table are weighted and updated according to a preset adaptive update algorithm. During the inverter's non-calibration period, the updated temperature error compensation table is used to look up and correct the real-time acquired raw current data, and the compensated zero-sequence current measurement value is output.

2. The temperature drift adaptive compensation calibration method according to claim 1, characterized in that, The synchronous acquisition of raw current data output by the zero-sequence current sensor and real-time temperature data of the surrounding environment includes: The analog output signal of the zero-sequence current sensor is continuously sampled by an analog-to-digital converter at a preset first sampling frequency to obtain the original digital current sequence. The original current digital sequence is denoised by a digital filter to remove high-frequency noise interference, resulting in a filtered current data stream. A circular buffer queue is established, and the filtered current data stream and the temperature data stream of the sensor's surrounding environment, which are collected synchronously, are aligned by time tags and stored in the circular buffer queue.

3. The temperature drift adaptive compensation calibration method according to claim 1, characterized in that, The step of identifying whether the inverter is in the zero-sequence current theoretical reference state based on the waveform characteristics and amplitude changes of the original current data, and if it is in the zero-sequence current theoretical reference state and the duration meets the preset time threshold, then generating a calibration trigger signal includes: Based on the waveform characteristics and amplitude changes of the original current data, the root mean square value of the current amplitude within a preset sliding time window is calculated in real time. Determine whether the root mean square value of the current amplitude is less than the preset silence threshold. If so, start the timer to accumulate the duration. When the duration reaches the preset time threshold, the inverter is confirmed to be in zero vector switching state, and a high-level signal is output as a calibration trigger signal.

4. The temperature drift adaptive compensation calibration method according to claim 1, characterized in that, In response to the calibration trigger signal, the target current data under the zero-sequence current theoretical reference state is extracted, and the statistical average value of the target current data is compared with the preset theoretical zero-sequence current reference value to calculate the current temperature drift error value under the current temperature conditions, including: The target current data is defined as historical data of a preset length prior to the moment the calibration trigger signal is received. Calculate the arithmetic mean of all sampling points in the target current data and use it as the observed zero-sequence current value under the current operating condition; The difference between the observed zero-sequence current value and the theoretical zero-sequence current reference value is the current temperature drift error value.

5. The temperature drift adaptive compensation calibration method according to claim 1, characterized in that, The step of mapping the current temperature drift error value to a preset temperature error compensation table based on the real-time temperature data, and updating the compensation coefficients of the corresponding temperature range in the temperature error compensation table according to a preset adaptive update algorithm includes: The real-time temperature data is compared with each temperature segment node in the temperature error compensation table to determine the temperature range in which the current temperature falls. The correction step size for this calibration is calculated based on the preset learning rate factor, and the correction step size is equal to the product of the current temperature drift error value and the learning rate factor. The original compensation coefficient value corresponding to the temperature range is algebraically added to the correction step size to generate the updated compensation coefficient, and the compensation coefficients of the adjacent nodes of the temperature range are updated synchronously.

6. The temperature drift adaptive compensation calibration method according to claim 1, characterized in that, During the inverter's non-calibration period, the updated temperature error compensation table is used to look up and correct the real-time acquired raw current data, and the compensated zero-sequence current measurement value is output, including: When the inverter is in dynamic operation, the temperature data and corresponding raw current data are read in real time. Based on the temperature data at the current moment, the real-time compensation value corresponding to the current temperature is obtained from the updated temperature error compensation table using a linear interpolation algorithm. The zero-sequence current measurement value after eliminating the effect of temperature drift is obtained by subtracting the real-time compensation value from the original current data.

7. The temperature drift adaptive compensation calibration method according to any one of claims 1-6, characterized in that, The temperature drift adaptive compensation calibration method also includes: Listen for system power-down or hibernation commands from the controller; Upon receiving the system power-down command or hibernation command, all data in the currently updated temperature error compensation table will be transferred to non-volatile memory. During the next power-on initialization phase of the system, historical compensation data is read from the non-volatile memory and overwritten with the initial default values ​​of the temperature error compensation table.

8. A temperature drift adaptive compensation calibration device, characterized in that, include: The acquisition module is used to simultaneously acquire the raw current data output by the zero-sequence current sensor and the real-time temperature data of the surrounding environment during inverter operation. The identification module is used to identify whether the inverter is in the zero-sequence current theoretical reference state based on the waveform characteristics and amplitude changes of the original current data. If it is in the zero-sequence current theoretical reference state and the duration meets the preset time threshold, a calibration trigger signal is generated. The comparison module is used to extract the target current data under the zero-sequence current theoretical reference state in response to the calibration trigger signal, and compare the statistical average value of the target current data with the preset theoretical zero-sequence current reference value to calculate the current temperature drift error value under the current temperature conditions. The update module is used to map the current temperature drift error value to a preset temperature error compensation table based on the real-time temperature data, and to perform weighted updates on the compensation coefficients of the corresponding temperature range in the temperature error compensation table according to a preset adaptive update algorithm. The compensation module is used to correct the real-time acquired raw current data by looking up the updated temperature error compensation table during the non-calibration period of the inverter, and output the compensated zero-sequence current measurement value.