Current detection method and current detection system with temperature compensation

By adopting a current detection method with temperature compensation in a computer system, the current value is compensated using a nonlinear temperature compensation model, the deviation problem caused by the system temperature changes is solved, and higher detection accuracy and space savings are achieved.

CN120177859APending Publication Date: 2025-06-20广州壁仞智能科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510332114.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

In computer systems, current detection has a deviation between the detection current and the actual current caused by system temperature changes, which affects the accuracy of the detection.

Method used

The current detection method with temperature compensation is adopted, and the current temperature value of the power line is obtained by obtaining the preset nonlinear temperature compensation model to compensate the current value by using the preset nonlinear temperature compensation model.

Benefits of technology

It effectively reduces the current detection deviation caused by system temperature changes, improves the accuracy of current detection, and avoids the space occupation of hardware compensation circuits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120177859A_ABST
    Figure CN120177859A_ABST
Patent Text Reader

Abstract

The invention relates to a current detection method with temperature compensation and a current detection system. The method comprises the following steps: acquiring a current value of a power line of an electricity load in computing equipment before temperature compensation; acquiring a current temperature value associated with the power line; and obtaining a temperature compensation current value of the power line according to a preset nonlinear temperature compensation model, the current temperature value and the current value before temperature compensation. Current detection and temperature compensation of the power line in the computing device are achieved, a nonlinear temperature compensation model is adopted to replace a hardware compensation circuit, space occupation is saved while a good temperature compensation effect is achieved, in addition, collection of the current value is achieved through the filter inductor connected in series in the power line, and the calculation efficiency is improved. Compared with the prior art, the temperature compensation circuit has the advantages that power consumption is reduced, the dual function of filtering system power supply by the filter inductor is achieved, the space of the register is fully utilized, and the temperature compensation current value stored by the register and finally output and displayed is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of current detection, and particularly to a current detection method and a current detection system with temperature compensation. Background Art

[0002] A computer system includes many hardware components, such as a processor, a graphics processing unit, a memory, a hard disk, etc. These hardware components all require a stable power supply. Effective current detection can help the power management system timely detect device anomalies and avoid power overload, thereby protecting the power supply and hardware components. And effective current detection can provide a direct status reference for aspects such as energy efficiency optimization and performance optimization of the computer system. Therefore, in a computer system, current detection has important significance in many aspects. Summary of the Invention

[0003] In view of this, the present disclosure provides a current detection method and a current detection system with temperature compensation to implement the detection of the current in the power line of the electrical load in a computing device, and perform temperature-based compensation on the detected current, helping to reduce the deviation between the detected current and the actual current in the power line caused by the change in the system temperature of the computing device, and helping to improve the accuracy of current detection.

[0004] The technical solution of the present disclosure is implemented as follows:

[0005] According to one aspect of the embodiments of the present disclosure, a current detection method with temperature compensation is provided, including:

[0006] Obtaining a pre-temperature-compensation current value of the power line of the electrical load in the computing device;

[0007] Obtaining a current temperature value associated with the power line;

[0008] Obtaining a temperature-compensated current value of the power line according to a preset non-linear temperature compensation model, the current temperature value, and the pre-temperature-compensation current value.

[0009] In a possible implementation manner, the obtaining a pre-temperature-compensation current value of the power line of the electrical load in the computing device includes:

[0010] Obtaining an equivalent voltage value between two ends of a filter inductor connected in series in the power line;

[0011] Obtaining the pre-temperature-compensation current value according to the equivalent voltage value and the equivalent resistance of the filter inductor.

[0012] In a possible implementation manner, the equivalent voltage value is collected by a voltage detection circuit associated with the equivalent resistance of the filter inductor.

[0013] In a possible implementation, the non-linear temperature compensation model is a quadratic polynomial regression model.

[0014] In a possible implementation, the quadratic polynomial regression model is:

[0015] err = a·T 2 + b·T + c

[0016] where err is the current deviation ratio, T is the temperature value, and a, b, and c are model parameters, and the model parameters are obtained by fitting the sample data associated with the current value before temperature compensation and the temperature-compensated current value.

[0017] In a possible implementation, obtaining the temperature-compensated current value of the power line according to the preset non-linear temperature compensation model, the current temperature value, and the current value before temperature compensation includes:

[0018] The temperature-compensated current value is obtained by the following formula:

[0019] Icomp = Imon / [1 - (a·t 2 + b·t + c)]

[0020] where Icomp is the temperature-compensated current value, Imon is the current value before temperature compensation, and t is the current temperature value.

[0021] In a possible implementation, after obtaining the temperature-compensated current value, the current detection method further includes:

[0022] Storing the register value representing the temperature-compensated current value in a register, where the register value is obtained according to the temperature-compensated current value, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, the maximum value of the register, and the maximum allowable voltage value that can be collected between both ends of the filter inductor;

[0023] Obtaining a reported current value according to a preset scaling factor, the current value corresponding to a unit bit, and the register value, where the scaling factor is determined according to the maximum allowable voltage value that can be collected between both ends of the filter inductor, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, and the maximum current value on the power line, and the current value corresponding to a unit bit is determined according to the maximum current value on the power line and the maximum value of the register;

[0024] Outputting the reported current value.

[0025] In a possible implementation manner, obtaining a reported current value according to a preset scaling factor, a current value corresponding to a unit bit, and the register value includes obtaining the reported current value according to the following formula:

[0026] i report = D imon_actual ·ε comp ·Current LSB

[0027] wherein, i report is the reported current value, D imon_actual is the register value, ε comp is the scaling factor, and Current LSB is the current value corresponding to the unit bit;

[0028] wherein, the register value is proportional to the temperature compensation current value, the register value is proportional to the equivalent resistance of the filter inductor, the register value is proportional to the gain of the voltage detection circuit, the register value is proportional to the maximum value of the register, and the register value is inversely proportional to the maximum voltage value allowed to be collected between both ends of the filter inductor;

[0029] The scaling factor is proportional to the maximum voltage value allowed to be collected between both ends of the filter inductor, the scaling factor is inversely proportional to the equivalent resistance of the filter inductor, the scaling factor is inversely proportional to the gain of the voltage detection circuit, and the scaling factor is inversely proportional to the maximum current value on the power supply line;

[0030] The current value corresponding to the unit bit is proportional to the maximum current value on the power supply line and inversely proportional to the maximum value of the register.

[0031] According to another aspect of the embodiments of the present disclosure, a current detection system is provided, including:

[0032] A current value acquisition module, coupled to the power supply line of the electrical load in the computing device, for acquiring the current value before temperature compensation of the power supply line of the electrical load in the computing device, wherein the power supply line is located in the power network of the computing device;

[0033] A temperature value acquisition module, for acquiring the current temperature value associated with the power supply line;

[0034] A temperature compensation module, coupled to the current value acquisition module and the temperature value acquisition module, for obtaining the temperature compensation current value of the power supply line according to a preset non-linear temperature compensation model, the current temperature value, and the current value before temperature compensation.

[0035] In a possible implementation, the current value acquisition module includes:

[0036] A filter inductor, which is connected in series to the power line;

[0037] A voltage detection circuit, coupled to both ends of the filter inductor, for collecting the equivalent voltage value between both ends of the filter inductor;

[0038] A current acquisition unit, coupled to the voltage detection circuit, for obtaining the pre-temperature-compensation current value according to the equivalent voltage value and the equivalent resistance of the filter inductor.

[0039] In a possible implementation, the current detection system further includes:

[0040] A register, coupled to the temperature compensation module, for storing a register value representing the temperature-compensated current value, where the register value is obtained according to the temperature-compensated current value, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, the maximum value of the register, and the maximum voltage value allowed to be collected between both ends of the filter inductor;

[0041] A reported current value acquisition module, coupled to the register, for obtaining the register value and obtaining a reported current value according to a preset scaling factor, the current value corresponding to a unit bit, and the register value, where the scaling factor is determined according to the maximum voltage value allowed to be collected between both ends of the filter inductor, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, and the maximum current value on the power line, and the current value corresponding to a unit bit is determined according to the maximum current value on the power line and the maximum value of the register;

[0042] An information output module, coupled to the reported current value acquisition module, for outputting the reported current value.

[0043] According to another aspect of the embodiments of the present disclosure, there is provided an electronic device, including:

[0044] A processor;

[0045] A memory for storing executable instructions of the processor;

[0046] Wherein, the processor is configured to execute the executable instructions to implement the current detection method with temperature compensation as described in any one of the above.

[0047] According to yet another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, when at least one instruction in the computer-readable storage medium is executed by a processor of an electronic device, enabling the electronic device to implement the current detection method with temperature compensation as described in any one of the above.

[0048] As can be seen from the above solution, the current detection method and current detection system with temperature compensation of the present disclosure achieve the detection of the current in the power supply line of the electrical load in the computing device and the temperature compensation of the detected current. A non-linear temperature compensation model is adopted to replace the hardware compensation circuit, and the collected current value is temperature-compensated through calculation. Thus, the finally required reported or displayed current value is the temperature-compensated current value, and the hardware module for calculation can be reused with other available modules, so that no additional space resources are occupied. Therefore, while achieving a good temperature compensation effect, the space occupancy is saved. In addition, the technical solution of the present disclosure does not adopt a shunt resistor, but uses a filter inductor connected in series in the power supply line to collect the current value. On the one hand, since the shunt resistor is no longer adopted and the equivalent resistance of the filter inductor is smaller than the resistance value of the shunt resistor, the corresponding power loss is reduced. On the other hand, the filter inductor also has the function of filtering out clutter. Therefore, the technical solution of the present disclosure also realizes the dual functions of the filter inductor for system power supply. In addition, the present disclosure controls the storage and data output of the temperature-compensated current value through a register, realizing the full utilization of the register space, which helps the temperature-compensated current value stored in the register and finally output and displayed to be more accurate. Description of the Drawings

[0049] Figure 1 is a schematic structural diagram of a current detection circuit in the related art;

[0050] Figure 2 is a schematic flowchart of a current detection method with temperature compensation shown according to a schematic embodiment;

[0051] Figure 3 is a schematic structural diagram of a voltage detection circuit shown according to a schematic embodiment;

[0052] Figure 4 is a schematic diagram of the relationship curve of the equivalent resistance of an inductor coil with a flat copper wire structure changing with temperature;

[0053] Figure 5 is a circuit schematic diagram of an NTC network in the related art;

[0054] Figure 6 is a schematic diagram of the relationship curve of the resistance of the NTC network changing with temperature;

[0055] Figure 7 is a schematic diagram of the change trend of Iout, Imon, and Icomp in Table 1;

[0056] Figure 8It is a schematic process diagram showing the register storage of the temperature-compensated current value and the reporting of the current value output;

[0057] Figure 9 It is a schematic diagram of the scaling relationship between the register value and the data;

[0058] Figure 10 It is a schematic structural diagram of a current detection system shown according to a schematic embodiment;

[0059] Figure 11 It is a schematic structural diagram of a current value acquisition module shown according to a schematic embodiment;

[0060] Figure 12 It is a schematic structural diagram of another embodiment of a current detection system shown according to a schematic embodiment;

[0061] Figure 13 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0062] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the following examples are given with reference to the accompanying drawings to further elaborate on the present disclosure in detail.

[0063] Figure 1 It is a schematic structural diagram of a current detection circuit in the related art. As Figure 1 shown, the current detection circuit in the related art is to connect a shunt resistor R1 in series in the power supply line VBUS that supplies power to the load from the power supply end, and connect a current power monitor 101 across both ends of the shunt resistor R1. The current power detector calculates the current in the power supply line VBUS by measuring the voltage drop across both ends of the shunt resistor R1 and based on the shunt resistor R1. On this basis, relevant parameters such as power can be obtained.

