[background technology]
The constant-current drive circuit that tradition generally adopts as shown in Figure 1, its operation principle is: resistance R 1 and voltage-stabiliser tube DZ provide reference voltage for circuit, operational amplifier A is controlled metal-oxide-semiconductor Q1 battery BAT is charged, charging current is obtained by the resistance R up-sampling, and deliver to the backward end of operational amplifier A, realize that Closed-loop Constant-current controls.
The shortcoming of conventional linear constant current charge:
1, adopt the closed loop Linear Control, in order to adapt to different cell loads, needing increases compensating network, otherwise circuit stability, reliability reduce.
2, the reference voltage of circuit adopts voltage-stabiliser tube, and precision and temperature coefficient, consistency are bad; Batch production needs the choosing survey, gives buying, processing, produces and bring a lot of inconvenience, and production cost is high, keeps in repair and detect inconvenience.
3, charging current is by resistance R, obtaining, and constant current accuracy depends on temperature coefficient, precision and the consistency (temperature coefficient and the offset voltage of ignoring operational amplifier here) of resistance R.If select temperature to float the resistance of coefficient and high conformity, cost certainly will increase.
4, the Q1 linear amplification region of must working, otherwise can not constant current.The source of Q1 is leaked the too high meeting of pressure drop and is caused the power consumption of Q1 excessive, is unfavorable for heat radiation, and Q1 need to adopt more large-area metal-oxide-semiconductor; Also limited on the other hand the VDD lower range.
5, circuit form is fixed, and while if want, realizing diversified constant current such as trickle charge, revises inconvenient; And the countless control interfaces of circuit, need to increase more additional devices and realize Based Intelligent Control.
[summary of the invention]
Based on this, be necessary to provide a kind of numerical-control constant current driving circuit that can diversified provide accurate constant current to control.
A kind of numerical-control constant current driving circuit, comprise forward-backward counter, constant current size adjustment module and current detection module, described current detection module makes forward-backward counter increase progressively counting or countdown for detection of charging current and according to the size of charging current to the counting direction pin transmitted signal of the forward-backward counter be attached thereto, described forward-backward counter makes a plurality of output pins correspondingly export respectively high level or low level according to count value, described constant current size adjustment module comprises the regulon of the corresponding connection of a plurality of output pins with described forward-backward counter, conducting when described regulon is high level at described output pin, when being low level, described output pin closes.
Preferably, described forward-backward counter comprises the d type flip flop of a plurality of cascades, the D of each d type flip flop end and
End connects, the Q end is as one of output pin of described forward-backward counter, and the input end of clock CLK input clock signal of the d type flip flop of the first order, after this d type flip flop of the input end of clock CLK of the d type flip flop of every one-level by analog switch and previous stage
End, Q hold multiplexing connection, and all analog switches all connect the counting direction pin of described forward-backward counter, and the reset terminal of all d type flip flops connects the reset signal input pin of described forward-backward counter.
Preferably, described forward-backward counter also comprises counting overflow control unit, and when described counting overflow control unit was high level or is low level in the output of described a plurality of d type flip flops, the clock signal that makes to be input to first order d type flip flop was always low level.
Preferably, described regulon comprises NAND gate and metal-oxide-semiconductor, two input pins of described NAND gate connect respectively reset signal input pin and the output pin of described forward-backward counter, the output pin of described NAND gate connects the grid of metal-oxide-semiconductor, and the source electrode of described metal-oxide-semiconductor, drain electrode connect respectively the positive pole of rechargeable battery and the positive pole of power supply.
Preferably, described metal-oxide-semiconductor is PMOS, and quantity is 7, is designated as accordingly respectively from high to low PMOS0~PMOS6 according to the meter digital with output pin, wherein, PMOS1~PMOS6 open that resistance is respectively PMOS0 open 1/2,1/4,1/8,1/16,1/32,1/64 times of resistance.
Preferably, described current detection circuit comprises differential amplifier, follower, mirror current source and comparator, described follower comprises metal-oxide-semiconductor M1 and resistance R 1, the in-phase input end input reference voltage of described differential amplifier, inverting input connects the source electrode of metal-oxide-semiconductor M1 also by described resistance R 1 ground connection, the output of described differential amplifier connects the grid of metal-oxide-semiconductor M1, the drain electrode of described metal-oxide-semiconductor M1 is connected with an end of mirror current source, the other end of described mirror current source is by connecting the source electrode of metal-oxide-semiconductor M2, the drain electrode of described metal-oxide-semiconductor M2 connects the drain electrode of metal-oxide-semiconductor M3, the source ground of described metal-oxide-semiconductor M3, the described reference voltage of grid input of described metal-oxide-semiconductor M2, the grid input supply voltage of described metal-oxide-semiconductor M3, the drain electrode of described metal-oxide-semiconductor M2 also connects the inverting input of described comparator, the described charging current of in-phase input end sampling of described comparator, the output output of described comparator makes forward-backward counter increase progressively the signal of counting or countdown.
Preferably, described mirror current source comprises metal-oxide-semiconductor M4, the metal-oxide-semiconductor M5 that two source electrodes and grid are connected mutually, and the source electrode of described metal-oxide-semiconductor M1 connects the drain electrode of described metal-oxide-semiconductor M4, and is connected to the grid that metal-oxide-semiconductor M4 and metal-oxide-semiconductor M5 are connected jointly.
Above-mentioned numerical-control constant current driving circuit makes regulon conducting or disconnection by increasing progressively and successively decreasing of forward-backward counter, thereby change the size of charging current, current detection module is ceaselessly made forward-backward counter according to the variation of electric current to add, subtract counting, charged electrical is failed to be convened for lack of a quorum to fluctuate back and forth near set point, its mean value just equals the constant current value of setting, thereby can comparatively accurately control constant current and adapt to multiple load.
[embodiment]
As shown in Figure 2, be the module map of the numerical-control constant current driving circuit of an embodiment.This numerical-control constant current driving circuit comprises forward-backward counter 100, constant current size adjustment module 200 and current detection module 300.The constant current when numerical-control constant current driving circuit of this enforcement mainly can be used for charging is controlled, when normal operation, constant current size adjustment module 200 is connected to the positive pole of charge power supply, and the output of constant current size adjustment module 200 is connected with the positive pole of rechargeable battery BAT, the negative pole of rechargeable battery BAT connects the negative pole (generally all ground connection) of charge power supply by switching device, the pressure drop of switching device is proportional to charging current.Current detection module 300 makes forward-backward counter 100 increase progressively counting or countdown for detection of charging current and according to the size of charging current to forward-backward counter 100 transmitted signals.Forward-backward counter 100 makes a plurality of output pin Q0~QN correspondingly export respectively high level or low level according to count value.Constant current size adjustment module 200 comprises the regulon 210 that a plurality of and described output pin Q0~QN is corresponding, and regulon 210 is 0~N) conducting when the high level at output pin Qn(n, disconnects when output pin Qn is low level.During a plurality of regulon 210 conducting, can provide resistance effect in parallel, thereby the resistance of whole constant current size adjustment module 200 change, and therefore can regulate charging current.
Forward-backward counter 100 has a plurality of pins, specifically comprises:
Reset signal input pin CLS, receive enable signal or reset signal, makes forward-backward counter 100 start working or count zero clearing.
Counting direction pin UP/DOWN, be high level or low level according to input signal, increases progressively respectively counting or countdown.
Clock pin CLK, the receive clock signal.
Output pin Q0~QN, correspondingly export respectively high level or low level according to count value.
As shown in Figure 3, be the internal circuit diagram of forward-backward counter in the present embodiment 100.Forward-backward
counter 100 comprises the d type flip flop of a plurality of cascades, the D of each d type flip flop end and
End connects, the Q end is as one of output pin of forward-backward
counter 100, and the input end of clock CLK input clock signal of the d type flip flop of the first order, after this d type flip flop of the input end of clock CLK of the d type flip flop of every one-level by analog switch MUX and previous stage
End, Q hold multiplexing connection, and all analog switch MUX connect the counting direction pin UP/DOWN of forward-backward
counter 100, and the reset terminal of all d type flip flops connects the reset signal input pin CLS of forward-backward
counter 100.
The operation principle of forward-backward
counter 100 is as follows: when counting direction pin UP/DOWN input high level, the gating signal of analog switch MUX is 0, its clock signal input terminal by rear one-level d type flip flop CLK is connected with the Q end of previous stage d type flip flop, and all d type flip flops form subtract counter; When counting direction pin UP/DOWN input low level, the gating signal of analog switch MUX is 1, its clock signal input terminal by rear one-level d type flip flop CLK and previous stage d type flip flop
End connects, and all d type flip flops form up counter.
Output Q0~the QN of forward-backward counter 100 is corresponding with count value successively, and the N=6 of take is example, and when count value was 1, Q0~Q6 was output as 0000001, and when count value was 2, Q0~Q6 was output as 0000010, the like.
As shown in Figure 4, in constant current size adjustment module 200, regulon 210 comprises NAND gate and metal-oxide-semiconductor, two input pins of NAND gate connect respectively and only connect one of the reset signal input pin of forward-backward counter 100 and output pin, the output pin of NAND gate connects the grid of metal-oxide-semiconductor, the source electrode of described metal-oxide-semiconductor connects the positive pole of power supply, and the drain electrode of described metal-oxide-semiconductor connects the positive pole of rechargeable battery.
The metal-oxide-semiconductor of take is example as the quantity of PMOS, regulon 210 as 7, and following table has provided the relation of metal-oxide-semiconductor on off state and forward-backward counter 100 outputs.
Rstn |
Q0-Q6 |
PMOS0 |
PMOS1 |
PMOS2 |
PMOS3 |
PMOS4 |
PMOS5 |
PMOS6 |
1 |
0000000 |
Close |
Close |
Close |
Close |
Close |
Close |
Close |
0 |
0000001 |
Open |
Close |
Close |
Close |
Close |
Close |
Close |
0 |
0000010 |
Close |
Open |
Close |
Close |
Close |
Close |
Close |
0 |
0000011 |
Open |
Open |
Close |
Close |
Close |
Close |
Close |
…… |
…… |
…… |
…… |
…… |
…… |
…… |
…… |
…… |
0 |
1111111 |
Open |
Open |
Open |
Open |
Open |
Open |
Open |
If the area of PMOS1~PMOS6 is made as respectively to 2,4,8,16,32,64 times of PMOS0, it is opened resistance R dson and also is 1/2,1/4,1/8,1/16,1/32,1/64 times of PMOS0.If it is Rdson that PMOS0 opens resistance, the parallel impedance computing formula opened by 7 binary combination of 7 PMOS is as follows:
Rdson(7) excursion is Rdson~Rdson/127, by this rheostat access charge circuit, just can realize that the ladder of 1/127 precision is regulated.PMOS0-PMOS6 is made in same integrated circuit the inside, and when deviation appears in wafer production technology, or during extraneous variations in temperature, they change on year-on-year basis, and the degree of regulation of electric current is unaffected.
Current detection module 300 makes forward-backward counter 100 increase progressively counting or countdown for detection of charging current and according to the size of charging current to forward-backward counter 100 transmitted signals.
As shown in Figure 5, current detection circuit 300 comprises differential amplifier 310, follower 320, mirror current source 330 and comparator 340.Follower 320 comprises metal-oxide-semiconductor M1 and resistance R 1, and the in-phase input end input reference voltage Vref of differential amplifier 310, inverting input connect the source electrode of metal-oxide-semiconductor M1 and by resistance R 1 ground connection, the output of differential amplifier 310 connects the grid of metal-oxide-semiconductor M1.The drain electrode of metal-oxide-semiconductor M1 is connected with an end of mirror current source 330, the other end of mirror current source 330 connects the drain electrode of metal-oxide-semiconductor M3 by the source electrode that connects metal-oxide-semiconductor M2, the drain electrode of metal-oxide-semiconductor M2, the source ground of metal-oxide-semiconductor M3, the grid input reference voltage Vref of metal-oxide-semiconductor M2, the grid input supply voltage of metal-oxide-semiconductor M3, the drain electrode of metal-oxide-semiconductor M2 also connects the inverting input of comparator 340, the described charging current of in-phase input end sampling of comparator 340, the output output of comparator 340 makes forward-backward counter 100 increase progressively the signal of counting or countdown.
Mirror current source 330 comprises metal-oxide-semiconductor M4, the metal-oxide-semiconductor M5 that two source electrodes and grid are connected mutually, and the source electrode of metal-oxide-semiconductor M1 connects the drain electrode of metal-oxide-semiconductor M4, and is connected to the grid that metal-oxide-semiconductor M4 and metal-oxide-semiconductor M5 are connected jointly.
Further, forward-backward counter 100 also comprises counting overflow control unit 110, when described counting overflow control unit was high level or is low level in the output of described a plurality of d type flip flops, the clock signal that makes to be input to first order d type flip flop was always low level.
Above-mentioned metal-oxide-semiconductor can be PMOS or NMOS.
The charging current control procedure of above-mentioned constant-current drive circuit is:
When battery accesses, make the switching device conducting, the negative pole of battery is by this switching device ground connection, the positive pole of battery is connected to VDD by the PMOS of constant current size adjustment module 200, in case PMOS is open-minded, power supply will, by PMOS and switching device, charge to battery; PMOS opens the impedance that quantity has determined charge circuit, has also determined the size of charging current.
If need to charge to battery, the input enable signal is low level.Forward-backward counter 100 starts counting under the driving of clock signal, open gradually PMOS, and charging current increases progressively gradually, and the voltage on switching device also increases.When this voltage is greater than setting threshold Vset, mean that charging current has been greater than the constant current value of setting, current detection module 300 makes the counting of forward-backward counter 100 successively decrease from increasing progressively to become, and closes gradually PMOS, and charging current starts to diminish gradually.After charging current reduced to a certain degree, current detection module 300 made forward-backward counter 100 from successively decreasing, become and increase progressively again.Along with the charged electrical rheology is large, diminish, counter is ceaselessly done and is added, subtracts counting, makes near the charged electrical fluctuation back and forth set point that fails to be convened for lack of a quorum, its mean value just equals the constant current value of setting.
The above embodiment has only expressed several execution mode of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection range of patent of the present invention should be as the criterion with claims.