Gain control circuit, method and vehicle
By introducing a gain control unit into the gain control circuit, the gain gear of the operational amplification unit is automatically adjusted according to the digital voltage signal and voltage gain gear, solving the problem of large and small gain caused by current changes, and improving the accuracy of current determination and real-time.
Patent Information
- Application Number
- CN202411062261.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-08-05
AI Technical Summary
In new energy vehicles, the change in the battery charge and discharge current causes the voltage collected by the current-sense resistor to be amplified by a fixed-ratio operation, and the gain is too large and too small, which exceeds the processing range of the analog-to-digital converter and cannot accurately determine the real-time current.
Design a gain control circuit, including a current sense resistor, an operational amplification unit, an analog-to-digital conversion unit and a gain control unit, and automatically controls the gain gear of the operational amplification unit through digital voltage signals and voltage gain gears to ensure that the voltage is converted in analog-to-digital conversion. within the normal processing range of the device.
It improves the reliability and timeliness of gain control, ensures the accuracy of subsequent current determination, and avoids real-time and reliability problems caused by gain mismatch.
Smart Images

Figure CN118677388B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of circuit technology, and in particular, to a gain control circuit, method and vehicle. Background Art
[0002] In new energy vehicles, it is usually necessary to monitor the battery charge and discharge current in real time in order to detect and respond to fault events such as overcurrent and short circuit in real time. At present, a current sensing resistor is often set to collect the voltage flowing through the current sensing resistor on the current path, and the voltage is amplified by an operational amplifier and processed by an analog-to-digital converter to obtain recognizable voltage data, thereby calculating the current real-time current.
[0003] However, since the battery charging and discharging current varies (sometimes large, sometimes small) during vehicle operation, when the voltage of the current-sense resistor is collected and passes through an operational amplifier with a fixed multiple, the voltage obtained by the gain fluctuates, sometimes exceeding the normal processing range of the analog-to-digital converter, resulting in the inability to accurately determine the current real-time current. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a gain control circuit, method and vehicle.
[0005] In a first aspect, the present disclosure provides a gain control circuit, the gain control circuit comprising: a current sensing resistor, an operational amplifier unit, an analog-to-digital conversion unit and a gain control unit, the input end of the operational amplifier unit is connected to both ends of the current sensing resistor, the output end of the operational amplifier unit is connected to the input end of the analog-to-digital conversion unit, the output end of the analog-to-digital conversion unit is connected to the input end of the gain control unit, and the output end of the gain control unit is connected to the input end of the operational amplifier unit;
[0006] The operational amplifier unit is used to collect the voltage signal at both ends of the current sensing resistor, and amplify the voltage signal based on the voltage gain gear to obtain an analog voltage signal;
[0007] The analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog voltage signal to obtain a digital voltage signal;
[0008] The gain control unit is used to control the gain level of the operational amplifier unit according to the digital voltage signal and the voltage gain level; the gain level is used to characterize the amplification factor of the operational amplifier unit when amplifying the voltage signal.
[0009] Optionally, the gain control unit includes: multiple digital comparators, multiple registers corresponding to the multiple digital comparators one by one, and a comparison decoding circuit; different digital comparators correspond to different gain gears; the output end of the analog-to-digital conversion unit is connected to the first input end of the digital comparator, and the output end of the register is connected to the second input end of the digital comparator; the output end of the digital comparator is connected to the input end of the comparison decoding circuit, and the output end of the comparison decoding circuit is connected to the input end of the operational amplifier unit.
[0010] Optionally, the comparison decoding circuit is used to determine a first voltage comparison result corresponding to the digital voltage signal according to the voltage gain gear; the first voltage comparison result includes that the voltage exceeds the normal operating voltage range, or the voltage does not exceed the normal operating voltage range; and based on the first voltage comparison result and the voltage gain gear, a target gain gear is determined; and based on the target gain gear, the gain gear of the operational amplifier unit is controlled.
[0011] Optionally, the comparison decoding circuit is used to select the digital comparator corresponding to the voltage gain gear as the target digital comparator from the multiple digital comparators, and obtain the first voltage comparison result corresponding to the digital voltage signal output by the target digital comparator.
[0012] Optionally, the target digital comparator is used to obtain a first preset voltage value range stored in a register connected to the target digital comparator, and determine the first voltage comparison result corresponding to the digital voltage signal according to the first preset voltage value range.
[0013] Optionally, the voltage exceeding the normal operating voltage range includes: the voltage exceeding the upper limit of the normal operating voltage range or the voltage exceeding the lower limit of the normal operating voltage range; the target digital comparator is used to determine that the first voltage comparison result includes that the voltage exceeds the upper limit of the normal operating voltage range when the digital voltage signal is greater than the upper limit of the first preset voltage value range; or, when the digital voltage signal is less than the lower limit of the first preset voltage value range, determine that the first voltage comparison result includes that the voltage exceeds the lower limit of the normal operating voltage range; or, when the digital voltage signal is within the first preset voltage value range, determine that the first voltage comparison result includes that the voltage does not exceed the normal operating voltage range.
[0014] Optionally, when the first voltage comparison result includes that the voltage exceeds the upper limit of the normal working voltage range, the comparison decoding circuit is used to use the voltage gain gear as the target gain gear when the voltage gain gear is the lowest level gain gear; or, when the voltage gain gear is not the lowest level gain gear, use the next level gain gear corresponding to the voltage gain gear as the target gain gear; wherein the level of the next level gain gear corresponding to the voltage gain gear is lower than the level of the voltage gain gear.
[0015] Optionally, when the first voltage comparison result includes that the voltage exceeds the lower limit of the normal working voltage range, the comparison decoding circuit is used to use the voltage gain gear as the target gain gear when the voltage gain gear is the highest level gain gear; or, when the voltage gain gear is a gain gear of a non-highest level, use the previous level gain gear corresponding to the voltage gain gear as the target gain gear; wherein the level of the previous level gain gear corresponding to the voltage gain gear is higher than the level of the voltage gain gear.
[0016] Optionally, when the first voltage comparison result includes that the voltage does not exceed a normal operating voltage range, the comparison decoding circuit is configured to use the voltage gain level as the target gain level.
[0017] Optionally, the comparison decoding circuit is used to maintain the gain level of the operational amplifier unit when the target gain level includes the voltage gain level; or
[0018] When the target gain level does not include the voltage gain level, the gain level of the operational amplifier unit is adjusted to the target gain level.
[0019] Optionally, the gain control unit also includes: an analog comparator, a first resistor, a second resistor and a third resistor; the first resistor, the second resistor and the third resistor are connected in series in sequence, and are respectively connected to a power line and a ground line after being connected in series; the first input terminal of the analog comparator is connected to the connecting line between the first resistor and the second resistor, the second input terminal of the analog comparator is connected to the connecting line between the second resistor and the third resistor, the third input terminal of the analog comparator is connected to the output terminal of the operational amplifier unit, and the output terminal of the analog comparator is connected to the comparison decoding circuit.
[0020] Optionally, the analog comparator is used to obtain the analog voltage signal output by the operational amplifier unit, and determine a second voltage comparison result corresponding to the analog voltage signal; the second voltage comparison result includes that the voltage exceeds the normal working voltage range, or the voltage does not exceed the normal working voltage range;
[0021] The comparison decoding circuit is used to determine the target gain level according to the first voltage comparison result, the second voltage comparison result and the voltage gain level.
[0022] Optionally, the analog comparator is used to obtain a second preset voltage value range; and determine the second voltage comparison result according to the second preset voltage value range and the analog voltage signal.
[0023] Optionally, the comparison decoding circuit is used to determine the target gain level according to the first voltage comparison result and the voltage gain level when the first voltage comparison result and the second voltage comparison result are the same, or the second voltage comparison result includes that the voltage does not exceed the normal operating voltage range; or, when the first voltage comparison result and the second voltage comparison result are different, and the second voltage comparison result includes that the voltage exceeds the normal operating voltage range, determine the target gain level according to the second voltage comparison result and the voltage gain level.
[0024] Optionally, the gain control circuit further includes: a processor; the processor is connected to the analog-to-digital conversion unit and the gain control unit respectively.
[0025] Optionally, the processor is used to periodically determine whether the first voltage comparison result is different from the second voltage comparison result; and when it is determined that the first voltage comparison result is different from the second voltage comparison result for a preset number of consecutive cycles, determine that there is a fault in the gain control circuit.
[0026] Optionally, the processor is used to obtain a resistance value corresponding to the current sensing resistor; and determine a corresponding target current value according to the digital voltage signal and the resistance value.
[0027] In a second aspect, the present disclosure provides a gain control method, which is applied to a gain control circuit, wherein the gain control circuit comprises: a current sensing resistor, an operational amplifier unit, an analog-to-digital conversion unit and a gain control unit, wherein the input end of the operational amplifier unit is connected to both ends of the current sensing resistor, the output end of the operational amplifier unit is connected to the input end of the analog-to-digital conversion unit, the output end of the analog-to-digital conversion unit is connected to the input end of the gain control unit, and the output end of the gain control unit is connected to the input end of the operational amplifier unit; the method comprises:
[0028] Acquire a digital voltage signal output by the analog-to-digital conversion unit; the digital voltage signal is obtained after the analog-to-digital conversion unit performs analog-to-digital conversion on the analog voltage signal output by the operational amplifier unit, and the analog voltage signal is obtained after the operational amplifier unit performs amplification processing on the collected voltage signal across the current-sensing resistor based on the voltage gain gear;
[0029] The gain level of the operational amplifier unit is controlled according to the digital voltage signal and the voltage gain level; the gain level is used to characterize the amplification factor when the operational amplifier unit amplifies the voltage signal.
[0030] Optionally, controlling the gain level of the operational amplifier unit according to the digital voltage signal and the voltage gain level includes:
[0031] Determining a first voltage comparison result corresponding to the digital voltage signal according to the voltage gain gear; the first voltage comparison result includes that the voltage exceeds the normal working voltage range, or the voltage does not exceed the normal working voltage range;
[0032] Determining a target gain level according to the first voltage comparison result and the voltage gain level;
[0033] The gain level of the operational amplifier unit is controlled according to the target gain level.
[0034] Optionally, determining a first voltage comparison result corresponding to the digital voltage signal according to the voltage gain gear includes:
[0035] Obtaining a first preset voltage value range corresponding to the voltage gain gear;
[0036] The first voltage comparison result corresponding to the digital voltage signal is determined according to the first preset voltage value range.
[0037] Optionally, the voltage exceeding the normal working voltage range includes: the voltage exceeding the upper limit of the normal working voltage range or the voltage exceeding the lower limit of the normal working voltage range; and determining the first voltage comparison result corresponding to the digital voltage signal according to the first preset voltage value range includes:
[0038] In the case where the digital voltage signal is greater than the upper limit of the first preset voltage value range, determining the first voltage comparison result includes that the voltage exceeds the upper limit of the normal working voltage range; or,
[0039] In the case where the digital voltage signal is less than the lower limit of the first preset voltage value range, determining the first voltage comparison result includes that the voltage exceeds the lower limit of the normal working voltage range; or,
[0040] In a case where the digital voltage signal is within the first preset voltage value range, determining the first voltage comparison result includes that the voltage does not exceed a normal operating voltage range.
[0041] Optionally, when the first voltage comparison result includes that the voltage exceeds an upper limit of a normal operating voltage range, determining a target gain level according to the first voltage comparison result and the voltage gain level includes:
[0042] In the case where the voltage gain level is the lowest level gain level, the voltage gain level is used as the target gain level; or,
[0043] When the voltage gain level is not a lowest level gain level, taking a next level gain level corresponding to the voltage gain level as the target gain level;
[0044] Among them, the level of the next level gain level corresponding to the voltage gain level is lower than the level of the voltage gain level.
[0045] Optionally, when the first voltage comparison result includes that the voltage exceeds a lower limit of a normal working voltage range, determining the target gain level according to the first voltage comparison result and the voltage gain level includes:
[0046] In the case where the voltage gain level is the highest level gain level, the voltage gain level is used as the target gain level; or,
[0047] When the voltage gain level is a gain level other than the highest level, taking the previous level gain level corresponding to the voltage gain level as the target gain level;
[0048] Among them, the level of the previous level gain level corresponding to the voltage gain level is higher than the level of the voltage gain level.
[0049] Optionally, when the first voltage comparison result includes that the voltage does not exceed a normal operating voltage range, determining the target gain level according to the first voltage comparison result and the voltage gain level includes:
[0050] The voltage gain level is used as the target gain level.
[0051] Optionally, controlling the gain level of the operational amplifier unit according to the target gain level includes:
[0052] When the target gain level includes the voltage gain level, maintaining the gain level of the operational amplifier unit; or
[0053] When the target gain level does not include the voltage gain level, the gain level of the operational amplifier unit is adjusted to the target gain level.
[0054] Optionally, the method further comprises:
[0055] Acquire the analog voltage signal output by the operational amplifier unit;
[0056] Determine a second voltage comparison result corresponding to the analog voltage signal; the second voltage comparison result includes that the voltage exceeds the normal working voltage range, or the voltage does not exceed the normal working voltage range;
[0057] The determining the target gain level according to the first voltage comparison result and the voltage gain level comprises:
[0058] The target gain level is determined according to the first voltage comparison result, the second voltage comparison result, and the voltage gain level.
[0059] Optionally, determining a second voltage comparison result corresponding to the analog voltage signal includes:
[0060] Obtaining a second preset voltage value range;
[0061] The second voltage comparison result is determined according to the second preset voltage value range and the analog voltage signal.
[0062] Optionally, determining the target gain level according to the first voltage comparison result, the second voltage comparison result and the voltage gain level includes:
[0063] When the first voltage comparison result and the second voltage comparison result are the same, or the second voltage comparison result includes that the voltage does not exceed the normal operating voltage range, determining the target gain level according to the first voltage comparison result and the voltage gain level; or,
[0064] When the first voltage comparison result is different from the second voltage comparison result, and the second voltage comparison result includes that the voltage exceeds a normal operating voltage range, the target gain level is determined according to the second voltage comparison result and the voltage gain level.
[0065] Optionally, the gain control circuit further includes: a processor; the processor is connected to the analog-to-digital conversion unit and the gain control unit respectively.
[0066] Optionally, the method further comprises:
[0067] periodically determining whether the first voltage comparison result is different from the second voltage comparison result;
[0068] When it is determined that the first voltage comparison result is different from the second voltage comparison result for a preset number of consecutive cycles, it is determined that a fault exists in the gain control circuit.
[0069] Optionally, the method further comprises:
[0070] Obtaining a resistance value corresponding to the current-sense resistor;
[0071] A corresponding target current value is determined according to the digital voltage signal and the resistance value.
[0072] In a third aspect, the present disclosure provides a vehicle, comprising the gain control circuit provided in the first aspect of the present disclosure.
[0073] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0074] The present disclosure provides a gain control circuit, including a current-sense resistor, an operational amplifier unit, an analog-to-digital conversion unit, and a gain control unit, wherein the input end of the operational amplifier unit is connected to the two ends of the current-sense resistor, the output end of the operational amplifier unit is connected to the input end of the analog-to-digital conversion unit, the output end of the analog-to-digital conversion unit is connected to the input end of the gain control unit, and the output end of the gain control unit is connected to the input end of the operational amplifier unit; the operational amplifier unit is used to collect the voltage signal at the two ends of the current-sense resistor, and amplify the voltage signal based on the voltage gain gear to obtain an analog voltage signal; the analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog voltage signal to obtain a digital voltage signal; the gain control unit is used to control the gain gear of the operational amplifier unit according to the digital voltage signal and the voltage gain gear; the gain gear is used to characterize the amplification factor when the operational amplifier unit amplifies the voltage signal. By adding a gain control unit, the digital voltage signal output by the analog conversion unit can be monitored, and the gain gear of the operational amplifier unit can be flexibly and automatically controlled according to the digital voltage signal and the current voltage gain gear of the operational amplifier unit. The entire gain level control process does not require the participation of software and programs, and the gain level of the operational amplifier unit can be controlled by relying on hardware circuits, thereby improving the reliability and timeliness of gain control. In addition, by controlling the gain level, the accuracy of the voltage output by the analog conversion unit after subsequent adjustment can be guaranteed, thereby improving the accuracy of the subsequent current determination.
[0075] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0077] Figure 1 is a structural block diagram of a gain control circuit according to an exemplary embodiment.
[0078] Figure 2 is a structural block diagram of another gain control circuit according to an exemplary embodiment.
[0079] Figure 3 is a structural block diagram of another gain control circuit according to an exemplary embodiment.
[0080] Figure 4 is a structural block diagram of another gain control circuit according to an exemplary embodiment.
[0081] Figure 5 It is a flowchart of a gain control method according to an exemplary embodiment.
[0082] Figure 6 The figure is a flow chart of a gain control method according to an exemplary embodiment.
[0083] Figure 7 is a flow chart of another gain control method according to an exemplary embodiment.
[0084] Figure 8 is a flow chart of another gain control method according to an exemplary embodiment.
[0085] Fig. 9 is a flow chart of another gain control method according to an exemplary embodiment.
[0086] Fig.10 is a block diagram of a vehicle according to an exemplary embodiment. DETAILED DESCRIPTION
[0087] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0088] The terms "first", "second", etc. in the specification and claims of this application and the above drawings are used to distinguish similar objects and do not have to be understood as a specific order or sequence. In addition, in the description with reference to the drawings, the same symbols in different drawings represent the same elements.
[0089] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0090] In the description of the present disclosure, unless otherwise specified, "plurality" means two or more than two, and other quantifiers are similar; "at least one item", "one or more items" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one item a can represent any number of a; for another example, one or more items of a, b and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0091] Although operations or steps are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or to perform all the operations or steps shown to obtain the desired results. In the embodiments of the present disclosure, these operations or steps can be performed in series; these operations or steps can also be performed in parallel; or some of these operations or steps can be performed.
[0092] Before introducing the gain control circuit, method and vehicle provided by the present disclosure, the application scenarios involved in the various embodiments of the present disclosure are first introduced. The present disclosure is applied to the scenario where the vehicle detects the charging and discharging current of the battery. In this scenario, a current sensing resistor is often set to collect the voltage flowing through the current sensing resistor on the current path, and the voltage is amplified by an operational amplifier and then processed by an analog-to-digital converter to obtain recognizable voltage data, thereby calculating the current real-time current. However, since the battery charging and discharging current of the vehicle changes (sometimes large and sometimes small) during operation, when the collected voltage of the current sensing resistor passes through an operational amplifier with a fixed multiple, the voltage obtained by the gain fluctuates, and sometimes exceeds the normal processing range of the analog-to-digital converter, resulting in an abnormal voltage output by the analog-to-digital converter, which in turn makes it impossible to accurately determine the current real-time current.
[0093] In some related technologies, a main control MCU (Microcontroller Unit) chip is provided. The main control MCU chip selects the gain gear corresponding to the operational amplifier according to the current working condition of the vehicle, so as to match the appropriate gain ratio of the battery charge and discharge current under the current working condition, and ensure that the voltage after gain is within the data processing range of the analog-to-digital converter, thereby ensuring data accuracy.
[0094] However, the inventors have discovered in long-term practice that, in the above method, when a large current change occurs in a certain working scenario, causing the voltage to exceed the data processing range of the analog-to-digital converter, the main control MCU chip must first be notified of the situation, and then the main control MCU chip configures the gain multiplier of the operational amplifier according to a pre-set processing strategy. The entire process responds too slowly, and its real-time performance and reliability are poor.
[0095] In order to solve the above technical problems, the present invention provides a gain control circuit, method and vehicle. By adding a gain control unit, the digital voltage signal output by the analog conversion unit can be monitored, and the gain level of the operational amplifier unit can be flexibly and automatically controlled according to the digital voltage signal and the current voltage gain level of the operational amplifier unit. The entire gain level control process does not require the participation of software and programs, and the control of the gain level of the operational amplifier unit can be achieved by relying on hardware circuits, thereby improving the reliability and timeliness of the gain control. In addition, by controlling the gain level, the accuracy of the voltage output by the analog conversion unit after subsequent adjustment can be guaranteed, thereby improving the accuracy of the subsequent determination of the current.
[0096] The specific implementation modes of the present invention are described in detail below with reference to the accompanying drawings.
[0097] Figure 1 is a block diagram of a gain control circuit according to an exemplary embodiment. Figure 1 As shown, the gain control circuit 100 includes: a current sensing resistor R W , an operational amplifier unit 101, an analog-to-digital conversion unit 102 and a gain control unit 103, wherein the input end of the operational amplifier unit 101 is connected to the current sensing resistor R W The output end of the operational amplifier unit 101 is connected to the input end of the analog-to-digital conversion unit 102, the output end of the analog-to-digital conversion unit 102 is connected to the input end of the gain control unit 103, and the output end of the gain control unit 103 is connected to the input end of the operational amplifier unit 101;
[0098] The operational amplifier unit 101 is used to collect the current sensing resistor R W The voltage signal at both ends is amplified based on the voltage gain level to obtain an analog voltage signal.
[0099] In some application scenarios, if it is necessary to detect the charge and discharge current of the battery, the current sensing resistor R W Set it on the current path through which the battery's charge and discharge current flows. In this way, the current sensing resistor R W The voltage signals at both ends are used to further detect the charging and discharging current of the battery.
[0100] The operational amplifier unit 101 has a voltage detection module in its memory, which can collect the voltage of the current sensing resistor R W The voltage signal at both ends, the voltage gain level is the current gain level of the operational amplifier unit 101. In this embodiment, the operational amplifier unit 101 may be an operational amplifier unit with adjustable gain.
[0101] In addition, when the gain control circuit starts to operate, that is, after the battery is powered on, the first level of gain gear (that is, the lowest level of gain gear) in the adjustable gain of the operational amplifier unit 101 can be used as the voltage gain gear.
[0102] The analog-to-digital conversion unit 102 is used to perform analog-to-digital conversion on the analog voltage signal to obtain a digital voltage signal.
[0103] The analog-to-digital conversion unit 102 may be, for example, an ADC (Analog-to-Digital Converter) unit, which can perform analog-to-digital conversion on an input signal.
[0104] The gain control unit 103 is used to control the gain level of the operational amplifier unit 101 according to the digital voltage signal and the voltage gain level.
[0105] The gain level is used to represent the amplification factor of the voltage signal when the operational amplifier unit 101 amplifies the voltage signal.
[0106] Alternatively, if Figure 2 As shown, the gain control unit 103 may include: a plurality of digital comparators 1031, a plurality of registers 1032 corresponding to the plurality of digital comparators 1031, and a comparison decoding circuit 1033. Figure 2 In the figure, three digital comparators 1031 and three registers 1032 are taken as examples for demonstration.
[0107] Different digital comparators 1031 correspond to different gain levels. In other words, the number of digital comparators 1031 corresponds to the number of adjustable gain levels of the operational amplifier unit 101. For example, if the operational amplifier unit 101 includes three adjustable gain levels, the gain control unit 103 includes three digital comparators 1031.
[0108] The output end of the analog-to-digital conversion unit 102 is connected to the first input end of the digital comparator 1031, and the output end of the register 1032 is connected to the second input end of the digital comparator 1031; the output end of the digital comparator 1031 is connected to the input end of the comparison decoding circuit 1033, and the output end of the comparison decoding circuit 1033 is connected to the input end of the operational amplifier unit 101.
[0109] The register 1032 is used to store a preset voltage value range corresponding to the digital comparator 1031 connected thereto; wherein the preset voltage value ranges corresponding to different gain levels are different.
[0110] The digital comparator 1031 is used to determine the voltage comparison result corresponding to the digital voltage signal according to the preset voltage value range, and output the result to the comparison decoding circuit 1033 .
[0111] It should be noted that the preset voltage value range corresponding to the digital comparator 1031 connected thereto and stored in the register 1032 can be customized according to different application scenarios, and the present disclosure does not make any specific limitation on this.
[0112] Optionally, the comparison decoding circuit 1033 is used to determine a first voltage comparison result corresponding to the digital voltage signal according to the voltage gain gear.
[0113] The first voltage comparison result includes that the voltage exceeds the normal working voltage range, or that the voltage does not exceed the normal working voltage range.
[0114] The comparison decoding circuit 1033 is used to determine a target gain level according to the first voltage comparison result and the voltage gain level; and to control the gain level of the operational amplifier unit according to the target gain level.
[0115] Specifically, the comparison decoding circuit 1033 is used to select the digital comparator 1031 corresponding to the voltage gain gear as the target digital comparator from the multiple digital comparators 1031, and obtain the first voltage comparison result corresponding to the digital voltage signal output by the target digital comparator.
[0116] It is understandable that each digital comparator 1031 will output a voltage comparison result to the comparison decoding circuit 1033. In the scenario where this solution is applied, the most important thing to pay attention to is whether the acquired digital voltage signal is within the normal working voltage range corresponding to the current voltage gain gear. Therefore, in some embodiments, the first voltage comparison result output by the target digital comparator corresponding to the voltage gain gear can be obtained from multiple digital comparators 1031, so as to serve as a basis for subsequent determination of whether the current gain gear is appropriate.
[0117] Optionally, the target digital comparator is used to obtain a first preset voltage value range stored in a register 1032 connected to the target digital comparator, and determine the first voltage comparison result corresponding to the digital voltage signal according to the first preset voltage value range.
[0118] Optionally, the voltage exceeding the normal operating voltage range includes: the voltage exceeding an upper limit of the normal operating voltage range or the voltage exceeding a lower limit of the normal operating voltage range.
[0119] Accordingly, the target digital comparator is used to determine that the first voltage comparison result includes that the voltage exceeds the upper limit of the normal working voltage range when the digital voltage signal is greater than the upper limit of the first preset voltage value range; or, when the digital voltage signal is less than the lower limit of the first preset voltage value range, determine that the first voltage comparison result includes that the voltage exceeds the lower limit of the normal working voltage range; or, when the digital voltage signal is within the first preset voltage value range, determine that the first voltage comparison result includes that the voltage does not exceed the normal working voltage range.
[0120] For example, the result output by the target digital comparator can be represented by a binary number, for example, if the first voltage comparison result is 10, it means that the voltage exceeds the upper limit of the normal working voltage range. If the first voltage comparison result is 01, it means that the voltage exceeds the lower limit of the normal working voltage range. If the first voltage comparison result is 11, it means that the voltage does not exceed the normal working voltage range.
[0121] It should be noted that the voltage comparison results of the remaining digital comparators are determined in the same manner as the method in which the target digital comparator determines the first voltage comparison result, and will not be described in detail here.
[0122] Specifically, in one possible implementation, when the first voltage comparison result includes that the voltage exceeds the upper limit of the normal working voltage range, the comparison decoding circuit 1033 is used to, when the voltage gain gear is the lowest level gain gear, use the voltage gain gear as the target gain gear; or, when the voltage gain gear is not the lowest level gain gear, use the next level gain gear corresponding to the voltage gain gear as the target gain gear; wherein the level of the next level gain gear corresponding to the voltage gain gear is lower than the level of the voltage gain gear.
[0123] That is to say, if the first voltage comparison result includes that the voltage exceeds the upper limit of the normal working voltage range, it indicates that the current gain gear is high and the gain gear needs to be lowered. At this time, it is also necessary to pay attention to whether the voltage gain gear is the lowest level gain gear. If it is the lowest level gain gear, the voltage gain gear is used as the target gain gear. If it is not the lowest level gain gear, the lower level gain gear is used as the target gain gear.
[0124] In another possible implementation, when the first voltage comparison result includes that the voltage exceeds the lower limit of the normal operating voltage range, the comparison decoding circuit 1033 is used to, when the voltage gain gear is the highest level gain gear, use the voltage gain gear as the target gain gear; or, when the voltage gain gear is a non-highest level gain gear, use the previous level gain gear corresponding to the voltage gain gear as the target gain gear; wherein the level of the previous level gain gear corresponding to the voltage gain gear is higher than the level of the voltage gain gear.
[0125] That is to say, if the first voltage comparison result includes that the voltage exceeds the lower limit of the normal working voltage range, it indicates that the current gain gear is low and the gain gear needs to be adjusted up. At this time, it is also necessary to pay attention to whether the voltage gain gear is the highest level gain gear. If it is the highest level gain gear, the voltage gain gear is used as the target gain gear. If it is not the highest level gain gear, the higher level gain gear is used as the target gain gear.
[0126] In another possible implementation, when the first voltage comparison result includes that the voltage does not exceed the normal operating voltage range, the comparison decoding circuit 1033 is used to use the voltage gain level as the target gain level.
[0127] That is, if the first voltage comparison result includes that the voltage does not exceed the normal operating voltage range, it can be determined that the current gain level is appropriate and there is no need to adjust the current gain level.
[0128] Accordingly, the comparison decoding circuit 1033 is used to maintain the gain level of the operational amplifier unit 101 when the target gain level includes the voltage gain level; or,
[0129] When the target gain level does not include the voltage gain level, the gain level of the operational amplifier unit 101 is adjusted to the target gain level.
[0130] Specifically, if the target gain level is a gain level lower than the voltage gain level, the comparison decoding circuit 1033 generates a gain down adjustment signal and outputs it to the operational amplifier unit 101, so that the operational amplifier unit 101 adjusts the gain level down to the target gain level. If the target gain level is a gain level higher than the voltage gain level, the comparison decoding circuit 1033 generates a gain up adjustment signal and outputs it to the operational amplifier unit 101, so that the operational amplifier unit 101 adjusts the gain level up to the target gain level.
[0131] It should be noted that the above-mentioned gain gear adjustment process can be performed periodically, that is, the voltage range is determined once every certain period. If it exceeds the normal operating voltage range, the current gain gear is adjusted until no voltage exceeds the normal operating voltage range (that is, the voltage is within the normal operating voltage range corresponding to the current gain gear) or there is no gain gear to be adjusted up or down (that is, the highest level gain gear is reached or the lowest level gain gear is reached).
[0132] Alternatively, if Figure 3 As shown, the gain control unit 103 may also include: an analog comparator 1034, a first resistor R1, a second resistor R2 and a third resistor R3; the first resistor R1, the second resistor R2 and the third resistor R3 are connected in series in sequence, and are respectively connected to a power line and a ground line after being connected in series; a first input end of the analog comparator 1034 is connected to a connection line between the first resistor R1 and the second resistor R2, a second input end of the analog comparator 1034 is connected to a connection line between the second resistor R2 and the third resistor R3, a third input end of the analog comparator 1034 is connected to an output end of the operational amplifier unit 101, and an output end of the analog comparator 1034 is connected to the comparison decoding circuit 1033.
[0133] Among them, Figure 3 As shown, one end of the first resistor R1 is connected to the power line, the other end of the first resistor R1 is connected to the second resistor R2, one end of the third resistor R3 is connected to the second resistor R2, and the other end of the third resistor R3 is connected to the ground line.
[0134] In some embodiments, the resistance values of the first resistor R1, the second resistor R2, and the third resistor R3 can be selected according to actual needs. When the first input terminal of the analog comparator 1034 is connected to the connection line between the first resistor R1 and the second resistor R2, and the second input terminal of the analog comparator 1034 is connected to the connection line between the second resistor R2 and the third resistor R3, at this time, the first input terminal and the second input terminal of the analog comparator 1034 will respectively obtain a voltage value, which is used as the voltage endpoint value for subsequent comparison, that is, the maximum value thereof is used as the upper limit of the voltage range, and the minimum value thereof is used as the lower limit of the voltage range, thereby obtaining the second preset voltage value range. That is, the first resistor R1, the second resistor R2, and the third resistor R3 together form a voltage-dividing resistor string, which is used to generate the upper limit and lower limit of the second preset voltage value range.
[0135] The second preset voltage value range is usually larger than the first preset voltage value range, and serves as a voltage verification range to monitor the gain adjustment process. That is, if the second preset voltage value range is exceeded, then it must exceed the preset voltage value range under normal circumstances; if the first preset voltage value range is exceeded, it does not necessarily exceed the second preset voltage value range.
[0136] Optionally, the analog comparator 1034 is used to obtain the analog voltage signal output by the operational amplifier unit 101 and determine a second voltage comparison result corresponding to the analog voltage signal.
[0137] The second voltage comparison result includes that the voltage exceeds the normal working voltage range, or the voltage does not exceed the normal working voltage range. The voltage exceeding the normal working voltage range may include: the voltage exceeds the upper limit of the normal working voltage range, or the voltage exceeds the lower limit of the normal working voltage range.
[0138] Similarly, the second voltage comparison result output by the analog comparator 1034 can also be represented by a binary number. For example, if the second voltage comparison result is 10, it means that the voltage exceeds the upper limit of the normal working voltage range. If the second voltage comparison result is 01, it means that the voltage exceeds the lower limit of the normal working voltage range. If the second voltage comparison result is 11, it means that the voltage does not exceed the normal working voltage range.
[0139] The comparison decoding circuit 1033 is used to determine the target gain level according to the first voltage comparison result, the second voltage comparison result and the voltage gain level.
[0140] The analog comparator 1034 is used to obtain a second preset voltage value range, and determine the second voltage comparison result according to the second preset voltage value range and the analog voltage signal.
[0141] Among them, the method of determining the second voltage comparison result according to the second preset voltage value range and the analog voltage signal is the same as the method of determining the first voltage comparison result, which will not be further described here.
[0142] Optionally, the comparison decoding circuit 1033 is used to determine the target gain level according to the first voltage comparison result and the voltage gain level when the first voltage comparison result and the second voltage comparison result are the same, or the second voltage comparison result includes that the voltage does not exceed the normal operating voltage range; or, when the first voltage comparison result and the second voltage comparison result are different, and the second voltage comparison result includes that the voltage exceeds the normal operating voltage range, determine the target gain level according to the second voltage comparison result and the voltage gain level.
[0143] Among them, if the first voltage comparison result and the second voltage comparison result are the same, indicating that the comparison results output by the analog comparator 1034 and the target digital comparator are the same, then the target gain gear can be determined according to the first voltage comparison result output by the target digital comparator. Or if the second voltage comparison result includes that the voltage does not exceed the normal working voltage range, indicating that the current voltage does not exceed the normal working voltage range of the analog comparator 1034, then the target gain gear can be determined according to the first voltage comparison result output by the target digital comparator. If the first voltage comparison result and the second voltage comparison result are different, and the second voltage comparison result includes that the voltage exceeds the normal working voltage range, then the comparison result of the target digital comparator can be ignored, and the target gain gear can be determined directly according to the second voltage comparison result and the voltage gain gear.
[0144] It should be noted that the method for determining the target gain level according to the second voltage comparison result and the voltage gain level is the same as the method for determining the target gain level according to the first voltage comparison result and the voltage gain level, and will not be described in detail here.
[0145] In addition, the present disclosure is not limited to the individual components in the gain control unit 103 being discrete components. The individual discrete components may be integrated into a chip according to actual needs to further improve the integration of circuit functions.
[0146] Alternatively, if Figure 4 As shown, the gain control circuit 100 may further include: a processor 104; the processor 104 is connected to the analog-to-digital conversion unit 102 and the gain control unit 103 respectively.
[0147] Specifically, the processor 104 can be connected to multiple registers 1032 in the gain control unit 103 to set the preset voltage value range corresponding to the digital comparator 1031 connected thereto and stored in the multiple registers 1032. The processor 104 can also be connected to the analog comparator 1034 of the gain control unit 103.
[0148] Optionally, the processor 104 is used to periodically determine whether the first voltage comparison result is different from the second voltage comparison result; and determine that there is a fault in the gain control circuit when it is determined that the first voltage comparison result is different from the second voltage comparison result for a preset number of consecutive cycles.
[0149] In some embodiments, the processor 104 may obtain the first voltage comparison result and the second voltage comparison result in multiple cycles, and determine whether the first voltage comparison result and the second voltage comparison result are different. If the first voltage comparison result and the second voltage comparison result are determined to be different for a preset number of consecutive cycles, it may be determined that the gain control circuit 100 has a fault.
[0150] In other embodiments, the processor 104 may also determine whether the first voltage comparison result and the second voltage comparison result are different when receiving the second voltage comparison result output by the analog comparator 1034 that the voltage exceeds the normal operating voltage range. When it is determined that the first voltage comparison result and the second voltage comparison result are different for a preset number of consecutive cycles, it may be determined that the gain control circuit 100 has a fault.
[0151] Furthermore, the processor 104 can also generate warning information when determining that the gain control circuit 100 has a fault, so as to prompt the user to check the gain control circuit 100. In this way, the analog comparator 1034 can be used to further detect whether a fault occurs in the gain control circuit 100, which ensures the safety of vehicle battery management for new energy vehicles.
[0152] In addition, if the voltage of the first voltage comparison result and the second voltage comparison result exceeds the normal operating voltage range for a preset number of consecutive cycles, it indicates that the current currently flowing through the current sensing resistor is abnormal. Similarly, in order to ensure safe use, an alarm prompt message can be generated to remind relevant personnel to check.
[0153] For example, if the voltage of the first voltage comparison result and the second voltage comparison result exceeds the upper limit of the normal working voltage range for a preset number of consecutive cycles, it is necessary to lower the gain level by one level, but the current is already at the lowest gain level, then it can be determined that the excessive current may be caused by an external overcurrent short circuit, and a corresponding alarm prompt message can be generated.
[0154] Optionally, the processor 104 is configured to obtain a resistance value corresponding to the current-sense resistor; and determine a corresponding target current value according to the digital voltage signal and the resistance value.
[0155] Among them, according to the digital voltage signal and the resistance value, the target current value can be determined by calculating the current determination formula in the related art, which will not be further described here.
[0156] By adjusting the gain level of the operational amplifier unit 101 , the accuracy of the digital voltage signal output by the analog-to-digital conversion unit 103 can be ensured, thereby ensuring the target current value corresponding to the subsequent battery.
[0157] Compared with the method of pure software control, the present invention can realize the gain level control of the operational amplifier unit 101 through a hardware circuit, and the hardware circuit structure is simple, easy to implement, and has higher reliability and real-time performance.
[0158] In addition, if the target current value exceeds the preset current range threshold, the processor 104 may also generate corresponding prompt information to prompt the user to check it.
[0159] By adopting the above circuit and adding a gain control unit, the digital voltage signal output by the analog conversion unit can be monitored, and the gain level of the operational amplifier unit can be flexibly and automatically controlled according to the digital voltage signal and the current voltage gain level of the operational amplifier unit. The entire gain level control process does not require the participation of software and programs, and the gain level of the operational amplifier unit can be controlled by relying on hardware circuits, thereby improving the reliability and timeliness of the gain control. In addition, by controlling the gain level, the accuracy of the voltage output by the analog conversion unit after subsequent adjustment can be guaranteed, thereby improving the accuracy of the subsequent determination of the current.
[0160] For ease of understanding, the following example takes the operational amplifier unit including three adjustable gain gears (i.e., the first gain gear, the second gain gear, and the third gain gear, and the first gain gear has the lowest level and the third gain gear has the highest level), and the voltage comparison result of the digital comparator can be represented by two binary digits: 01: the voltage exceeds the lower limit of the normal working voltage range; 10: the voltage exceeds the upper limit of the normal working voltage range; 11: the voltage does not exceed the normal working voltage range, and the digital comparator includes digital comparator 1, digital comparator 2, and digital comparator 3 as an example to illustrate the above digital comparator scheme. Figure 5As shown, digital comparator 1 is used for comparing digital voltage signals of the first gain gear, digital comparator 2 is used for comparing digital voltage signals of the second gain gear, and digital comparator 3 is used for comparing digital voltage signals of the third gain gear. When the function is initialized (that is, when the gain control circuit starts to be used), the operational amplifier unit starts the first gain gear, and the comparison decoding circuit obtains the result of digital comparator 1 and makes a judgment. If the voltage comparison result is 01, it is necessary to increase the gain by one level, that is, adjust it to the second gain gear; if the voltage comparison result is 10, it is necessary to reduce the gain by one level, but since it is currently the lowest level gain gear, the current gain gear should be maintained; if the voltage comparison result is 11, it is necessary to maintain the current gain gear. In the case of increasing to the second gain gear, when the next cycle is reached, the comparison decoding circuit obtains the voltage comparison result of digital comparator 2 and makes a judgment. If the voltage comparison result is 01, it is necessary to increase the gain by one level, that is, adjust it to the third gain level; if the voltage comparison result is 10, it is necessary to reduce the gain by one level, that is, adjust it to the first gain level; if the voltage comparison result is 11, it is necessary to maintain the current gain level. In the case of increasing to the third gain level, when the next cycle is reached, the comparison decoding circuit obtains the voltage comparison result of the digital comparator 3 and makes a judgment. If the voltage comparison result is 01, it is necessary to increase the gain by one level, but since it is currently the highest level gain level, the current gain level should be maintained; if the voltage comparison result is 10, it is necessary to reduce the gain by one level, that is, adjust it to the second gain level; if the voltage comparison result is 11, it is necessary to maintain the current gain level. The above steps are executed cyclically during the operation of the entire circuit until no voltage exceeds the normal working voltage range, or there is no adjustable gain level (that is, the highest level gain level is reached or the lowest level gain level is reached).
[0161] The following is an example of a method for monitoring a circuit in combination with the comparison result of an analog comparator. The analog comparator can obtain a voltage signal indicating the upper limit and the lower limit of the voltage range through a first resistor, a second resistor, and a third resistor, and compare the analog voltage signal with the two voltage signals to obtain a second voltage comparison result. If the second voltage comparison result of the analog comparator includes 10 (the voltage exceeds the upper limit of the normal working voltage range), the comparison decoding circuit can ignore the first voltage comparison result output by the current target digital comparator, directly reduce the gain by one level, and if it is still over the limit, continue to reduce the gain by one level in one cycle until no event of the voltage exceeding the normal working voltage range occurs or the gain is reduced to the lowest level. If the second voltage comparison result of the analog comparator includes 01 (the voltage exceeds the lower limit of the normal working voltage range), the comparison decoding circuit can ignore the first voltage comparison result output by the current target digital comparator, directly increase the gain by one level, and if it is still over the limit, continue to increase the gain by one level in one cycle until no event of the voltage exceeding the normal working voltage range occurs or the gain is increased to the highest level. That is to say, in the case of over-limit, the priority of the second voltage comparison result output by the analog comparator may be set to the highest to ensure the timeliness of the gain adjustment.
[0162] In addition, the analog comparator can also send the second voltage comparison result to the processor. Based on the first voltage comparison result and the second voltage comparison result, if the processor determines that the first voltage comparison result is different from the second voltage comparison result for a preset number of consecutive cycles, it can be determined that the entire circuit may have sampling, amplification and conversion failures, or the current analog signal processing method is not suitable for the current application scenario, and the fault information will be reported through the processor.
[0163] In order to understand the present scheme more intuitively, the present disclosure also provides an embodiment, which uses an adjustable 3-level gain gear operational amplifier unit to illustrate the current acquisition scheme. The circuit scheme can be a 5V power supply system, and the operational amplifier unit collects the voltage across the current sensing resistor. Due to the bidirectionality of the battery charging and discharging current, the maximum input voltage of the 16-bit analog-to-digital conversion unit is -2.5V~+2.5V, and the corresponding conversion data is -32767~+32767. The maximum current of the system is ±250A, the current sensing resistor is set to 1mΩ, and the gain gear has three gears: the first gain gear: 10 times, the second gain gear: 20 times, and the third gain gear: 40 times.
[0164] According to the application scenario of the embodiment, the processor pre-sets a preset voltage value range of three registers for comparison with the collected digital voltage signal.
[0165] Register 1 corresponds to the first gain gear, and the comparison range is set as: [-30000~-500], [+500+30000]. Digital voltage signals exceeding the above range are judged as voltages exceeding the normal working voltage range. Among them, the digital voltage signal at [-499~+499] is a voltage exceeding the lower limit of the normal working voltage range, and the digital comparator 1 outputs 01; the digital voltage signal at [-32767~-30001] and [+30001~+32767] is a voltage exceeding the upper limit of the normal working voltage range, and the digital comparator 1 outputs 10; the digital voltage signal at [-30000~-500] and [+500+30000] is a voltage that does not exceed the normal working voltage range, and the digital comparator 1 outputs 11; this section setting mark is set 1.
[0166] Register 2 corresponds to the second gain gear, and the comparison range is set to: [-30000~-1000], [+1000+30000]. Digital voltage signals exceeding the above range are judged to exceed the normal working voltage range. Among them, the digital voltage signal at [-999~+999] is the voltage exceeding the lower limit of the normal working voltage range, and the digital comparator 2 outputs 01; the digital voltage signal at [-32767~-30001] and [+30001~+32767] is the voltage exceeding the upper limit of the normal working voltage range, and the digital comparator 2 outputs 10; the digital signal at [-30000~-1000] and [+1000+30000] is the voltage within the normal working voltage range, and the digital comparator 2 outputs 11; this section setting mark is set 2.
[0167] Register 3 corresponds to the third gain gear, and the comparison range is set to: [-30000~-2000], [+2000+30000]. Digital voltage signals exceeding the above range are judged to exceed the normal working voltage range. Among them, the digital voltage signal at [-1999~+1999] is the voltage exceeding the lower limit of the normal working voltage range, and the digital comparator 3 outputs 01; the digital voltage signal at [-32767~-30001] and [+30001~+32767] is the voltage exceeding the upper limit of the normal working voltage range, and the digital comparator 3 outputs 10; the digital signal at [-30000~-2000] and [+2000+30000] is the voltage within the normal working voltage range, and the digital comparator 3 outputs 11; this section setting mark is set 3.
[0168] When the circuit is initially operated, the first gain level is used by default, so the register 1 and the corresponding digital comparator 1 work effectively. The following different time points represent the time points for detection when different cycles are reached.
[0169] Assume that at the first time point, the operational amplifier unit collects the voltage across the current-sense resistor and obtains a digital voltage signal of 400 through analog-to-digital conversion. According to setting 1, the digital comparator 1 outputs 01 to the comparison decoding circuit. The comparison decoding circuit decodes and identifies that the current is the first gain gear, and the first voltage comparison result is 01, then generates a control signal to increase the gain gear by one level, and controls the operational amplifier unit to switch the gain gear to the second gain gear;
[0170] Assume that at the second time point, the operational amplifier unit collects the voltage across the current-sense resistor and obtains a digital voltage signal of 800 through analog-to-digital conversion. According to setting 2, digital comparator 2 outputs 01 to the comparison decoding circuit. The comparison decoding circuit decodes and recognizes that the current gain level is the second gain level, and the first voltage comparison result is 01, then generates a control signal to increase the gain level by one level, and controls the operational amplifier unit to switch the gain level to the third gain level;
[0171] Assume that at the third time point, the operational amplifier unit collects the voltage across the current-sense resistor and obtains a digital voltage signal of 1800 through analog-to-digital conversion. According to setting 3, the digital comparator 3 outputs 01 to the comparison decoding circuit. The comparison decoding circuit decodes and recognizes that the current is the third gain gear, and the first voltage comparison result is 01, then the current third gain gear is maintained (since it is already the highest level gain gear, there is no gain gear that can be increased, so the current third gain gear is maintained);
[0172] Assume that at the fourth time point, the operational amplifier unit collects the voltage across the current-sense resistor and obtains a digital voltage signal of 16000 through analog-to-digital conversion. According to setting 3, the digital comparator 3 outputs 11 to the comparison decoding circuit. The comparison decoding circuit decodes and recognizes that the current gain level is the third level, and the first voltage comparison result is 11, then the current gain level is maintained;
[0173] Assume that at the fifth time point, the operational amplifier unit collects the voltage across the current-sense resistor and obtains a digital voltage signal of 32000 through analog-to-digital conversion. According to setting 3, the digital comparator 3 outputs 10 to the comparison decoding circuit. The comparison decoding circuit decodes and recognizes that the current gain level is the third gain level, and the first voltage comparison result is 10, then generates a control signal to reduce the gain level by one level, and controls the operational amplifier unit to switch the gain level to the second gain level;
[0174] Assume that at the sixth time point, the operational amplifier unit collects the voltage across the current-sense resistor and obtains a digital voltage signal of 15000 through analog-to-digital conversion. According to setting 2, digital comparator 2 outputs 11 to the comparison decoding circuit. The comparison decoding circuit decodes and recognizes that the current gain level is the second level, and the first voltage comparison result is 11, then the current gain level is maintained;
[0175] Assume that at the seventh time point, the operational amplifier unit collects the voltage across the current-sense resistor and obtains a digital voltage signal of 32500 through analog-to-digital conversion. According to setting 2, digital comparator 2 outputs 10 to the comparison decoding circuit. The comparison decoding circuit decodes and recognizes that the current gain level is the second gain level, and the first voltage comparison result is 10, then generates a control signal to reduce the gain level by one level, and controls the operational amplifier unit to switch the gain level to the first gain level;
[0176] By analogy, the above detection steps are executed cyclically during the operation of the circuit.
[0177] In addition, the result of the analog comparator can also be combined in the detection process to determine whether there is a fault in the circuit. For example, assuming that at the time point m1~mN, the gain gear of the operational amplifier unit is the third gain gear, the operational amplifier unit collects the voltage across the current-sense resistor and obtains a digital voltage signal between 0 and 50 through analog-to-digital conversion. According to setting 3, the digital comparator 3 always (that is, continuously and repeatedly) outputs 01 to the comparison decoding circuit. The comparison decoding circuit decodes and identifies that the current is the third gain gear and the first voltage comparison result is 01. Since the current is the highest level gain gear and there is no gain gear that can be increased, the current third gain gear is maintained. However, the output result of the analog comparator in this process is 11, that is, the analog comparator does not generate an out-of-range prompt. The processor identifies the current state and determines that there may be a problem in the process of the operational amplifier output to the analog-to-digital conversion. The corresponding alarm prompt can be generated so that measures can be taken in time to put the circuit in a safe state.
[0178] For another example, assume that at the K1~KN time point, the gain gear of the operational amplifier unit is the first gain gear, and the voltage across the current-sensing resistor collected by the operational amplifier unit and obtained through analog-to-digital conversion is always 32767. According to setting 1, the digital comparator 1 always (that is, continuously and repeatedly) outputs 10 to the comparison decoding circuit. The comparison decoding circuit decodes and recognizes that the current is the first gain gear and the first voltage comparison result is 10, then the current first gain gear is maintained. In this process, the analog comparator outputs the result of 10, and an alarm is generated; the processor recognizes the current state and can determine that the current-sensing resistor may collect an excessive current, and the external overcurrent short circuit can be generated. A corresponding alarm prompt can be generated so that timely measures can be taken to put the circuit in a safe state. In other words, if the digital comparator and the analog comparator output over-limit comparison results for multiple consecutive times, it can also be determined that the current circuit may have a fault, and a corresponding alarm prompt can be generated.
[0179] Figure 6The present invention is a flow chart of a gain control method according to an exemplary embodiment, which is applied to a gain control circuit, wherein the gain control circuit includes: a current sensing resistor, an operational amplifier unit, an analog-to-digital conversion unit, and a gain control unit, wherein the input end of the operational amplifier unit is connected to both ends of the current sensing resistor, the output end of the operational amplifier unit is connected to the input end of the analog-to-digital conversion unit, the output end of the analog-to-digital conversion unit is connected to the input end of the gain control unit, and the output end of the gain control unit is connected to the input end of the operational amplifier unit; Figure 6 As shown, the method may include the following steps:
[0180] In step S101, a digital voltage signal output by the analog-to-digital conversion unit is obtained.
[0181] Among them, the digital voltage signal is obtained after the analog-to-digital conversion unit performs analog-to-digital conversion on the analog voltage signal output by the operational amplifier unit, and the analog voltage signal is obtained after the operational amplifier unit amplifies the collected voltage signal across the current sensing resistor based on the voltage gain gear.
[0182] In step S102, the gain level of the operational amplifier unit is controlled according to the digital voltage signal and the voltage gain level.
[0183] The gain level is used to represent the amplification factor of the voltage signal when the operational amplifier unit amplifies the voltage signal.
[0184] In some embodiments, the gain control unit includes: multiple digital comparators, multiple registers corresponding to the multiple digital comparators, and comparison decoding circuits; different digital comparators correspond to different gain gears; the output end of the analog-to-digital conversion unit is connected to the first input end of the digital comparator, and the output end of the register is connected to the second input end of the digital comparator; the output end of the digital comparator is connected to the input end of the comparison decoding circuit, and the output end of the comparison decoding circuit is connected to the input end of the operational amplifier unit. The functions of each device / circuit in the gain control unit can be referred to Figures 1 to 5 The relevant instructions in will not be repeated here.
[0185] Alternatively, if Figure 7 As shown, in the above step S102, controlling the gain level of the operational amplifier unit according to the digital voltage signal and the voltage gain level may include the following steps:
[0186] In step S1021, a first voltage comparison result corresponding to the digital voltage signal is determined according to the voltage gain level.
[0187] The first voltage comparison result includes that the voltage exceeds the normal working voltage range, or that the voltage does not exceed the normal working voltage range.
[0188] In step S1022, a target gain level is determined according to the first voltage comparison result and the voltage gain level.
[0189] In step S1023, the gain level of the operational amplifier unit is controlled according to the target gain level.
[0190] Further, in step S1021, determining the first voltage comparison result corresponding to the digital voltage signal according to the voltage gain gear may include: obtaining a first preset voltage value range corresponding to the voltage gain gear; and determining the first voltage comparison result corresponding to the digital voltage signal according to the first preset voltage value range.
[0191] In some embodiments, the voltage exceeding the normal operating voltage range may include: the voltage exceeding an upper limit of the normal operating voltage range or the voltage exceeding a lower limit of the normal operating voltage range.
[0192] Correspondingly, according to the first preset voltage value range, determining the first voltage comparison result corresponding to the digital voltage signal includes:
[0193] In the case where the digital voltage signal is greater than the upper limit of the first preset voltage value range, determining the first voltage comparison result includes that the voltage exceeds the upper limit of the normal working voltage range; or,
[0194] In the case where the digital voltage signal is less than the lower limit of the first preset voltage value range, determining the first voltage comparison result includes that the voltage exceeds the lower limit of the normal working voltage range; or,
[0195] In the case where the digital voltage signal is within the first preset voltage value range, determining the first voltage comparison result includes that the voltage does not exceed a normal operating voltage range.
[0196] In a possible implementation, when the first voltage comparison result includes that the voltage exceeds an upper limit of a normal operating voltage range, determining the target gain level according to the first voltage comparison result and the voltage gain level includes:
[0197] In the case where the voltage gain level is the lowest level gain level, the voltage gain level is used as the target gain level; or,
[0198] When the voltage gain level is not the lowest level gain level, the next level gain level corresponding to the voltage gain level is used as the target gain level;
[0199] Among them, the level of the next level gain level corresponding to the voltage gain level is lower than the level of the voltage gain level.
[0200] In another possible implementation, when the first voltage comparison result includes that the voltage exceeds a lower limit of a normal operating voltage range, determining the target gain level according to the first voltage comparison result and the voltage gain level includes:
[0201] In the case where the voltage gain level is the highest level gain level, the voltage gain level is used as the target gain level; or,
[0202] When the voltage gain level is not the highest level gain level, the previous level gain level corresponding to the voltage gain level is used as the target gain level;
[0203] Among them, the level of the previous level gain level corresponding to the voltage gain level is higher than the level of the voltage gain level.
[0204] In another possible implementation, when the first voltage comparison result includes that the voltage does not exceed a normal operating voltage range, determining the target gain level according to the first voltage comparison result and the voltage gain level includes: using the voltage gain level as the target gain level.
[0205] Accordingly, in the above step S1023, controlling the gain level of the operational amplifier unit according to the target gain level includes:
[0206] When the target gain level includes the voltage gain level, maintaining the gain level of the operational amplifier unit; or,
[0207] When the target gain level does not include the voltage gain level, the gain level of the operational amplifier unit is adjusted to the target gain level.
[0208] Furthermore, if Figure 8 As shown, the method may also include the following steps:
[0209] In step S103, the analog voltage signal output by the operational amplifier unit is obtained.
[0210] In step S104, a second voltage comparison result corresponding to the analog voltage signal is determined.
[0211] The second voltage comparison result includes that the voltage exceeds the normal working voltage range, or that the voltage does not exceed the normal working voltage range.
[0212] Correspondingly, determining the target gain level according to the first voltage comparison result and the voltage gain level in the above step S1022 includes: determining the target gain level according to the first voltage comparison result, the second voltage comparison result and the voltage gain level.
[0213] Optionally, determining the second voltage comparison result corresponding to the analog voltage signal in step S104 may include:
[0214] Obtaining a second preset voltage value range;
[0215] The second voltage comparison result is determined according to the second preset voltage value range and the analog voltage signal.
[0216] Optionally, determining the target gain level according to the first voltage comparison result, the second voltage comparison result and the voltage gain level may include:
[0217] When the first voltage comparison result and the second voltage comparison result are the same, or the second voltage comparison result includes that the voltage does not exceed the normal working voltage range, the target gain level is determined according to the first voltage comparison result and the voltage gain level; or,
[0218] When the first voltage comparison result is different from the second voltage comparison result, and the second voltage comparison result includes a voltage exceeding a normal operating voltage range, the target gain level is determined according to the second voltage comparison result and the voltage gain level.
[0219] Furthermore, the gain control circuit further includes: a processor; the processor is connected to the analog-to-digital conversion unit and the gain control unit respectively.
[0220] Alternatively, if Fig. 9 As shown, the method may also include:
[0221] In step S105 , it is periodically determined whether the first voltage comparison result is different from the second voltage comparison result.
[0222] In step S106, when it is determined that the first voltage comparison result is different from the second voltage comparison result for a preset number of consecutive cycles, it is determined that the gain control circuit has a fault.
[0223] In some embodiments, after obtaining the digital voltage signal, the resistance value corresponding to the current sensing resistor can be further obtained, and then the corresponding target current value can be determined based on the digital voltage signal and the resistance value to achieve the purpose of monitoring the current flowing through the current sensing resistor.
[0224] In addition, if the target current value exceeds the preset current range threshold, the processor may also generate corresponding prompt information to prompt the user to check it.
[0225] It should be noted that, regarding the method in the above embodiment, the specific manner of performing the operation in each step has been described in Figures 1 to 5The embodiment of the gain control circuit 100 is described in detail in the accompanying drawings and will not be elaborated on in detail here.
[0226] By adopting the above method, by adding a gain control unit, the digital voltage signal output by the analog conversion unit can be monitored, and the gain level of the operational amplifier unit can be flexibly and automatically controlled according to the digital voltage signal and the current voltage gain level of the operational amplifier unit. The entire gain level control process does not require the participation of software and programs, and the gain level of the operational amplifier unit can be controlled by relying on hardware circuits, thereby improving the reliability and timeliness of the gain control. In addition, by controlling the gain level, the accuracy of the voltage output by the analog conversion unit after subsequent adjustment can be guaranteed, thereby improving the accuracy of the subsequent determination of the current.
[0227] Fig.10 is a block diagram of a vehicle according to an exemplary embodiment, such as Fig.10 As shown, the vehicle 300 includes the above Figures 1 to 5 A gain control circuit 100 is provided in FIG.
[0228] Regarding the vehicle 300 in the above embodiment, the specific manner in which the gain control circuit 100 performs operations has been described in detail in the embodiment of the gain control circuit 100, and will not be elaborated here.
[0229] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0230] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0231] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A gain control circuit, It is characterized in that The gain control circuit comprises: a current-sense resistor, an operational amplifier unit, an analog-to-digital conversion unit and a gain control unit, wherein the input end of the operational amplifier unit is connected to both ends of the current-sense resistor, the output end of the operational amplifier unit is connected to the input end of the analog-to-digital conversion unit, the output end of the analog-to-digital conversion unit is connected to the input end of the gain control unit, and the output end of the gain control unit is connected to the input end of the operational amplifier unit; The operational amplifier unit is used to collect the voltage signal at both ends of the current sensing resistor, and amplify the voltage signal based on the voltage gain gear to obtain an analog voltage signal; The analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog voltage signal to obtain a digital voltage signal; The gain control unit is used to control the gain level of the operational amplifier unit according to the digital voltage signal and the voltage gain level; the gain level is used to represent the amplification factor of the operational amplifier unit when amplifying the voltage signal; The gain control unit comprises: a plurality of digital comparators, a plurality of registers corresponding to the plurality of digital comparators one by one, and a comparison decoding circuit; different digital comparators correspond to different gain gears; the output end of the analog-to-digital conversion unit is connected to the first input end of the digital comparator, the output end of the register is connected to the second input end of the digital comparator; the output end of the digital comparator is connected to the input end of the comparison decoding circuit, and the output end of the comparison decoding circuit is connected to the input end of the operational amplifier unit; The gain control unit also includes: an analog comparator, a first resistor, a second resistor and a third resistor; the first resistor, the second resistor and the third resistor are connected in series in sequence, and are respectively connected to a power line and a ground line after being connected in series; a first input end of the analog comparator is connected to a connection line between the first resistor and the second resistor, a second input end of the analog comparator is connected to a connection line between the second resistor and the third resistor, a third input end of the analog comparator is connected to an output end of the operational amplifier unit, and an output end of the analog comparator is connected to the comparison decoding circuit.
2. The circuit according to claim 1, It is characterized in that The comparison decoding circuit is used to determine a first voltage comparison result corresponding to the digital voltage signal according to the voltage gain gear; the first voltage comparison result includes that the voltage exceeds the normal working voltage range, or the voltage does not exceed the normal working voltage range; and determine a target gain gear according to the first voltage comparison result and the voltage gain gear; and control the gain gear of the operational amplifier unit according to the target gain gear.
3. The circuit according to claim 2, It is characterized in that The comparison decoding circuit is used to use the digital comparator corresponding to the voltage gain level as the target digital comparator from the multiple digital comparators, and obtain the first voltage comparison result corresponding to the digital voltage signal output by the target digital comparator.
4. The circuit according to claim 3, It is characterized in that The target digital comparator is used to obtain a first preset voltage value range stored in a register connected to the target digital comparator, and determine the first voltage comparison result corresponding to the digital voltage signal according to the first preset voltage value range.
5. The circuit according to claim 4, It is characterized in that The voltage exceeding the normal operating voltage range includes: the voltage exceeding the upper limit of the normal operating voltage range or the voltage exceeding the lower limit of the normal operating voltage range; the target digital comparator is used to determine that the first voltage comparison result includes that the voltage exceeds the upper limit of the normal operating voltage range when the digital voltage signal is greater than the upper limit of the first preset voltage value range; or, when the digital voltage signal is less than the lower limit of the first preset voltage value range, determine that the first voltage comparison result includes that the voltage exceeds the lower limit of the normal operating voltage range; or, when the digital voltage signal is within the first preset voltage value range, determine that the first voltage comparison result includes that the voltage does not exceed the normal operating voltage range.
6. The circuit according to claim 5, It is characterized in that When the first voltage comparison result includes that the voltage exceeds the upper limit of the normal working voltage range, the comparison decoding circuit is used to use the voltage gain gear as the target gain gear when the voltage gain gear is the lowest level gain gear; or, when the voltage gain gear is not the lowest level gain gear, use the next level gain gear corresponding to the voltage gain gear as the target gain gear; wherein the level of the next level gain gear corresponding to the voltage gain gear is lower than the level of the voltage gain gear.
7. The circuit according to claim 5, It is characterized in that When the first voltage comparison result includes that the voltage exceeds the lower limit of the normal working voltage range, the comparison decoding circuit is used to use the voltage gain gear as the target gain gear when the voltage gain gear is the highest level gain gear; or, when the voltage gain gear is not the highest level gain gear, use the previous level gain gear corresponding to the voltage gain gear as the target gain gear; wherein the level of the previous level gain gear corresponding to the voltage gain gear is higher than the level of the voltage gain gear.
8. The circuit according to claim 5, It is characterized in that When the first voltage comparison result includes that the voltage does not exceed a normal operating voltage range, the comparison decoding circuit is configured to use the voltage gain level as the target gain level.
9. The circuit according to claim 2, It is characterized in that The comparison decoding circuit is used to maintain the gain level of the operational amplifier unit when the target gain level includes the voltage gain level; or When the target gain level does not include the voltage gain level, the gain level of the operational amplifier unit is adjusted to the target gain level.
10. The circuit according to claim 2, It is characterized in that The analog comparator is used to obtain the analog voltage signal output by the operational amplifier unit, and determine a second voltage comparison result corresponding to the analog voltage signal; the second voltage comparison result includes that the voltage exceeds the normal working voltage range, or the voltage does not exceed the normal working voltage range; The comparison decoding circuit is used to determine the target gain level according to the first voltage comparison result, the second voltage comparison result and the voltage gain level.
11. The circuit according to claim 10, It is characterized in that The analog comparator is used to obtain a second preset voltage value range; and determine the second voltage comparison result according to the second preset voltage value range and the analog voltage signal.
12. The circuit according to claim 10, It is characterized in that The comparison decoding circuit is used to determine the target gain gear according to the first voltage comparison result and the voltage gain gear when the first voltage comparison result and the second voltage comparison result are the same, or the second voltage comparison result includes that the voltage does not exceed the normal working voltage range; Alternatively, when the first voltage comparison result is different from the second voltage comparison result, and the second voltage comparison result includes that the voltage exceeds the normal operating voltage range, the target gain level is determined according to the second voltage comparison result and the voltage gain level.
13. A circuit according to any one of claims 10 to 12, It is characterized in that The gain control circuit further includes: a processor; the processor is connected to the analog-to-digital conversion unit and the gain control unit respectively.
14. The circuit according to claim 13, It is characterized in that The processor is used to periodically determine whether the first voltage comparison result is different from the second voltage comparison result; and when it is determined that the first voltage comparison result is different from the second voltage comparison result for a preset number of consecutive cycles, determine that there is a fault in the gain control circuit.
15. The circuit according to claim 13, It is characterized in that The processor is used to obtain the resistance value corresponding to the current-sensing resistor; and determine the corresponding target current value according to the digital voltage signal and the resistance value.
16. A gain control method, It is characterized in that The invention is applied to a gain control circuit, the gain control circuit comprising: a current sensing resistor, an operational amplifier unit, an analog-to-digital conversion unit and a gain control unit, the input end of the operational amplifier unit is connected to both ends of the current sensing resistor, the output end of the operational amplifier unit is connected to the input end of the analog-to-digital conversion unit, the output end of the analog-to-digital conversion unit is connected to the input end of the gain control unit, and the output end of the gain control unit is connected to the input end of the operational amplifier unit; the method comprises: Acquire a digital voltage signal output by the analog-to-digital conversion unit; the digital voltage signal is obtained after the analog-to-digital conversion unit performs analog-to-digital conversion on the analog voltage signal output by the operational amplifier unit, and the analog voltage signal is obtained after the operational amplifier unit performs amplification processing on the collected voltage signal across the current-sensing resistor based on the voltage gain gear; According to the digital voltage signal and the voltage gain level, the gain level of the operational amplifier unit is controlled; the gain level is used to characterize the amplification factor of the operational amplifier unit when amplifying the voltage signal; The gain control unit comprises: a plurality of digital comparators, a plurality of registers corresponding to the plurality of digital comparators one by one, and a comparison decoding circuit; different digital comparators correspond to different gain gears; the output end of the analog-to-digital conversion unit is connected to the first input end of the digital comparator, the output end of the register is connected to the second input end of the digital comparator; the output end of the digital comparator is connected to the input end of the comparison decoding circuit, and the output end of the comparison decoding circuit is connected to the input end of the operational amplifier unit; The gain control unit also includes: an analog comparator, a first resistor, a second resistor and a third resistor; the first resistor, the second resistor and the third resistor are connected in series in sequence, and are respectively connected to a power line and a ground line after being connected in series; a first input end of the analog comparator is connected to a connection line between the first resistor and the second resistor, a second input end of the analog comparator is connected to a connection line between the second resistor and the third resistor, a third input end of the analog comparator is connected to an output end of the operational amplifier unit, and an output end of the analog comparator is connected to the comparison decoding circuit.
17. The method according to claim 16, It is characterized in that The step of controlling the gain level of the operational amplifier unit according to the digital voltage signal and the voltage gain level comprises: Determining a first voltage comparison result corresponding to the digital voltage signal according to the voltage gain gear; the first voltage comparison result includes that the voltage exceeds the normal working voltage range, or the voltage does not exceed the normal working voltage range; Determining a target gain level according to the first voltage comparison result and the voltage gain level; The gain level of the operational amplifier unit is controlled according to the target gain level.
18. The method according to claim 17, It is characterized in that Determining the first voltage comparison result corresponding to the digital voltage signal according to the voltage gain gear includes: Obtaining a first preset voltage value range corresponding to the voltage gain gear; The first voltage comparison result corresponding to the digital voltage signal is determined according to the first preset voltage value range.
19. The method according to claim 18, It is characterized in that The voltage exceeding the normal working voltage range includes: the voltage exceeding the upper limit of the normal working voltage range or the voltage exceeding the lower limit of the normal working voltage range; the determining the first voltage comparison result corresponding to the digital voltage signal according to the first preset voltage value range includes: In the case where the digital voltage signal is greater than the upper limit of the first preset voltage value range, determining the first voltage comparison result includes that the voltage exceeds the upper limit of the normal working voltage range; or, In the case where the digital voltage signal is less than the lower limit of the first preset voltage value range, determining the first voltage comparison result includes that the voltage exceeds the lower limit of the normal working voltage range; or, In a case where the digital voltage signal is within the first preset voltage value range, determining the first voltage comparison result includes that the voltage does not exceed a normal operating voltage range.
20. The method according to claim 19, It is characterized in that In a case where the first voltage comparison result includes that the voltage exceeds an upper limit of a normal working voltage range, determining a target gain level according to the first voltage comparison result and the voltage gain level includes: In the case where the voltage gain level is the lowest level gain level, the voltage gain level is used as the target gain level; or, When the voltage gain level is not a lowest level gain level, taking a next level gain level corresponding to the voltage gain level as the target gain level; Among them, the level of the next level gain level corresponding to the voltage gain level is lower than the level of the voltage gain level.
21. The method according to claim 19, It is characterized in that In a case where the first voltage comparison result includes that the voltage exceeds a lower limit of a normal working voltage range, determining a target gain level according to the first voltage comparison result and the voltage gain level includes: In the case where the voltage gain level is the highest level gain level, the voltage gain level is used as the target gain level; or, When the voltage gain level is a gain level other than the highest level, taking the previous level gain level corresponding to the voltage gain level as the target gain level; Among them, the level of the previous level gain level corresponding to the voltage gain level is higher than the level of the voltage gain level.
22. The method according to claim 19, It is characterized in that In a case where the first voltage comparison result includes that the voltage does not exceed a normal operating voltage range, determining a target gain level according to the first voltage comparison result and the voltage gain level includes: The voltage gain level is used as the target gain level.
23. The method according to claim 17, It is characterized in that The step of controlling the gain level of the operational amplifier unit according to the target gain level includes: When the target gain level includes the voltage gain level, maintaining the gain level of the operational amplifier unit; or When the target gain level does not include the voltage gain level, the gain level of the operational amplifier unit is adjusted to the target gain level.
24. The method according to claim 17, It is characterized in that The method further comprises: Acquire the analog voltage signal output by the operational amplifier unit; Determine a second voltage comparison result corresponding to the analog voltage signal; the second voltage comparison result includes that the voltage exceeds the normal working voltage range, or the voltage does not exceed the normal working voltage range; The determining the target gain level according to the first voltage comparison result and the voltage gain level comprises: The target gain level is determined according to the first voltage comparison result, the second voltage comparison result, and the voltage gain level.
25. The method according to claim 24, It is characterized in that Determining a second voltage comparison result corresponding to the analog voltage signal includes: Obtaining a second preset voltage value range; The second voltage comparison result is determined according to the second preset voltage value range and the analog voltage signal.
26. The method according to claim 24, It is characterized in that The determining the target gain level according to the first voltage comparison result, the second voltage comparison result and the voltage gain level comprises: When the first voltage comparison result and the second voltage comparison result are the same, or the second voltage comparison result includes that the voltage does not exceed the normal operating voltage range, determining the target gain level according to the first voltage comparison result and the voltage gain level; or, When the first voltage comparison result is different from the second voltage comparison result, and the second voltage comparison result includes that the voltage exceeds a normal operating voltage range, the target gain level is determined according to the second voltage comparison result and the voltage gain level.
27. The method according to any one of claims 24 to 26, It is characterized in that The gain control circuit further includes: a processor; the processor is connected to the analog-to-digital conversion unit and the gain control unit respectively.
28. The method according to claim 27, It is characterized in that The method further comprises: periodically determining whether the first voltage comparison result is different from the second voltage comparison result; When it is determined that the first voltage comparison result is different from the second voltage comparison result for a preset number of consecutive cycles, it is determined that a fault exists in the gain control circuit.
29. The method according to claim 27, It is characterized in that The method further comprises: Obtaining a resistance value corresponding to the current-sense resistor; A corresponding target current value is determined according to the digital voltage signal and the resistance value.
30. A vehicle, It is characterized in that The vehicle comprises the gain control circuit according to any one of claims 1 to 15 above.