[0064] With the continuous increase in the computing power requirements of the computing card, the power required by the load also increases accordingly. At the same time, the existence of the shunt resistor R1 in the related art will also consume the electric energy in the power supply line VBUS, resulting in the shunt resistor R1 robbing a part of the power output by the power supply and causing power loss. In view of this, the embodiments of the present disclosure provide a current detection method and a current detection system with temperature compensation, which utilize the filter inductance originally configured on the power supply line to achieve temperature compensation for the detected current value, so that the detected current value is closer to the actual current value, and on this basis, eliminate the power loss caused by the existence of the shunt resistor.

[0065] Figure 2 It is a schematic flowchart of a current detection method with temperature compensation shown according to a schematic embodiment, as Figure 2As shown, the current detection method with temperature compensation mainly includes the following steps 201 to 203.

[0066] Step 201: Obtain the pre-temperature-compensation current value of the power supply line of the electrical load in the computing device.

[0067] In the illustrative embodiment, the power supply line is located in the power network of the computing device. For example, the power supply line can be the power bus for power supply from the power supply end in the related art to the load. In the illustrative embodiment, the electrical load can be hardware components such as a processor, a graphics processing unit, a memory, and a hard disk.

[0068] In the illustrative embodiment, the pre-temperature-compensation current value can be the uncompensated current value detected from the power supply line by related technical means. In the embodiments of the present disclosure, a method and related circuit for obtaining the pre-temperature-compensation current value in step 201 are also provided, as detailed in the following description.

[0069] Step 202: Obtain the current temperature value associated with the power supply line.

[0070] In the illustrative embodiment, the current temperature value can be directly read from the register that stores the temperature value existing in the computing device. To ensure the stable operation of the computing device, the computing device usually includes hardware components for temperature monitoring, such as temperature sensors. These temperature sensors collect the temperatures at various locations in the computing device as needed, such as collecting the temperatures of hardware components such as the motherboard, processor, graphics processing unit, memory, and hard disk, and store the collected temperature values in the corresponding registers for reading when needed. In the illustrative embodiment, the temperature value stored in the relevant register can be used as the current temperature value. In the illustrative embodiment, the current temperature value associated with the power supply line can be the temperature value of the environment where the power supply line is located, or the temperature value collected by the temperature sensor directly set on the power supply line and stored in the register.

[0071] Step 203: Obtain the temperature-compensated current value of the power supply line according to the preset non-linear temperature compensation model, the current temperature value, and the pre-temperature-compensation current value.

[0072] In the illustrative embodiment, the non-linear temperature compensation model is a quadratic polynomial regression model, which mainly includes the functional relationship between the current deviation ratio between the current temperature value and the pre-temperature-compensation current value and the current temperature value. See the following description for details.

[0073] Different from the method of detecting current using a shunt resistor in the related art, in the embodiments of the present disclosure, instead of using a shunt resistor, a filter inductor connected in series in the power line (i.e., the existing filter inductor on the power line, or the filter inductor originally configured on the power line) is used to collect the current value. On the one hand, since the shunt resistor is no longer used and the equivalent resistance of the filter inductor is smaller than the resistance value of the shunt resistor, the corresponding power loss is reduced. On the other hand, the filter inductor also has the function of filtering out clutter. Therefore, the embodiments of the present disclosure also realize the dual function of the filter inductor for system power supply. Based on this, in the illustrative embodiment, there is no shunt resistor on the power line.

[0074] In the illustrative embodiment, step 201 may specifically include: obtaining the equivalent voltage value between both ends of the filter inductor connected in series in the power line; and obtaining the current value before temperature compensation according to the equivalent voltage value and the equivalent resistance of the filter inductor.

[0075] Since the equivalent resistance of the filter inductor and the self-inductance value of the filter inductor are equivalent to being connected in series inside the external pad, the voltage difference across the two ends of the equivalent resistance of the filter inductor cannot be obtained by direct measurement means, and a sampling circuit for the equivalent resistance of the filter inductor is required to obtain relevant information. Therefore, in the illustrative embodiment, the equivalent voltage value is collected by a voltage detection circuit associated with the equivalent resistance of the filter inductor.

[0076] Figure 3 It is a schematic structural diagram of a voltage detection circuit shown according to an illustrative embodiment. As Figure 3 shown, the voltage detection circuit includes a resistor-capacitor network branch 301, an amplifier circuit 302, and a data processing module 303. Among them, the resistor-capacitor network branch 301 is connected to both ends of the filter inductor FL. The resistor-capacitor network branch 301 includes a resistor R and a capacitor C. One end of the resistor R is coupled to one end of the filter inductor FL, the other end of the resistor R is coupled to one end of the capacitor C, and the other end of the capacitor C is coupled to the other end of the filter inductor FL. For the sake of clarity in illustration, Figure 3 the filter inductor FL is schematically shown as two parts, the equivalent resistance DCR of the filter inductor and the inductor L. In fact, the inductor L and the equivalent resistance DCR are two inherent properties of the filter inductor FL itself. The acquisition end of the amplifier circuit 302 is coupled to both ends of the capacitor C in the resistor-capacitor network branch 301 for acquiring the voltage Vc across the capacitor C. The output end of the amplifier circuit 302 is coupled to the data processing module 303. The amplifier circuit 302 is used to amplify the voltage Vc across the capacitor C collected through an amplifier AMP and perform analog-to-digital conversion through an analog-to-digital converter ADC to obtain the specific data value of the voltage Vc. The data processing module 303 is used to store the specific data value of the voltage Vc and perform subsequent data processing.

[0077] Figure 3The physical principle of the voltage detection circuit shown is as follows.

