CN114221321B - Automatic voltage polarity conversion circuit and method for direct-current power supply - Google Patents

Automatic voltage polarity conversion circuit and method for direct-current power supply Download PDF

Info

Publication number
CN114221321B
CN114221321B CN202111576906.4A CN202111576906A CN114221321B CN 114221321 B CN114221321 B CN 114221321B CN 202111576906 A CN202111576906 A CN 202111576906A CN 114221321 B CN114221321 B CN 114221321B
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.)
Active
Application number
CN202111576906.4A
Other languages
Chinese (zh)
Other versions
CN114221321A (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

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 conversion circuit and method of a direct current power supply, wherein the circuit comprises a power circuit, an output voltage dividing 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 dividing 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 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 and off according to the voltage polarity. The invention judges the polarity of the input voltage by detecting the positive and negative of the instantaneous value of the input voltage and the polarity of the input voltage, has the advantage of reliable polarity judgment, and can judge whether the circuit has open circuit, under-voltage or over-voltage condition by detecting the output voltage.

Description

Automatic voltage polarity conversion circuit and method for direct-current power supply
Technical Field
The invention relates to the field of power electronics, in particular to a voltage polarity automatic conversion 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 application of direct current electric equipment are more and more in depth. The direct current power supply system has the problem of voltage polarity, the voltage polarities of the direct current power supplies from different sources can be the same or opposite, and when a plurality of direct current power supplies are connected to a direct current public coupling point or supply power to a direct current load, voltage polarity correction is required, otherwise, the direct current electric equipment is damaged due to polarity connection.
At present, an input direct-current voltage reverse connection preventing circuit is mature, and a specific implementation mode mainly comprises a diode reverse connection preventing circuit or a reverse connection preventing circuit which adopts a power MOSFET to replace a diode so as to reduce conduction loss. The reverse connection preventing circuit is simple and easy to operate, but can not convert the input direct current sources with different positive and negative voltage polarities into direct current sources with the same output voltage polarity, and is one of the problems which must be solved in the fields of distributed power generation and direct current micro-grid power supply.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a voltage polarity automatic conversion circuit and method of a direct current power supply, which can realize the automatic correction of the polarity of the direct current voltage and ensure that the output voltage always has one polarity which is fixed and unchanged.
In order to achieve the above object, according to a first aspect of the present invention, there is provided a voltage polarity automatic switching circuit of 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, the voltage polarity of the dc power supply is switched to a fixed polarity by controlling on/off of the two pairs of power switches respectively; the input end of the output voltage dividing circuit is connected to the output end of the power circuit, and the output end of the output voltage dividing circuit provides an output voltage signal for judging whether the power circuit works normally or not; the input voltage dividing circuit is connected with the direct current power supply at the input end, and the output end of the input voltage dividing circuit provides an input voltage signal for the input voltage polarity circuit to judge the polarity of the input voltage; the input end of the input instantaneous voltage circuit is connected to the output end of the input voltage dividing circuit, the output end of the input instantaneous voltage circuit provides an input voltage signal with the amplitude shifted upwards, the input voltage instantaneous value is actually measured according to the input voltage signal to assist in judging the polarity of the input voltage, and if the input voltage instantaneous value is larger than zero, the input voltage is positive; if the instantaneous value of the input voltage is smaller than zero, the input voltage is negative; the input voltage polarity circuit is connected with the output end of the input voltage dividing circuit, the output end of the input voltage polarity circuit provides level signals for the control circuit, and if the input voltage polarity circuit is at a high level, the input voltage is positive; if the input voltage is at a low level, the input voltage is at a negative polarity; the control circuit is characterized in that three input ports of the control circuit are respectively connected to the output end of the output voltage dividing circuit, the output end of the input instantaneous voltage circuit and the output end of the input voltage polarity circuit, and 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 and off according to the voltage polarity; 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 through 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 a first input end L1 of the direct current power supply, and is connected with a drain electrode of the first P-MOSFET and a drain electrode of the first N-MOSFET, the other end of the first capacitor is connected with a second input end L2 of the direct current power supply, and is connected with a drain electrode of the second P-MOSFET and a drain electrode of the second N-MOSFET, after the source electrode of the first P-MOSFET is connected with the source electrode of the second P-MOSFET, an anode DCP is formed, and after the source electrode of the first N-MOSFET is connected with the source electrode of the second N-MOSFET, an anode DCN is formed; a second capacitor is connected between the positive electrode DCP and the negative electrode DCN; wherein the first and second P-MOSFETs form one pair of the power switches, and the first and second P-MOSFETs form the other pair of the power switches.
Preferably, the output voltage dividing 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 which is connected to one end of a third resistor, one end of which is connected to one end of a fourth resistor, one end of which is connected to one end of a fifth resistor, one end of which is connected to one end of a first diode, one end of which is connected to one second diode, the other end of which is connected to one end of a second diode, the other end of which is connected to one end of the third resistor, the other end of which is connected to one end of the fourth capacitor, the other end of which is connected to one end of the fifth resistor, the second diode, the anode of which is connected to the negative electrode DCN, and the analog-to-digital conversion pin ADCIN in the control circuit.
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 transient voltage circuit includes a tenth resistor, one end of which is connected to a +3.3v power supply, the other end of the tenth resistor, one end of the 11 th resistor, one end of the seventh capacitor and +five of the first op amp non-inverting input terminal, the other end of the eleventh resistor, the other end of the seventh capacitor and ground are connected, one end of the eighth capacitor, one end of the twelfth resistor, the node N2 and the fourth of the first op amp inverting input terminal are connected, and the other end of the eighth capacitor, the other end of the 12 th resistor, the first op amp output terminal and the fourth of the thirteenth resistor are connected; the positive electrode of the first operational amplifier is connected with a +3.3V power supply, and the negative electrode 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 the 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 the power supply +3.3V.
Preferably, the input voltage polarity circuit includes a tenth capacitor, one end of which is connected to a fifteenth resistor, the node N2 and an inverting input end-four of the second op-amp, the non-inverting input end+ of the second op-amp is connected to the node N1, the other end of the tenth capacitor, the other end of the fifteenth resistor, the output end of the second op-amp and the one end four 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, the third pin 3 of the first optocoupler are connected to ground, and the fourth pin4 of the first optocoupler, the one end of the seventeenth resistor and the external interrupt pin XINT in the control circuit are connected.
Preferably, the control circuit includes two analog-to-digital converters and a processor, wherein an input end ADCIN of one analog-to-digital converter is connected to an output end of the input transient voltage circuit, and an input end ADCIN2 of the other analog-to-digital converter is connected to an output end of the output voltage dividing circuit; four output ports of the processor are respectively connected to 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 steps of:
(1) Judging the voltage polarity of an input direct current power supply; (2) And (3) respectively controlling 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 polarity of the voltage in the step (1) is positive, controlling the first pair of power switches to be turned on and the second pair of power switches to be turned off so that the polarity of the dc output voltage of the power circuit is positive; when the polarity of the voltage in the step (1) is negative, the first pair of power switches are controlled to be turned off, and the second pair of power switches are controlled to be turned on, so that the polarity of the direct current output voltage of the power circuit is positive.
Compared with the prior art, the invention has the following beneficial effects:
(1) Compared with a direct-current voltage polarity reverse connection preventing circuit, the direct-current voltage polarity reverse connection preventing circuit can realize the automatic correction of the direct-current voltage polarity, the output is only positive, during normal operation, the MOSFET replaces a diode to conduct, the MOSFET conduction voltage is reduced, the conduction loss is greatly reduced, and therefore the direct-current voltage polarity reverse connection preventing circuit has the advantage of high transmission efficiency besides the polarity automatic correction capability. Particularly when the current-carrying capacity is small, the MOSFET can bring about higher efficiency instead of diode conduction. 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, and T2 and T4 are positive voltage conduction type, so that the quantity of isolation driving voltages is less than that of the situation that three isolation driving power supplies are needed when the whole N-MOSFETs are used, 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 method has the advantage of reliable polarity judgment, and meanwhile, whether the circuit has an open circuit, an undervoltage or an overvoltage condition can be judged by detecting the output voltage. For example, if any one of the power transistors T1 to T4 is in a virtual connection or an open circuit, an output voltage abnormality may be caused.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments, given with reference to the accompanying drawings in which:
FIG. 1 is a schematic block diagram of one embodiment of a circuit of the present invention;
FIG. 2 is an electrical schematic of one embodiment of the circuit of the present invention;
figure 3 is a flow chart of one embodiment of the method of the present invention.
In the figure: the power circuit 1, the output voltage dividing circuit 2, the input voltage dividing 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 present invention, but are not intended to limit the invention in any way. It should be noted that variations and modifications could be made by those skilled in the art without departing from the inventive concept. These are all within the scope of the present invention.
As shown in fig. 1, an embodiment of the automatic voltage polarity switching circuit of the dc power supply of the present invention includes a power circuit 1, whose input terminal is connected to the dc power supply, including two pairs of power switches, and switching the voltage polarity of the dc power supply to a fixed polarity by controlling on/off of the two pairs of power switches respectively; the input end of the output voltage dividing circuit 2 is connected to the output end of the power circuit 1, and the output end of the output voltage dividing circuit provides an output voltage signal for judging whether the power circuit 1 works normally or not; an input voltage dividing circuit 3 having an input terminal connected to the dc power supply and an output terminal for supplying an input voltage signal to an input voltage polarity circuit 5 to determine the polarity of the input voltage; the input transient 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 the amplitude shifted upwards, and the polarity of the input voltage is judged in an auxiliary way according to the actually measured input voltage transient value, if the input voltage transient value is greater than zero, the input voltage is positive; if the instantaneous value of the input voltage is smaller 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 dividing circuit 3, and the output end of which provides a level signal to the control circuit 6, and if the input voltage is high level, the input voltage is positive; if the input voltage is at a low level, the input voltage is at a negative polarity; the control circuit 6, its three input ports are connected to the output end of the said output voltage divider circuit 2, the output end of the said input instantaneous voltage circuit 4 and the output end of the said input voltage polarity circuit 5 separately, its four output ports are connected to the control end of two pairs of said power switches in the said power circuit 1 separately, are used for distinguishing the voltage polarity of the said direct-flow power, and control two pairs of said power switches on and off separately accordingly; the output end of the input voltage polarity circuit 5 is connected to the external interrupt pin XINT of the control circuit 6, and the interrupt service routine for judging the polarity of the input voltage is triggered by the level signal.
In one embodiment of the circuit of the present invention, as shown in fig. 2, 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 the first capacitor C1 is connected to the first input terminal L1 of the dc power supply, and is connected 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 is connected to the drain of the second P-MOSFET T3 and the drain of the second N-MOSFET T4, where after the source of the first P-MOSFET T1 is connected to the source of the second P-MOSFET T3, a positive DCP is formed, and after the source of the first N-MOSFET T2 is connected to the source of the second N-MOSFET T4, a negative DCN is formed; 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 form one pair of the power switches, and the first N-MOSFET T2 and the second P-MOSFET T3 form the other pair of the power switches.
In one embodiment of the circuit of the present invention, the output voltage dividing circuit 2 uses resistor voltage division, RC filtering and dual diode clipping to obtain an output voltage signal, and the output voltage signal is sent to the ADCIN port of the control circuit 6, where the output voltage dividing circuit 2 specifically includes a first resistor R1, one end of which is connected to the positive DCP, the other end of which is connected to one end of the second resistor R2, the other end of the second resistor R2, one end of the third resistor R3, one end of the fourth resistor R4, one end of the third resistor C3, one end of the fourth resistor R4, one end of the first diode D1, one end of the second diode D2, one end of the third resistor C3, one end of the third resistor R3, one end of the fourth resistor C4, one end of the fifth resistor R5, one end of the second diode D2, one end of the negative electrode DCN, and the analog-to-digital conversion pin ADCIN in the control circuit 6 are connected.
In one embodiment of the circuit of the present invention, as shown in fig. 2, the input voltage dividing circuit 3 mainly comprises resistors R6-R9 and capacitors C5-C6 to form a differential voltage dividing circuit, which has a filtering function and outputs an amplitude +/-0.7V; the input voltage dividing circuit 3 specifically includes 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 the eighth resistor R8, one end of the ninth resistor R9 and one end of the sixth capacitor C6 are connected, and the other end of the ninth resistor R9, the cathode of the third diode D3 and the anode of the fourth diode D4 are connected to form a node N2.
In one embodiment of the circuit of the present invention, as shown in FIG. 2, the input transient voltage circuit 4 increases the input voltage having a magnitude below +/-0.7V to +3.3V/2, providing an input voltage signal having 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 transient voltage circuit 4 specifically includes a tenth resistor R10, one end of which is connected to 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 the seventh capacitor C7, and the non-inverting input end of the first OP1 are connected to +five, the other end of the eleventh resistor R11, the other end of the seventh capacitor C7, and ground are connected, one end of the eighth capacitor C8, one end of the twelfth resistor R12, the node N2, and the inverting input end-four of the first 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 OP1, and one end of the thirteenth resistor R13 are connected; the positive electrode of the first operational amplifier OP1 is connected with a +3.3V power supply, and the negative electrode 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 the power +3.3v.
As shown in fig. 2, in one 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 XINT is high. When the input voltage is negative, the OP2 outputs high voltage, the primary diode of the optical coupler OC1 emits light, and XINT is low level. The input voltage polarity circuit 5 specifically includes a tenth capacitor C10, one end of which is connected to a fifteenth resistor R15, the node N2 and an inverting input end-four of the second OP2, the non-inverting input end+ of the second 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 end of the second OP2 and one end of a sixteenth resistor R16 are connected to each other, the other end of the sixteenth resistor R16 is connected to the first pin 1 of the first optocoupler OC1, the second pin 2 and the third pin 3 of the first optocoupler OC1 are connected to the ground, and the fourth pin 4 of the first optocoupler OC1, one end of the seventeenth resistor R17 and the external interrupt pin XINT in the control circuit 6 are connected to each other.
As shown in fig. 1 and 2, in one embodiment of the circuit of the present invention, the control circuit 6 includes two analog-to-digital converters and a processor, wherein an input ADCIN of one analog-to-digital converter is connected to the output end of the input instantaneous voltage circuit 4, and an input ADCIN2 of the other analog-to-digital converter is connected to the output end 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, is responsible for detecting analog-to-digital conversion output voltage signals and input voltage signals, and executes 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, 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.
An embodiment of the voltage polarity automatic conversion method of the direct current power supply comprises the following steps: (1) judging the voltage polarity of an input direct current power supply; (2) According to the voltage polarity obtained in the step (1), two pairs of power switches are respectively controlled to be on-off so that the direct current output voltage of the power circuit 1 has fixed polarity. Specifically, when the polarity of the voltage in the step (1) is positive, controlling the first pair of power switches to be turned on and 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; when the polarity of the voltage in the step (1) is negative, the first pair of power switches is controlled to be turned off, and the second pair of power switches is controlled to be turned on, so that the polarity of the direct current output voltage of the power circuit 1 is positive.
As shown in fig. 3, the method actually performs 14 steps including analog-to-digital conversion, interrupt service, polarity determination, and driving signal formation, namely steps 1-Step14 described below:
Step1, setting an analog-to-digital conversion register, wherein the analog-to-digital conversion register comprises a control register 1, a control register 2, a sampling time register, an injection channel data offset register, a watchdog/low threshold value 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 the analog-to-digital conversion of ADCIN channels and ADCIN channels;
step3, reading analog-digital conversion data, reading the numerical value in each data register of ADCIN and ADCIN, and storing the numerical value in the corresponding register;
Step4, determining the conversion data > threshold, determining ADCIN whether the sampling value is greater than 1.65V, outputting a signal Y1 when established, indicating positive polarity of the input voltage, and outputting N1 when not established, indicating negative polarity of the input voltage. According to the sampling value of ADCIN channels, the DC power supply polarity conversion circuit is used for judging whether the DC power supply polarity conversion circuit works normally or not;
Step5, setting an interrupt register, and determining that the interrupt source is allowed to be shielded, the interrupt vector table is designed, and the interrupt vector table is mounted to an instruction memory through a cmd file;
Step6, starting interruption and starting total interruption;
step7, executing an interrupt service routine, and adopting a XINT pin low level to cause interrupt response; the condition that the interrupt service routine is triggered is that the level signal is high level, so that the interrupt service routine can set a certain position in a certain register according to the situation, the input voltage is positive, otherwise, reset a certain position in a certain register, the input voltage is negative, and the main routine can read the state of the position according to the situation;
Step8, detecting whether the port voltage is greater than 0, outputting a confirmation signal Y2 when the port voltage is greater than 0, wherein the polarity of the input voltage is positive, and otherwise outputting N2, wherein the polarity of the input voltage is negative;
Step9, AND, signals Y1 and Y2;
step10, inputting a positive polarity of the voltage, and determining that the input voltage is positive;
Step11, setting dp1=1, dp4=1, dp2=0 and dp3=0, driving T1 and T4 to be on, and T2 and T3 to be off, wherein positive voltage at an input end is transmitted to an output end in phase, and the final output end is positive voltage;
Step12, AND the signals N1 and N2;
Step13, the negative polarity of the input voltage is determined, and the input voltage is determined to be negative;
Step14, setting dp1=0, dp4=0, dp2=1, dp3=1, driving T1 and T4 to turn off, and T2 and T3 to turn on, wherein the negative voltage at the input terminal is transmitted to the output terminal in an inverted manner, and the final output terminal is positive voltage.
By executing the control program of the flow shown in fig. 3, the judgment of the polarity of the input voltage is completed, corresponding driving pulses are sent out, and the power circuit is controlled to be turned on by T1 and T4, turned off by T3 and T2, or turned on by T3 and T2, and turned off by T1 and T4.
In the control procedure of the flow shown in fig. 3, the and operation of the signals Y1 and Y2 and the and operation of the signals N1 and N2 can effectively increase the accuracy of the polarity judgment.
The foregoing describes specific embodiments of the present invention. It is to be understood that the invention is not limited to the particular embodiments described above, and that various changes and modifications may be made by one skilled in the art within the scope of the claims without affecting the spirit of the invention. The above-described preferred features may be used in any combination without collision.

Claims (8)

1. A voltage polarity automatic switching circuit of a dc power supply, comprising:
the input end of the power circuit (1) is connected to the 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 and off;
The input end of the output voltage dividing circuit (2) is connected to the output end of the power circuit (1), and the output end of the output voltage dividing circuit provides an output voltage signal for judging whether the power circuit (1) works normally or not;
An input voltage dividing circuit (3) having an input terminal connected to the DC power supply and an output terminal for supplying an input voltage signal to an input voltage polarity circuit (5) to determine the polarity of the input voltage;
The input terminal of the input instantaneous voltage circuit (4) is connected to the output terminal of the input voltage dividing circuit (3), the output terminal of the input instantaneous voltage circuit provides an input voltage signal with the amplitude shifted upwards, the polarity of the input voltage is assisted to be judged according to the actually measured input voltage instantaneous value, and if the input voltage instantaneous value is larger than zero, the input voltage is positive; if the instantaneous value of the input voltage is smaller than zero, the input voltage is negative;
An input voltage polarity circuit (5) with an input end connected to the output end of the input voltage dividing circuit (3), and an output end providing a level signal to the control circuit (6), and if the input voltage is high level, the input voltage is positive; if the input voltage is at a low level, the input voltage is at a negative polarity; and, a step of, in the first embodiment,
The control circuit (6) is respectively connected with 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 the four output ports of the control circuit are respectively connected with 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 the two pairs of power switches to be on and 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 through the level signal;
The input instantaneous voltage circuit (4) comprises a tenth resistor (R10), one end of the tenth resistor (R10) is connected with a +3.3V power supply, the other end of the tenth resistor (R10), a node N1, one end of an eleventh resistor (R11), one end of a seventh capacitor (C7) and a first operational amplifier (OP 1) non-inverting input end +five 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), a node N2 and a first operational amplifier (OP 1) inverting input end-four are connected, and the other end of the eighth capacitor (C8), the other end of the twelfth resistor (R12), the output end of the first operational amplifier (OP 1) and one end of a thirteenth resistor (R13) are connected; the positive electrode of the first operational amplifier (OP 1) is connected with a +3.3V power supply, and the negative electrode 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 the ninth capacitor (C9), the anode of the fifth diode (D5), the cathode of the sixth diode (D6) and the six analog-to-digital conversion pins 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 a power supply +3.3V;
The input voltage polarity circuit (5) comprises a tenth capacitor (C10), one end of which, one end of a fifteenth resistor (R15), the node N2 and the inverting input end-four of the second OP2 are connected, the non-inverting input end+ of the second OP2 is connected with the node N1, the other end of the tenth capacitor (C10), the other end of the fifteenth resistor (R15), the output end of the second OP2 and one end-four 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 optocoupler (OC 1), the second pin 2 and the third pin 3 of the first optocoupler (OC 1) are connected with the ground, and the fourth pin 4 of the first optocoupler (OC 1), one end of the seventeenth resistor (R17) and the external interrupt pin XINT in the control circuit (6) are connected.
2. The automatic voltage polarity switching circuit of a direct current 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 direct current power supply and to the drain of the first P-MOSFET (T1), 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 direct current power supply and to the drain of the second P-MOSFET (T3), the source of the first P-MOSFET (T1) is connected to the source of the second P-MOSFET (T3), and then a positive DCP is formed, and the source of the first N-MOSFET (T2) is connected to the source of the second N-MOSFET (T4) and then a negative DCN is formed; 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) form one pair of the power switches, and the first N-MOSFET (T2) and the second P-MOSFET (T3) form the other pair of the power switches.
3. The automatic voltage polarity switching circuit of a dc power supply according to claim 2, wherein the output voltage dividing circuit (2) includes a first resistor (R1) having one end connected to the positive DCP, the other end 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 the fourth capacitor (C4), one end of a fifth resistor (R5), one end of a first diode (D1) and one end of a 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 negative DCN are connected, and the first diode (D1) anode, the second diode (D2) and the cathode of the control pin (ADCIN) are connected.
4. The automatic voltage polarity switching circuit of a dc power supply according to claim 3, wherein the input voltage dividing circuit (3) includes 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 1, wherein the control circuit (6) comprises two analog-to-digital converters and a processor, wherein an input ADCIN of one analog-to-digital converter is connected to the output of the input instantaneous voltage circuit (4), and an input ADCIN of the other analog-to-digital converter is connected to the output of the output voltage divider circuit (2); four output ports of the processor are respectively connected to control ends of a pair of power switches in the power circuit (1).
6. The automatic voltage polarity switching circuit of claim 5, 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).
7. A method for automatically switching the voltage polarity of a dc power supply of the dc power supply voltage polarity automatic switching circuit of claim 1, comprising the steps of:
(1) Judging the voltage polarity of an input direct current power supply;
(2) According to the voltage polarity obtained in the step (1), two pairs of power switches are respectively controlled to be on-off so that the direct current output voltage of the power circuit (1) has fixed polarity.
8. The method according to claim 7, wherein when the voltage polarity in the step (1) is positive, the first pair of power switches are controlled to be turned on, and the second pair of power switches are controlled to be turned off, so that the polarity of the dc output voltage of the power circuit (1) is positive; when the polarity of the voltage in the step (1) is negative, the first pair of power switches are controlled to be turned off, and the second pair of power switches are controlled to be turned on, so that the polarity of the direct current output voltage of the power circuit (1) is 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 CN114221321A (en) 2022-03-22
CN114221321B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114552564B (en) * 2022-04-27 2022-07-08 深圳市爱图仕影像器材有限公司 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

