A battery charging management algorithm that automatically resumes operation when the open circuit abnormality at the charging output is eliminated
Through the multi-stage decreasing constant current charging method and the event cycle timing stage method, the problem of the battery charging output end being unable to automatically recover when the circuit is abnormal is solved, and the automatic recovery and normal charging of the battery are achieved.
Patent Information
- Application Number
- CN202310218691.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2043-03-02
Smart Images

Figure CN116154915B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic circuits, and in particular to a battery charging management algorithm that can automatically resume operation when an open circuit abnormality at a charging output terminal is eliminated. Background Art
[0002] Among the battery charging management methods, there is a multi-stage decreasing constant current charging method that can suppress the overcharge spike voltage at the output when the charging output is open. It divides the entire charging process into several stages. Each stage uses a constant current method for charging, but the charging current decreases stage by stage. The first stage takes the maximum charging current I allowed by the battery. Charge() , the stage before charging is terminated is the termination charging current threshold I Term When the charging output terminal is not open-circuited, recharging starts from the first stage; when the charging output terminal is open-circuited, recharging starts from the latter stage, which can suppress the voltage spike at the output terminal.
[0003] This method offers simple control logic and quick hardware response times. However, if a battery is suddenly connected to the output terminal after it has been opened, the system will not automatically resume operation once the open-circuit condition has been resolved. While suddenly connecting a battery while the system is powered is not recommended and may pose unexpected risks, users may not be aware of this in practice.
[0004] Suppose the charging output is short-circuited when the system powers on. When charging is terminated and recharging is triggered, a battery with a low voltage is suddenly connected. The output voltage is immediately pulled down to the battery voltage, and the system immediately initiates recharging. Due to the system's execution logic, the current used for this recharge will be lower than the previous one. Using such a low current to charge the battery will have little effect.
[0005] Therefore, it is necessary to consider an algorithm for automatically restoring normal charging current when a battery is suddenly connected. The present invention proposes a battery charging management algorithm that can automatically resume operation when the open circuit abnormality at the charging output terminal is eliminated. Summary of the Invention
[0006] The purpose of the present invention is to provide a battery charging management algorithm that can automatically resume operation when the open circuit abnormality of the charging output terminal is eliminated, aiming to solve the problem that the above system cannot charge normally when the charging output terminal is open circuit or the battery is suddenly connected.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a battery charging management algorithm that can automatically resume operation when the open circuit abnormality at the charging output terminal is eliminated, the method comprising:
[0008] Step S100, the charging process is divided into N + 1 stages, where N > 0, and they are sequentially denoted as stage 0, 1, 2, …, N. Each stage charges with a constant output current, and the current value decreases step by step. The current value in stage 0 is set as the maximum charging current I allowed by the battery. Charge(max) , stage M - 1 is the stage before charging termination, where 0 < M ≤ N, and the charging current is I Term , and the Mth stage is the stage to terminate the charging process;
[0009] Step S200, the output terminal voltage V is continuously detected in each stage Sense whether it reaches the voltage V representing the full charge of the battery Full , let y = 1 represent V Sense ≥V Full , y = 0 represent V Sense <V Full , and as long as y = 1, this stage is immediately ended;
[0010] Step 3S00, stages 0 to M are multi - cycle stages, that is, these stages are allowed to contain multiple cycles, and there is only one event to end them: y = 1. Stages M + 1 to N are single - cycle stages, allowing at most one cycle, and there are two events to end them: y = 1, or PC > 0. The single - cycle stages are optional, where PC represents the number of cycles at the end of the stage, and the number of cycles at the end of the stage can be summarized into two states: PC = 0 or PC > 0;
[0011] Step S400, when stages 0 to M - 1 end, enter the next stage to continue charging; when stages M to N end, terminate charging and wait for re - charging. Let z = 1 represent V Sense ≥V Recharge , z = 0 represent V Sense <V Recharge , then re - charging starts when z changes from 1 to 0, where V Recharge is the re - charging voltage threshold;
[0012] Step S500, the number of stages at the end of charging termination is n, where n ≥ M. During re - charging, if PC[n] = 0, move forward one step backward, unless it has reached stage N.
[0013] As a preferred implementation of the present invention, in step S200, a timer is set for each stage for timing. Each time the timing is full, it is called the completion of a timing cycle; the number of cycles is denoted as PC. When the timing is less than one cycle, the number of cycles PC is taken as 0, and each time a cycle is full, the number of cycles PC is incremented by 1. The duration of the timing cycle for each stage can be the same or different.
[0014] As a preferred embodiment of the present invention, the setting of the timer duration in step S200 must satisfy the following requirements: when the output end is open, the current stage ends within one cycle due to y=1, that is, the number of cycles at the end of the stage is 0; and when the output end is not open, the current stage will not end within one cycle, that is, the number of cycles at the end of the stage is greater than 0.
[0015] As a preferred embodiment of the present invention, the details of step S500 are as follows:
[0016] When n>M, if PC[n]>0, it moves forward one step and finally returns to the 0th order, that is, returns to 0 step by step, or directly returns to the 0th order, that is, returns to 0 in a single step, and then the charging current increases step by step or increases in a single step to the maximum charging current;
[0017] When n=M, it still goes back one step when PC[k]=0, unless k=N. When PC[k]>0, it is allowed to include multiple cycles. First, it is necessary to distinguish whether the output end has been connected to the battery or suddenly connected to the battery. If the battery is suddenly connected, it will return to 0 step by step or step by step when the first timing cycle is full. If the battery was connected during the last charge, it will continue to maintain the current stage when the timing cycle is full. Among them, k is an integer variable used to store the stage number, and n is the stage number when charging is terminated.
[0018] As a preferred embodiment of the present invention, whether the output terminal is always connected to the battery is distinguished by checking whether PC[k-1] is 0 during the last charging process. If it is 0, it means that the battery was suddenly connected, and if it is not 0, it means that the battery was connected during the last charging.
[0019] As a preferred embodiment of the present invention, the algorithm formula used in this method is as follows:
[0020]
[0021] Where N is an integer constant representing the maximum order;
[0022] M is an integer constant, representing the maximum number of stages when charging the battery, M≤N;
[0023] k is an integer variable used to store the number of stages;
[0024] y is a Boolean variable, y represents V sense With V Full The comparison results.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] A battery charging management algorithm of the present invention can automatically resume operation when an open-circuit anomaly at the charging output terminal is eliminated. When the open-circuit state at the output is eliminated, it can quickly and automatically resume normal operation. Secondly, the entire algorithm is concise and clear, only using simple operations such as incrementing by 1, decrementing by 1, comparing, and jumping of integers, which is easy to implement in hardware and also easy to implement in various programming languages. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention.
[0028] Figure 1 It is the overall flowchart of a battery charging management algorithm of the present invention that can automatically resume operation when an open-circuit anomaly at the charging output terminal is eliminated;
[0029] Figure 2 It is the waveform diagram of the output current and output voltage when charging the battery according to the present invention;
[0030] Figure 3 It is the waveform diagram of the output current and output voltage when the output terminal is open-circuited according to the present invention;
[0031] Figure 4 It is the flowchart of the algorithm disclosed by the present invention;
[0032] Figure 5 It is the state transition diagram of the algorithm disclosed by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0033] In order to make the technical problems, technical solutions, and beneficial effects to be solved by the present invention more clearly understood, the following further details the present invention in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. [[ID=三十二]]
[0034] [[ID=三十三]]Please refer to [[ID=三十四]] Figure 1-Figure 5 [[ID=三十五]]For achieving the above object, the present invention provides the following technical solution: A battery charging management algorithm that can automatically resume operation when an open-circuit anomaly at the charging output terminal is eliminated, the method includes: [[ID=三十六]] [[ID=三十七]]
[0035] [[ID=三十八]]Step S100, the charging process is divided into N + 1 stages, and N > 0. They are sequentially denoted as stage 0, 1, 2,..., N. Each stage charges with a constant output current, and the current value decreases step by step. The current value in stage 0 is set as the maximum charging current I allowed by the battery [[ID=三十九]] Charge(max) [[ID=四十]]where stage M - 1 is the stage before the charging termination, where 0 < M ≤ N, and the charging current is I [[ID=四十一]] Term [[ID=四十二]]and the Mth stage is the stage to terminate the charging process; [[ID=四十三]]
[0036] In this step, the charging process is divided into multiple stages. Suppose there are a total of N + 1 (N > 0) stages, and the stage numbers range from 0 to N. Each stage charges with a constant output current, and the current value decreases step by step. The current value in stage 0 is set as the maximum charging current I allowed by the battery. Charge() , stage M - 1 (0 < M ≤ N) is the stage before charging termination, and the charging current is I. Term . The Mth stage is the stage to terminate the charging process; the stages after this stage are all set to further suppress the spike voltage when the output is open - circuited, and they are all optional stages. The stage current can also increase step by step. In this case, the direction of stage progression is just opposite, and its working principle is exactly the same.
[0037] Step S200, continuously detect the output - terminal voltage V in each stage. Sense Whether it reaches the voltage V representing that the battery is full. Full , let y = 1 represent V Sense ≥V Full , y = 0 represent V Sense <V Full , as long as y = 1, immediately end this stage;
[0038] In this step, continuously detect the output - terminal voltage V in each stage. sense Whether it reaches the voltage V representing that the battery is full. Full , let y = 1 represent V Sense ≥V Full , y = 0 represent V Sense <V Full , as long as y = 1, immediately end this stage. At the same time, a timer is set for each stage to time. Each time the timing is full, it is called completing a timing cycle. When the timing is less than one cycle, the cycle number PC is taken as 0, and each time a cycle is full, the cycle number PC is incremented by 1. The duration of the timing cycle for each stage can be the same or different, but the duration setting must meet the following conditions: when the output is open - circuited, in one cycle, this stage ends due to y = 1, that is, the cycle number at the end of the stage is 0; when the output is not open - circuited, in one cycle, this stage does not end, that is, the cycle number at the end of the stage > 0. This is one of the core processing methods of this algorithm, simply referred to as the "event - cycle timing stage method", meaning that within a stage, both a specific event is detected and periodic timing is carried out.
[0039] Step 3S00, stages 0 to M are multi - cycle stages, that is, these stages are allowed to contain multiple cycles, and there is only one event to end them: y = 1. Stages M + 1 to N are single - cycle stages, allowing at most one cycle, and there are two events to end them: y = 1, or PC > 0. Among them, the single - cycle stages are optional. Here, PC represents the cycle number at the end of the stage, and the cycle number at the end of the stage can be summarized into two states: PC = 0 or PC > 0;
[0040] Step S400: When the phases 0 to M-1 are finished, the charging process continues. When the phases M to N are finished, the charging process is terminated and the system waits for recharging. Let z = 1 represent V Sense ≥V Recharge , z=0 represents V Sense <V Recharge , then recharging begins when z changes from 1 to 0, where V Recharge is the recharge voltage threshold;
[0041] The number of stages at the end of step S500 charging is n, where n ≥ M. During recharging, if PC[n] = 0, then the battery advances one stage backward, unless it has already reached stage N.
[0042] In this step, it is assumed that the number of stages at the end of charging is n (n>=M). During recharging, if PC[n]=0, the recharge current will advance one stage, unless it has already reached stage N. In this way, when the output is open, the recharge current decreases gradually. When n>M, if PC[n]>0, the recharge current will advance one stage and eventually return to stage 0, which is called "step-by-step return to 0", or directly return to stage 0, which is called "single-step return to 0". In this way, when the output open circuit is eliminated, the recharge current will increase gradually or in single steps to the maximum charging current. The processing method for n=M is as follows;
[0043] In the stage of k<=M, whether terminating charging and waiting for recharging, or continuing charging, when PC[k]=0, it still goes back one step (unless k=N), but the processing method is different when PC[k]>0. Since they are allowed to contain multiple cycles, they cannot go forward when PC[k]>0, but need to distinguish whether the output end has been connected to the battery or suddenly connected to the battery. In this regard, the method disclosed in the present invention uses the "review method", that is, checking whether PC[k-1] is 0 during the last charging process. If it is 0, it means that the battery was suddenly connected, so it is necessary to return to 0 step by step or step by step when the first timing cycle is full. If it is not 0, it means that the battery was connected during the last charging, so it continues to maintain the current stage when the timing cycle is full. The processing method of PC[k]>0 is shown in the attached figure. Figure 5 Provide auxiliary explanation.
[0044] For further information, see Figure 4 , the algorithm formula used in this method is as follows:
[0045]
[0046] Where N is an integer constant representing the maximum order;
[0047] M is an integer constant, representing the maximum number of stages when charging the battery, M≤N;
[0048] k is an integer variable used to store the number of stages;
[0049] y is a Boolean variable, y represents V sense With V Full The comparison results.
[0050] Example
[0051] The following is an example of implementing this algorithm in C language, using the step-by-step zeroing method. It requires hardware design support, mainly including:
[0052] (1) A constant current source with controllable output current, the output current is C*I b , C can be selected from 1 to MAX, MAX=I Charge(max) / I b There are many ways to implement this constant current source in hardware.
[0053] (2) Two analog comparators, one of which is used to charge the output port voltage V Sense With the set constant V Full Comparison, output y, if V Sense ≥V Full Then y=1, otherwise y=0; the other is used for charging output port voltage V Sense With the set constant V Recharge Comparison, output z, if V Sense ≥V Recharge If there is no analog comparator, you can use an analog / digital converter to convert V Sense Convert it into a digital value and then compare it with the digital constant.
[0054] The following constants and variables are predeclared:
[0055] (1) Integer constant N, representing the maximum order;
[0056] (2) Integer constant M, representing the maximum number of stages when charging the battery, M <= N;
[0057] (3) Integer variable k, used to store the stage number;
[0058] (4) Boolean variable y, y = false represents V Sense <V Full The comparison results;
[0059] (5) Boolean variable z, z = false represents V Sense <V Recharge The comparison results;
[0060] (6) A one-dimensional integer array constant C[k] with a length of N+1 is used to store the multiple values of the charging current at each stage, C[0]=MAX, C[M-1]=I Term / I b Rounding of
[0061] (7) A one-dimensional integer array constant P[k] of length N+1 is used to store the cycle count length of each stage. Different stages can have the same number, but they must meet the requirements that the output open circuit is less than 1 cycle and the output is not open circuit for more than 1 cycle;
[0062] (8) A one-dimensional integer array variable PC[k] with a length of N+1 is used to store the number of cycles in each stage.
[0063] The following program segment implements the algorithm, using labels and goto statements for readability:
[0064]
[0065]
[0066] In summary, when the output is open, the system rapidly reduces the charging and recharging currents to very low values to suppress output voltage spikes. Although this charging current is low, it can still quickly allow the output voltage to exceed the battery's full charge voltage, thereby terminating the charging cycle. However, when a battery is connected, it takes a much longer time to fully charge the battery. Therefore, a timer with an appropriate value is added during these low-current phases. When the timer reaches full, it indicates that the output open anomaly has resolved and the charging current should be increased. This means that the present invention can quickly and automatically resume normal operation when the output open condition is resolved. Furthermore, the algorithm is concise and clear, using only simple operations such as integer increment and decrement, comparison, and jumps, making it easy to implement in both hardware and various programming languages.
[0067] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0068] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A battery charging management algorithm that automatically resumes operation when the open circuit abnormality at the charging output terminal is eliminated, characterized in that: The algorithm includes: Step S100: The charging process is divided into N+1 stages, where N>0, which are sequentially recorded as stages 0, 1, 2, ..., N. Each stage uses a constant output current for charging, and the current value decreases step by step. The current value of stage 0 is set to the maximum charging current allowed by the battery. Charge(max) , stage M-1 is the stage before charging is terminated, where 0<M≤N, and the charging current is I Term , the Mth stage is the stage of terminating the charging process; Step S200: Continuously detect the output voltage V in each stage. Sense Whether the voltage V representing a full battery charge is reached Full , let y = 1 represent V Sense ≥V Full , y=0 represents V Sense <V Full , as long as y = 1, this stage ends immediately; Step S300: Stages 0 to M are multi-cycle stages, i.e., these stages are allowed to contain multiple cycles, and there is only one event that causes them to end: y = 1. Stages M+1 to N are single-cycle stages, and at most one cycle is allowed. There are two possible events that cause them to end: y = 1, or PC > 0. The single-cycle stage is optional, where PC represents the number of cycles at the end of the stage, and the number of cycles at the end of the stage can be summarized into two states: PC = 0 or PC > 0. Step S400: When the stage 0 to M-1 is finished, the charging process continues; when the stage M to N is finished, the charging process is terminated and the charging process is continued. Let z = 1 represent V Sense ≥V Recharge , z=0 represents V Sense <V Recharge , then recharging begins when z changes from 1 to 0, where V Recharge is the recharge voltage threshold; The number of stages when charging is terminated in step S500 is n, where n≥M. During recharging, if PC[n]=0, the process moves backward by one stage unless the process has reached stage N.
2. A battery charging management algorithm capable of automatically resuming operation when the open circuit abnormality at the charging output terminal is eliminated according to claim 1, characterized in that: In step S200, a timer is set for each stage for timing, wherein each time the timing is completed is called a timing cycle; wherein the number of cycles is recorded as PC, when the timing is less than one cycle, the number of cycles PC is taken as 0, and each time a full cycle is completed, the number of cycles PC is increased by 1, and the timing cycle lengths of each stage can be the same or different.
3. A battery charging management algorithm capable of automatically resuming operation when the open circuit abnormality at the charging output terminal is eliminated according to claim 2, characterized in that: The setting of the timer duration in step S200 must satisfy the following requirements: when the output terminal is open, the current stage ends within one cycle due to y=1, that is, the number of cycles at the end of the stage is 0; and when the output terminal is not open, the current stage will not end within one cycle, that is, the number of cycles at the end of the stage is greater than 0.
4. The battery charging management algorithm according to claim 3, which can automatically resume operation when the open circuit abnormality of the charging output terminal is eliminated, is characterized in that: The details of step S500 are as follows: When n>M, if PC[n]>0, it moves forward one step and finally returns to the 0th order, that is, returns to 0 step by step, or directly returns to the 0th order, that is, returns to 0 in a single step, and then the charging current increases step by step or increases in a single step to the maximum charging current; When n=M, it still goes back one step when PC[k]=0, unless k=N. When PC[k]>0, it is allowed to include multiple cycles. First, it is necessary to distinguish whether the output end has been connected to the battery or suddenly connected to the battery. If the battery is suddenly connected, it will return to 0 step by step or step by step when the first timing cycle is full. If the battery was connected during the last charge, it will continue to maintain the current stage when the timing cycle is full. Among them, k is an integer variable used to store the stage number, and n is the stage number when charging is terminated.
5. The battery charging management algorithm according to claim 4, which can automatically resume operation when the open circuit abnormality of the charging output terminal is eliminated, is characterized in that: The way to distinguish whether the output terminal has been connected to the battery is to check whether PC[k-1] is 0 during the last charging process. If it is 0, it means that the battery was connected suddenly, and if it is not 0, it means that the battery was connected during the last charging.
6. A battery charging management algorithm capable of automatically resuming operation when the open circuit abnormality at the charging output terminal is eliminated according to claim 5, characterized in that: The algorithm formula used in this method is as follows: Where N is an integer constant representing the maximum order; M is an integer constant, representing the maximum number of stages when charging the battery, M≤N; k is an integer variable used to store the number of stages; y is a Boolean variable, y represents V Sense With V Full The comparison results.
Citation Information
Patent Citations
Battery management systems and method for charging battery pack with multiple batteries
CN101604860A
Ladder type gradual parameter attenuation battery equalization method
CN103647328A