[0078] For the convenience of analysis, the impedance equation in the frequency domain is used to Figure 3 Analyzing the voltage detection circuit shown in FIG. 1 , the filter inductor FL and the RC network branch 301 are regarded as two branches connected in parallel in the power line VBUS, and then:

[0079]

[0080] Wherein, ic is the current of the RC network branch 301, R is the resistance value of the resistor R, is the impedance value of capacitor C, where C is the capacitance value of capacitor C, s is a complex frequency variable. Since the analysis is performed in the frequency domain, it contains complex frequency variables, iout is the current value of the filter inductor FL, DCR is the resistance value of the equivalent resistance DCR of the filter inductor FL, sL is the impedance value of the filter inductor FL, and L is the inductance of the filter inductor FL.

[0081] According to Ohm's law:

[0082]

[0083] Wherein, vc is the voltage value of the voltage Vc across the capacitor C collected.

[0084] Through the above two formulas, we can get:

[0085] vc·s·C·R+vc=iout·(DCR+s·L)

[0086] and then

[0087]

[0088] based on Figure 3 The voltage detection circuit shown in FIG. 1 is used to make the voltage Vc across the capacitor C equal to the voltage across the filter inductor FL.

[0089] vc=iout·DCR

[0090] Then there is

[0091]

[0092] The specific values ​​of the resistor R and the capacitor C in the RC network branch 301 can be determined by the above formula.

[0093] As can be seen from the above formulas, by setting the magnitudes of the resistor R and the capacitor C in the resistor-capacitor network branch 301, the voltage across the equivalent resistor DCR can be indirectly obtained by measuring the voltage Vc across the capacitor C, and then the current value in the power supply line VBUS can be obtained in combination with the equivalent resistor DCR of the filter inductor FL.

[0094] Since the material characteristics of the filter inductor FL cause the equivalent resistor DCR to change with temperature. For example, a commonly used molded inductance coil is a flat copper wire structure. The equivalent resistor DCR of the molded inductance coil used as the filter inductor FL is the equivalent resistance value of the copper wire, and the relationship between its equivalent resistance value and temperature is as follows:

[0095]

[0096] Where T is the temperature value, ρ is the resistivity, which changes with temperature, l is the length of the inductance coil, and A is the cross-sectional area of the inductance coil. Among them, for the selected filter inductor, l and A are constant values, the value of the equivalent resistor DCR is related to the resistivity, and the resistivity and temperature can be described as

[0097] ρ(T) = ρ(25°C)·(1 + 3930 ppm / °C·(T - 25°C))

[0098] Where ppm represents one part per million, and ρ(25°C) represents the resistivity at a temperature of 25 degrees Celsius.

[0099] Furthermore

[0100]

[0101] From the above formula, the relationship curve of the equivalent resistor DCR changing with temperature can be obtained, as Figure 4 shown, the equivalent resistor DCR will increase as the temperature rises.

[0102] Since the voltage detection circuit is used to indirectly obtain the current value on the power supply line VBUS (flowing through the filter inductor FL) by collecting the voltage Vc across the capacitor C, and the equivalent resistor DCR of the filter inductor FL changes with temperature, but the resistance value of the resistor R and the impedance value of the capacitor C remain unchanged. Therefore, this leads to a deviation between the collected voltage Vc across the capacitor C and the voltage across the filter inductor FL, and further a deviation between the obtained current value and the true current value on the power supply line VBUS (flowing through the filter inductor FL). Therefore, temperature compensation needs to be performed on the obtained current value.

[0103] In the related art, temperature compensation is usually performed by means of a hardware compensation circuit. The method is to add an NTC (Negative Temperature Coefficient) network to the circuit to be temperature-compensated. Figure 5 is a schematic circuit diagram of an NTC network in the related art. As Figure 5 shown, the NTC network includes a resistor Rs, a resistor Rp, and a thermistor Rntc. The thermistor Rntc is a thermistor with a negative temperature coefficient. Among them, the resistor Rp and the thermistor Rntc are connected in parallel and coupled to one end of the resistor Rs to form an NTC network. The total resistance of the NTC network is

[0104]

[0105] Among them,

[0106]

[0107] Among them, R1 is the total resistance of the NTC network, R NTC is the resistance value of the thermistor Rntc, R P is the resistance value of the resistor Rp, R s is the resistance value of the resistor Rs, R 25℃ is the resistance value of the thermistor Rntc at a temperature of 25 degrees Celsius. B is the material constant of the thermistor Rntc, also known as the B constant or β value, and its unit is Kelvin (K).

[0108] Through the above formula, the relationship curve of the resistance of the NTC network changing with temperature can be obtained. As Figure 6 shown, the resistance of the NTC network will decrease as the temperature rises. Therefore, the equivalent resistance can be compensated as the temperature rises, so that the resistance is stabilized in a relatively narrow range, and then a more accurate current value can be obtained.

[0109] However, in the related art, the added NTC network will occupy a certain amount of space, and it may not be suitable when applied to scenarios with high space requirements, such as when applied to the internal circuit of a chip. In view of this, the embodiments of the present disclosure adopt a non-linear temperature compensation model method to perform temperature compensation on the collected current value through calculation. In this way, the finally required reported or displayed current value is the current value after temperature compensation, and the hardware module for calculation can be reused with other available modules, so that no additional space resources will be occupied.

[0110] In the illustrative embodiment, the quadratic polynomial regression model as the non-linear temperature compensation model in the embodiments of the present disclosure is:

[0111] err = a·T2 +b·T + c

[0112] Among them, err is the current deviation ratio, T is the temperature value, and a, b, and c are model parameters. These model parameters are obtained by fitting the sample data related to the current value before temperature compensation and the current value of temperature compensation. Among them, the sample data can be obtained through experiments in advance.

[0113] In the illustrative embodiment, based on the above quadratic polynomial regression model, step 203 may specifically include obtaining the current value of temperature compensation through the following formula:

[0114] Icomp = Imon / [1 - (a·t 2 +b·t + c)]

[0115] Among them, Icomp is the current value of temperature compensation, Imon is the current value before temperature compensation, and t is the current temperature value. Among them, a·t 2 +b·t + c is the current deviation ratio of the above quadratic polynomial regression model.

[0116] The following further explains the quadratic polynomial regression model.

[0117] The general formula of the quadratic polynomial regression model is as follows:

[0118]

[0119] Among them, represents the deviation, which is a tensor, and each element in it represents the deviation value at a temperature, is the tensor of the square of the temperature, is the tensor of the temperature. The temperature is the independent variable and the deviation is the dependent variable, representing the detection error. This detection error is caused by the change in temperature. a, b, c, and ε are all model coefficients, where ε is the random error.

[0120] Regarding in the above quadratic polynomial regression model formula as a variable and as another variable, then the non - linear temperature compensation model can be regarded as a binary linear function model:

[0121]

[0122] Among them, is equivalent to is equivalent to is equivalent to In this way, it can be solved according to the linear function model in the general linear case of the least - squares method.

[0123] Find the solution of the least squares method:

[0124]

[0125] where,

[0126]

[0127] where n is the number of samples, and t1 to t n are different temperature values,

[0128] Let

[0129]

[0130] Then, through the fitting of the sample data, the regression coefficients, that is, the values of a, b, and c, can be obtained

[0131]

[0132] where, for some sample data and the corresponding compensation results, refer to the content of Table 1.

[0133] Table 1 Sample Data

[0134] temp Iout vc_mea err Imon vc_comp Icomp 0 50 0.022665 9.34% 45.329212 0.024244 48.48822 5 50 0.024896 0.42% 49.791072 0.025845 51.69017 10 50 0.023886 4.46% 47.771747 0.024108 48.21581 15 50 0.026366 -5.46% 52.731112 0.025914 51.82725 20 50 0.026392 -5.57% 52.783539 0.025299 50.59723 25 50 0.025982 -3.93% 51.963452 0.024325 48.65036 30 50 0.027394 -9.57% 54.787259 0.025083 50.16643 35 50 0.028401 -13.60% 56.80113 0.025466 50.93175 40 50 0.02898 -15.92% 57.959267 0.025477 50.95365 45 50 0.028614 -14.46% 57.228627 0.024692 49.38355 50 50 0.028991 -15.97% 57.982583 0.024582 49.16486 55 50 0.030255 -21.02% 60.509639 0.025234 50.46844 60 50 0.030836 -23.35% 61.672815 0.025324 50.64739 65 50 0.03034 -21.36% 60.680754 0.024556 49.11274 70 50 0.031708 -26.83% 63.416473 0.025316 50.63151 75 50 0.030118 -20.47% 60.23533 0.023741 47.48174 80 50 0.03329 -33.16% 66.579038 0.02593 51.86051 85 50 0.032116 -28.46% 64.231032 0.02474 49.47928 90 50 0.033107 -32.43% 66.214772 0.025242 50.48435 95 50 0.032836 -31.34% 65.671992 0.024798 49.59521 100 50 0.033735 -34.94% 67.469078 0.025253 50.50648

[0135] where temp represents the temperature (unit: degree Celsius), Iout represents the current value on the power supply line VBUS set by the system, that is, the set current value passing through the filter inductor FL (unit: ampere), vc_mea represents the voltage value of the voltage Vc across the capacitor C collected, err represents the deviation. Since the measurement deviation is caused by the change of the equivalent resistance DCR of the filter inductor FL with temperature, err is obtained from the equivalent resistance DCR of the filter inductor FL at the current temperature and the equivalent resistance at 25 degrees Celsius. Imon represents the current value before temperature compensation, and the deviation between Imon and Iout is consistent with err. vc_comp is the voltage Vc across the capacitor C after temperature compensation, and Icomp is the temperature compensation current value after compensation. Among them, the compensation formula for Icomp is:

[0136] Icomp = Imon / [1 - (a·t 2 + b·t + c)]

[0137] The compensation formula for vc_comp is similar, that is:

[0138] vc_comp = vc_mea / [1 - (a·t 2 + b·t + c)]

[0139] Figure 7It is a schematic diagram showing the change trends of Iout, Imon, and Icomp in Table 1. From Figure 7 Table 1, it can be seen that the deviation between Imon and Iout becomes larger and larger as the temperature increases. After temperature compensation, Icomp obtained is near Iout at each temperature, and the deviation from Iout is very small, indicating that the current detection method with temperature compensation in the embodiments of the present disclosure has achieved an excellent temperature compensation effect.

[0140] A register is a unit in a device for storing data. However, the register itself has an upper limit on its storage capacity. For example, the maximum value of data stored in a 16-bit register is 2 15 , and the current value detected after analog-to-digital conversion may fluctuate within a small range. If the current value occupies only a very small storage space in the register, it will be very difficult to reflect the change of the current value in the data stored in the register. For example, if the current value fluctuates between 49 amperes and 51 amperes, and the stored value 10 (in decimal) in the 16-bit register represents 50 amperes, then the current values other than 50 amperes between 49 amperes and 51 amperes will be very difficult to obtain corresponding stored values in the register. Conversely, if the stored value 2 15 in the 16-bit register represents 50 amperes, then the current values exceeding 50 amperes will cause data overflow in the register.

[0141] In view of this, the current detection method with temperature compensation in the embodiments of the present disclosure also provides a control method for storing the temperature compensation current value in the register and outputting data. Figure 8 It is a schematic diagram showing the process of storing the temperature compensation current value in the register and reporting the output of the current value according to a schematic embodiment. As Figure 8 shown, in the schematic embodiment, after obtaining the temperature compensation current value, the current detection method with temperature compensation in the embodiments of the present disclosure further includes the following steps 801 to 803.