Also Published As

Publication number Publication date
CN114221321A (en) 2022-03-22

Similar Documents

Publication Publication Date Title
TWI577115B (en) Switch power circuit and method for controlling voltage of bus capacitor of switch power circuit
CN103546035B (en) Flyback structure-based power conversion device and power conversion method thereof
CN206321756U (en) Power failure detection circuit and switching power supply circuit
CN109581233B (en) Device for detecting positive and negative monolithic voltages of fuel cell and control method thereof
CN114221321B (en) Automatic voltage polarity conversion circuit and method for direct-current power supply
US11366462B2 (en) High-voltage interlock device and fault detection method thereof
CN102377326B (en) Insulated gate bipolar transistor (IGBT)-bridge-switch-topology-based driving circuit and protection module thereof
US20140361608A1 (en) Redundant power supply circuit, power over ethernet system, and method
US20200244098A1 (en) Power supply apparatus and power supply method
CN115453957B (en) Digital quantity input acquisition system
CN106208369A (en) A kind of on-line monitoring device of intelligent type low-voltage circuit breaker
CN111707862A (en) Power failure detection circuit
CN115693637A (en) Direct-current power supply grid-connected device, system and method
CN213600776U (en) Power failure detection circuit
CN212229004U (en) Optical coupling isolation detection circuit with low power consumption and wide voltage
CN211744029U (en) Over-voltage and under-voltage protection circuit of control chip and control circuit
CN108594082A (en) A kind of alternating current power-off signal transmission circuit and method
CN211043524U (en) Three-phase power supply phase loss detection circuit
CN100370388C (en) Feedback circuit for multi-channel output switch electric source and realizing method
CN213213358U (en) DC motor locked rotor detection module and motor driving device
CN218102977U (en) Power supply circuit and electronic device
CN215180474U (en) Non-isolated terminal voltage monitoring circuit of isolated power supply
CN217766583U (en) Direct-current voltage isolation sampling circuit
CN218601372U (en) Power consumption detection circuit and electronic equipment
CN220830510U (en) Main control USB port shared circuit for focusing of 4G camera

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