[background technology]
The constant-current drive circuit that tradition generally adopts as shown in Figure 1; Its operation principle is: resistance R 1 is that circuit provides reference voltage with voltage-stabiliser tube DZ; Operational amplifier A control metal-oxide-semiconductor Q1 charges to battery BAT; Charging current is obtained by the resistance R up-sampling; And deliver to the backward end of operational amplifier A, realize closed loop constant current control.
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 greatly.
2, the reference voltage of circuit adopts voltage-stabiliser tube, and precision and temperature coefficient, consistency are bad; Batch process needs to select surveys, and brings a lot of inconvenience to buying, processing, production, and production cost is high, keeps in repair and detect inconvenience.
3, charging current is by obtaining on the resistance R, 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 for use 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 adopt more large-area metal-oxide-semiconductor; Also limited the VDD lower range on the other hand.
5, circuit form is fixed, if when wanting to realize 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 drive circuit that accurate constant current control can diversified be provided.
A kind of numerical control constant-current drive circuit; Comprise forward-backward counter, constant current size adjustment module and current detection module; Said current detection module is used to detect charging current and sends signal according to the size of charging current to forward-backward counter makes forward-backward counter counts or countdown; Said forward-backward counter makes a plurality of output pins correspondingly export high level or low level respectively according to count value; Said constant current size adjustment module comprises the corresponding regulon of a plurality of and said output pin; Conducting when said regulon is high level at said output pin is closed during for low level at said output pin.
Preferably; Said forward-backward counter comprises the d type flip flop of a plurality of cascades; The D end of each d type flip flop is connected with the Q end, Q holds as one of output pin of said 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 input end of clock CLK of the d type flip flop of each grade holds multiplexing the connection through analog switch with Q end, the Q of the d type flip flop of previous stage; All analog switches all connect the counting direction pin of said forward-backward counter, and the reset terminal of all d type flip flops connects the reset signal input pin of said forward-backward counter.
Preferably, said forward-backward counter comprises that also counting overflows control unit, and said counting overflows control unit when the output of said a plurality of d type flip flops is high level or is low level, makes the clock signal that is input to first order d type flip flop be always low level.
Preferably; Said regulon comprises NAND gate and metal-oxide-semiconductor; Two input pins of said NAND gate connect one of reset signal input pin and output pin of said forward-backward counter respectively; The output pin of said NAND gate connects the grid of metal-oxide-semiconductor, between the positive pole of the source electrode of said metal-oxide-semiconductor, drain electrode connection power supply and the positive pole of rechargeable battery.
Preferably; Said metal-oxide-semiconductor is PMOS, and quantity is 7, is designated as PMOS0~PMOS6 from high to low respectively accordingly 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; Said current detection circuit comprises differential amplifier; Follower; Mirror current source and comparator; Said follower comprises metal-oxide-semiconductor M1 and resistance R 1; The in-phase input end input reference voltage of said differential amplifier; Inverting input connects the drain electrode of metal-oxide-semiconductor M1 and through said resistance R 1 ground connection; The output of said differential amplifier connects the grid of metal-oxide-semiconductor M1; The drain electrode of said metal-oxide-semiconductor M1 is connected with an end of mirror current source; The other end of said mirror current source is through connecting the source electrode of metal-oxide-semiconductor M2; The drain electrode of said metal-oxide-semiconductor M2 connects the source electrode of metal-oxide-semiconductor M3; The grounded drain of said metal-oxide-semiconductor M3; The grid of said metal-oxide-semiconductor M2 is imported said reference voltage; The grid input supply voltage of said metal-oxide-semiconductor M3; The drain electrode of said metal-oxide-semiconductor M2 also connects the inverting input of said comparator; The in-phase input end of the said comparator said charging current of sampling, the output output of said comparator makes the signal of forward-backward counter counts or countdown.
Preferably, said 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 said metal-oxide-semiconductor M1 connects the drain electrode of said 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 drive circuit makes regulon conducting or disconnection through increasing progressively and successively decreasing of forward-backward counter; Thereby change the size of charging current; Current detection module is then ceaselessly made forward-backward counter according to change in current to add, subtract counting; Charging current can be fluctuateed near set point back and forth; Its mean value just equals the constant current value set, 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 drive circuit of an embodiment.This numerical control constant-current drive circuit comprises forward-backward counter 100, constant current size adjustment module 200 and current detection module 300.Constant current control when the numerical control constant-current drive circuit of this enforcement mainly can be used for charging; When operate as normal; The positive pole that constant current size adjustment module 200 is connected to 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 through switching device, and the pressure drop of switching device is proportional to charging current.Current detection module 300 is used to detect charging current and sends signal according to the size of charging current to forward-backward counter 100 makes forward-backward counter 100 counts or countdown.Forward-backward counter 100 makes a plurality of output pin Q0~QN correspondingly export high level or low level respectively according to count value.Constant current size adjustment module 200 comprises the regulon 210 that a plurality of and said output pin Q0~QN is corresponding, and (n is 0~N) conducting when the high level to regulon 210, breaks off during for low level at output pin Qn at output pin Qn.Resistance parallel connection effect can be provided during a plurality of regulon 210 conductings, thereby the resistance of whole constant current size adjustment module 200 changes, so can regulate charging current.
Forward-backward counter 100 has a plurality of pins, specifically comprises:
Reset signal input pin CLS receives enable signal or reset signal, forward-backward counter 100 is started working or counts zero clearing.
Counting direction pin UP/DOWN is high level or low level according to input signal, respectively counts or countdown.
Clock pin CLK, the receive clock signal.
Output pin Q0~QN correspondingly exports high level or low level respectively 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 end of each d type flip flop is connected with the Q end, Q holds 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 input end of clock CLK of the d type flip flop of each grade holds multiplexing the connection through analog switch MUX with Q end, the Q of the d type flip flop of previous stage; 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 following: when counting direction pin UP/DOWN input high level; The gating signal of analog switch MUX is 0; Its clock signal input terminal CLK with back one-level d type flip flop is connected with the Q end of previous stage d type flip flop, and all d type flip flops constitute subtract counter; When counting direction pin UP/DOWN input low level, the gating signal of analog switch MUX is 1, and its clock signal input terminal CLK with back one-level d type flip flop is connected with the Q end of previous stage d type flip flop, and all d type flip flops constitute up counter.
Output Q0~the QN of forward-backward counter 100 is corresponding with count value successively, is example with N=6, and when count value was 1, Q0~Q6 was output as 0000001, and when count value was 2, Q0~Q6 was output as 0000010, and the like.
As shown in Figure 4; In the constant current size adjustment module 200; Regulon 210 comprises NAND gate and metal-oxide-semiconductor; Two input pins of NAND gate connect and only connect one of reset signal input pin and output pin of forward-backward counter 100 respectively; The output pin of NAND gate connects the grid of metal-oxide-semiconductor; The source electrode of said metal-oxide-semiconductor connects the positive pole of power supply, and the drain electrode of said metal-oxide-semiconductor connects the positive pole of rechargeable battery.
With the metal-oxide-semiconductor be the quantity of PMOS, regulon 210 to be 7 be example, 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 2,4,8,16,32,64 times of PMOS0 respectively, then 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, then the parallel impedance computing formula opened by 7 binary combination of 7 PMOS is following:
The excursion of Rdson (7) is Rdson~Rdson/127, and this rheostat is inserted 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 is used to detect charging current and sends signal according to the size of charging current to forward-backward counter 100 makes forward-backward counter 100 counts or countdown.
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 drain electrode of metal-oxide-semiconductor M1 and through 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 source electrode of metal-oxide-semiconductor M3 through the source electrode that connects metal-oxide-semiconductor M2, the drain electrode of metal-oxide-semiconductor M2; The grounded drain 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 in-phase input end of the comparator 340 said charging current of sampling, the output output of comparator 340 makes the signal of forward-backward counter 100 counts 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 comprises that also counting overflows control unit 110; Said counting overflows control unit when the output of said a plurality of d type flip flops is high level or is low level, makes the clock signal that is input to first order d type flip flop be 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 inserts, make the switching device conducting, the negative pole of battery is through this switching device ground connection; The positive pole of battery is connected to VDD through the PMOS of constant current size adjustment module 200; In case PMOS is open-minded, power supply will pass through PMOS and switching device, and battery is charged; PMOS opens the impedance that quantity has determined charge circuit, has also determined the size of charging current.
If desired battery is charged, the input enable signal is a low level.Forward-backward counter 100 begins counting under the driving of clock signal, open PMOS gradually, and charging current increases progressively gradually, and the voltage on the switching device also increases.When this voltage during greater than setting threshold Vset, mean charging current 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 PMOS gradually, and charging current begins to diminish gradually.After charging current reduced to a certain degree, current detection module 300 became forward-backward counter 100 again to increase progressively from successively decreasing.Along with charging current becomes big, diminishes, counter is ceaselessly done and is added, subtracts counting, makes the charging current can near fluctuation back and forth set point, and its mean value just equals the constant current value set.
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 claim of the present invention.Should be pointed out that for the person of ordinary skill of the art under the prerequisite that does not break away from the present invention's design, 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 accompanying claims.