[0142] Step 801: Store the register value representing the temperature compensation current value in the register, where the register value is obtained based on the temperature compensation current value, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, the maximum value of the register, and the maximum voltage value allowed to be collected between both ends of the filter inductor.

[0143] In a schematic embodiment, the register value is proportional to the temperature compensation current value, the register value is proportional to the equivalent resistance of the filter inductor, the register value is proportional to the gain of the voltage detection circuit, the register value is proportional to the maximum value of the register, and the register value is inversely proportional to the maximum voltage value allowed to be collected between both ends of the filter inductor. In the schematic embodiment, the relationships between the register value and the temperature compensation current value, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, the maximum value of the register, and the maximum voltage value allowed to be collected between both ends of the filter inductor are as follows:

[0144]

[0145] Wherein, i t_comp is the temperature compensation current value, Gain Amp is the gain of the voltage detection circuit, D imon_max is the maximum value of the register, and v shunt_max is the maximum voltage value allowed to be collected between both ends of the filter inductor. Among them, Gain Amp can be the gain of the voltage detection circuit, that is, the gain of the voltage detection circuit for the equivalent voltage value, and the gain of the voltage detection circuit comes from the gain of the amplifier that amplifies the signal in the voltage detection circuit. In the schematic embodiment, if the register is a 16-bit register, then D imon_max is 2 15 . v shunt_max is set by the system of the computing device where the power line is located. According to the above relationships, the register value representing the temperature compensation current value can be obtained.

[0146] Step 802, obtain a reported current value according to a preset scaling factor, the current value corresponding to a unit bit, and the register value, wherein the scaling factor is determined according to the maximum voltage value allowed to be collected between both ends of the filter inductor, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, and the maximum current value on the power line, and the current value corresponding to a unit bit is determined according to the maximum current value on the power line and the maximum value of the register.

[0147] In the schematic embodiment, step 802 may specifically include obtaining the reported current value according to the following formula:

[0148] i report = D imon_actual · ε comp · Current LSB

[0149] Wherein, i report is the reported current value, D imon_actual is the register value, ε comp is the scaling factor, and Current LSB is the current value corresponding to a unit bit.

[0150] Among them, the scaling factor is proportional to the maximum voltage value allowed to be collected between both ends of the filtering inductor, inversely proportional to the equivalent resistance of the filtering inductor, inversely proportional to the gain of the voltage detection circuit, and inversely proportional to the maximum current value on the power line. In the schematic embodiment, the relationship between the scaling factor and the maximum voltage value allowed to be collected between both ends of the filtering inductor, the equivalent resistance of the filtering inductor, the gain of the voltage detection circuit, and the maximum current value on the power line is as follows:

[0151]

[0152] Among them, ifull _scale_current is the maximum current value on the power line, and ifull _scale_current is set by the system of the computing device where the power line is located.

[0153] Among them, the current value corresponding to a unit bit is proportional to the maximum current value on the power line and inversely proportional to the maximum value of the register. In the schematic embodiment, the relationship between the current value corresponding to a unit bit and the maximum current value on the power line and the maximum value of the register is as follows:

[0154]

[0155] Step 803, output the reported current value.

[0156] In the schematic embodiment, the reported current value can be output to a display device.

[0157] The above steps 801 to 803 can be implemented by the MCU (Microcontroller Unit) or SOC (System on Chip) in the computing device.

[0158] The principle of the above process of storing the temperature compensation current value in the register and outputting the reported current value is as follows.

[0159] Figure 9 is a schematic diagram of the scaling relationship between the register value and the data. As Figure 9 shown, the outer frame of the red dot represents the maximum voltage value (v shunt_max ) allowed to be collected between both ends of the detected filtering inductor. After passing through the operational amplifier and ADC sampling, it is stored in the register. The register value (Dv shunt_max ) corresponding to the maximum voltage value (v shunt ) has a magnitude of D imon_max . Among them, the voltage value from 0 to v shunt_max is multiplied by the gain (Gain Amp of the amplifier that amplifies the signal in the voltage detection circuit.) is linearly mapped to the register storage space from 0 to 2 (taking 16 bits as an example), then the corresponding translation formula should be: 15 In the register storage space from 0 to 2 (taking 16 bits as an example), the corresponding translation formula should be:

[0160]

[0161] Taking a 16-bit register as an example, then D imon_max is 2 15 .

[0162] As Figure 9 shown, if the actual requirement of the current system is the inner frame of the blue dot, the detection voltage only reaches up to

[0163] i full_scale_current ·DRC

[0164] Then the maximum value of the register only needs to use

[0165]

[0166] If you want to improve the space utilization rate of the register, magnify the value of the register to the entire storage space D imon_max (The storage space of a 16-bit register is 2 15 ), then the magnification factor is

[0167]

[0168] That is

[0169]

[0170] So when translating, use a unified

[0171]

[0172] For the specific implementation, see the following formula derivation. It should be noted that the value of DCR here is taken as the value at 25 degrees Celsius, and this value is usually marked in the inductor data sheet.

[0173] First, define:

[0174] i report = D imon ·Current LSB

[0175]

[0176] Among them, D imon represents the value in the register, that is, the reported current value is equal to the product of the value in the register and the current value corresponding to the unit bit. The current value corresponding to the unit bit is equal to the maximum current value on the power line divided by the maximum value of the register.

[0177] Then the value stored in the register can be expressed by the following formula

[0178]

[0179] That is to say, the product of the temperature compensation current value, the equivalent resistance value of the filter inductor, the gain of the voltage detection circuit, and the maximum value of the register, divided by the maximum voltage value allowed to be collected between both ends of the filter inductor, is equal to the register value.

[0180] The reported current value obtained from the register value can be expressed by the following formula

[0181]

[0182] That is to say, the product of the register value, the scaling factor, and the current value corresponding to the unit bit is equal to the reported current value.

[0183] To make the reported current value equal to the temperature compensation current value, that is

[0184] i t_comp =i report

