CN114221321A - Voltage polarity automatic switching circuit and method of direct-current power supply - Google Patents

Voltage polarity automatic switching circuit and method of direct-current power supply Download PDF

Info

Publication number
CN114221321A
CN114221321A CN202111576906.4A CN202111576906A CN114221321A CN 114221321 A CN114221321 A CN 114221321A CN 202111576906 A CN202111576906 A CN 202111576906A CN 114221321 A CN114221321 A CN 114221321A
Authority
CN
China
Prior art keywords
circuit
voltage
resistor
input
polarity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111576906.4A
Other languages
Chinese (zh)
Other versions
CN114221321B (en
Inventor
焦伟
贺凯
高煜寒
陈忠华
吴双
李煌
高飞
杨喜军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Jiaotong University
Original Assignee
Shanghai Jiaotong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Jiaotong University filed Critical Shanghai Jiaotong University
Priority to CN202111576906.4A priority Critical patent/CN114221321B/en
Publication of CN114221321A publication Critical patent/CN114221321A/en
Application granted granted Critical
Publication of CN114221321B publication Critical patent/CN114221321B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J1/00Circuit arrangements for dc mains or dc distribution networks
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J1/00Circuit arrangements for dc mains or dc distribution networks
    • H02J1/08Three-wire systems; Systems having more than three wires
    • H02J1/082Plural DC voltage, e.g. DC supply voltage with at least two different DC voltage levels

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Dc-Dc Converters (AREA)

Abstract

The invention provides a voltage polarity automatic switching circuit and a method of a direct current power supply, wherein the circuit comprises a power circuit, an output voltage division circuit, an input instantaneous voltage circuit, an input voltage polarity circuit and a control circuit; the power circuit comprises two pairs of power switches, three input ports of the control circuit are respectively connected to the output end of the output voltage division circuit, the output end of the input instantaneous voltage circuit and the output end of the input voltage polarity circuit, and four output ports are respectively connected to the control ends of the two pairs of power switches in the power circuit and used for judging the voltage polarity of the direct current power supply and respectively controlling the two pairs of power switches to be on or off. The polarity of the input voltage is judged by detecting the positive and negative of the instantaneous value of the input voltage and the polarity of the input voltage, so that the polarity judgment method has the advantage of reliable polarity judgment, and can judge whether the circuit has open circuit, undervoltage or overvoltage conditions by detecting the output voltage.

Description

Voltage polarity automatic switching circuit and method of direct-current power supply
Technical Field
The invention relates to the field of power electronics, in particular to a voltage polarity automatic switching circuit and method of a direct current power supply.
Background
Distributed power generation represented by wind and light and research and application of a direct-current micro-grid are more and more extensive, and research and development and application of direct-current power utilization equipment are more and more deep. The direct current power supply system has the problem of voltage polarity, the voltage polarities of direct current power supplies from different sources may be the same or opposite, when a plurality of direct current power supplies are connected to a direct current common coupling point or supply power to a direct current load, the voltage polarity needs to be corrected, otherwise, direct current electric equipment is damaged due to the fact that the polarities are reversed.
At present, an input direct-current voltage anti-reverse connection circuit is mature, and the specific implementation form is mainly a diode anti-reverse connection circuit or an anti-reverse connection circuit which adopts a power MOSFET to replace a diode so as to reduce conduction loss. Although the reverse connection preventing circuit is simple and feasible, the direct current sources with different input positive and negative voltage polarities cannot be converted into the direct current power source with the same output voltage polarity, and the reverse connection preventing circuit is one of the problems which need to be solved in the fields of distributed power generation and direct current micro-grid power supply.
Disclosure of Invention
The present invention provides a circuit and a method for automatically converting voltage polarity of a dc power supply, which can automatically correct the dc voltage polarity, so that the output voltage always has a fixed and unchangeable polarity.
In order to achieve the above object, in a first aspect, the present invention provides an automatic voltage polarity conversion circuit for a dc power supply, including a power circuit, an input terminal of which is connected to the dc power supply, and including two pairs of power switches, wherein the voltage polarity of the dc power supply is converted into a fixed polarity by respectively controlling the two pairs of power switches to be turned on and off; the input end of the output voltage division circuit is connected to the output end of the power circuit, and the output end of the output voltage division circuit provides an output voltage signal for judging whether the power circuit works normally or not; the input end of the input voltage division circuit is connected to the direct current power supply, and the output end of the input voltage division circuit provides an input voltage signal for the input voltage polarity circuit to judge the polarity of the input voltage; an input instantaneous voltage circuit, the input end of which is connected to the output end of the input voltage division circuit, the output end of which provides an input voltage signal with an amplitude value shifted upwards, the polarity of the input voltage is assisted and judged according to the actually measured input voltage instantaneous value, and if the input voltage instantaneous value is greater than zero, the input voltage is positive; if the instantaneous value of the input voltage is less than zero, the input voltage is negative; the input end of the input voltage polarity circuit is connected to the output end of the input voltage division circuit, the output end of the input voltage polarity circuit provides a level signal for the control circuit, and if the level signal is a high level, the input voltage is positive; if the voltage is low level, the input voltage is negative; the three input ports of the control circuit are respectively connected to the output end of the output voltage division circuit, the output end of the input instantaneous voltage circuit and the output end of the input voltage polarity circuit, and the four output ports of the control circuit are respectively connected to the control ends of two pairs of power switches in the power circuit and are used for judging the voltage polarity of the direct-current power supply and respectively controlling the two pairs of power switches to be on or off; the output end of the input voltage polarity circuit is connected to an external interrupt pin XINT1 of the control circuit, and an interrupt service routine for judging the polarity of the input voltage is triggered by the level signal.
Preferably, the power circuit comprises a first P-MOSFET, a second P-MOSFET, a first N-MOSFET and a second N-MOSFET, one end of a first capacitor is connected with the first input end L1 of the dc power supply and is connected with the drain of the first P-MOSFET and the drain of the first N-MOSFET, the other end of the first capacitor is connected with the second input end L2 of the dc power supply and is connected with the drain of the second P-MOSFET and the drain of the second N-MOSFET, the source of the first P-MOSFET is connected with the source of the second P-MOSFET to form a positive DCP, and the source of the first N-MOSFET is connected with the source of the second N-MOSFET to form a negative DCN; a second capacitor is connected between the positive electrode DCP and the negative electrode DCN; wherein the first P-MOSFET and the second N-MOSFET form one pair of the power switches, and the first N-MOSFET and the second P-MOSFET form another pair of the power switches.
Preferably, the output voltage divider circuit includes a first resistor, one end of which is connected to the positive electrode DCP, the other end of which is connected to one end of a second resistor, the other end of the second resistor, one end of a third resistor, one end of a fourth resistor, and one end of a third capacitor, the other end of the fourth resistor, one end of a fourth capacitor, one end of a fifth resistor, the anode of a first diode, and the cathode of the second diode are connected to one another, the other end of the third capacitor, the other end of the third resistor, the other end of the fourth capacitor, the other end of the fifth resistor, the anode of the second diode, and the cathode of the second diode are connected to one another, and the anode of the first diode, the cathode of the second diode, and an analog-to-digital conversion pin ADCIN2 in the control circuit are connected to one another.
Preferably, the input voltage-dividing circuit includes a sixth resistor, one end of the seventh resistor, and one end of the fifth capacitor are connected, and the other end of the seventh resistor, the anode of the third diode, and the cathode of the fourth diode are connected to form a node N1; one end of the eighth resistor, one end of the ninth resistor and one end of the sixth capacitor are connected, and the other end of the ninth resistor, the cathode of the third diode and the anode of the fourth diode are connected to form a node N2.
Preferably, the input instantaneous voltage circuit comprises a tenth resistor, one end of the tenth resistor is connected with a +3.3V power supply, the other end of the tenth resistor, the node N1, one end of a 11 th resistor, one end of a seventh capacitor and + five of the first operational amplifier non-inverting input end are connected, the other end of the eleventh resistor, the other end of the seventh capacitor and the ground are connected, one end of an eighth capacitor, one end of a twelfth resistor, the node N2 and four of the first operational amplifier inverting input end are connected, and the other end of the eighth capacitor, the other end of the 12 th resistor, the first operational amplifier output end and one end of a thirteenth resistor are connected; the anode of the first operational amplifier is connected with a +3.3V power supply, and the cathode of the first operational amplifier is connected with the ground; the other end of the thirteenth resistor, one end of the fourteenth resistor, one end of the ninth capacitor, the anode of the fifth diode, the cathode of the sixth diode and an analog-to-digital conversion pin ADCIN1 of the control circuit are connected, the other end of the fourteenth resistor, the other end of the ninth capacitor, the anode of the sixth diode and the ground are connected, and the cathode of the fifth diode is connected with +3.3V of the power supply.
Preferably, the input voltage polarity circuit includes a tenth capacitor, one end of which, one end of a fifteenth resistor, the node N2 and the inverting input terminal-four of the second operational amplifier are connected, the non-inverting input terminal + of the second operational amplifier is connected to the node N1, the other end of the tenth capacitor, the other end of the fifteenth resistor, the output terminal of the second operational amplifier and one end of the sixteenth resistor are connected, the other end of the sixteenth resistor is connected to the first pin 1 of the first optocoupler, the second pin 2 of the first optocoupler and the third pin 3 of the second optocoupler are connected to ground, and the fourth pin 4 of the first optocoupler, one end of the seventeenth resistor and the external interrupt pin XINT1 of the control circuit are connected to each other.
Preferably, the control circuit comprises two analog-to-digital converters and a processor, wherein an input end ADCIN1 of one analog-to-digital converter is connected to the output end of the input instantaneous voltage circuit, and an input end ADCIN2 of the other analog-to-digital converter is connected to the output end of the output voltage dividing circuit; and four output ports of the processor are respectively connected to the control ends of a pair of power switches in the power circuit.
Preferably, the four output ports of the processor are DP1, DP2, DP3 and DP4, respectively, wherein DP1 is connected to the gate of the first P-MOSFET, DP2 is connected to the gate of the first N-MOSFET, DP3 is connected to the gate of the second P-MOSFET, and DP4 is connected to the gate of the second N-MOSFET.
In a second aspect, the present invention provides a method for automatically converting voltage polarity of a dc power supply, including the following steps:
(1) judging the voltage polarity of an input direct current power supply; (2) and (3) respectively controlling one of the two pairs of power switches to be on and off according to the voltage polarity obtained in the step (1) so that the direct current output voltage of the power circuit has fixed polarity.
Preferably, when the voltage polarity in step (1) is positive, the first pair of power switches is controlled to be turned on, and the second pair of power switches is controlled to be turned off, so that the polarity of the dc output voltage of the power circuit is positive; and (2) when the voltage polarity in the step (1) is negative, controlling the first pair of power switches to be turned off, and controlling the second pair of power switches to be turned on, so that the polarity of the direct-current output voltage of the power circuit is also positive.
Compared with the prior art, the invention has the following beneficial effects:
(1) compared with a direct-current voltage polarity reverse connection prevention circuit, the direct-current voltage polarity reverse connection prevention circuit has the advantages that the direct-current voltage polarity can be automatically corrected, the output is only positive, when the direct-current voltage polarity reverse connection prevention circuit normally works, the MOSFET replaces a diode to conduct electricity, the conduction voltage of the MOSFET is reduced, and the conduction loss is greatly reduced, so that the direct-current voltage polarity reverse connection prevention circuit has the advantage of high transmission efficiency besides the polarity automatic correction capability. Especially when the current carrying capacity is small, the MOSFET conducts instead of the diode, which can bring higher efficiency. In addition, the MOSFET can adopt parallel connection wires, so that the conduction loss is further reduced, and the transmission efficiency is improved;
(2) t1 and T3 are high-end P-MOSFETs, T2 and T4 are low-end N-MOSFETs, the whole bridge arm only needs two independent switching power supplies, T1 and T3 are negative voltage conduction type, T2 and T4 are positive voltage conduction type, thus when the quantity of isolation driving voltage is less than that of full N-MOSFETs, three isolation driving power supplies are needed, the circuit is simplified, and the cost is reduced;
(3) the polarity of the input voltage is judged by detecting the positive and negative of the instantaneous value of the input voltage and the polarity of the input voltage, so that the polarity judgment is reliable, and whether the circuit is open-circuited, under-voltage or overvoltage can be judged by detecting the output voltage. For example, if any of the power transistors T1-T4 is connected in a virtual manner or opened, an abnormal output voltage will be caused.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a schematic block diagram of one embodiment of the circuit of the present invention;
FIG. 2 is an electrical schematic of one embodiment of the circuit of the present invention;
FIG. 3 is a flow chart of an embodiment of the method of the present invention.
In the figure: the power circuit 1, the output voltage division circuit 2, the input voltage division circuit 3, the input instantaneous voltage circuit 4, the input voltage polarity circuit 5 and the control circuit 6.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that variations and modifications can be made by persons skilled in the art without departing from the spirit of the invention. All falling within the scope of the present invention.
As shown in fig. 1, an embodiment of the automatic voltage polarity switching circuit of a dc power supply of the present invention includes a power circuit 1, an input terminal of which is connected to the dc power supply, and which includes two pairs of power switches, and the voltage polarity of the dc power supply is switched to a fixed polarity by respectively controlling the two pairs of power switches to be turned on and off; an input end of the output voltage division circuit 2 is connected to an output end of the power circuit 1, and an output end of the output voltage division circuit provides an output voltage signal for judging whether the power circuit 1 works normally; an input voltage divider circuit 3, the input end of which is connected to the dc power supply, and the output end of which provides an input voltage signal to the input voltage polarity circuit 5 to determine the polarity of the input voltage; an input instantaneous voltage circuit 4, an input end of which is connected to an output end of the input voltage dividing circuit 3, an output end of which provides an input voltage signal with an amplitude shifted up, and the polarity of the input voltage is assisted and judged by actually measuring an input voltage instantaneous value according to the input voltage signal, and if the input voltage instantaneous value is greater than zero, the input voltage is positive; if the instantaneous value of the input voltage is less than zero, the input voltage is negative; an input voltage polarity circuit 5, an input end of which is connected to the output end of the input voltage dividing circuit 3, and an output end of which provides a level signal to the control circuit 6, wherein if the level signal is a high level, the input voltage is a positive polarity; if the voltage is low level, the input voltage is negative; a control circuit 6, three input ports of which are respectively connected to the output end of the output voltage dividing circuit 2, the output end of the input instantaneous voltage circuit 4 and the output end of the input voltage polarity circuit 5, and four output ports of which are respectively connected to the control ends of two pairs of power switches in the power circuit 1, for judging the voltage polarity of the direct current power supply and respectively controlling the two pairs of power switches to be on or off according to the voltage polarity; the output terminal of the input voltage polarity circuit 5 is connected to the external interrupt pin XINT1 of the control circuit 6, and the level signal triggers an interrupt service routine for determining the polarity of the input voltage.
As shown in fig. 2, in an embodiment of the circuit of the present invention, the power circuit 1 includes a first P-MOSFET T1, a second P-MOSFET T3, a first N-MOSFET T2 and a second N-MOSFET T4, one end of a first capacitor C1 is connected to a first input terminal L1 of the dc power supply and is connected to a drain of the first P-MOSFET T1 and a drain of the first N-MOSFET T2, the other end of the first capacitor C1 is connected to a second input terminal L2 of the dc power supply and is connected to a drain of the second P-MOSFET T3 and a drain of the second N-MOSFET T4, a source of the first P-MOSFET T1 is connected to a source of the second P-MOSFET T3 to form a positive DCP, and a source of the first N-MOSFET T2 is connected to a source of the second N-MOSFET T4 to form a negative DCN; a second capacitor C2 is connected between the positive electrode DCP and the negative electrode DCN; wherein the first P-MOSFET T1 and the second N-MOSFET T4 constitute one pair of the power switches, and the first N-MOSFET T2 and the second P-MOSFET T3 constitute the other pair of the power switches.
As shown in fig. 2, in an embodiment of the circuit of the present invention, the output voltage divider circuit 2 obtains an output voltage signal by using resistance voltage division, RC filtering and dual-diode amplitude limiting, and sends the output voltage signal to the ADCIN2 port of the control circuit 6, the output voltage divider circuit 2 specifically includes a first resistor R1, one end of which is connected to the positive electrode DCP, the other end of which is connected to one end of a second resistor R2, the other end of the second resistor R2, one end of a third resistor R3, one end of a fourth resistor R4 and one end of a third capacitor C3, the other end of the fourth resistor R4, one end of a fourth capacitor C4, one end of a fifth resistor R5, the anode of a first diode D1 and the cathode of a second diode D2, the other end of the third capacitor C3, the other end of the third resistor R3, the other end of the fourth capacitor C4, the other end of the fifth resistor R5, the anode of the second diode D2 and the negative electrode DCN 1 are connected to a sixth diode, and the anode of the first diode D1 is connected to the negative electrode of the negative electrode, The cathode of the second diode D2 is connected to the analog-to-digital conversion pin ADCIN2 of the control circuit 6.
As shown in FIG. 2, in one embodiment of the circuit of the present invention, the input voltage divider circuit 3 mainly comprises resistors R6-R9 and capacitors C5-C6 to form a differential voltage divider circuit, which has a filtering function and outputs an amplitude of +/-0.7V; the input voltage-dividing circuit 3 specifically comprises a sixth resistor R6, one end of the sixth resistor R6, one end of a seventh resistor R7 and one end of a fifth capacitor C5 are connected, and the other end of the seventh resistor R7, the anode of a third diode D3 and the cathode of a fourth diode D4 are connected to form a node N1; one end of an eighth resistor R8, one end of a ninth resistor R9 and one end of a sixth capacitor C6 are connected, and the other end of the ninth resistor R9, the cathode of a third diode D3 and the anode of a fourth diode D4 are connected to form a node N2.
As shown in FIG. 2, in one embodiment of the circuit of the present invention, the input transient voltage circuit 4 boosts the input voltage to a magnitude of less than +/-0.7V to +3.3V/2, providing an input voltage signal with an up-shifted magnitude. When the input voltage is zero, i.e. the voltage between L1 and L2 is zero, the output voltage is 1.65V. When the input voltage is positive, i.e. the voltage between L1 and L2 is positive, the output voltage is significantly greater than 1.65V. When the input voltage is negative, namely the voltage between L1 and L2 is negative, the output voltage is obviously less than 1.65V; the input instantaneous voltage circuit 4 specifically comprises a tenth resistor R10, one end of which is connected with a +3.3V power supply, the other end of the tenth resistor R10, one end of the node N1, one end of the 11 th resistor R11, one end of a seventh capacitor C7 and + five non-inverting input ends of a first operational amplifier OP1 are connected, the other end of the eleventh resistor R11, the other end of the seventh capacitor C7 and ground are connected, one end of an eighth capacitor C8, one end of a twelfth resistor R12, one end of the node N2 and four inverting input ends of the first operational amplifier OP1 are connected, and the other end of the eighth capacitor C8, the other end of the 12 th resistor R12, the output end of the first operational amplifier OP1 and one end of a thirteenth resistor R13 are connected; the anode of the first operational amplifier OP1 is connected with a +3.3V power supply, and the cathode of the first operational amplifier OP1 is connected with the ground; the other end of the thirteenth resistor R13, one end of the fourteenth resistor R14, one end of the ninth capacitor C9, the anode of the fifth diode D5, the cathode of the sixth diode D6 and the sixth analog-to-digital conversion pin ADCIN1 of the control circuit 6 are connected, the other end of the fourteenth resistor R14, the other end of the ninth capacitor C9, the anode of the sixth diode D6 and the ground are connected, and the cathode of the fifth diode D5 is connected with + 3.3V.
As shown in fig. 2, in an embodiment of the circuit of the present invention, when the input voltage of the input voltage polarity circuit 5 is positive, the OP2 outputs a low voltage, the primary diode of the optocoupler OC1 does not emit light, and the xin 1 obtains a high level. When the input voltage is negative polarity, the OP2 outputs high voltage, the primary side diode of the optical coupler OC1 emits light, and XINT1 obtains low level. The input voltage polarity circuit 5 specifically includes a tenth capacitor C10, one end of which, one end of a fifteenth resistor R15, the node N2 and the inverting input terminal-four of the second operational amplifier OP2 are connected, the non-inverting input terminal + of the second operational amplifier OP2 is connected to the node N1, the other end of the tenth capacitor C10, the other end of the fifteenth resistor R15, the output terminal of the second operational amplifier OP2 and one end of a sixteenth resistor R16 are connected, the other end of the sixteenth resistor R16 is connected to the first pin 1 of the first optical coupler OC1, the second pin 2 and the third pin 3 of the first optical coupler OC1 are connected to ground, and the fourth pin 4 of the first optical coupler OC1, one end of the seventeenth resistor R17 and the external interrupt pin XINT1 of the control circuit 6 are connected to each other.
As shown in fig. 1 and fig. 2, in an embodiment of the circuit of the present invention, the control circuit 6 includes two analog-to-digital converters and a processor, wherein an input terminal ADCIN1 of one analog-to-digital converter is connected to the output terminal of the input instantaneous voltage circuit 4, and an input terminal ADCIN2 of the other analog-to-digital converter is connected to the output terminal of the output voltage dividing circuit 2; the four output ports of the processor are respectively connected to the control ends of a pair of the power switches in the power circuit 1. The processor can adopt a DSP or MCU digital circuit and is responsible for detecting an analog-to-digital conversion output voltage signal and an input voltage signal and executing a control program.
In one embodiment of the circuit of the present invention, as shown in FIG. 2, the four output ports of the processor are DP1, DP2, DP3 and DP4, wherein DP1 is connected to the gate of the first P-MOSFET T1, DP2 is connected to the gate of the first N-MOSFET T2, DP3 is connected to the gate of the second P-MOSFET T3, and DP4 is connected to the gate of the second N-MOSFET T4.
One embodiment of the voltage polarity automatic switching method of the direct current power supply comprises the following steps: (1) judging the voltage polarity of an input direct current power supply; (2) and (4) respectively controlling one of the two pairs of power switches to be on and off according to the voltage polarity obtained in the step (1) so that the direct current output voltage of the power circuit 1 has a fixed polarity. Specifically, when the voltage polarity in step (1) is positive, controlling the first pair of power switches to be turned on, and controlling the second pair of power switches to be turned off, so that the polarity of the dc output voltage of the power circuit 1 is positive; and (2) when the voltage polarity in the step (1) is negative, controlling the first pair of power switches to be turned off, and controlling the second pair of power switches to be turned on, so that the polarity of the direct-current output voltage of the power circuit 1 is also positive.
As shown in fig. 3, the method is actually performed in 14 steps including analog-to-digital conversion, interrupt service, polarity determination, and drive signal formation, that is, the following steps 1-Step 14:
step1, setting analog-to-digital conversion registers, including a control register 1, a control register 2, a sampling time register, an injection channel data offset register, a watchdog/low threshold register, a rule sequence register, an injection data register, a rule data register and a state register;
step2, starting analog-to-digital conversion, and starting analog-to-digital conversion of the ADCIN1 and ADCIN2 channels;
step3, reading analog-to-digital conversion data, reading the numerical values in the data registers of ADCIN1 and ADCIN2, and storing the numerical values in the corresponding registers;
step4 judges whether or not the converted data > threshold value and the ADCIN1 sample value is greater than 1.65V, outputs a signal Y1 indicating the positive polarity of the input voltage when true, and outputs N1 indicating the negative polarity of the input voltage when false. According to the sampling value of the ADCIN2 channel, whether the direct current power supply polarity conversion circuit works normally is judged;
step5, setting an interrupt register, determining to allow to shield an interrupt source, designing an interrupt vector table, and mounting the interrupt vector table to an instruction memory through a cmd file;
step6, starting interruption and starting total interruption;
step7, executing an interrupt service program, and adopting a low level of a XINT1 pin to cause an interrupt response; the condition that the interrupt service program is triggered is that the level signal is high level, so the interrupt service program can set a bit in a certain register according to the condition to indicate that the input voltage is positive polarity, otherwise, reset the certain bit in the certain register to indicate that the input voltage is negative polarity, and the main program can read the bit state according to the condition;
step8, detecting whether the port voltage is greater than 0, if yes, outputting a confirmation signal Y2 which shows that the polarity of the input voltage is positive, otherwise outputting N2 which shows that the polarity of the input voltage is negative;
step9, anding signals Y1 and Y2;
step10, inputting positive polarity of the voltage, and determining that the input voltage is positive;
step11, setting DP1 to 1, DP4 to 1, DP2 to 0, and DP3 to 0, driving T1 and T4 to be on, T2 and T3 to be off, transmitting the positive polarity voltage of the input end to the output end in phase, and finally, the output end is the positive polarity voltage;
step12, anding, signals N1 and N2;
step13, inputting the voltage with negative polarity, and determining the input voltage with negative polarity;
step14 sets DP1 to 0, DP4 to 0, DP2 to 1, and DP3 to 1, drives T1 and T4 to turn off, turns T2 and T3 to turn on, and the negative polarity voltage at the input terminal is transmitted to the output terminal in reverse phase, and finally the output terminal is the positive polarity voltage.
By executing the control procedure of the flow shown in fig. 3, the polarity of the input voltage is determined and the corresponding driving pulse is sent out, and the power circuit is controlled to be turned on between T1 and T4, turned off between T3 and T2, or turned on between T3 and T2, and turned off between T1 and T4.
In the control routine of the flowchart shown in fig. 3, the signals Y1 and Y2 and the signals N1 and N2 are and-operated to effectively increase the accuracy of polarity determination.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes and modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The above-described preferred features may be used in any combination without conflict with each other.

Claims (10)

1. A voltage polarity automatic switching circuit of a direct current power supply is characterized by comprising:
the input end of the power circuit (1) is connected to a direct current power supply and comprises two pairs of power switches, and the voltage polarity of the direct current power supply is converted into fixed polarity by respectively controlling the two pairs of power switches to be on or off;
the input end of the output voltage division circuit (2) is connected to the output end of the power circuit (1), and the output end of the output voltage division circuit provides an output voltage signal for judging whether the power circuit (1) works normally or not;
an input voltage divider circuit (3) having an input terminal connected to the dc power supply and an output terminal supplying an input voltage signal to the input voltage polarity circuit (5) to determine the polarity of the input voltage;
an input instantaneous voltage circuit (4), the input end of which is connected to the output end of the input voltage dividing circuit (3), the output end of which provides an input voltage signal with an amplitude value shifted upwards, the polarity of the input voltage is assisted and judged by actually measuring the input voltage instantaneous value, and if the input voltage instantaneous value is greater than zero, the input voltage is positive; if the instantaneous value of the input voltage is less than zero, the input voltage is negative;
an input voltage polarity circuit (5), the input end of which is connected to the output end of the input voltage division circuit (3), and the output end of which provides a level signal to the control circuit (6), wherein if the level signal is a high level, the input voltage is positive; if the voltage is low level, the input voltage is negative; and the combination of (a) and (b),
a control circuit (6), three input ports of which are respectively connected to the output end of the output voltage dividing circuit (2), the output end of the input instantaneous voltage circuit (4) and the output end of the input voltage polarity circuit (5), and four output ports of which are respectively connected to the control ends of two pairs of power switches in the power circuit (1), and are used for judging the voltage polarity of the direct current power supply and respectively controlling one of the two pairs of power switches to be on or off according to the voltage polarity;
the output end of the input voltage polarity circuit (5) is connected to an external interrupt pin XINT1 of the control circuit (6), and an interrupt service routine for judging the polarity of the input voltage is triggered by the level signal.
2. The circuit for automatically switching voltage polarity of a DC power supply according to claim 1, wherein the power circuit (1) comprises a first P-MOSFET (T1), a second P-MOSFET (T3), a first N-MOSFET (T2) and a second N-MOSFET (T4), one end of a first capacitor (C1) is connected to the first input terminal L1 of the DC power supply and to the drain of the first P-MOSFET (T1) and the drain of the first N-MOSFET (T2), the other end of the first capacitor (C1) is connected to the second input terminal L2 of the DC power supply and to the drain of the second P-MOSFET (T3) and the drain of the second N-MOSFET (T4), the source of the first P-MOSFET (T1) is connected to the source of the second P-MOSFET (T3) to form a positive electrode, and the source of the first N-MOSFET (T2) is connected to the source of the second P-MOSFET (T4), forming a negative electrode DCN; a second capacitor (C2) is connected between the positive electrode DCP and the negative electrode DCN; wherein the first P-MOSFET (T1) and the second N-MOSFET (T4) constitute one pair of the power switches, and the first N-MOSFET (T2) and the second P-MOSFET (T3) constitute the other pair of the power switches.
3. The circuit according to claim 2, wherein the output voltage divider circuit (2) comprises a first resistor (R1), one end of which is connected to the positive electrode DCP, the other end of which is connected to one end of a second resistor (R2), the other end of the second resistor (R2), one end of a third resistor (R3), one end of a fourth resistor (R4) and one end of a third capacitor (C3), the other end of the fourth resistor (R4), one end of a fourth capacitor (C4), one end of a fifth resistor (R5), the anode of a first diode (D1) and the cathode of the second diode (D2) are connected, the other end of the third capacitor (C3), the other end of the third resistor (R3), the other end of the fourth capacitor (C4), the other end of the fifth resistor (R5), the anode of the second diode (D2) and the cathode of the first diode (D1), and the anode of the first diode (D1) is connected to the cathode of the first diode (D1), The cathode of the second diode (D2) is connected with an analog-to-digital conversion pin ADCIN2 in the control circuit (6).
4. The circuit for automatically switching voltage polarity of a dc power supply according to claim 3, wherein the input voltage divider circuit (3) comprises a sixth resistor (R6), one end of the sixth resistor (R6), one end of a seventh resistor (R7) and one end of a fifth capacitor (C5) are connected, and the other end of the seventh resistor (R7), the anode of the third diode (D3) and the cathode of the fourth diode (D4) are connected to form a node N1; one end of an eighth resistor (R8), one end of a ninth resistor (R9) and one end of a sixth capacitor (C6) are connected, and the other end of the ninth resistor (R9), the cathode of a third diode (D3) and the anode of a fourth diode (D4) are connected to form a node N2.
5. The automatic voltage polarity switching circuit of a dc power supply according to claim 4, wherein the input transient voltage circuit (4) comprises a tenth resistor (R10), one end of which is connected to the +3.3V power supply, the other end of the tenth resistor (R10), the node N1, one end of an 11 th resistor (R11), one end of a seventh capacitor (C7), and the non-inverting input terminal + five of the first operational amplifier (OP1), the other end of the eleventh resistor (R11), the other end of the seventh capacitor (C7), and ground, one end of an eighth capacitor (C8), one end of a twelfth resistor (R12), the node N2, and the inverting input terminal of the first operational amplifier (OP1), the other end of the eighth capacitor (C8), the other end of a 12 th resistor (R12), the output terminal of the first operational amplifier (OP1), and one end of a thirteenth resistor (R13); the anode of the first operational amplifier (OP1) is connected with a +3.3V power supply, and the cathode of the first operational amplifier is connected with the ground; the other end of the thirteenth resistor (R13), one end of the fourteenth resistor (R14), one end of a ninth capacitor (C9), the anode of a fifth diode (D5), the cathode of a sixth diode (D6) and the sixth analog-to-digital conversion pin ADCIN1 of the control circuit (6) are connected, the other end of the fourteenth resistor (R14), the other end of the ninth capacitor (C9), the anode of the sixth diode (D6) and the ground are connected, and the cathode of the fifth diode (D5) is connected with +3.3V of the power supply.
6. The automatic voltage polarity switching circuit of a DC power supply according to claim 5, wherein the input voltage polarity circuit (5) comprises a tenth capacitor (C10), one end of the first optical coupler (OC1), one end of a fifteenth resistor (R15), the node N2 and the inverting input end-four of the second operational amplifier (OP2) are connected, the non-inverting input end + of the second operational amplifier (OP2) is connected with the node N1, the other end of a tenth capacitor (C10), the other end of a fifteenth resistor (R15), the output end of the second operational amplifier (OP2) and one end of a sixteenth resistor (R16) are connected, the other end of the sixteenth resistor (R16) is connected with the first pin 1 of the first optical coupler (OC1), the second pin 2 and the third pin 3 of the first optical coupler (OC1) are connected with the ground, and one end of the fourth pin 4 and the seventeenth resistor (R17) of the first optical coupler (OC1) and the external interrupt pin XINT1 of the control circuit (6) are connected.
7. The automatic voltage polarity switching circuit of the DC power supply according to claim 6, wherein the control circuit (6) comprises two analog-to-digital converters and a processor, wherein an input terminal ADCIN1 of one analog-to-digital converter is connected to the output terminal of the input instantaneous voltage circuit (4), and an input terminal ADCIN2 of the other analog-to-digital converter is connected to the output terminal of the output voltage dividing circuit (2); the four output ports of the processor are respectively connected to the control ends of a pair of power switches in the power circuit (1).
8. The automatic voltage polarity switching circuit of claim 7, wherein four output ports of the processor are DP1, DP2, DP3 and DP4, respectively, wherein DP1 is connected to the gate of the first P-MOSFET (T1), DP2 is connected to the gate of the first N-MOSFET (T2), DP3 is connected to the gate of the second P-MOSFET (T3), and DP4 is connected to the gate of the second N-MOSFET (T4).
9. A voltage polarity automatic switching method of a direct current power supply is characterized by comprising the following steps:
(1) judging the voltage polarity of an input direct current power supply;
(2) and (2) respectively controlling one of the two pairs of power switches to be on and off according to the voltage polarity obtained in the step (1) so that the direct current output voltage of the power circuit (1) has fixed polarity.
10. The method according to claim 9, wherein when the voltage polarity in step (1) is positive, the first pair of power switches is controlled to be turned on, and the second pair of power switches is controlled to be turned off, so that the polarity of the dc output voltage of the power circuit (1) is positive; and (2) when the voltage polarity in the step (1) is negative, controlling the first pair of power switches to be turned off, and controlling the second pair of power switches to be turned on, so that the polarity of the direct-current output voltage of the power circuit (1) is also positive.
CN202111576906.4A 2021-12-22 2021-12-22 Automatic voltage polarity conversion circuit and method for direct-current power supply Active CN114221321B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111576906.4A CN114221321B (en) 2021-12-22 2021-12-22 Automatic voltage polarity conversion circuit and method for direct-current power supply

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111576906.4A CN114221321B (en) 2021-12-22 2021-12-22 Automatic voltage polarity conversion circuit and method for direct-current power supply

Publications (2)

Publication Number Publication Date
CN114221321A true CN114221321A (en) 2022-03-22
CN114221321B CN114221321B (en) 2024-04-19

Family

ID=80704915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111576906.4A Active CN114221321B (en) 2021-12-22 2021-12-22 Automatic voltage polarity conversion circuit and method for direct-current power supply

Country Status (1)

Country Link
CN (1) CN114221321B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114552564A (en) * 2022-04-27 2022-05-27 深圳市爱图仕影像器材有限公司 Multichannel power supply switching circuit and lighting device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102170221A (en) * 2011-04-20 2011-08-31 上海交通大学 Interleaved power factor corrector with approximate open-loop control
CN102664394A (en) * 2012-04-25 2012-09-12 贺川 Direct current polarity detection and protection circuit module
CN103328987A (en) * 2011-01-27 2013-09-25 Fdk株式会社 Polarity detection circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103328987A (en) * 2011-01-27 2013-09-25 Fdk株式会社 Polarity detection circuit
CN102170221A (en) * 2011-04-20 2011-08-31 上海交通大学 Interleaved power factor corrector with approximate open-loop control
CN102664394A (en) * 2012-04-25 2012-09-12 贺川 Direct current polarity detection and protection circuit module

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114552564A (en) * 2022-04-27 2022-05-27 深圳市爱图仕影像器材有限公司 Multichannel power supply switching circuit and lighting device

Also Published As

Publication number Publication date
CN114221321B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
WO2022041890A1 (en) Switching value acquisition circuit and method
CN103546035B (en) Flyback structure-based power conversion device and power conversion method thereof
CN111884646A (en) Intelligent M-BUS host circuit with photoelectric isolation function and control method
CN114221321A (en) Voltage polarity automatic switching circuit and method of direct-current power supply
CN115616427A (en) Lithium battery detection system and detection device
CN106208369A (en) A kind of on-line monitoring device of intelligent type low-voltage circuit breaker
CN111707862A (en) Power failure detection circuit
CN111856332A (en) Circuit and method for detecting disconnection of shunt
TWI698646B (en) Electronic apparatus, voltage detector and power detection method thereof
CN216930034U (en) Communication optimization equipment and communication system based on two buses
CN115693637A (en) Direct-current power supply grid-connected device, system and method
CN212412839U (en) Dual-power control circuit applied to navigation positioning terminal
CN211744029U (en) Over-voltage and under-voltage protection circuit of control chip and control circuit
CN100370388C (en) Feedback circuit for multi-channel output switch electric source and realizing method
CN217766583U (en) Direct-current voltage isolation sampling circuit
CN213879664U (en) Power supply circuit and power supply equipment
CN212572515U (en) Intelligent M-BUS host circuit with photoelectric isolation function
CN213600776U (en) Power failure detection circuit
CN220830510U (en) Main control USB port shared circuit for focusing of 4G camera
CN215180474U (en) Non-isolated terminal voltage monitoring circuit of isolated power supply
CN103529341A (en) Remote control loop detection circuit for negative control terminal
CN218102977U (en) Power supply circuit and electronic device
CN217769906U (en) Switching power supply circuit, circuit board and air conditioner
CN112087245B (en) Power line carrier communication device and communication method
CN220358837U (en) Parallel operation detection circuit of battery pack, battery pack and energy storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant