Detection chip, circuit board, electronic equipment and current detection method
By setting up an auxiliary circuit inside the detection chip for current self-calibration, the high cost problem caused by external equipment calibration is solved, and efficient and low-cost current detection is achieved.
Patent Information
- Application Number
- CN202410544784.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-11-07
AI Technical Summary
In existing technologies, current detection in electronic devices is prone to errors, requiring calibration with external equipment, which results in high costs in terms of manpower, time, and equipment.
An auxiliary circuit is set inside the detection chip. The current is input to the detection resistor through the auxiliary circuit to self-calibrate the current measurement value, reducing the dependence on external devices.
This achieves the goal of saving manpower, time, and equipment costs while ensuring accuracy, and improving the efficiency of current detection.
Smart Images

Figure CN120908513A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of electronic equipment, and in particular to a detection chip, a circuit board, an electronic device, and a current detection method. BACKGROUND
[0002] With the rapid development of electronic equipment technology, it is particularly important to detect the current of components in electronic equipment to ensure normal operation of the electronic equipment. However, due to the influence of the detection environment and the material of the components, there will inevitably be some errors between the current measurement value obtained by the detection circuit when detecting the current of the components and the true current value. Therefore, in order to improve the accuracy and stability of the current detection of the components by the detection current, it is necessary to calibrate the current measurement value. The related technology calibrates the current measurement value by means of external equipment, which requires special staff to install and debug the external equipment, resulting in high cost of manpower and time for current detection. SUMMARY
[0003] Embodiments of the present application provide a detection chip, a circuit board, an electronic device, and a current detection method, which calibrate the current measurement value by setting a current source in the detection chip, thereby reducing the cost required for current detection.
[0004] To achieve the above purpose, embodiments of the present application adopt the following technical solutions: an auxiliary circuit is arranged in the detection chip of the electronic device, so that the auxiliary circuit inputs current to the detection resistor connected to the detection circuit to determine the current calibration value. In this way, after the detection circuit detects the current of the detection resistor and obtains the current measurement value of the detection resistor, the current measurement value can be calibrated based on the previously determined current calibration value. In this way, compared with the method of calibrating the current measurement value by relying on external equipment, the auxiliary circuit in the detection chip can calibrate the current value detected by the detection circuit, thereby effectively saving the manpower cost, time cost required for installing and debugging external equipment, and saving the equipment cost required for purchasing external equipment.
[0005] In a first aspect, a current detection chip is provided, which is coupled with a detection resistor of a to-be-detected circuit in an electronic device through a detection circuit. The detection chip is further configured with an auxiliary circuit inside the chip, and the auxiliary circuit is coupled with the detection resistor in the to-be-detected circuit. When the to-be-detected circuit is not enabled and is in a non-working state, the detection chip first controls the auxiliary circuit to input a current to the detection resistor, and controls the detection circuit to measure a current measurement value of the detection resistor at the same time, so as to calculate a current calibration value of the detection resistor based on an actual size of the current input by the auxiliary circuit to the detection resistor and the current measurement value measured by the detection circuit. When the to-be-detected circuit enters a working state, the detection chip performs current detection on the detection resistor, and performs self-calibration on the current measurement value of the detection resistor measured by the detection circuit based on the current calibration value, to obtain an actual current value of the detection resistor after calibration.
[0006] In a feasible embodiment of the first aspect, the detection chip mainly includes an auxiliary circuit and a detection circuit. The auxiliary circuit is provided with a first port and a second port, the first port is coupled with a first end of the detection resistor in the to-be-detected circuit, and the second port is coupled with a second end of the detection resistor. The detection circuit is also coupled with the first port and the second port provided by the auxiliary circuit. In addition, in the to-be-detected circuit, the to-be-detected circuit includes a voltage power supply and an enable switch in addition to the detection resistor and a load. The first end of the detection resistor is connected with the voltage power supply, the second end of the detection resistor is connected with a first end of the enable switch, and a second end of the enable switch is connected with a ground end.
[0007] In the present application, the detection chip controls the auxiliary circuit to generate currents of the same size at the first port and the second port when the to-be-detected circuit is in a non-working state, controls the detection circuit to accurately measure a current measurement value a of the detection resistor, and calculates a ratio between the current measurement value a and a current value of the second current, so as to take the ratio as a current calibration value of the detection resistor. Then, when the to-be-detected circuit is in a working state, the detection chip controls the detection circuit to perform current detection on the detection resistor to obtain a current measurement value b of the detection resistor, and uses the current calibration value to calibrate the current measurement value b, to obtain an actual current value of the detection resistor when the to-be-detected circuit is in the working state. Therefore, compared with a current detection method which depends on external equipment to calibrate the measurement value, the embodiment of the present application can effectively save manpower, time and equipment costs and improve the efficiency of current detection and calibration, while ensuring accurate current detection.
[0008] In a feasible embodiment of the first aspect, the detection chip can further obtain a plurality of current calibration values by changing the magnitude of the current value of the first current and the current value of the second current each time the magnitude of the current value of the first current and the current value of the second current are changed simultaneously, and then obtaining a current calibration value by the above process. Then, the plurality of current calibration values are obtained, and the average of the plurality of current calibration values is calculated, and the average is taken as the current calibration value of the detection resistor.
[0009] In a feasible embodiment of the first aspect, the detection circuit can include an analog-to-digital converter. The analog-to-digital converter can be coupled to the first port and the second port of the auxiliary circuit, respectively, to read the voltage measurement value across the detection resistor, and divide the read voltage measurement value by the resistance value of the detection resistor to measure the current measurement value of the detection resistor. Illustratively, after the analog-to-digital converter reads the analog voltage value across the detection resistor, the read voltage signal is converted into a digital signal form of the voltage measurement value.
[0010] In a feasible embodiment of the first aspect, the detection circuit can further include a voltage amplifier to amplify the voltage across the detection resistor through the current detection amplifier. In this way, the analog-to-digital converter can convert the amplified analog voltage value across the detection resistor into a digital signal form of the voltage measurement value.
[0011] In a feasible embodiment of the first aspect, the auxiliary circuit can include a first current source and a second current source. The first current source and the second current source can be mirror current sources. The first end of the first current source is coupled to the first port, and the second end of the first current source is coupled to the ground. The first end of the second current source is coupled to the second port, and the second end of the second current source is coupled to the ground. In this way, the detection chip can generate the first current at the first port through the first current source and generate the second current at the second port through the second current source when the circuit under test is in a non-working state.
[0012] In a feasible embodiment of the first aspect, since the current value of the first current is equal to the current value of the second current, the detection chip can further design the length of the wire between the first end of the detection resistor and the first current source to be consistent with the length of the wire between the first end of the detection resistor and the second current source when the detection chip controls the first current source to generate the first current at the first port and controls the second current source to generate the second current at the second port. In this way, the resistance voltage drop of the first current in the wire and the resistance voltage drop of the second current in the wire can be offset each other. In this way, when the detection chip controls the detection circuit to obtain the current calibration value of the detection resistor, the current measurement value a of the detection resistor can be accurately measured under the condition that the resistance voltage drop of the second current and the resistance voltage drop of the first current are offset. Thus, more accurate current detection of the detection resistor is achieved.
[0013] In a possible implementation of the first aspect, the auxiliary circuit can further include a first switch and a second switch. The first switch can be connected in series between the first port and the first current source, or the first switch can also be connected in series between the first current source and the ground. The second switch can be connected in series between the second port and the second current source, or the second switch can also be connected in series between the second current source and the ground.
[0014] In the present application, the detection chip controls the first switch and the second switch to be closed, so as to control the first current source to generate the first current at the first port, and control the second current source to generate the second current at the second port. Thus, the detection chip can control the detection circuit to calculate the current calibration value of the detection resistor based on the voltage generated by the second current at both ends of the detection resistor, so as to calibrate the current measurement value of the detection resistor when the to-be-detected circuit is in the working state. That is, the present application can more simply and quickly obtain the current calibration value of the detection resistor by controlling the first switch and the second switch, thereby further improving the efficiency of current detection and calibration.
[0015] In a possible implementation of the first aspect, the to-be-detected circuit further includes a filtering sub-circuit, the filtering sub-circuit is coupled with the detection resistor, and the first port and the second port of the auxiliary circuit are coupled with the filtering sub-circuit. The filtering sub-circuit can include a first resistor, a second resistor, and a capacitor. The first end of the first resistor is coupled with the first end of the detection resistor, and the second end of the first resistor is coupled with the first port of the auxiliary circuit. When the detection chip controls the auxiliary circuit to generate the first current at the first port, the first current will pass through the first resistance value, thereby generating a first voltage value at both ends of the first resistor. In addition, the first end of the second resistor is coupled with the second end of the detection resistor, and the second end of the second resistor is coupled with the second port. When the detection chip controls the auxiliary circuit to generate the second current at the second port, the second current will pass through the second resistance value, thereby generating a second voltage value at both ends of the second resistor. Furthermore, the capacitor is connected in series between the second end of the first resistor and the second end of the second resistor, mainly for blocking the path between the second end of the first resistor and the second end of the second resistor, so that the detection circuit can use the first port and the second port to detect the current of the detection resistor.
[0016] In a possible implementation of the first aspect, when the to-be-detected circuit is in the non-working state, the detection chip controls the auxiliary circuit to generate a third current at the first port, and controls the detection circuit to detect the current of the first resistor, so as to calculate the resistance value of the first resistor based on the current value of the third current. In addition, when the to-be-detected circuit is in the non-working state, the detection chip controls the auxiliary circuit to generate a fourth current at the second port, and controls the detection circuit to detect the current of the second resistor, so as to calculate the resistance value of the second resistor based on the current value of the fourth current.
[0017] The second aspect also provides a circuit board, which comprises a detection chip, a first current source and a second current source. The detection chip is coupled with two ends of a detection resistor of a to-be-detected circuit through a first port and a second port respectively, and is coupled with the first current source and the second current source through a fourth port and a fifth port respectively, and generates a first current at the first port through the first current source and generates a second current at the second port through the second current source. The current value of the first current is equal to the current value of the second current. Thus, the detection chip can further control the detection circuit to measure a current measurement value a of the detection resistor, and calculate a ratio between the current measurement value a and the current value of the second current, so as to take the ratio as a current calibration value of the detection resistor. Then, when the to-be-detected circuit is in a working state, the detection chip controls the detection circuit to perform current detection on the detection resistor to obtain a current measurement value b of the detection resistor, and calibrates the current measurement value b using the current calibration value to obtain an actual current value of the detection resistor when the to-be-detected circuit is in the working state. Thus, compared with a current detection mode that relies on external equipment to calibrate a measurement value, the embodiment of the present application can effectively save the cost of manpower, time and equipment and improve the efficiency of current detection and calibration under the premise of ensuring accurate current detection.
[0018] In a feasible embodiment of the second aspect, the circuit board further comprises a first switch and a second switch. The first end of the first switch is coupled with the fourth port of the auxiliary circuit, the first current source is coupled with the second end of the first switch, the first end of the second switch is coupled with the fifth port of the auxiliary circuit, and the second current source is coupled with the second end of the second switch. In this way, when the to-be-detected circuit is in a non-working state, the detection chip can control the first switch and the second switch to be closed through the circuit board, so that the first current source generates the first current at the first port and the second current source generates the second current at the second port.
[0019] The third aspect also provides an electronic device. In the to-be-detected circuit of the electronic device, the first end of a detection resistor is connected with a first port provided by an auxiliary circuit in a detection chip, and the second end of the detection resistor is connected with a second port provided by the auxiliary circuit. Based on this, when the to-be-detected circuit is in a non-working state, the electronic device controls the detection circuit to read a voltage measurement value between the two ends of the detection resistor based on the first port and the second port through the detection chip, and then divides the voltage measurement value by the resistance value of the detection resistor to obtain a current measurement value of the detection resistor at this time. Then, if the electronic device has previously obtained a current calibration value of the detection resistor through the detection chip, the electronic device further performs self-calibration on the current measurement value of the detection resistor using the current calibration value, so as to obtain an actual current value of the detection resistor at this time.
[0020] In the present application, the electronic device only needs to control the auxiliary circuit arranged inside the detection chip, and can obtain the current calibration value by combining the algorithm, so as to realize automatic calibration of the current measurement value when the detection chip detects the current of the load by using the current calibration value. In this way, compared with the method of relying on external equipment to calibrate the current measurement, the present application can not only accurately detect the current, but also save the labor cost, time cost and equipment cost of calibrating the current measurement value, and improve the efficiency of current detection.
[0021] In a feasible embodiment of the third aspect, a filtering sub-circuit is further arranged between the detection resistance and the first port and the second port of the auxiliary circuit. In this way, when the detection voltage is generated at both ends of the detection resistance, the detection voltage is filtered by the filtering sub-circuit and then read by the detection circuit through the first port and the second port, and then the detection voltage is divided by the resistance value of the detection resistance by the detection circuit or the detection chip to measure the current measurement value of the detection resistance.
[0022] In a feasible embodiment of the third aspect, the auxiliary circuit further includes a first current source and a second current source, the first end of the first current source is connected to the first port, and the first end of the second current source is connected to the second port. Thus, the electronic device can control the first current source to generate the first current at the first port and control the second current source to generate the second current at the second port through the detection chip. In this case, the electronic device can design the length of the wire between the first end of the detection resistance and the first current source to be the same as the length of the wire between the first end of the detection resistance and the second current source. Thus, when the current value of the first current is the same as the current value of the second current, the resistance voltage drop generated by the second current when transmitting in the wire will cancel out the resistance voltage drop generated by the first current when transmitting in the wire. In this way, the electronic device can measure a more accurate current measurement value by controlling the detection circuit to detect the current of the detection resistance through the detection chip when the same first current and second current are generated at the same time, and obtain a more accurate current calibration value based on the current measurement value.
[0023] In the fourth aspect, a current detection method is provided. In the case of newly arranging an auxiliary circuit inside the detection chip, the detection chip controls the auxiliary circuit to generate the same current value at the first port and the second port when the to-be-detected circuit is in a non-working state, controls the detection circuit to accurately measure the current measurement value a of the detection resistance, and takes the ratio of the current measurement value a and the second current value as the current calibration value of the detection resistance. Then, when the to-be-detected circuit is in a working state, the detection chip controls the detection circuit to detect the current of the detection resistance to obtain the current measurement value b of the detection resistance, and the detection chip also uses the current calibration value to calibrate the current measurement value to obtain the actual current value of the detection resistance at this time.
[0024] In the present application, the current detection method provided by the embodiments of the present application only needs to detect the control of the chip on the auxiliary circuit arranged inside, can obtain the current calibration value by combining the algorithm, and thus can automatically calibrate the current measurement value by using the current calibration value when detecting the current of the detection resistor, and obtain the calibrated actual current value. Therefore, compared with the current detection method which depends on external equipment to calibrate the measurement value, the current detection method provided by the embodiments of the present application can effectively save the cost of manpower, time and equipment and improve the efficiency of current detection and calibration under the premise of ensuring accurate current detection.
[0025] In a feasible embodiment of the fourth aspect, the detection chip can also determine whether the to-be-detected circuit has a deviation error when the to-be-detected circuit is in a non-working state. If the detection chip determines that the to-be-detected circuit does not have a deviation error, the detection chip directly obtains the current calibration value by using the current measurement value a in the process of obtaining the current calibration value, and directly calibrates the current measurement value b by using the current calibration value in the formal current detection process of the detection resistor, so as to obtain the accurate actual current value of the detection resistor. However, if the detection chip determines that the to-be-detected circuit has a deviation error, the detection chip first eliminates the deviation error, and then obtains the current calibration value by using the current measurement value a after eliminating the deviation error in the process of obtaining the current calibration value. Moreover, in the formal current detection process of the detection resistor, the detection chip also first eliminates the deviation error, and then calibrates the current measurement value b after eliminating the deviation error by using the current calibration value, so as to obtain the accurate actual current value of the detection resistor.
[0026] In a feasible embodiment of the fourth aspect, in the case that the auxiliary circuit of the detection chip specifically includes the first current source and the second current source, the detection chip can pre-configure a plurality of current sizes in the first current source and the second current source. Based on this, when the detection chip controls the auxiliary circuit to generate the first current at the first port and the second current at the second port, the detection chip can specifically control the first current source and the second current source to switch the current size respectively to generate the first current with different sizes at the first port and the second current with different sizes at the second port when the to-be-detected circuit is in a non-working state.
[0027] In a feasible embodiment of the fourth aspect, in the case that the to-be-detected circuit further includes the filtering sub-circuit, the detection chip controls the detection circuit to detect the current of the detection resistor when the to-be-detected circuit is in a non-working state. At this time, the detection circuit reads the first voltage value U R1 at both ends of the first resistor, the second voltage value U R2The third voltage value Ut1 across the detection resistor R_SENS is detected, and the total voltage measurement value U1 is composed of the first voltage value Ut, the second voltage value Ut2 and the third voltage value Ut1. Then, the detection chip calculates the third voltage value Ut1 by combining the voltage measurement value U1 of the three detection voltages, the current value of the first current or the second current, the resistance value of the first resistor and the resistance value of the second resistor. Then, the detection chip further divides the third voltage value Ut1 by the resistance value of the detection resistor R_SENS to measure the current measurement value a of the detection resistor R_SENS at this time. Moreover, the detection chip compares the current measurement value a with the current value of the second current, and takes the ratio between the current measurement value a and the second current value as the current calibration value of the detection resistor R_SENS.
[0028] In a possible implementation of the fourth aspect, the detection chip can further calibrate the tolerance of the detection resistor, so as to obtain a more accurate resistance value of the detection resistor. In the process of obtaining the current calibration value of the detection resistor and in the process of performing formal current detection on the detection resistor, the detection chip can obtain a more accurate current measurement value by dividing the voltage measurement value read by the detection circuit by the resistance value of the detection resistor.
[0029] In the fifth aspect, the present application provides a computer readable storage medium, which stores computer instructions, when the computer instructions are run on an electronic device, the detection chip in the electronic device can execute the method in the third aspect.
[0030] In the sixth aspect, the present application provides a computer program product containing instructions, when the computer program product is run on a computer, the computer can execute the method in the third aspect.
[0031] In the seventh aspect, an apparatus is provided, which includes a processor for supporting the detection chip in the electronic device to implement the functions related to the third aspect. In a possible design, the apparatus further includes a memory for storing necessary program instructions and data of the electronic device.
[0032] The technical effects brought by the fifth aspect to the sixth aspect can be referred to the technical effects brought by the different implementation manners of the fourth aspect, and will not be described herein. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1A schematic diagram of a slope curve between the current measurement value and the actual current value involved in the embodiment of the present application;
[0034] Figure 2 A schematic diagram of another slope curve between the current measurement value and the actual current value involved in the embodiment of the present application;
[0035] Figure 3 A schematic diagram of another slope curve between the current measurement value and the actual current value involved in the embodiment of the present application;
[0036] Figure 4 A schematic diagram of a circuit structure for calibrating the current measurement value by means of an external device involved in the embodiment of the present application;
[0037] Figure 5 A schematic diagram of a structure of a circuit to be measured involved in the embodiment of the present application;
[0038] Figure 6 A schematic diagram of a structure of an auxiliary circuit involved in the embodiment of the present application;
[0039] Figure 7 A schematic diagram of a structure of a detection circuit involved in the embodiment of the present application;
[0040] Figure 8 A schematic diagram of a circuit structure of a detection chip involved in the embodiment of the present application;
[0041] Figure 9 A schematic diagram of another structure of an auxiliary circuit involved in the embodiment of the present application;
[0042] Figure 10 A schematic diagram of a structure of a circuit board involved in the embodiment of the present application;
[0043] Figure 11 A schematic diagram of another structure of an auxiliary circuit involved in the embodiment of the present application;
[0044] Figure 12 A schematic diagram of another structure of a circuit board involved in the embodiment of the present application;
[0045] Figure 13 A schematic diagram of another structure of a circuit to be measured involved in the embodiment of the present application. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments provided by the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0047] The terms "first", "second", etc. are used herein only to describe different instances, and can not be understood as indicating or implying relative importance or a specific number of the technical features indicated. Thus, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified.
[0048] In describing some embodiments, "coupled", "connected", "linked", and variations thereof, can be used. For example, the term "connected" can be used to describe some embodiments in which two or more components are in direct or indirect physical contact with each other. For example, A and B can be connected, which means that A and B are connected, or A and B are connected through other components. In addition, the term "coupled" can be an electrical connection that enables signal transmission.
[0049] "A, B, and C at least one of them" has the same meaning as "at least one of A, B, or C", which includes the following combinations of A, B, and C: only A, only B, only C, a combination of A and B, a combination of A and C, a combination of B and C, and a combination of A, B, and C.
[0050] "A and / or B" includes the following three combinations: only A, only B, and a combination of A and B.
[0051] As used herein, "about", "approximately", or "approximately" includes the stated value and the average value within an acceptable deviation range of the specific value, wherein the acceptable deviation range is determined by considering the measurement being discussed and the error related to the measurement of the specific quantity (i.e. the limitations of the measurement system) by those of ordinary skill in the art.
[0052] Before introducing the embodiments of the present application, the related technical terms involved in the embodiments of the present application are briefly introduced.
[0053] Zero drift, temperature offset and sensitivity drift.
[0054] Zero drift is also called zero drift. Zero drift phenomenon refers to when the input signal of the amplifier circuit is zero (i.e. no AC input), due to the influence of temperature change, unstable power supply voltage and other factors, the static operating point changes, and is amplified and transmitted step by step, resulting in the output voltage of the circuit deviating from the original fixed value and fluctuating up and down.
[0055] Temperature drift refers to the change of transistor parameters caused by the change of ambient temperature, which causes the instability of static operating point, the instability of dynamic parameters of circuit, and even the failure of normal operation of circuit. Generally speaking, as the temperature rises, the current amplification of the transistor increases, and the quiescent point (Q point) rises. On the contrary, as the temperature drops, the current amplification of the transistor decreases, and the Q point drops. Therefore, the current change caused by the increase or decrease of temperature is called temperature drift.
[0056] Sensitivity drift refers to the change of the sensitivity of the pressure sensor caused by the change of environmental temperature and other factors.
[0057] Mirror current source.
[0058] Mirror current source is a basic unit circuit in the design of integrated circuits. The mirror current source has the characteristic that the output current of the first current source is a "copy" of the input or output current of the second current source in a certain proportion, to generate a bias current and as an active load. In the design of new current mode analog integrated circuits, in addition to being used to generate bias currents, mirror current sources are also widely used to realize the copying or multiplication of current signals. In addition, mirror current sources with complementary polarities can also realize the transformation between differential current signals and single-ended current signals.
[0059] Current calibration.
[0060] Nowadays, with the rapid development of electronic equipment technology, the components configured in electronic equipment are becoming more and more complex and precise, and different components each need to input current, voltage with their own standards when working. Therefore, in order to ensure that each component in the electronic equipment can work continuously with the corresponding standard current or voltage, so as to ensure the normal operation of various functions of the electronic equipment, it is often necessary to detect the parameters of the current and voltage of the components in the electronic equipment to monitor the analog parameters such as current and voltage of the components.
[0061] However, when the detection circuit detects the current of the component, it is inevitable that there will be some errors between the current measurement value measured by the detection circuit and the actual current value flowing through the component due to the influence of changes in detection environment temperature and changes in material properties of the component itself. Therefore, in order to accurately monitor the current of the component, it is usually necessary to calibrate the measured current measurement value when the detection circuit detects the current of the component, and then monitor the current based on the actual current value obtained after calibration.
[0062] Ideally, the current measurement value I L the actual current value IIS They should be the same, so there is no need to consider the current measurement value I. L Perform calibration. And such as Figure 1 As shown, the current measurement value I L Compared with the actual current value I IS At the same time, the measured current value I L Compared with the actual current value I IS The calibration curve typ-I between IS The slope is 1. Furthermore, for the current measurement value I... L and actual current value I IS For these two values, knowing the magnitude of either value allows us to use the calibration curve typ-I. IS The slope is calculated to obtain another numerical value. Therefore, the calibration curve typ-I... IS The slope can be used as a measure of the current I. L Perform calibration to obtain the actual current value I IS The current calibration value. That is, the current calibration value is equal to the current measurement value I. L Divide by the actual current value I IS Alternatively, the current calibration value is equal to the actual current value I. IS Divide by the measured current value I L .
[0063] However, as Figure 2 As shown, due to changes in ambient temperature and / or changes in the material properties of the components themselves, these phenomena frequently occur during current detection by the detection circuit. Consequently, the circuit under test is highly susceptible to temperature shifts or sensitivity drift due to these changes, leading to variations in the measured current value I obtained by the detection circuit. L Compared to the actual current value I IS Some errors may occur, namely, the current measurement value I. L Less than the actual current value I IS Or, the current measurement value I L Greater than the actual current value I IS This results in the current measurement value I. L Compared with the actual current value I IS The calibration curve typ-I between IS The slope is not equal to 1. At this point, in order to accurately monitor the actual current value I of the component... IS Then, the current measurement value I can be calculated using the following formula 1. L Perform calibration to obtain the actual current value I IS :
[0064] I IS =1 / kIS *I L Formula 1.
[0065] It should be noted that 1 / k in Formula 1 IS For current measurement value I L Compared with the actual current value I IS The calibration curve typ-I between IS The slope, which is used to measure the current value I L Perform calibration to obtain the actual current value I IS The current calibration value.
[0066] In addition, such as Figure 3 As shown, if the circuit under test is affected by the environment, and the detection circuit can detect the presence of current in the circuit under test even before the electronic device controls the power supply to input current to the components, it indicates that the circuit under test has experienced a zero-point offset, which will lead to an abnormal current measurement value I. L Compared to the actual current value I IS Offset error occurs. Furthermore, if the circuit under test exhibits temperature or sensitivity shifts, it will also affect the measured current value I. L Less than (or greater than) the actual current value I IS At this time, the measured current value I L Compared with the actual current value I IS The calibration curve typ-I between IS Not only will the slope not be 1 (less than 1 or greater than 1), but the origin will also shift. This indicates that it is necessary to adjust not only the current measurement value I... L Perform calibration to make the calibration curve typ-I IS The slope regresses to 1, and further calibration of the current measurement value I is required. L Eliminate offset error and make calibration curve typ-I IS The origin must be returned to zero so that the actual current value I of the component can be accurately monitored. IS That is, at this time, the current measurement value I can be calculated using Formula 2 as shown below. L The actual current value I is obtained by calibration. IS :
[0067] I IS =1 / k IS *(I L -I IS(OFFSET) ) Formula 2.
[0068] It should be noted that I in Formula 2 IS(OFFSET) For current measurement value I L Compared with the actual current value I IS The offset error between, IIS(OFFSET) Specifically, the current can be obtained by detecting the current in the circuit under test when the circuit under test is disabled. Furthermore, I IS(OFFSET) It can be positive or negative. For example... Figure 3 As shown, I IS(OFFSET) It is positive and its absolute value equals maxI IS At that time, the calibration curve typ-I IS The overall tilt is upward, while I IS(OFFSET) It is negative and its absolute value equals min I IS At that time, the calibration curve typ-I IS The overall direction shifts downwards.
[0069] The implementation methods of the embodiments of this application will now be described.
[0070] In related technologies, when performing current detection on a circuit under test to determine the actual current value of components within that circuit, an external device is used to apply a known current to the circuit under test inside the electronic device. Then, a detection circuit is used to measure the current in the circuit under test, and the current measurement value obtained from the detection circuit is calibrated using the aforementioned calculation methods to obtain the actual current value inside the circuit under test. For example... Figure 4 As shown, when calibrating the current measurement value using an external device, it is necessary to first couple the programmable power supply providing the current from the external device to the sensing resistor R_SENS connected to the detection circuit in the circuit under test. The point where the programmable power supply and the sensing resistor R_SENS are coupled is then used as the test point. Next, a known current is injected into the test point through the programmable power supply, and the current calibration value 1 / k is determined using the algorithm described above. IS Then use the current calibration value 1 / k IS The current measurement value of the sensing resistor R_SENS is calibrated to obtain the actual current value.
[0071] Therefore, not only is it necessary to spend manpower to install, debug, and operate the external equipment, but in some special cases, it may also be necessary to disassemble the electronic equipment in order to accurately connect the programmable power supply provided by the external equipment to the detection resistor in the circuit under test, so as to ensure that the programmable power supply can input current to both ends of the detection resistor. That is, the current method of relying on external equipment to calibrate current measurement values for current detection is relatively expensive in terms of time, manpower, and equipment costs.
[0072] To solve the problem of high cost of current detection, an auxiliary circuit is arranged in the detection chip of the electronic device, and the auxiliary circuit is used to input current to the detection resistor connected to the detection circuit to determine the current calibration value. After the detection circuit detects the current of the detection resistor and obtains the current measurement value of the detection resistor, the current measurement value can be calibrated based on the previously determined current calibration value. That is, the electronic device itself can be used to calibrate the current measurement value during current detection. Therefore, compared with the method of calibrating the current measurement value by relying on external equipment, the method can effectively save the labor cost and time cost of installing and debugging external equipment, and save the equipment cost of purchasing external equipment.
[0073] In addition, the current measurement value can be calibrated more quickly during current detection, and the actual current value of the component in the to-be-detected circuit can be detected more quickly. That is, the method can improve the efficiency of current detection.
[0074] In addition, in the related art, the external equipment is coupled to the detection circuit when the current measurement value is calibrated by the external equipment, and the position where the external equipment is coupled to the detection circuit is used as a test point. Therefore, the detection chip needs to be additionally designed with at least two pins connected to the internal detection circuit, and the two pins are left empty for connecting the external equipment. To solve this problem, in the method, the detection chip can calibrate the current measurement value without relying on the external equipment, so that the detection chip does not need to be additionally designed with the pins, which can reduce the difficulty of circuit design of the detection chip and save the cost of the chip to a certain extent.
[0075] Based on the overall concept of the method, the detection chip, the circuit board, the electronic device, and the current detection method provided in the embodiments of the present application are described in detail.
[0076] In the embodiments of the present application, the electronic device provided by the embodiments of the present application can include, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a virtual reality device, an electric vehicle, and a terminal device with a function of accessing a network to communicate.
[0077] The detection chip is connected with the to-be-detected circuit in the electronic device, and the detection chip performs current detection on the to-be-detected circuit when the to-be-detected circuit is in a working state. It should be understood that the electronic device can include one or more to-be-detected circuits. In the case where the electronic device includes multiple to-be-detected circuits, the detection chip can be switched to be connected with any one to-be-detected circuit through a switch, so as to perform current detection on the to-be-detected circuit. For the convenience of description and understanding, the current detection performed by the detection chip on one to-be-detected circuit in the electronic device is taken as an example to describe the embodiments of the present application. The implementation of the detection chip connected with any to-be-detected circuit in the electronic device and performing current detection on the to-be-detected circuit can be the same. In addition, the detection result obtained by the detection chip through current detection on the to-be-detected circuit can be the detection result of one or more loads in the to-be-detected circuit. For example, in the case where the to-be-detected circuit includes multiple loads and the multiple loads are connected in series, based on the principle that the current of a series circuit is equal everywhere, the actual current value of any one load in the to-be-detected circuit obtained by the detection chip through current detection on the load is also the actual current value of other loads in the to-be-detected circuit.
[0078] It should be noted that the load in the to-be-detected circuit can include resistors, transistors, light-emitting diodes, cameras, speakers, vibration motors, processors, internal memories, charging management modules, power management modules, antennas, mobile communication modules, wireless communication modules, audio modules, receivers, microphones, earphone interfaces, sensor modules, keys, indicators, display screens, and user identity module card interfaces, and the like. The embodiments of the present application do not limit the specific types of loads in the to-be-detected circuit.
[0079] As Figure 5As shown, in the to-be-tested circuit, a first end of the detection resistor R_SENS is connected with the voltage power supply VCC, and a second end of the detection resistor R_SENS is connected with a first end of the enable switch LOAD-EN. A first end of the load RL is connected with a second end of the enable switch LOAD-EN, a filter capacitor C2 of the load RL is connected with the load RL in parallel, and a second end of the load RL is connected with the ground terminal GND. In this way, as long as the electronic device controls the load switch LOAD-EN to be open, the entire to-be-tested circuit will not be conducted and thus is in a non-working state. When the voltage power supply VCC in the to-be-tested circuit conducts a current, as long as the electronic device controls the load switch LOAD-EN to be closed, the entire to-be-tested circuit can be conducted so that the to-be-tested circuit enters a working state. When the to-be-tested circuit is in the working state, since the current conducted by the voltage power supply VCC flows through the detection resistor R_SENS, the electronic device can perform current detection on the detection resistor R_SENS through the detection chip, and can take the actual current value of the detection resistor R_SENS finally detected as the actual current value of the load RL (usually, the current divided by the filter capacitor C2 is small and thus can be ignored).
[0080] It should be noted that, in the to-be-tested circuit, the first end of the load RL and the second end of the enable switch LOAD-EN can further include electronic devices such as a low dropout regulator (LDO) and / or a DC-DC optical regulator. It should be understood that, based on different design needs of actual applications, different regulators and / or other electronic devices can be designed between the first end of the load RL and the second end of the enable switch LOAD-EN in different feasible implementations, and the embodiments of the present application do not specifically limit the types of electronic devices connected with the load RL in the to-be-tested circuit.
[0081] The circuit board provided by the embodiments of the present application can be a circuit board for laying a detection chip in an electronic device. The to-be-tested circuit of the electronic device can be laid on the circuit board, or the to-be-tested circuit can also be laid outside the circuit board. The detection chip is connected with the to-be-tested circuit, so as to perform current detection on the to-be-tested circuit when the to-be-tested circuit is in a working state. The circuit board provided by the embodiments of the present application does not limit the specific laying manner of the detection chip (or the detection chip and the to-be-tested circuit) on the circuit board.
[0082] The current detection method provided by the embodiments of the present application is applied to the detection chip described above. That is, the detection chip performs the current detection method provided by the embodiments of the present application to perform current detection on the to-be-tested circuit in the electronic device, and after performing current detection on the to-be-tested circuit to obtain a current measurement value, the detection chip can also calibrate the current measurement value by using the current calibration value to obtain an actual current value.
[0083] In some embodiments, the detection chip is coupled with a detection resistor of the to-be-detected circuit in the electronic device through a detection circuit. In this way, when the to-be-detected circuit is in a working state, the detection chip can control the detection circuit to perform current detection on the detection resistor. In addition, the detection chip is newly configured with an auxiliary circuit inside the chip, and the auxiliary circuit is coupled with the detection resistor in the to-be-detected circuit. In this way, when the to-be-detected circuit is not enabled and thus in a non-working state, the detection chip can first control the auxiliary circuit to input a current to the detection resistor, and at the same time, control the detection circuit to measure a current measurement value of the detection resistor under the condition that the current passes through the detection resistor, and further calculate a current calibration value of the detection resistor based on an actual size of the current input by the auxiliary circuit to the detection resistor and the measured current measurement value of the detection resistor. Thus, when the to-be-detected circuit enters the working state, if the detection chip performs current detection on the detection resistor, the detection chip can perform self-calibration on the current measurement value of the detection resistor measured by the detection circuit based on the current calibration value obtained before, to obtain an actual current value of the detection resistor after calibration. Among them, when the detection resistor is arranged in the main trunk of the to-be-detected circuit, the actual current value is also the current value of the current transmitted in the entire to-be-detected circuit, and when the detection resistor is in series with the load, the actual current value is also the current value of the current in the load.
[0084] As shown in Figure 6 The detection chip mainly includes an auxiliary circuit and a detection circuit. The auxiliary circuit is provided with a first port A, a second port B and a third port C, the first port A is coupled with a first end of a detection resistor R_SENS in the to-be-detected circuit, the second port B is coupled with a second end of the detection resistor R_SENS, and the third port C is coupled with a ground terminal GND. The detection circuit is also coupled with the first port A and the second port B provided by the auxiliary circuit. In addition, in the to-be-detected circuit, in addition to including the detection resistor R_SENS and the load RL, the to-be-detected circuit also includes a voltage power supply VCC and an enable switch LOAD-EN. The first end of the detection resistor R_SENS is connected with the voltage power supply VCC, and the second end of the detection resistor R_SENS is connected with the first end of the enable switch LOAD-EN, and the second end of the enable switch LOAD-EN is connected with the ground terminal GND.
[0085] It should be noted that the first port A of the auxiliary circuit can be a pin of the detection chip for connecting with the first end of the detection resistor R_SENS, and the second port B of the auxiliary circuit can be a pin of the detection chip for connecting with the second end of the detection resistor R_SENS. In addition, the voltage power supply VCC can be a voltage provided by a battery in an electronic device to which the detection chip belongs, or the voltage power supply VCC can also be a voltage obtained by the circuit board performing step-up and step-down processing on the voltage provided by the battery in the electronic device after the battery provides the voltage to the circuit board. It should be understood that the voltage power supply VCC can also be other voltages different from the above according to different design needs of actual applications, but no matter what type the voltage power supply VCC is, as long as the voltage power supply VCC is used to enable the to-be-detected circuit in which the detection resistor R_SENS is located to enter a working state and belongs to the technical concept of the present application, it should be included in the protection scope of the embodiments of the present application.
[0086] Based on this, when the enable switch LOAD-EN is turned off to make the to-be-detected circuit in a non-working state, the detection chip controls the auxiliary circuit to introduce a first current from the first end of the detection resistor R_SENS through the first port A, so as to form a path 1 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the first port A, the third port C and the ground end GND are sequentially connected in series. The current on the path 1 is the first current. In addition, the detection chip also controls the auxiliary circuit to introduce a second current from the second end of the detection resistor R_SENS through the second port B, so as to form a path 2 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the second end of the detection resistor R_SENS, the second port B, the third port C and the ground end GND are sequentially connected in series. The current on the path 2 is the second current, and the current value of the second current is equal to that of the first current.
[0087] Since the path 1 and the path 2 are formed at the same time, the first current does not pass through the detection resistor R_SENS, but the second current passes through the detection resistor R_SENS, so only the second current generates a detection voltage across the detection resistor R_SENS. Therefore, the detection chip controls the detection circuit to perform current detection on the detection resistor R_SENS at this time, and the detection circuit can read the voltage measurement value generated by the second current across the detection resistor R_SENS through the first port A and the second port B. Then, the detection chip can obtain the current measurement value a of the detection resistor R_SENS at this time by dividing the voltage measurement value by the resistance value of the detection resistor R_SENS. Further, the detection chip can obtain the current calibration value of the detection resistor R_SENS by dividing the current measurement value a by the current value of the second current. Alternatively, the detection chip can also obtain the current calibration value of the detection resistor R_SENS by dividing the current value of the second current by the current measurement value a.
[0088] In some embodiments, the detection chip can also obtain a current calibration value through the above process after changing the magnitude of the current value of the first current and the current value of the second current each time. In this way, the detection chip obtains multiple current calibration values by changing the magnitude of the current value of the first current and the current value of the second current multiple times, calculates the average of the multiple current calibration values, and takes the average as the current calibration value of the detection resistor R_SENS.
[0089] After obtaining the current calibration value of the detection resistor R_SENS, the detection chip controls the detection circuit to perform formal current detection on the detection resistor R_SENS when the enable switch LOAD-EN is closed to enable the to-be-detected circuit to be in the working state. At this time, the detection circuit also reads the voltage measurement value between the two ends of the detection resistor R_SENS through the first port A and the second port B, and divides the voltage measurement value by the resistance value of the detection resistor R_SENS to obtain the current measurement value b of the detection resistor R_SENS at this time. Then, when the current calibration value is obtained by dividing the current measurement value a by the second current value, the detection chip calibrates the current measurement value b by dividing the current measurement value b by the current calibration value to obtain the actual current value of the detection resistor R_SENS. Alternatively, when the current calibration value is obtained by dividing the second current value by the current measurement value a, the detection chip multiplies the current measurement value b by the current calibration value to calibrate the current measurement value b to obtain the actual current value of the detection resistor R_SENS.
[0090] It should be noted that in the embodiments of the present application, when the detection chip controls the detection circuit to perform formal current detection on the detection resistor, it also controls the auxiliary circuit not to generate the first current at the first port and not to generate the second current at the second port. In addition, in the embodiments of the present application, the current values of the first current and the second current can be obtained by a current sensor in advance, for example, the first current value and the second current value can be 1000 milliampere (mA). It should be understood that based on different design needs of actual applications, the first current value and the second current value can of course be other magnitudes in different embodiments, and the current detection method provided by the embodiments of the present application is not limited to the specific magnitude of the first current value and the second current value.
[0091] In the embodiment of the present application, in the case that an auxiliary circuit is newly arranged inside the detection chip, the detection chip controls the auxiliary circuit to generate the same size of current at the first port and the second port when the to-be-detected circuit is in the non-working state, controls the detection circuit to accurately measure the current measurement value a of the detection resistor, and calculates the ratio between the current measurement value a and the current value of the second current, taking the ratio as the current calibration value of the detection resistor. Then, when the to-be-detected circuit is in the working state, the detection chip controls the detection circuit to perform current detection on the detection resistor to obtain the current measurement value b of the detection resistor, and calibrates the current measurement value b using the current calibration value to obtain the actual current value of the detection resistor when the to-be-detected circuit is in the working state. That is, the embodiment of the present application only needs to control the auxiliary circuit arranged inside the detection chip, and can obtain the current calibration value by combining the algorithm, so that the current measurement value is automatically calibrated using the current calibration value when the current detection is performed on the detection resistor, and the calibrated actual current value is obtained. Therefore, compared with the current detection mode that depends on external equipment to calibrate the measurement value, the embodiment of the present application can effectively save the cost of manpower, time and equipment and improve the efficiency of current detection and calibration under the premise of ensuring accurate current detection.
[0092] In some embodiments, considering that the to-be-detected circuit in the detection chip is affected by the environment, the current measurement value is also prone to deviate from the actual current value, therefore, the detection chip can also determine whether the to-be-detected circuit has a deviation error when the to-be-detected circuit is in the non-working state. If the detection chip determines that the to-be-detected circuit does not have a deviation error, the detection chip directly obtains the current calibration value using the current measurement value a in the process of obtaining the current calibration value, and directly calibrates the current measurement value b using the current calibration value in the process of performing formal current detection on the detection resistor, so that the accurate actual current value of the detection resistor can be obtained. However, if the detection chip determines that the to-be-detected circuit has a deviation error, the detection chip first eliminates the deviation error, and then obtains the current calibration value using the current measurement value a after the elimination of the deviation error in the process of obtaining the current calibration value. Moreover, in the process of performing formal current detection on the detection resistor, the detection chip also first eliminates the deviation error, and then calibrates the current measurement value b after the elimination of the deviation error using the current calibration value, so that the accurate actual current value of the detection resistor can be obtained.
[0093] Therefore, the detection chip directly controls the detection circuit to perform current detection on the detection resistor when the to-be-detected circuit is in the non-working state. Since there is no current flowing through the detection resistor at this time, once the detection circuit can detect that there is a voltage between the two ends of the detection resistor, the detection chip determines that the detection resistor has a deviation error. Conversely, if the detection circuit cannot detect that there is a voltage between the two ends of the detection resistor at this time, the detection chip determines that the detection resistor does not have a deviation error.
[0094] The detection chip divides the voltage measurement value read by the detection circuit at this time by the resistance value of the detection resistor, thereby obtaining the current measurement value of the detection resistor at this time, and the detection chip also takes the current measurement value as the current offset value c of the detection resistor.
[0095] After that, the detection chip controls the auxiliary circuit to generate the first current at the first port and the second current at the second port at the same time when the to-be-detected circuit is in the non-working state, and controls the detection circuit to perform current detection on the detection resistor to obtain the current measurement value a2' of the detection resistor. After that, the detection chip first subtracts the current offset value c from the current measurement value a2', and then divides the difference between the current measurement value a2' and the current offset value c by the current value of the second current, thereby obtaining the current calibration value of the detection resistor after eliminating the offset error.
[0096] After that, the detection chip controls the detection circuit to perform formal current detection on the detection resistor when the to-be-detected circuit is in the working state, thereby obtaining the current measurement value b2' of the detection resistor. At this time, the detection chip still first subtracts the current offset value c from the current measurement value b2' to eliminate the offset error of the current measurement value b2'. Then, the detection chip divides the difference between the current measurement value b2' and the current offset value c by the current calibration value of the detection resistor after eliminating the offset error, thereby obtaining the accurate actual current value b2 of the detection resistor after calibration.
[0097] In some embodiments, the detection circuit can include an analog-to-digital converter. The analog-to-digital converter can be coupled with the first port A and the second port B of the auxiliary circuit respectively, to read the voltage measurement value between the two ends of the detection resistor, and divide the read voltage measurement value by the resistance value of the detection resistor to measure the current measurement value of the detection resistor. Exemplarily, the digital-to-analog converter reads the voltage difference (analog voltage value) between the voltage at the first end of the detection resistor and the voltage at the second end of the detection resistor through the first port A and the second port B, and then converts the analog voltage value into a digital signal form of voltage value, to take the voltage value as the voltage measurement value between the two ends of the detection resistor.
[0098] It should be noted that the analog-to-digital converter can be a double-ended full-differential input analog-to-digital converter ADC, or the analog-to-digital converter can also be a single-ended full-differential analog-to-digital converter ADC. It should be understood that the specific type of analog-to-digital converter can be different in different embodiments based on different design needs of actual applications, and the embodiments of the present application are not limited to the specific type of analog-to-digital converter. As long as the analog-to-digital converter is used to read the voltage difference across the detection resistor in the detection circuit for current detection of the detection resistor, and belongs to the technical concept of the embodiments of the present application, it should be included in the protection scope of the embodiments of the present application.
[0099] In addition, for the convenience of description and understanding, hereinafter the double-ended full-differential input analog-to-digital converter ADC or the single-ended full-differential analog-to-digital converter ADC described above is replaced by the analog-to-digital converter ADC, and the specific implementation of the embodiments of the present application is described.
[0100] In some embodiments, in order to improve the detection accuracy of the detection circuit to the voltage measurement value across the detection resistor, the detection circuit can further include a voltage amplifier to amplify the voltage difference across the detection resistor through the voltage amplifier. In this way, the analog-to-digital converter can convert the amplified analog voltage value across the detection resistor R_SENS into a digital signal form of the voltage measurement value.
[0101] As Figure 7As shown, the voltage amplifier in the detection circuit can be a full differential amplifier FDA. The full differential amplifier FDA is connected with the detection resistance R_SENS through the first port A and the second port B provided by the auxiliary circuit, and the back end of the full differential amplifier FDA is coupled with the analog-to-digital converter ADC. That is, the full differential amplifier FDA includes ports 1 to 4, wherein the ports 1 and 3 are negative ports, and the ports 2 and 4 are positive ports. The port 1 of the full differential amplifier FDA is connected with the first port A, thereby being connected with the first end of the detection resistance R_SENS; the port 2 of the full differential amplifier FDA is connected with the second port B, thereby being connected with the second end of the detection resistance R_SENS. In addition, the port 3 of the full differential amplifier FDA is coupled with the first pin INM of the analog-to-digital converter ADC, and the port 4 of the full differential amplifier FDA is coupled with the second pin INP of the analog-to-digital converter ADC. In this way, when the detection resistance R_SENS generates a detection voltage at both ends due to the current passing through, the detection voltage will be read by the analog-to-digital converter ADC after anti-interference amplification processing by the full differential amplifier FDA, and converted into a voltage measurement value of a digital signal. Thus, the detection chip can divide the voltage measurement value by the resistance value of the detection resistance R_SENS to measure the current measurement value of the detection resistance R_SENS. That is, the embodiment of the present application can enable the detection circuit to measure the current measurement value of the detection resistance based on the first port and the second port provided by the auxiliary circuit. And, the embodiment of the present application can enable the analog-to-digital converter to more conveniently read the voltage measurement value of the detection resistance by adding the full differential amplifier to amplify the voltage at both ends of the detection resistance before the analog-to-digital converter, thereby improving the accuracy and reliability of the detection chip in controlling the detection circuit to detect the current of the detection resistance.
[0102] In some embodiments, the auxiliary circuit can include a first current source and a second current source. The first current source and the second current source can be mirror current sources. Wherein the first end of the first current source is coupled with the first port, and the second end of the first current source is coupled with the ground end. The first end of the second current source is coupled with the second port, and the second end of the second current source is coupled with the ground end. In this way, the detection chip can generate a first current at the first port through the first current source and a second current at the second port through the second current source when the to-be-detected circuit is in a non-working state.
[0103] As Figure 8As shown, in the auxiliary circuit, the first end of the first current source IS1 is positive, the second end is negative, and the positive end of the first current source IS1 is coupled to the first port A, and the negative end of the first current source IS1 is coupled to the ground terminal GND as one of the third ports C of the auxiliary circuit. In addition, the first end of the second current source IS2 is also positive, the second end is also negative, and the positive end of the second current source IS2 is coupled to the second port B, and the negative end of the second current source IS2 is coupled to the ground terminal GND as another third port C of the auxiliary circuit. Therefore, the detection chip can control the first current source IS1 to introduce the first current from the first end of the detection resistor R_SENS through the first port A to form a path 1 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the first port A, the first current source IS1 and the ground terminal GND are sequentially connected. At the same time, the detection chip also controls the second current source IS2 to introduce the second current from the second end of the detection resistor R_SENS through the second port B to form a path 2 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the second end of the detection resistor R_SENS, the second port B, the second current source IS2 and the ground terminal GND are sequentially connected.
[0104] In some embodiments, in the case of including the first current source and the second current source in the auxiliary circuit of the detection chip, the detection chip can pre-configure a plurality of current values in the first current source and the second current source, respectively. For example, the detection chip can configure at least one current value of 0 in the first current source and the second current source, and configure a first current value greater than 0 in the first current source, and configure a second current value equal to the first current value in the second current source.
[0105] Based on this, when the to-be-detected circuit is in a non-working state, the detection chip controls the first current source to introduce a current value of 0 through the first port A, switches to introduce a first current with a current value greater than 0 through the first port A to form a path 1, and controls the second current source to introduce a current value of 0 through the second port B, and switches to introduce a second current with a current value greater than 0 through the second port B to form a path 2.
[0106] It should be noted that the first current source and the second current source are each configured with multiple current values, which can be calibrated in advance by the current sensor. For example, before the detection chip is shipped, the current value greater than 0 configured by the first current source is calibrated as the current value of the first current by the current sensor, and the current value configured by the second current source which is the same as the current value of the first current is calibrated as the current value of the second current. Then, the current value of the first current and the current value of the second current can be stored in the detection chip or the electronic device to which the detection chip belongs. Thus, when the detection chip controls the first current source to form the path 1 and controls the second current source to form the path 2, the detection chip can at least call the current value of the second current to calculate the ratio of the current value of the second current to the current measurement value b, so as to obtain the current calibration value of the detection resistor.
[0107] In some embodiments, since the current value of the first current is equal to the current value of the second current, when the detection chip controls the first current source to generate the first current at the first port and controls the second current source to generate the second current at the second port, the detection chip can also design the length of the wire between the first end of the detection resistor and the first current source IS1 to be consistent with the length of the wire between the first end of the detection resistor R_SENS and the second current source IS2, so as to realize that the resistance voltage drop generated when the first current is transmitted in the path 1 can be offset by the resistance voltage drop generated when the second current is transmitted in the path 2. Thus, when the detection chip controls the detection circuit to obtain the current calibration value of the detection resistor, the detection chip can accurately measure the current measurement value a of the detection resistor in the case that the resistance voltage drop of the second current is offset by the resistance voltage drop of the first current. Thus, the detection chip can obtain a more accurate current calibration value based on the accurate current measurement value a and the current value of the second current, and then the detection chip can obtain a more accurate actual current value of the detection resistor by using the current calibration value to calibrate the current measurement value b of the detection resistor. That is, the embodiments of the present application can realize more accurate current detection of the detection resistor.
[0108] In some embodiments, the auxiliary circuit can further include a first switch and a second switch. The first switch and the second switch can each be a switch only having an "on" function and an "off" function. The first switch can be connected in series between the first port and the first current source, or the first switch can also be connected in series between the first current source and the ground. The second switch can be connected in series between the second port and the second current source, or the second switch can also be connected in series between the second current source and the ground.
[0109] As Figure 9As shown, in the auxiliary circuit, a first switch SW1 is connected in series between the first port A and the first current source IS1, and a second switch SW2 is connected in series between the second port B and the second current source IS2. Thus, when the circuit under test is in the non-working state, the detection chip only needs to control the first switch SW1 to be closed, so as to generate the first current at the first port A, thereby forming a path 1 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the first port A, the first switch SW1, the first current source IS1 and the ground terminal GND are connected in series. At this time, the first current source IS1 continuously introduces the first current from the first end of the detection resistor R_SENS. In addition, the detection chip controls the second switch SW2 to be closed, so as to generate the second current at the second port B, thereby forming a path 2 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the second end of the detection resistor R_SENS, the second port B, the second switch SW2, the second current source IS2 and the ground terminal GND are connected in series. At this time, the second current source continuously introduces the second current from the second end of the detection resistor R_SENS.
[0110] In some other embodiments, the auxiliary circuit can also be coupled with the current sources on the circuit board where the detection chip is located, so as to generate the first current at the first port and the second current at the second port through the current sources on the circuit board. For example, the circuit board where the detection chip is located includes a first current source and a second current source. The auxiliary circuit includes a first port, a second port, a fourth port and a fifth port. The first port is coupled with the first end of the detection resistor, and the second port is coupled with the second end of the detection resistor. In addition, the first current source on the circuit board is coupled with the fourth port, and the second current source on the circuit board is coupled with the fifth port. Thus, when the circuit under test is in the non-working state, the detection chip controls the first current source and the second current source on the circuit board at the same time, so as to make the first current source generate the first current at the first port, and make the second current source generate the second current at the second port.
[0111] As Figure 10As shown, in the auxiliary circuit, the first port A is coupled with the first end of the detection resistor R_SENS, and the second port is coupled with the second end of the detection resistor R_SENS. In addition, the circuit board on which the detection chip is located includes a first current source IS1 and a second current source IS2. The first end of the first current source IS1 is positive, and the second end is negative. The positive pole of the first current source IS1 is coupled with the fourth port D of the auxiliary circuit on the detection chip, and the negative pole of the first current source IS1 is coupled with the ground terminal GND. The first end of the second current source IS2 is also positive, and the second end is also negative. The positive pole of the second current source IS2 is coupled with the fifth port E of the auxiliary circuit on the detection chip, and the negative pole of the second current source IS2 is coupled with the ground terminal GND. Thus, when the circuit under test is in a non-working state, the detection chip can control the first current source IS1 to pass through the first port A, the first switch SW1 and the fourth port D to lead the first current from the first end of the detection resistor R_SENS, to form a path 1 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the first port A, the fourth port D, the first current source IS1 and the ground terminal GND are connected in series. At the same time, the detection chip controls the second current source IS2 to pass through the second port B, the second switch SW2 and the fifth port E to lead the second current from the second end of the detection resistor R_SENS, to form a path 2 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the second end of the detection resistor R_SENS, the second port B, the fifth port E, the second current source IS2 and the ground terminal GND are connected in series.
[0112] It should be noted that the fourth port D of the auxiliary circuit can be a pin of the detection chip for connecting with the first end of the first current source IS1, and the fifth port E of the auxiliary circuit can be a pin of the detection chip for connecting with the first end of the second current source.
[0113] In other embodiments, the auxiliary circuit can also include a first switch and a second switch. The first port is coupled with the first end of the detection resistor, the second port is coupled with the second end of the detection resistor, the first switch is connected in series between the first port and the fourth port, and the second switch is connected in series between the second port and the fifth port. In addition, the first current source on the circuit board is coupled with the fourth port, and the second current source on the circuit board is coupled with the fifth port. In this way, when the circuit under test is in a non-working state, the detection chip can control the first switch and the second switch to be closed at the same time, so as to make the first current source on the circuit board generate the first current at the first port, and make the second current source on the circuit board generate the second current at the second port.
[0114] As Figure 11As shown, in the auxiliary circuit, the first port A is coupled with the first end of the detection resistor R_SENS, and the second port is coupled with the second end of the detection resistor R_SENS. The first switch SW1 is connected in series between the first port A and the fourth port D, and the second switch SW2 is connected in series between the second port B and the fifth port E. In addition, the circuit board where the detection chip is located includes a first current source IS1 and a second current source IS2. The first end of the first current source IS1 is positive, and the second end is negative. The positive end of the first current source IS1 is coupled with the fourth port D of the auxiliary circuit on the detection chip, and the negative end of the first current source IS1 is coupled with the ground terminal GND. The first end of the second current source IS2 is also positive, and the second end is also negative. The positive end of the second current source IS2 is coupled with the fifth port E of the auxiliary circuit on the detection chip, and the negative end of the second current source IS2 is coupled with the ground terminal GND. Thus, when the circuit under test is in a non-working state, the detection chip can control the first switch SW1 to be closed, so that the first current source IS1 passes through the first port A, the first switch SW1 and the fourth port D to introduce a first current from the first end of the detection resistor R_SENS, to form a path 1 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the first port A, the first switch SW1, the fourth port D, the first current source IS1 and the ground terminal GND are connected in series. At the same time, the detection chip controls the second switch SW2 to be closed, so that the second current source IS2 passes through the second port B, the second switch SW2 and the fifth port E to introduce a second current from the second end of the detection resistor R_SENS, to form a path 2 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the second end of the detection resistor R_SENS, the second port B, the second switch SW2, the fifth port E, the second current source IS2 and the ground terminal GND are connected in series.
[0115] In some other embodiments, the circuit board where the detection chip is located further includes a first switch and a second switch. That is, the auxiliary circuit on the detection chip includes a first port, a second port, a fourth port and a fifth port. The first port is coupled with the first end of the detection resistor, the second port is coupled with the second end of the detection resistor, the first port is directly coupled with the fourth port, and the second port is directly coupled with the fifth port. On the circuit board, the first end of the first switch is coupled with the fourth port of the auxiliary circuit, the first current source is coupled with the second end of the first switch, the first end of the second switch is coupled with the fifth port of the auxiliary circuit, and the second current source is coupled with the second end of the second switch. In this way, when the circuit under test is in a non-working state, the detection chip can still control the first switch and the second switch to be closed at the same time, so that the first current source generates a first current at the first port, and the second current source generates a second current at the second port.
[0116] As Figure 12As shown, in the auxiliary circuit, the first port A is coupled with the first end of the detection resistor R_SENS, and the second port is coupled with the second end of the detection resistor R_SENS. In addition, on the circuit board where the detection chip is located, the first end of the first switch SW1 is coupled with the fourth port D, the second end of the first switch SW1 is coupled with the first end (positive pole) of the first current source IS1, the first end of the second switch SW2 is coupled with the fifth port E, and the second end (negative pole) of the first current source IS1 is coupled with the ground terminal GND. Moreover, on the circuit board, the second end of the second switch SW2 is coupled with the first end (positive pole) of the second current source IS2, and the second end (negative pole) of the second current source IS2 is coupled with the ground terminal GND. Thus, when the circuit under test is in the non-working state, the detection chip can control the first switch SW1 to be closed through the circuit board, so as to make the first current source IS1 pass through the first port A, the first switch SW1 and the fourth port D to lead the first current from the first end of the detection resistor R_SENS, so as to form a path 1 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the first port A, the first switch SW1, the fourth port D, the first current source IS1 and the ground terminal GND are sequentially connected in series. At the same time, the detection chip controls the second switch SW2 to be closed, so as to make the second current source IS2 pass through the second port B, the second switch SW2 and the fifth port E to lead the second current from the second end of the detection resistor R_SENS, so as to form a path 2 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the second end of the detection resistor R_SENS, the second port B, the second switch SW2, the fifth port E, the second current source IS2 and the ground terminal GND are sequentially connected in series.
[0117] After the voltage power supply VCC in the circuit under test is enabled so that the circuit under test enters the working state, the detection chip also controls the first switch and the second switch to be opened, so as to ensure that, when the circuit under test is in the working state, only the current provided by the voltage power supply VCC flows through the detection resistor, so that the detection chip can control the detection circuit to formally perform current detection on the detection resistor.
[0118] It should be noted that, in addition to being able to simultaneously control the first switch SW1 and the second switch SW2 to be closed or opened, the detection chip can of course separately control the first switch SW1 and the second switch SW2, so as to make the first switch SW1 be closed and the second switch SW2 be opened, or make the first switch SW1 be opened and the second switch SW2 be closed.
[0119] The first switch and the second switch are controlled to be closed by the detection chip, so that the first current source is controlled to generate the first current at the first port, and the second current source is controlled to generate the second current at the second port. Then, the detection chip can control the detection circuit to calculate the current calibration value of the detection resistor based on the voltage generated by the second current at both ends of the detection resistor, so as to calibrate the current measurement value of the detection resistor when the to-be-detected circuit is in the working state, thereby obtaining the actual current value of the detection resistor. That is, the current calibration value of the detection resistor can be obtained more simply and quickly by controlling the first switch and the second switch in the embodiment of the application, thereby further improving the efficiency of current detection and calibration.
[0120] In some embodiments, the to-be-detected circuit further includes a filtering sub-circuit, the filtering sub-circuit is coupled with the detection resistor, and the first port and the second port of the auxiliary circuit are respectively coupled with the filtering sub-circuit. The filtering sub-circuit can be a circuit design for filtering and noise reduction in the to-be-detected circuit. The filtering sub-circuit can include a first resistor, a second resistor and a capacitor. The first end of the first resistor is coupled with the first end of the detection resistor, and the second end of the first resistor is coupled with the first port in the auxiliary circuit. When the detection chip controls the auxiliary circuit to generate the first current at the first port, the first current will pass through the first resistance value, thereby generating a first voltage value at both ends of the first resistor. In addition, the first end of the second resistor is coupled with the second end of the detection resistor, and the second end of the second resistor is coupled with the second port. When the detection chip controls the auxiliary circuit to generate the second current at the second port, the second current will pass through the second resistance value, thereby generating a second voltage value at both ends of the second resistor. Furthermore, the capacitor is connected in series between the second end of the first resistor and the second end of the second resistor, and is mainly used to block the path between the second end of the first resistor and the second end of the second resistor. In this way, the detection circuit can detect the current of the detection resistor by using the first port and the second port.
[0121] It should be noted that the first resistor and the second resistor can not be actual resistor devices. In addition, in some embodiments, the first resistor and the second resistor can also be resistors designed to offset the resistance voltage drops generated in the respective circuit traces of the first current and the second current. The specific type of the first resistor and the second resistor is not limited in the embodiment of the application.
[0122] As Figure 13As shown, the first resistor R1, the second resistor R2 and the capacitor C1 included in the to-be-tested circuit together constitute the above-mentioned filtering sub-circuit. The first end of the first resistor R1 is coupled with the first end of the detection resistor R_SENS, and the second end of the first resistor R1 is coupled with the first port A provided by the auxiliary circuit in the detection chip. The first end of the second resistor R2 is connected with the second end of the detection resistor R_SENS, and the second end of the second resistor R2 is coupled with the second port B provided by the auxiliary circuit. In addition, the first end of the capacitor C1 is coupled with the second segment of the first resistor R1, and the second end of the capacitor C1 is coupled with the second end of the second resistor R2. In this way, since the detection circuit in the detection chip is coupled with the first port A and the second port B respectively, when the detection voltage is generated at both ends of the detection resistor R_SENS, the detection chip controls the detection circuit at the first port A and the second port B, so that the detection voltage at both ends of the detection resistor R_SENS can be read, and the detection voltage is also the detection voltage after the noise is filtered out by the filtering sub-circuit. Further, the detection chip divides the voltage measurement value of the detection voltage at both ends of the detection resistor R_SENS read by the detection circuit by the resistance value of the detection resistor R_SENS, so as to measure the current measurement value of the detection resistor R_SENS.
[0123] Based on this, when the to-be-tested circuit is in a non-working state, the detection chip controls the first switch SW1 and the second switch SW2 to be closed, so as to form a path 1 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the first resistor R1, the first port A, the first switch SW1, the first current source IS1 and the ground terminal GND are sequentially connected in series, and form a path 2 in which the voltage power supply VCC, the first end of the detection resistor R_SENS, the second end of the detection resistor R_SENS, the second resistor R2, the second port B, the second switch SW2, the second current source IS2 and the ground terminal GND are sequentially connected in series. At this time, since the first current flows through the path 1, and the first current passes through the first resistor R1, the first current will generate a detection voltage at both ends of the first resistor R1. In addition, in the path 2, the second current will pass through the detection resistor R_SENS and the second resistor R2, so that the second current will generate a detection voltage at both ends of the detection resistor R_SENS and both ends of the second resistor R2.
[0124] In this way, the detection chip controls the detection circuit to perform current detection on the detection resistor R_SENS at this time, and the detection circuit can read the first voltage value U R1 and the second voltage value U R2and the third voltage value Ut1 across the detection resistor R_SENS is obtained. Then, the detection chip divides the third voltage value Ut1 by the resistance value of the detection resistor R_SENS to measure the current measurement value a of the detection resistor R_SENS at this time. And the detection chip compares the current measurement value a with the current value of the second current to take the ratio between the current measurement value a and the second current value as the current calibration value of the detection resistor R_SENS.
[0125] After the circuit under test enters the working state, the detection chip also controls the detection circuit to read the detection voltage across the first resistor R1, the detection voltage across the detection resistor R_SENS, and the detection voltage across the second resistor R2 through the first port A and the second port B, and to obtain the total voltage measurement value U2 of the three detection voltages, and to calculate the voltage measurement value Ut2 of the detection voltage across the detection resistor R_SENS at this time by combining the current value of the first current or the second current, the resistance value of the first resistor, and the resistance value of the second resistor, and to divide the voltage measurement value Ut2 by the resistance value of the detection resistor R_SENS to measure the current measurement value b of the detection resistor R_SENS at this time. Then, the detection chip calibrates the current measurement value b by using the current calibration value to obtain the actual current value of the detection resistor R_SENS at this time. For example, when the current calibration value is obtained by dividing the current measurement value a by the second current value, the detection chip divides the current measurement value b by the current calibration value to calibrate the current measurement value b to obtain the actual current value. When the current calibration value is obtained by dividing the second current value by the current measurement value a, the detection chip multiplies the current measurement value b by the current calibration value to calibrate the current measurement value b to obtain the actual current value.
[0126] It should be noted that after the detection chip controls the detection circuit to measure the voltage measurement value U1, the detection chip subtracts the first voltage value U R1 , the second voltage value U R2 across the second resistor R2 from the voltage measurement value U1 to obtain the third voltage value Ut1 of the detection voltage across the detection resistor R_SENS. Since the first current flows from the first port A to the first terminal of the detection resistor R_SENS when the detection circuit reads the voltage measurement value U1 through the first port A and the second port B, the first voltage value U R1should be negative. Thus, the calculation formula of the third voltage value Ut1 is: Ut1 = U1 - U R2 + U R1 Among them, the first voltage value U R1 is equal to the current value of the first current multiplied by the resistance value of the first resistor R1, and the second voltage value U R2 is equal to the current value of the second current multiplied by the resistance value of the second resistor R2.
[0127] In addition, the detection chip combines the voltage measurement value U2, the current value of the first current or the second current, the resistance value of the first resistor and the resistance value of the second resistor to calculate to obtain the voltage measurement value Ut2. Similar to the principle of calculating the voltage measurement value Ut1 by the detection chip, too much repetition is not described here.
[0128] In the embodiments of the present application, because the filter subcircuit is configured between the detection resistor and the first port and the second port provided by the auxiliary circuit, when the detection voltage is generated across the detection resistor, the detection voltage will be filtered by the filter subcircuit and then supplied to the detection circuit through the first port and the second port to be read to obtain the current measurement value of the detection resistor by dividing the detection voltage by the resistance value of the detection resistor by the detection circuit or the detection chip. In this way, it can be ensured that the detection circuit can stably and reliably read the voltage across the detection resistor, so as to measure the accurate current measurement value of the detection resistor. Further, when the detection chip executes the current detection method provided by the embodiments of the present application, the current calibration value is obtained based on the more accurate current measurement value, and the current calibration value is used to calibrate the current measurement value in the formal current detection process, which can further improve the accuracy of the actual current value finally measured.
[0129] In some embodiments, the resistance value of the first resistor R1 and the resistance value of the second resistor R2 can be pre-calibrated and stored in the detection chip (or stored in the electronic device to which the detection chip belongs), so that the detection chip can be called when calculating the voltage measurement value Ut1 or Ut2 described above. It should be understood that, based on different design needs of actual applications, the resistance value of the first resistor R1 and the resistance value of the second resistor R2 can of course be different in different implementations. That is, the circuit detection method provided by the embodiments of the present application does not limit the specific size of the resistance value of the first resistor R1 and the second resistor R2.
[0130] In other embodiments, the resistance values of the first resistor R1 and the second resistor R2 can also be obtained by the detection chip through the auxiliary circuit and the detection circuit respectively when the circuit under test is in a non-operating state. That is, when the circuit under test is in a non-operating state, the detection chip controls the auxiliary circuit to generate a third current at the first port and controls the detection circuit to detect the current of the first resistor, thereby calculating the resistance value of the first resistor based on the current value of the third current. Furthermore, when the circuit under test is in a non-operating state, the detection chip controls the auxiliary circuit to generate a fourth current at the second port and controls the detection circuit to detect the current of the second resistor, thereby calculating the resistance value of the second resistor based on the current value of the fourth current.
[0131] like Figure 13 As shown, when the current to be measured is in a non-operating state, the detection chip first controls the first current source IS1 to generate a third current at the first port A, and controls the detection circuit to perform current detection on the first resistor R1 at this time. Therefore, the detection circuit reads the voltage measurement value U across the first resistor R1 at this time through the analog-to-digital converter. R1 Then, the detection chip will take the voltage measurement value U R1 Dividing by the value of the third current yields the resistance value of the first resistor R1. Furthermore, while the circuit under test is still in an inactive state, the detection chip controls the second current source IS2 to generate a fourth current at port B, and simultaneously controls the detection circuit to detect the current across the second resistor R2. The detection circuit then reads the measured voltage U across the second resistor R2 via an analog-to-digital converter. R2 Then, the detection chip will take the voltage measurement value U R2 By dividing by the value of the fourth current, the resistance of the second resistor R2 can be measured.
[0132] It should be noted that when the auxiliary circuit generates a third current at the first port, this third current does not pass through the sensing resistor and the second resistor. Therefore, the voltage measurement value read by the sensing circuit through the first and second ports is the voltage value of the sensing voltage across the first resistor. Figure 13 As shown, when the auxiliary circuit generates a third current only at the first port A, the potential at the second port B is the same as the potential at the first terminal of the sensing resistor R_SENS. Therefore, the sensing circuit can read the voltage measurement value across the first resistor through the first port A and the second port B. Based on this, the value of the third current can be the same as the value of the first current, or it can be different from the value of the first current; for example, the value of the third current can be less than the value of the first current.
[0133] In addition, since the auxiliary circuit generates the fourth current at the second port, the fourth current passes through the detection resistor and the second resistor at the same time, so that when the detection circuit reads the detection voltage between the two ends of the second resistor through the first port and the second port, if the voltage between the two ends of the detection resistor is generated, the voltage between the two ends of the detection resistor will form interference, so that the detection circuit cannot accurately read the voltage value of the detection voltage between the two ends of the second resistor, and then obtain the accurate resistance value of the second resistor. Based on this, since the resistance value of the detection resistor is usually much smaller than the resistance value of the second resistor (the difference in resistance value is more than 100 times), therefore, in the case that the current value of the fourth current is relatively small, the voltage drop of the fourth current on the detection resistor R_SENS can be ignored, so that it is defaulted that the detection circuit can read the accurate voltage value of the detection voltage between the two ends of the second resistor, and then calculate the accurate resistance value of the second resistor. In this way, in the case that the second current value is 1000 mA, the fourth current value can be 100 microamperes (uA).
[0134] In some embodiments, in the case that the current value of the fourth current is ensured to be small enough, the current value of the third current can be the same as the current value of the fourth current. For example, in the case that the current value of the first current and the current value of the second current are 1000 mA, the current value of the third current and the current value of the fourth current are both 100 uA. It should be understood that the current value of the third current and the current value of the fourth current can of course be other sizes in different embodiments based on different design needs of actual applications, and the current detection method provided by the embodiments of the present application is not limited to the specific size of the current value of the third current and the current value of the fourth current.
[0135] In some embodiments, considering the offset error of the detection circuit when detecting the current of the detection resistor, the noise data of the detection resistor, the first resistor and the second resistor, and the tolerance of the detection resistor, the first resistor and the second resistor, the accuracy of the actual current value of the detection resistor is affected to a certain extent, and the detection chip can also calibrate the tolerance of the detection resistor to obtain a more accurate resistance value of the detection resistor. Then, in the process of obtaining the current calibration value of the detection resistor and in the process of formally detecting the current of the detection resistor, the detection chip will also be more accurate by dividing the voltage measurement value read by the detection circuit by the resistance value of the detection resistor to obtain the current measurement value.
[0136] As Figure 13As shown, when the circuit under test is in non-working state, if the detection chip directly controls the detection circuit to detect the current of the detection resistor R_SENS, the detection circuit can read the detection voltage at both ends of the detection resistor R_SENS, the detection chip first records the voltage measurement value U0 read by the detection circuit at this time as the offset error of the detection circuit detecting the current of the detection resistor R_SENS. In this way, the voltage U R1 `at both ends of the first resistor R1 can be expressed as: U R1 `= U t2 `- U0 + N1, wherein U t2 `is the voltage measurement value of the detection voltage at both ends of the first resistor R1 detected by the detection circuit when the detection chip controls the auxiliary circuit to generate the third current at the first port under the condition that the circuit under test is in non-working state, and N1 is the noise data of the first resistor R1. In addition, the voltage U R2 `at both ends of the second resistor R2 can be expressed as: U R2 `= U t1 `- U0 + N2, wherein U t1 `is the voltage measurement value of the detection voltage at both ends of the second resistor R2 detected by the detection circuit when the detection chip controls the auxiliary circuit to generate the fourth current at the second port under the condition that the circuit under test is in non-working state, the current value of the fourth current is the same as that of the third current, both are I. N2 is the noise data of the second resistor R2. Furthermore, the detection voltage U R-SENS `at both ends of the detection resistor R_SENS can be expressed as: U R-SENS `= U tR-SENS `- U0 + NR_SENS, wherein U tR-SENS `is the voltage measurement value of the detection voltage at both ends of the detection resistor R_SENS detected by the detection circuit when the detection chip controls the auxiliary circuit to generate the first current at the first port and the second current at the second port under the condition that the circuit under test is in non-working state, and NR_SENS is the noise data of the detection resistor R_SENS. The current value of the first current and that of the second current are the same, both are n I, and n is a positive integer greater than or equal to 100.
[0137] In addition, because U R1 `= I (r1 + e1), the detection chip can measure the resistance R1` of the first resistor R1 = (U t2 `- U0 + N1) / I = r1 + e1 - (U0 - N1) / I. Wherein r1 is the ideal resistance of the first resistor R1, and e1 is the tolerance of the first resistor R1. And because U R2 `= I (r2 + e2 + rR_SENS + Δ), the detection chip can also measure the resistance R2` of the second resistor R2 = (U t1= (U0+ N1) / I - rR_SENS = r2+ e2+ Δ - (U0- N2) / I. Wherein, r2 is the ideal resistance of the second resistor R2, e2 is the tolerance of the second resistor R2, rR_SENS is the ideal resistance of the detection resistor R_SENS, and Δ is the tolerance of the detection resistor R_SENS.
[0138] Thus, because U R-SENS = n I (rR_SENS+ Δ) + n I R2 - n I R1, the detection chip can obtain the resistance R1' of the first resistor R1 and the resistance R2' of the second resistor R2 by substituting the respective expressions, and thus obtain:
[0139] U R-SENS = n I (rR_SENS+ Δ) + n I (r2+ e2+ Δ) - n N1 - n I (r1+ e1) - n N2, Equation 1.
[0140] The detection chip iterates Equation 1, and thus obtains:
[0141] U R-SENS / n I = rR_SENS+ Δ + r2+ e2+ Δ - N1 / I - r1 - e1 - N2 / I, Equation 2.
[0142] The detection chip further iterates Equation 2 to solve Δ, and thus obtains:
[0143] Δ = U R-SENS / 2n I - rR_SENS / 2 + e1 / 2 - e2 / 2 + N2 / 2 I + N1 / 2 I = U tR-SENS / 2n I - U0 / 2n I + NR_SENS / 2n
[0144] I - rR_SENS / 2 + e1 / 2 - e2 / 2 + N2 / 2 I + N1 / 2 I.
[0145] Thus, it is known that the tolerance Δ of the detection resistor R_SENS needs to further subtract half of the tolerance e1 of the first resistor R1 and half of the tolerance e2 of the second resistor R2 to be determined, that is, the tolerance Δ of the detection resistor R_SENS is only affected by the size of "e1 / 2-e2 / 2". Thus, regardless of the size of e1 and e2, the difference value obtained by "e1 / 2-e2 / 2" is always relatively small. Moreover, the noise data N1 of the first resistor R1, the noise data N2 of the second resistor R2, and the noise data NR_SENS of the detection resistor R_SENS can each be continuously reduced by repeatedly detecting the current of the to-be-detected circuit. Thus, the detection chip can calibrate the tolerance Δ of the detection resistor R_SENS more accurately.
[0146] Therefore, in this embodiment, when the detection chip obtains the current calibration value of the detection resistor R_SENS, it utilizes U R-SENS Dividing the current measurement by the resistance value of the sensing resistor R_SENS (rR_SENS + Δ) yields a more accurate current measurement value 'a'. Dividing the current measurement value 'a' by the second current value then yields a more accurate current calibration value. Furthermore, when the circuit under test is in operation and the sensing chip is performing formal current sensing on the sensing resistor R_SENS, the chip divides the voltage measurement across R_SENS by the resistance value (rR_SENS + Δ) to obtain a more accurate current measurement value 'b'. The chip then calibrates the current measurement value 'b' using the current calibration value to obtain the actual current value of the sensing resistor R_SENS. In other words, the current sensing method provided in this application can further improve the accuracy of the current measurement value during the current sensing process, thereby obtaining a more accurate actual current value after further calibration of the current measurement value.
[0147] In some embodiments, this application provides an electronic device that implements the current detection method described in the various embodiments above. This function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described function.
[0148] In some embodiments, this application provides an electronic device including a processor and a memory; the memory is used to store computer program code, the computer program code including computer execution instructions, and when the electronic device is running, the processor executes the computer execution instructions to cause the electronic device to perform the current detection method as described in the above embodiments.
[0149] In some embodiments, this application provides an electronic device, including: a processor; the processor is configured to be coupled to a memory, and after reading instructions from the memory, execute the current detection method described in the above embodiments according to the instructions.
[0150] In some embodiments, this application provides a computer-readable storage medium including computer instructions that, when executed on a detection chip of an electronic device, cause the detection chip to perform the current detection method as described above.
[0151] In some embodiments, this application provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the current detection method as described above.
[0152] In some embodiments, the embodiments of the present application provide a computer program product, which, when running on a detection chip of an electronic device, causes the detection chip to perform the current detection method according to any of the above embodiments.
[0153] In some embodiments, the embodiments of the present application provide a computer program product, which, when running on an electronic device, causes the electronic device to perform the current detection method according to any of the above embodiments.
[0154] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0155] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A detection chip, characterized by, The detection chip is used for current detection of a to-be-tested circuit; the detection chip comprises: An auxiliary circuit comprising a first port and a second port, the first port being coupled with a first end of a detection resistor of the to-be-tested circuit, and the second port being coupled with a second end of the detection resistor; the auxiliary circuit is configured to generate a first current at the first port and a second current at the second port when the to-be-tested circuit is in a non-working state, wherein the first current is a current not flowing through the detection resistor, and the second current is a current flowing through the detection resistor, and a current value of the first current is equal to a current value of the second current; A detection circuit coupled with the first port and the second port respectively; the detection circuit is configured to calculate a current calibration value of the detection resistor based on a voltage at the first end of the detection resistor and a voltage at the second end of the detection resistor; The detection circuit is further configured to measure a current measurement value of the detection resistor by using the first port and the second port when the to-be-tested circuit is in a working state, and calibrate the current measurement value based on the current calibration value to obtain an actual current value of the detection resistor.
2. The detection chip according to claim 1, characterized in that, The auxiliary circuit comprises: A first current source, a first end of the first current source being coupled with the first port, and a second end of the first current source being coupled with a ground terminal; the first current source is configured to generate a first current at the first port when the to-be-tested circuit is in a non-working state; A second current source, a first end of the second current source being coupled with the second port, and a second end of the second current source being coupled with a ground terminal; the second current source is configured to generate a second current at the second port when the to-be-tested circuit is in a non-working state.
3. The detection chip of claim 2, wherein, The auxiliary circuit further comprises: A first switch connected in series between the first current source and the first port, or connected in series between the first current source and the ground terminal; the first switch is configured to turn on a path between the first port and the first current source, or turn off the path between the first port and the first current source; A second switch connected in series between the second current source and the second port, or connected in series between the second current source and the ground terminal; the second switch is configured to turn on a path between the second port and the second current source, or turn off the path between the second port and the second current source.
4. The detection chip according to any one of claims 1 to 3, characterized in that, The detection circuit comprises: A digital-to-analog converter coupled with the first port and the second port respectively; the digital-to-analog converter is configured to convert a voltage difference between a voltage at the first end of the detection resistor and a voltage at the second end of the detection resistor into a voltage value of the detection resistor.
5. A circuit board, characterized by The circuit board comprises a detection chip, a first current source and a second current source; the detection chip is used for current detection of a to-be-tested circuit; The detection chip comprises an auxiliary circuit and a detection circuit; The auxiliary circuit comprises a first port, a second port, a fourth port and a fifth port, the first port is coupled with a first end of a detection resistor of the to-be-tested circuit, the second port is coupled with a second end of the detection resistor, the fourth port is coupled with the first current source, and the fifth port is coupled with the second current source; the auxiliary circuit is configured to generate a first current at the first port by the first current source and generate a second current at the second port by the second current source when the to-be-tested circuit is in a non-working state, wherein the first current is a current not flowing through the detection resistor, the second current is a current flowing through the detection resistor, and a current value of the first current is equal to a current value of the second current; The detection circuit is coupled with the first port and the second port respectively; the detection circuit is configured to calculate a current calibration value of the detection resistor based on a voltage of the first end of the detection resistor and a voltage of the second end of the detection resistor; and the detection circuit is further configured to measure a current measurement value of the detection resistor by using the first port and the second port when the to-be-tested circuit is in a working state, and calibrate the current measurement value based on the current calibration value to obtain an actual current value of the detection resistor.
6. The circuit board of claim 5, wherein, The circuit board further comprises a first switch and a second switch; The first switch is connected in series between the first current source and the fourth port, or the first switch is connected in series between the first current source and a ground terminal; the first switch is configured to turn on a path between the fourth port and the first current source, or turn off the path between the fourth port and the first current source; The second switch is connected in series between the second current source and the fifth port, or the second switch is connected in series between the second current source and a ground terminal; the second switch is configured to turn on a path between the fifth port and the second current source, or turn off the path between the fifth port and the second current source.
7. An electronic device, comprising: The electronic device comprises a to-be-tested circuit and a detection chip; the electronic device performs current detection on the to-be-tested circuit by using the detection chip; The to-be-tested circuit comprises a detection resistor and a voltage power supply, and the voltage power supply is coupled with a first end of the detection resistor; The detection chip comprises: An auxiliary circuit comprising a first port and a second port, the first port is coupled with a first end of a detection resistor of the to-be-tested circuit, and the second port is coupled with a second end of the detection resistor; the auxiliary circuit is configured to generate a first current at the first port and generate a second current at the second port when the to-be-tested circuit is in a non-working state, wherein the first current is a current not flowing through the detection resistor, the second current is a current flowing through the detection resistor, and a current value of the first current is equal to a current value of the second current; The detection circuit is configured to calculate a current calibration value of the detection resistor based on a voltage at a first end of the detection resistor and a voltage at a second end of the detection resistor; and the detection circuit is further configured to, when the circuit under test is in an operating state, measure a current measurement value of the detection resistor by using the first port and the second port, and calibrate the current measurement value based on the current calibration value to obtain an actual current value of the detection resistor.
8. The electronic device of claim 7, wherein, The circuit under test further comprises a filtering sub-circuit; The filtering sub-circuit comprises: A first resistor, a first end of the first resistor being coupled to a first end of the detection resistor, and a second end of the first resistor being coupled to the first port; the first resistor is configured to generate a first voltage value when a first current passes through; A second resistor, a first end of the second resistor being coupled to a second end of the detection resistor, and a second end of the second resistor being coupled to the second port; the second resistor is configured to generate a second voltage value when a second current passes through; A capacitor, the capacitor being connected in series between the second end of the first resistor and the second end of the second resistor, for blocking a path between the second end of the first resistor and the second end of the second resistor; The detection circuit is configured to calculate a current calibration value of the detection resistor based on a voltage at a first end of the detection resistor and a voltage at a second end of the detection resistor; and the detection circuit is further configured to, when the circuit under test is in an operating state, measure a current measurement value of the detection resistor by using the first port and the second port, and calibrate the current measurement value based on the current calibration value to obtain an actual current value of the detection resistor.
9. The electronic device of claim 7 or 8, wherein, The circuit under test further comprises a load; The load is connected in series between the first end of the detection resistor and the voltage source, or the load is connected in series between the second end of the detection resistor and a ground terminal; and the actual current value of the detection resistor is an actual current value of the load.
10. The electronic device of any of claims 7 to 9, wherein, The auxiliary circuit comprises: A first current source, a first end of the first current source being coupled to the first port, and a second end of the first current source being coupled to a ground terminal; the first current source is configured to generate a first current at the first port when the circuit under test is in a non-operating state; A second current source, a first end of the second current source being coupled to the second port, and a second end of the second current source being coupled to a ground terminal; the second current source is configured to generate a second current at the second port when the circuit under test is in a non-operating state; A length of a wire between the first end of the detection resistor and the first current source is the same as a length of a wire between the first end of the detection resistor and the second current source.
11. A current detection method characterized by, A detection chip applied to an electronic device, the detection chip comprising: an auxiliary circuit and a detection circuit; the auxiliary circuit comprising a first port and a second port, the first port being coupled to a first end of a detection resistor of a circuit under test, and the second port being coupled to a second end of the detection resistor; and the detection circuit being coupled to the first port and the second port respectively; The current detection method comprises: The detection chip controls the auxiliary circuit to generate a first current at the first port and a second current at the second port when the to-be-tested circuit is in a non-working state, wherein the first current is a current not flowing through the detection resistor, the second current is a current flowing through the detection resistor, and a current value of the first current is equal to a current value of the second current; The detection chip controls the detection circuit to calculate a current calibration value of the detection resistor based on a voltage at a first end of the detection resistor and a voltage at a second end of the detection resistor; The detection chip controls the detection circuit to measure a current measurement value of the detection resistor by using the first port and the second port when the to-be-tested circuit is in a working state, and calibrates the current measurement value based on the current calibration value to obtain an actual current value of the detection resistor.
12. The current detection method according to claim 11, wherein The auxiliary circuit includes a first current source and a second current source; a first end of the first current source is coupled with the first port, and a second end of the first current source is coupled with a ground end; a first end of the second current source is coupled with the second port, and a second end of the second current source is coupled with the ground end; The detection chip controls the auxiliary circuit to generate a first current at the first port and a second current at the second port, including: The detection chip controls the first current source to switch from outputting zero current to outputting the first current to generate the first current at the first port, and controls the second current source to switch from outputting zero current to outputting the second current to generate the second current at the second port when the to-be-tested circuit is in a non-working state.
13. The current detection method according to claim 12, wherein The auxiliary circuit further includes a first switch and a second switch; the first switch is connected in series between the first current source and the first port, or the first switch is connected in series between the first current source and the ground end; the second switch is connected in series between the second current source and the second port, or the second switch is connected in series between the second current source and the ground end; The detection chip controls the auxiliary circuit to generate a first current at the first port and a second current at the second port, including: The detection chip controls the first current source to output the first current, and controls the second current source to output the second current; The detection chip controls the first switch and the second switch to be closed to generate the first current at the first port and the second current at the second port when the to-be-tested circuit is in a non-working state.
14. The current detection method according to any one of claims 11 to 13, characterized by, The to-be-tested circuit includes a filtering sub-circuit; the filtering sub-circuit includes a first resistor, a second resistor and a capacitor; a first end of the first resistor is coupled with a first end of the detection resistor, and a second end of the first resistor is coupled with the first port; the first resistor is configured to generate a first voltage value when a first current passes through; a first end of the second resistor is coupled with a second end of the detection resistor, and a second end of the second resistor is coupled with the second port; the second resistor is configured to generate a second voltage value when the second current passes through; the capacitor is connected in series between the second end of the first resistor and the second end of the second resistor, for blocking a path between the second end of the first resistor and the second end of the second resistor; the detection chip controls the detection circuit to calculate a third voltage value of the detection resistor based on the voltage at the first end of the detection resistor and the voltage at the second end of the detection resistor; the detection chip controls the detection circuit to calculate a third voltage value of the detection resistor based on the voltage at the first end of the detection resistor and the voltage at the second end of the detection resistor; the detection chip controls the detection circuit to calculate a current calibration value of the detection resistor based on the first voltage value, the second voltage value and the third voltage value.
15. The current detection method according to any one of claims 11 to 14, characterized by, The method further comprises: when the to-be-tested circuit is in a non-working state, the detection chip controls the detection circuit to obtain an initial current offset value of the detection resistor; the calibration of the current measurement value based on the current calibration value comprises: the detection chip calibrates a difference between the current measurement value and the initial current offset value based on the current calibration value.
16. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises computer instructions, which, when executed on an electronic device, cause a detection chip in the electronic device to perform the method of any one of claims 11-15.
17. A computer program product, characterised in that, The computer program product comprises computer instructions, which, when executed on an electronic device, cause a detection chip in the electronic device to perform the method of any one of claims 11-15.