[0185] Then the scaling factor is:[[]]END]]

[0186]

[0187] Therefore, when the maximum voltage value allowed to be collected between both ends of the filter inductor, the equivalent resistance of the filter inductor (the value at 25 degrees Celsius can be used), the gain of the voltage detection circuit, the maximum current value on the power line, the maximum value of the register, etc. are known, then according to

[0188] i report =D imon_actual ·εc omp ·Current LSB

[0189] the reported current value can be obtained.

[0190] The embodiment of the present disclosure also provides a current detection system, such as Figure 10As shown, the current detection system includes a current value acquisition module 1001, a temperature value acquisition module 1002, and a temperature compensation module 1003. Among them, the current value acquisition module 1001 is coupled to the power supply line of the electrical load in the computing device, and is used to acquire the pre-temperature-compensation current value of the power supply line of the electrical load in the computing device, where the power supply line is located in the power network of the computing device. The temperature value acquisition module 1002 is used to acquire the current temperature value associated with the environment where the filter inductor is located. The temperature compensation module 1003 is coupled to the current value acquisition module 1001 and the temperature value acquisition module 1002, and is used to obtain the temperature-compensated current value of the power supply line according to a preset non-linear temperature compensation model, the current temperature value, and the pre-temperature-compensation current value.

[0191] Figure 11 is a schematic structural diagram of the current value acquisition module shown according to a schematic embodiment, as Figure 11 shown. In the schematic embodiment, the current value acquisition module 1001 includes a filter inductor FL, a voltage detection circuit 1101, and a current acquisition unit 1102. Among them, the filter inductor FL is connected in series to the power supply line VBUS. The voltage detection circuit 1101 is coupled to both ends of the filter inductor FL and is used to collect the equivalent voltage value between both ends of the filter inductor FL. The current acquisition unit 1102 is coupled to the voltage detection circuit 1101 and is used to obtain the pre-temperature-compensation current value according to the equivalent voltage value and the equivalent resistance of the filter inductor FL. In the schematic embodiment, the specific structure of the voltage detection circuit 1101 can be referred to Figure 3 shown.

[0192] Figure 12 is a schematic structural diagram of another embodiment of the current detection system shown according to a schematic embodiment, as Figure 12As shown, in addition to having the structure described above, the current detection system may further include a register 1201, a reported current value obtaining module 1202, and an information output module 1203. Among them, the register 1201 is coupled to the temperature compensation module 1003 and is used to store the register 1201 value representing the temperature compensation current value. The register 1201 value is obtained according to the temperature compensation current value, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, the maximum value of the register 1201, and the maximum voltage value allowed to be collected between both ends of the filter inductor. The reported current value obtaining module 1202 is coupled to the register 1201 and is used to obtain the register 1201 value and obtain the reported current value according to a preset scaling factor, the current value corresponding to a unit bit, and the register 1201 value. The scaling factor is determined according to the maximum voltage value allowed to be collected between both ends of the filter inductor, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, and the maximum current value on the power line. The current value corresponding to a unit bit is determined according to the maximum current value on the power line and the maximum value of the register 1201. The information output module 1203 is coupled to the reported current value obtaining module 1202 and is used to output the reported current value.

[0193] In the illustrative embodiment, the current acquisition unit 1102 in the current value acquisition module 1001, the temperature value acquisition module 1002, the register 1201, the reported current value obtaining module 1202, and the information output module 1203 may be integrated in an MCU or an SOC in a computing device.

[0194] For the further functions and roles of the various components in the current detection system according to the embodiments of the present disclosure, reference may be made to the corresponding descriptions in the current detection method with temperature compensation in the above embodiments, which will not be elaborated here.

[0195] The current detection method and current detection system with temperature compensation according to the embodiments of the present disclosure achieve the detection of the current in the power supply line of the electrical load in the computing device and the temperature compensation of the detected current. A non-linear temperature compensation model is adopted to replace the hardware compensation circuit, and the collected current value is temperature-compensated through calculation. Thus, the finally reported or displayed current value is the temperature-compensated current value, and the hardware module for calculation can be reused with other available modules, so that no additional space resources are occupied. Therefore, while achieving a good temperature compensation effect, the space occupancy is saved. In addition, the embodiments of the present disclosure do not adopt a shunt resistor, but use a filter inductor connected in series in the power supply line to collect the current value. On the one hand, since the shunt resistor is no longer adopted and the equivalent resistance of the filter inductor is smaller than the resistance value of the shunt resistor, the corresponding power loss is reduced. On the other hand, the filter inductor also has the function of filtering out clutter. Therefore, the embodiments of the present disclosure also achieve the dual functions of the filter inductor for system power supply. In addition, the embodiments of the present disclosure control the storage and data output of the temperature-compensated current value through a register, realizing the full utilization of the register space, which helps the temperature-compensated current value stored in the register and finally output and displayed to be more accurate.

[0196] Figure 13 FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. In some embodiments, the electronic device is a server. The electronic device 1300 may vary greatly due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 1301 and one or more memories 1302. Among them, at least one program code is stored in the memory 1302, and the at least one program code is loaded and executed by the processor 1301 to implement the current detection method with temperature compensation provided by the above various embodiments. Of course, the electronic device 1300 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The electronic device 1300 may also include other components for implementing the functions of the device, which will not be elaborated here.

[0197] In an exemplary embodiment, a computer-readable storage medium including at least one instruction is also provided, such as a memory including at least one instruction. The at least one instruction can be executed by a processor in a computer device to complete the current detection method with temperature compensation in the above embodiments.

