Summary of the invention
Technical problem to be solved by this invention is, a kind of device and method that battery charging process is controlled is provided, in order to compatible variety classes battery, the charging curve of the various rechargeable batteries of flexible adaptation, battery is accurately charged, solve prior art in charging control process, adopt the problem of special charging management circuit cost height, very flexible, adaptation battery ability.
The invention provides a kind of device that battery charging process is controlled, the dissimilar battery that is used for portable product carried out unified Charge Management, it is characterized in that, comprising:
Microprocessor module is used to detect cell voltage, and stores the charging characteristic curve of variety classes battery, chooses corresponding charging characteristic curve according to battery variety during charging, and sets current charge parameter in view of the above, sends charging controlling command;
The voltage stabilization and current stabilization module is used for and will exports behind the external power supply voltage stabilization and current stabilization, and required constant voltage of battery charge or constant current are provided;
Power management module, be used for the external power supply of input is converted to each inner required road power supply, receive the charging controlling command that microprocessor module sends by holding wire with described microprocessor module communication, and carry out adjustment and sampling in view of the above to the output voltage and the electric current of described voltage stabilization and current stabilization module, sampled signal is returned microprocessor module by multichannel output switch;
The trickle charge module, be connected in series with the output of described voltage stabilization and current stabilization module, comprise low impedance path and high resistance path, and path conversion control circuit, described path conversion control circuit is under described microprocessor module control, cross when low when detecting cell voltage, the gating high resistance path is carried out trickle precharge to battery; When cell voltage just often, charge to battery in the gating low impedance path.
The holding wire of described power management module and microprocessor module communication can be serial port communication line or parallel port communication line or iic bus or SBI bus or spi bus, and further transmits information by interrupt signal to described microprocessor module.
Described voltage stabilization and current stabilization module comprises a pliotron, and its base stage links to each other with described power management module; Input links to each other with external power supply; Output links to each other with described trickle charge module.Described pliotron is the PNP pipe.The base stage of described pliotron links to each other with described power management module by one first resistor.Be connected in series one second resistor between the output of described pliotron and the described trickle charge module, in order to electric current, voltage signal sampling are sent into power management module.
The low impedance path of described trickle charge module comprises a MOSFET pipe, high resistance path comprises diode and the 3rd resistance that is connected in series, described low impedance path and high resistance path are connected in parallel, the grid of MOSFET pipe is under the control of described path conversion control circuit, realize the switch of MOSFET pipe, when this pipe was opened, the output of described voltage stabilization and current stabilization module was battery charge through the low impedance path, when this pipe is closed, be battery charge by high resistance path.
Described path conversion control circuit comprises a triode, one the 4th resistance of its base stage serial connection links to each other with described microprocessor, input links to each other with the grid of the MOSFET pipe of described low impedance path, and links to each other output head grounding with external power supply through one the 5th resistance.
The present invention also provides a kind of method that battery charging process is controlled, and utilizes described device that the dissimilar battery that is used for portable product is carried out unified Charge Management, it is characterized in that, comprises the steps:
Microprocessor module detects need be for battery charge the time, and according to battery variety, for this battery is chosen corresponding charging characteristic curve, and according to detected initial voltage of battery, control trickle charge module is selected the charging path;
Microprocessor module is set the initial charge parameter according to the charging characteristic curve of choosing, and this parameter is write described power management module;
Power management module is regulated the output of voltage stabilization and current stabilization module according to the parameter of described setting, through described trickle charge module battery is charged;
Microprocessor module regularly orders power management module that the charge parameter of voltage stabilization and current stabilization module output is sampled, and sampled signal is returned to microprocessor module;
Microprocessor module compares the sampled signal of returning with corresponding charging characteristic curve, judge whether to need to change charge parameter;
Change charge parameter if desired, then reset current charge parameter, and parameter is write power management module, regulate the output of voltage stabilization and current stabilization module by power management module in view of the above according to charging characteristic curve.
Described microprocessor is chosen the charging characteristic curve step according to battery variety, determines according to battery ID.If battery does not have ID, then which bar charging characteristic curve the variation according to cell voltage between charge period and charging current meets most, determines the charging characteristic curve of battery.
Described microprocessor module is according to detected initial voltage of battery, and control trickle charge module is selected the step of charging path, is to cross when low when cell voltage, and the high resistance path of control selection trickle charge module is carried out trickle precharge to battery; When cell voltage just often, select the low impedance path to charge.
Described method further comprises the steps:
When powering on, microprocessor module carries out initialization to power management module, sets its operating state, and and then set the voltage stabilization and current stabilization output state;
When power management module detects external power supply, begin to start charging;
When power management module detects external power supply and has disconnected, send charger to micro treatment module and extract interruption, interrupt by microprocessor responds, force to stop charging.
A kind of device and method that battery charging process is controlled provided by the present invention, can control the whole process of charging flexibly, the cost and the printed board area that adopt the special charging circuit have been saved, can adapt to simultaneously the charging curve of various rechargeable batteries flexibly, reach more accurate charging effect.
Embodiment
In the present invention, the concrete principle of charging constant-current circuit and constant voltage circuit is not discussed, is recommended to adopt ripe power management chip as power management module, to reach high conformity, control easy, the effect that circuit complexity is low.For the requirement that special applications is arranged, the control of charging, constant voltage, constant current, overvoltage protections etc. also can be realized by discrete circuit.
Fig. 1 shows the installation drawing that battery charging process is controlled of the embodiment of the invention, comprising:
Microprocessor module 101, microprocessor module are responsible for monitoring the whole link of charging, and the control power management module is carried out each link of charging.Be mainly used in the detection cell voltage, and store the charging characteristic curve of variety classes battery, choose corresponding charging characteristic curve according to battery variety during charging, and set current charge parameter in view of the above, send charging controlling command.
Wherein, the source of charging characteristic curve can obtain in technical article or more detailed battery production factory specification, usually, do not need to set corresponding charging curve for the battery of each producer and model, can refine is the electric and two kinds of charging characteristic curves of Ni-MH battery of lithium.Specifically in charging process, microprocessor is actual to be by the voltage and current on the battery being monitored, set charge parameter according to current supervision result, changing according to its charging characteristic curve as far as possible with voltage and electric current on the battery between the control charge period.Because be exactly a closed-loop control process like this, so the capacity of battery is little to charging control influence.
During charging, choose charging characteristic curve according to battery variety and judge battery variety and then choose corresponding charging characteristic curve according to battery ID.Usually ID is a resistance that is encapsulated in the battery, and different battery resistance differences by measuring its resistance, or detect this resistance and another known resistance partial pressure value after to a known voltage dividing potential drop, can judge the kind of battery.
For the battery that ID is not provided, two kinds of situations are arranged:
(1) with the equipment of AA or AAA battery,, therefore needn't discern because commercially available this battery is Ni-MH battery.
(2) except that above-mentioned situation, then need be in charging process, relatively which kind of battery charge characteristic curve the change procedure of cell voltage meets, and so as to judging battery variety, this mode needs higher sampling precision and more microprocessor resources.
Not only battery variety can be judged according to battery ID, battery capacity can also be judged.When not having ID, the judgement capacity is impossible substantially, but still can judge battery variety, because lithium battery and Ni-MH battery still have bigger difference at charging initial stage voltage climbing speed and the magnitude of voltage when rising to flex point, can identify battery variety in this course, charge parameter after in good time adjusting gets final product, and needs more accurate AD conversion but do like this, and expends more processor resource.
Voltage stabilization and current stabilization module 102 is used for and will exports behind the external power supply voltage stabilization and current stabilization, and required constant voltage of battery charge or constant current are provided.
Because it is hand-held or the mobile device power consumption is less usually, operating voltage and electric current can be very not big, therefore can use simple transistor to adjust circuit and realize voltage stabilization and current stabilization, voltage stabilization and current stabilization module in the embodiment of the invention adopts the PNP pliotron as adjusting pipe, the base stage of described pliotron links to each other with described power management module by one first resistor, and base stage is controlled by power management module; Be connected in series one second resistor between the output of described pliotron and the described trickle charge module, in order to electric current, voltage signal sampling are sent into power management module; Input links to each other with external power supply.For the application of special installation or strict demand power supply conversion efficiency, also can use the DC/DC converter to realize voltage stabilization and current stabilization, but can increase the circuit complexity.
Power management module 103, be used for the external power supply of input is converted to each inner required road power supply, receive the charging controlling command that microprocessor module sends by holding wire with described microprocessor module communication, and carry out adjustment and sampling in view of the above to the output voltage and the electric current of described voltage stabilization and current stabilization module, sampled signal is returned microprocessor module by multichannel output switch.
The embodiment of the invention adopts PM6610 power management chip that Qualcomm designs for cdma mobile terminal as power management module, according to different application, also can use the power management chip of other companies.The communication interface of PM6610 is special-purpose SBI bus, and when adopting other chips, the communication mode that must use respective chip to provide is such as serial port communication line, parallel port communication line, spi bus, iic bus etc.
Power management chip has the holding wire with the microprocessor module communication, iic bus for example, also can be that other is by microprocessor and the common communication modes of supporting of power management module, such as serial port communication line, the parallel port communication line, spi bus, SBI bus etc., can receive the order of sending from microprocessor module, power management module is responsible for carrying out the charging controlling command that microprocessor module sends, adjust the voltage stabilization and current stabilization module in charging different phase output constant voltage or constant current, there is the multichannel output switch of each road voltage sampling signal power management chip used in the present invention inside, can be connected to the AD converter of microprocessor module, software can be monitored charged state at any time, interrupt signal between power management module and the microprocessor module is used in time some important informations being passed to microprocessor, reduce processor inquiry workload, in time handle variety of event, if processor speed is enough fast, and other work are not busy, can not use interruption.Interrupt output if employed power management module does not provide, or the processor ability meets the demands fully, also can not use interruption, and by the processor active inquiry.
Another vital task of power management chip is the input of external power supply or battery to be converted to system each road power supply is provided.
Trickle charge module 104, trickle charge module are connected on discharging and recharging in the branch road of battery, are divided into two paths, a path is the MOSFET pipe, this pipe provides a low impedance path when opening, can supply big electric current quick charge, and this moment is as the output that battery directly is connected in the voltage stabilization and current stabilization circuit; Another path is made up of a diode and the 3rd resistance, is high resistance path.Described low impedance path and high resistance path are connected in parallel, and when FET closes, provide one to have higher internal resistance, produce the passage of a constant pressure drop.Owing to cross and to put or other reasons when causing brownout, carry out large current charge on the voltage stabilization and current stabilization output at battery, can cause certain infringement, influence battery life battery if still directly be connected on.
In addition, also main power supply branch voltage cell voltage be can be pulled low to, power management module 103 and whole system operation influenced.Adopt this high resistant passage, can provide a very little electric current to carry out precharge, can not influence main power supply branch voltage simultaneously to battery.Change the size that resistance value can change electric current, the recommendation electric current is 20~50mA.
The grid of MOSFET pipe is realized the switch of MOSFET pipe under the control of path conversion control circuit, when this pipe was opened, the output of described voltage stabilization and current stabilization module was battery charge through the low impedance path, when this pipe is closed, was battery charge by high resistance path.
Described path conversion control circuit comprises a triode, one the 4th resistance of its base stage serial connection links to each other with described microprocessor, input links to each other with the grid of the MOSFET pipe of described low impedance path, and links to each other output head grounding with external power supply through one the 5th resistance.
As shown in Figure 2, the method for utilizing device of the present invention that battery charging process is controlled comprises the steps:
Microprocessor module detects need be for battery charge the time, and according to battery variety, for this battery is chosen corresponding charging characteristic curve, and according to detected initial voltage of battery, control trickle charge module is selected charging path (step 201);
Microprocessor module is set the initial charge parameter according to the charging characteristic curve of choosing, and this parameter is write described power management module (step 202);
Power management module is according to the parameter of described setting, regulates the output of voltage stabilization and current stabilization module, through described trickle charge module to battery charge (step 203);
Microprocessor module regularly orders power management module that the charge parameter of voltage stabilization and current stabilization module output is sampled, and sampled signal is returned to microprocessor module (step 204);
Microprocessor module compares the sampled signal of returning with corresponding charging characteristic curve, judge whether to need to change charge parameter (step 205);
Change charge parameter if desired, then reset current charge parameter, and parameter is write power management module, regulate the output (step 206) of voltage stabilization and current stabilization module by power management module in view of the above according to charging characteristic curve.
As shown in Figure 3, in the embodiment of the invention, microprocessor module control power management chip is carried out the concrete steps of each link of charging, comprises following step:
Step 301, when powering on, system carries out initialization to power management chip, sets its operating state, sets the voltage stabilization and current stabilization output state.
Step 302 is registered a charger and is inserted interrupt service routine, so that when detecting external power supply, begins to start charging.
Step 303 is had no progeny in the response, and zero clearing charged state machine is provided with the initial voltage electric current, prepares to begin charging.
Step 304 starts timer, adopts the method control charging that regularly detects.
Step 305 writes power management chip with the parameter that sets, and is exported according to the parameter regulation of setting by power management chip.
Step 306, timing arrives, and microprocessor reads current cell voltage by the AD passage, and parameters such as charging current judge currently should be in which charging stage.
Step 307 judges whether battery is normal, and for the battery that ID is arranged, detecting with initial ID by ID has bigger variation, thinks that then unusual (for example in the charging, taking down battery) appears in battery.For the resistance of no ID, judge then whether electric current and voltage exists sudden change, because in the process of charging normal, except switching the trickle module switch, the voltage of battery and charging current do not have jumping characteristic and change, if any, then battery is unusual.
As unusually, enter step 308, it is unusual that state is set to not have battery/battery, withdraws from current charging.Transferring to other handling process after abnormal information is returned handles.For the battery of no ID,,, choose corresponding charging characteristic curve for subsequent step so step can identify battery variety simultaneously because in judging the electric current and voltage change procedure, need compare with various battery charge characteristic curves.
Battery normally then enters step 309.
Step 309, according to cell voltage, charging current, the charging characteristic curve with reference to configuring judges whether to change current charged state, if need not change, then withdraws from, if finished the current generation charging, then enters step 310.
Step 310, with reference to the charging characteristic curve that configures, the charge parameter that setting will change, the update mode machine enters step 311 to new parameter, and these parameters are write power management chip, is exported according to the parameter regulation of setting by power management chip.
Step 312 judges whether that needs upgrade the on off state of MOSFET.
Step 313 is if at trickle and charging done state, then should control the trickle charge module and close MOSFET; If in other charged states, then should control the trickle charge module and open MOSFET.
Step 314, power management chip can be sent charger to microprocessor and pull out interruption when detecting external power supply and disconnected, and microprocessor responds is interrupted, and enters step 314, force to stop charging, begin to enable next time charger and insert and interrupt.
Step 315 stops the timer that step 304 starts.
Step 316, control trickle charge module is opened MOSFET, changes battery-powered.
Method of the present invention is by monitoring the voltage and current in the charging process, with reference to the charging characteristic curve of battery, and all processes of accurate control charging, to reach quick to battery, charging accurately.
For the relatively abundanter microprocessor system of resource, the present invention has adopted state machine to upgrade and has sent the treating method that order separates to power management chip, like this, when the different power management chip of compatibility, only need to revise the order translator unit, can not influence complete charging control flow, for the relatively more nervous microprocessor system of resource, also can when the update mode machine, just directly parameter be passed to power management chip,, improve execution speed to reduce size of code.
The present invention can be in conjunction with various microprocessor systems and power management chip, bring into play the control ability of power management chip to greatest extent, the flexibility of microprocessor, add in the existing charging control state machine by charging characteristic curve corresponding battery, both can be in order to have controlled the charging process of this battery.
The above is preferred embodiment of the present invention only, is not to be used for limiting practical range of the present invention; Every equivalence of doing according to content of the present invention changes and revises, and is all contained by claim of the present invention.