[0198] Optionally, the above computer-readable storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may include ROM (Read-Only Memory), RAM (Random-Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage devices, etc.

[0199] The above are only the preferred embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present disclosure shall be included within the scope of protection of the present disclosure.

Claims

1. A current detection method with temperature compensation, comprising: Obtaining a pre-temperature-compensated current value of a power line of an electrical load in a computing device; Obtaining a current temperature value associated with the power line; The temperature compensated current value of the power line is obtained according to a preset nonlinear temperature compensation model, the current temperature value and the current value before temperature compensation.

2. The current detection method with temperature compensation according to claim 1, characterized in that: The method of obtaining the pre-temperature compensation current value of the power line of the power load in the computing device comprises: Obtaining an equivalent voltage value between two ends of a filter inductor connected in series in the power line; The current value before temperature compensation is obtained according to the equivalent voltage value and the equivalent resistance of the filter inductor.

3. The current detection method with temperature compensation according to claim 2, characterized in that: The equivalent voltage value is collected by a voltage detection circuit associated with the equivalent resistance of the filter inductor.

4. The current detection method with temperature compensation according to claim 1, characterized in that: The nonlinear temperature compensation model is a quadratic polynomial regression model.

5. The current detection method with temperature compensation according to claim 4, characterized in that: The quadratic polynomial regression model is: err=a·T 2 +b·T+c Wherein, err is the current deviation ratio, T is the temperature value, a, b, c are model parameters, and the model parameters are obtained by fitting the sample data associated with the current value before temperature compensation and the temperature compensated current value.

6. The current detection method with temperature compensation according to claim 5, characterized in that: The step of obtaining the temperature compensated current value of the power line according to the preset nonlinear temperature compensation model, the current temperature value and the current value before temperature compensation includes: The temperature compensation current value is obtained by the following formula: Icomp=Imon / [1-(a·t 2 +b·t+c)] Among them, Icomp is the temperature compensated current value, Imon is the current value before temperature compensation, and t is the current temperature value.

7. The current detection method with temperature compensation according to claim 3, characterized in that: After obtaining the temperature compensated current value, the current detection method further includes: The register value representing the temperature compensation current value is stored in a register, wherein the register value is obtained according to the temperature compensation current value, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, the maximum value of the register, and the maximum voltage value allowed to be collected between the two ends of the filter inductor; According to a preset scaling factor, a current value corresponding to a unit bit and the register value, a reported current value is obtained, wherein the scaling factor is determined according to a maximum voltage value allowed to be collected between two ends of the filter inductor, an equivalent resistance of the filter inductor, a gain of the voltage detection circuit, and a maximum current value on the power line, and the current value corresponding to the unit bit is determined according to the maximum current value on the power line and a maximum value of the register; The reported current value is output.

8. The current detection method with temperature compensation according to claim 7, characterized in that: Obtaining the reported current value according to the preset scaling factor, the current value corresponding to the unit bit, and the register value includes obtaining the reported current value according to the following formula: i report =D imon_actual ·ε comp ·Current LSB Among them, i report is the reported current value, D imon_actual is the register value, ε comp is the scaling factor, Current LSB is the current value corresponding to the unit bit; The register value is proportional to the temperature compensation current value, the register value is proportional to the equivalent resistance of the filter inductor, the register value is proportional to the gain of the voltage detection circuit, the register value is proportional to the maximum value of the register, and the register value is inversely proportional to the maximum voltage value allowed to be collected between the two ends of the filter inductor; The scaling factor is proportional to the maximum voltage value allowed to be collected between the two ends of the filter inductor, the scaling factor is inversely proportional to the equivalent resistance of the filter inductor, the scaling factor is inversely proportional to the gain of the voltage detection circuit, and the scaling factor is inversely proportional to the maximum current value on the power line; The current value corresponding to the unit bit is proportional to the maximum current value on the power line, and the current value corresponding to the unit bit is inversely proportional to the maximum value of the register.

9. A current detection system, characterized in that: include: A current value acquisition module, coupled to a power line of an electric load in a computing device, for acquiring a pre-temperature-compensated current value of the power line of the electric load in the computing device, wherein the power line is located in a power network in the computing device; A temperature value acquisition module, used to acquire a current temperature value associated with the power line; The temperature compensation module is coupled to the current value acquisition module and the temperature value acquisition module, and is used to obtain the temperature compensated current value of the power line according to a preset nonlinear temperature compensation model, the current temperature value and the current value before temperature compensation.

10. The current detection system according to claim 9, characterized in that: The current value acquisition module includes: A filter inductor, the filter inductor is connected in series in the power line; A voltage detection circuit, coupled to both ends of the filter inductor, for collecting an equivalent voltage value between both ends of the filter inductor; The current acquisition unit is coupled to the voltage detection circuit and is used to obtain the current value before temperature compensation according to the equivalent voltage value and the equivalent resistance of the filter inductor.

11. The current detection system according to claim 10, characterized in that: The current detection system also includes: A register, coupled to the temperature compensation module, for storing a register value representing the temperature compensation current value, wherein the register value is obtained according to the temperature compensation current value, the equivalent resistance of the filter inductor, the gain of the voltage detection circuit, the maximum value of the register, and the maximum voltage value allowed to be collected between the two ends of the filter inductor; a reported current value acquisition module, coupled to the register, for acquiring the register value, and obtaining the reported current value according to a preset scaling factor, a current value corresponding to a unit bit, and the register value, wherein the scaling factor is determined according to a maximum voltage value allowed to be collected between the two ends of the filter inductor, an equivalent resistance of the filter inductor, a gain of the voltage detection circuit, and a maximum current value on the power line, and the current value corresponding to the unit bit is determined according to the maximum current value on the power line and a maximum value of the register; The information output module is coupled to the reported current value obtaining module and is used for outputting the reported current value.

12. An electronic device, characterized in that: include: processor; a memory for storing executable instructions for the processor; The processor is configured to execute the executable instructions to implement the current detection method with temperature compensation as described in any one of claims 1 to 8.

13. A computer-readable storage medium, characterized in that: When at least one instruction in the computer-readable storage medium is executed by a processor of an electronic device, the electronic device is enabled to implement the current detection method with temperature compensation as claimed in any one of claims 1 to 8.