Disclosure of Invention
In order to solve the above problems, the present application provides an isolated output circuit, comprising: the device comprises an isolation circuit, a voltage stabilizing circuit and an adjusting circuit;
The isolation circuit is connected with the voltage stabilizing circuit and the adjusting circuit, and is used for receiving the pulse width modulation wave, isolating the pulse width modulation wave and then sending the pulse width modulation wave to the adjusting circuit;
the voltage stabilizing circuit is connected with the adjusting circuit and is used for stabilizing the power supply voltage, outputting a reference voltage and sending the reference voltage to the adjusting circuit;
the adjusting circuit is used for controlling the output current according to the isolated pulse width modulation wave.
Preferably, the voltage stabilizing circuit includes: the voltage stabilizing sub-circuit, the first filter circuit, the second filter circuit and the load;
The voltage stabilizing sub-circuit is connected in parallel with the first filter circuit and the second filter circuit, one end of the voltage stabilizing sub-circuit is input with a power supply voltage, the voltage stabilizing circuit processes the power supply voltage and then outputs a reference voltage, and the reference voltage is output to the isolation circuit and the adjusting circuit through the other end of the voltage stabilizing sub-circuit;
the load is connected with one end of the voltage stabilizing sub-circuit outputting the reference voltage. Preferably, the isolation circuit includes: an optical coupling circuit and a third filter circuit;
the third filter circuit is connected with the output end of the optical coupling circuit;
The input end of the optical coupling circuit is connected with the main control circuit, receives the pulse width modulation wave, generates an isolated pulse width modulation wave, and outputs the isolated pulse width modulation wave to the adjustment circuit through the output end.
The isolation output of 4-20mA signals is realized by utilizing a single optocoupler, the isolation output of an isolation circuit is realized on the basis of control cost, and the safety and reliability of the circuit are improved. Preferably, the adjusting circuit includes: a level selection circuit and a negative feedback circuit;
The input end of the level selection circuit is connected with the isolation circuit and the voltage stabilizing circuit, and the output end of the level selection circuit is connected with the negative feedback circuit;
the negative feedback circuit controls the output current according to the output level of the level selection circuit.
Preferably, the level selection circuit includes: a first switching circuit, a fourth filter circuit, and a fifth filter circuit;
The input end of the first switch circuit is used for receiving the power supply voltage, the reference voltage and the isolated pulse width modulation wave respectively, and the output end of the first switch circuit sequentially passes through the fourth filter circuit and the fifth filter circuit and is connected with the negative feedback circuit.
Preferably, the negative feedback circuit includes: the device comprises an operational amplifier, a triode Q1, a first TVS tube, a second TVS tube, a first current-limiting resistor, a second current-limiting resistor, a third current-limiting resistor, a first filter capacitor, a second filter capacitor, a control circuit and a precision resistor;
The non-inverting input end of the operational amplifier is connected with the level selection circuit, the inverting input end of the operational amplifier is connected with the triode Q1 through the first current limiting resistor, and the output end of the operational amplifier is connected with the second current limiting resistor;
The second current limiting resistor is connected with the first TVS tube and the control circuit;
the first TVS tube and the control circuit are connected with one end of the third current limiting resistor;
The other end of the third current limiting resistor is connected with a triode Q1;
the triode Q1 is connected with the control circuit, the first filter capacitor and the second TVS tube;
one end of the precision resistor is connected with the second filter capacitor, and the other end of the precision resistor is connected with the triode Q1.
The first TVS tube enables the negative feedback circuit to have an open-circuit fault tolerance function, and when the industrial application site is open-circuit, the first TVS tube ensures that the MOS tube in the control circuit is not broken down, and the negative feedback circuit and the output of the negative feedback circuit are not affected. The second TVS tube enables the negative feedback circuit to have a short-circuit fault tolerance function, and when the industrial application site is short-circuited, the negative feedback circuit and the output of the negative feedback circuit are not affected. The precision resistor can output the full-range current of 0-25mA, and the application scene is wider. And the operational amplifier and the precise resistor ensure that the design cost of the isolation output circuit is greatly saved on the premise of ensuring good precision.
Preferably, the first filter circuit and the second filter circuit each comprise a capacitor;
The voltage stabilizing sub-circuit includes an analog switch.
Preferably, the third filter circuit includes a capacitor;
the optocoupler circuit includes an optocoupler.
Preferably, the first switching circuit comprises an analog switch;
the fourth filter circuit and the fifth filter circuit each comprise a capacitor and a resistor.
Preferably, the control circuit comprises a PMOS transistor or a triode.
The application has the advantages that: the isolation circuit is used for isolating the pulse width modulation wave, so that the cost is low, the reliability is high, and the occupied I/O ports of the main board are few; the reference voltage is output through the voltage stabilizing circuit, and the adjusting circuit controls the output current according to the isolated pulse width modulation wave, so that few devices are needed, and the occupied space of the PCB is small.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
According to a first aspect of the present application, there is provided an isolated output circuit, as shown in fig. 1, comprising:
as shown in fig. 1, includes: an isolation circuit 101, a voltage stabilizing circuit 102, and an adjusting circuit 103.
The isolation circuit is connected with the voltage stabilizing circuit and the adjusting circuit, and is used for receiving the pulse width modulation wave, isolating the pulse width modulation wave and sending the pulse width modulation wave to the adjusting circuit.
The voltage stabilizing circuit is connected with the adjusting circuit and is used for stabilizing the power supply voltage, outputting the reference voltage and sending the reference voltage to the adjusting circuit.
And the adjusting circuit is used for controlling the output current according to the isolated pulse width modulation wave.
A voltage stabilizing circuit comprising: a voltage stabilizing sub-circuit 121, a first filter circuit 122, a second filter circuit 123, and a load 124. The voltage stabilizing sub-circuit is connected in parallel with the first filter circuit and the second filter circuit, one end of the voltage stabilizing sub-circuit inputs the power supply voltage, the voltage stabilizing circuit processes the power supply voltage and then outputs the reference voltage to the isolation circuit and the adjusting circuit through the other end. The load is connected with one end of the output reference voltage of the voltage stabilizing sub-circuit. The first filter circuit and the second filter circuit both comprise capacitors, and the voltage stabilizing sub-circuit comprises an analog switch.
As shown in fig. 2, the voltage stabilizing sub-circuit includes a voltage stabilizing diode U2, the first filter circuit includes a capacitor C2, the second filter circuit includes a capacitor C6, and the load 124 includes a resistor R6. The pin 1 of the zener diode U2 is connected to one end of the capacitor C6 and the supply voltage VDA, and the pin 2 of the zener diode U2 is connected to one end of the resistor R6, the other end of the capacitor C6 and one end of the capacitor C2. Pin 3 of zener diode U2 and the other end of capacitor C2 are both connected to supply voltage VDA. The other end of the resistor R6 is grounded. The capacitors C2 and C6 are used as filter capacitors for the supply voltage VDA, and the zener diode U2 outputs a reference voltage (regulated voltage) DAREF at the pin 2 when the voltage VDA is applied to the pin 3. Resistor R6 is connected between pin 2 of zener diode U2 and GND as a load resistor for reference voltage DAREF.
An isolation circuit, comprising: an optocoupler circuit 111 and a third filter circuit 112. The third filter circuit is connected with the output end of the optical coupling circuit. The input end of the optical coupling circuit is connected with the main control circuit, receives the pulse width modulation wave, generates the isolated pulse width modulation wave, and outputs the pulse width modulation wave to the adjusting circuit through the output end. The third filter circuit comprises a capacitor and the optocoupler circuit comprises an optocoupler.
As shown in fig. 3, the optocoupler circuit includes an optocoupler U1, and the third filter circuit includes a capacitor C4. The isolation circuit further includes a resistor R1, a resistor R3, and a capacitor C3. The cathode of the optical coupler U1 is connected with a pulse width modulation wave control circuit, receives the pulse width modulation wave PWM, the anode is connected with one end of a resistor R3, the emitter is connected with one end of a capacitor C4 and a reference voltage DAREF, and the collector is connected with the other end of the capacitor C4, one end of the resistor R1 and an adjusting circuit. The other end of the resistor R3 is connected with one end of the capacitor C3 and the power supply voltage VCC respectively, the other end of the capacitor C3 is grounded, and the other end of the resistor R1 is connected with the power supply voltage. When the pwm wave is at a high level, the collector output signal SW (isolated pwm wave) level is VDA; when the pwm wave is low, the output signal (isolated pwm wave) is DAREF. The optical coupling circuit can realize that the pulse width modulation wave PWM signal at the main control chip side is isolated and converted into the SW signal at the isolation end (the isolated pulse width modulation wave). C3 and C4 are filter capacitors of the power supply VCC and the VDA respectively; resistor R1 is a pull-up resistor of power supply voltage VCC, and resistor R3 is a pull-up resistor of power supply voltage VDA. The SW signal does not represent a switching signal here, but only represents a pulse width modulated wave isolated by the optocoupler circuit. If the duty ratio of the PWM wave PWM is 40%, the duty ratio of the isolated PWM wave (SW signal) is also 40%.
An adjustment circuit comprising: a level selection circuit 131 and a negative feedback circuit 132. The input end of the level selection circuit is connected with the isolation circuit and the voltage stabilizing circuit, and the output end of the level selection circuit is connected with the negative feedback circuit. The negative feedback circuit controls the output current according to the output level of the level selection circuit.
A level selection circuit comprising: a first switch circuit 311, a fourth filter circuit 312, and a fifth filter circuit 313. The input end of the first switch circuit is used for receiving the power supply voltage, the reference voltage and the isolated pulse width modulation wave respectively, and the output end of the first switch circuit sequentially passes through the fourth filter circuit and the fifth filter circuit and is connected with the negative feedback circuit. The first switching circuit comprises an analog switch, and the fourth filter circuit and the fifth filter circuit each comprise a capacitor and a resistor.
As shown in fig. 4, the first switch circuit includes an analog switch U4, the fourth filter circuit is an RC filter circuit including a resistor R8 and a capacitor C7, and the fifth filter circuit is an RC filter circuit including a resistor R9 and a capacitor C8. The level selection circuit further includes a capacitor C5 and a capacitor C9. Pin 1 of the analog switch U4 is connected with reference voltage DAREF output by the voltage stabilizing circuit and one end of the capacitor C9. Pin 2 is connected to reference voltage DAREF output by the voltage stabilizing circuit and one end of capacitor C5. Pin 3 is connected to the supply voltage VDA and the other end of capacitor C9. The pin 4 is connected with a negative feedback circuit through a resistor R8 and a resistor R9 which are connected in series. Pin 5 is connected to the other end of capacitor C5. The pin 6 is connected to the collector of the optocoupler U1, and receives the isolated pulse width modulated wave (SW signal). One end of the capacitor C7 is connected with the power supply voltage VDA and one end of the capacitor C8, and the other end is connected with one end of the resistor R8 and one end of the resistor R9. The other end of the capacitor C8 is connected with the other end of the resistor R9. The level selection circuit is used for realizing the selection function of the level of the output end of the analog switch U4. When collector output signal SW is level VDA, the output pin (pin 4) of analog switch U4 outputs a level value DAREF; when collector output signal SW is at level DAREF, pin 4 of analog switch U4 outputs a level value VDA. Two sections of RC filter circuits (a fourth filter circuit and a fifth filter circuit) are formed by C7, R8, C8 and R9, and the stability of the voltage output by the analog switch U4 can be ensured.
The negative feedback circuit includes: u3 operational amplifier U3, triode Q1Q1, first TVS tube D1, second TVS tube D2, first current-limiting resistor R4, second current-limiting resistor R7, third current-limiting resistor R5, first filter capacitor C11, second filter capacitor C1, control circuit 330 and precision resistor R2. The non-inverting input end of the operational amplifier is connected with the level selection circuit, the inverting input end of the operational amplifier is connected with the triode Q1 through the first current limiting resistor, and the output end of the operational amplifier is connected with the second current limiting resistor. The second current limiting resistor is connected with the first TVS tube and the control circuit. The first TVS tube and the control circuit are connected with one end of the third current limiting resistor. The other end of the third current limiting resistor is connected with the triode Q1. The triode Q1 is connected with the control circuit, the first filter capacitor and the second TVS tube. One end of the precision resistor is connected with the second filter capacitor, and the other end of the precision resistor is connected with the triode Q1. The operational amplifier comprises an operational amplifier, the control circuit comprises a PMOS tube or a triode, the first TVS tube comprises a diode, the second TVS tube comprises a TVS tube, the first current limiting resistor, the second current limiting resistor and the third current limiting resistor comprise resistors, the first filter capacitor and the second filter capacitor comprise capacitors, and the precision resistor comprises a precision resistor.
As shown in fig. 4, the control circuit includes a PMOS transistor Q2, and the PMOS transistor Q2 may be replaced by a triode. The negative feedback circuit further comprises a capacitor C10. The operational amplifier U3 has a forward input (pin 3) connected to the resistor R9 and the capacitor C8, a reverse input (pin 2) connected to one end of the resistor R4, and an output (pin 1) connected to one end of the capacitor R7. The ground of the operational amplifier U3 is grounded, and the power supply voltage terminal is connected with the power supply voltage and one end of the capacitor C10. The other end of the capacitor C10 is grounded. The other end of the resistor R7 is connected with one end of the TVS tube D1 and the grid electrode of the PMOS tube Q2. The source electrode of the PMOS tube Q2 is connected with the other end of the TVS tube D1 and one end of the resistor R5, and the drain electrode is connected with the collector electrode of the triode Q1, one end of the capacitor C11 and one end of the TVS tube D2. The other end of the resistor R5 is connected with the base electrode of the triode Q1. The emitter of the transistor Q1 is connected to one end of the resistor R2 and the other end of the resistor R4. The other end of the resistor R2 is connected with one end of the capacitor C1, and the other end of the capacitor C1 is grounded. The other end of the capacitor C11 and the other end of the TVS tube D2 are grounded.
Embodiments of the present application also include a pulse width modulated wave control circuit. The pulse width modulation wave control circuit is connected with the isolation circuit and is used for generating pulse width modulation waves and sending the pulse width modulation waves to the isolation circuit.
The pulse width modulation wave control circuit comprises a main control chip which can generate pulse width modulation waves. A main control chip on the main control board generates pulse width modulation waves through I/O control, and the duty ratio of the pulse width modulation waves is adjustable.
When the power supply voltage VDA is just powered on, the inverting input end of the operational amplifier U3 is pulled up to the VDA level by the resistor R2, and at the moment, the non-inverting input end of the operational amplifier U3 is smaller than the value of the VDA, so that the operational amplifier U3 outputs a low level, the PMOS tube Q2 is conducted, the resistor R2 has current flowing through, and the voltage of the inverting input end of the operational amplifier U3 is reduced, so that negative feedback is formed. The TVS tube D1 is used for preventing the PMOS tube Q2 from being broken down, and the TVS tube D2 is used for inhibiting transient current of an output current (Iout) port and protecting an output port circuit. R2 is a precision resistor, and the change of the resistance value along with the temperature is small; transistor Q1 acts as a switching device so that the circuit forms a complete loop.
Embodiments of the application also include a peripheral connection device to which an output current Iout of the current output port (Iout) is sent.
The isolation output of 4-20mA signals is realized by utilizing a single optocoupler, the isolation output of an adjusting circuit is realized on the basis of control cost, and the safety and the reliability of a circuit scheme are improved. The TVS tube D2 is used for suppressing transient current of an output current port, can protect an output port circuit, has no influence on an adjusting circuit when a short circuit occurs on an industrial application site, and can tolerate a short circuit fault. Because the MOS tube of the adjusting circuit is added with the TVS tube D1, when the industrial application site is broken, the TVS tube can ensure that the MOS tube is not broken down, has no influence on the adjusting circuit, and can tolerate broken faults. The embodiment of the application can output the full-range current of 0-25mA, and has wider application scene. The conversion process from analog quantity to digital quantity is controlled by using pulse width modulation wave control circuit, so that a DAC chip with high price can be saved, and the design cost of the circuit is further reduced. The core devices of the embodiment of the application are fewer, mainly comprise an operational amplifier and a precise resistor, and greatly save the design cost on the premise of ensuring good precision. The embodiment of the application only occupies one I/O port with a pulse width modulation function of the main board MCU to realize the reliable output of the 4-20mA current signal. The implementation mode of the application is completely built by discrete basic components, realizes the 4-20mA output function under the condition of occupying very small PCB layout space, greatly reduces the cost, enriches the flexibility of product design, and ensures that the 4-20mA signal output precision is higher by the precise resistor.
The following is a further explanation of the embodiments of the present application.
As shown in fig. 5, the power supply provides the working voltage (such as the power supply voltage) and the working current required by the circuit for the whole circuit system, and the power supply is generally powered by using the existing power supply circuit of the main control board. The supply source also provides a supply voltage VDA. The pulse width modulation wave control circuit uses the I/O of the main control chip on the main control board to generate pulse width modulation waves, thereby realizing the function of adjusting output current. The voltage stabilizing circuit is used for mainly providing a reference voltage (voltage reference value) DAREF for the adjusting circuit of the rear end. The isolation circuit converts the pulse width modulation wave on the main control chip side into the pulse width modulation wave on the isolation side, and realizes the isolation of the safety area and the dangerous area. The adjusting circuit controls the magnitude of the output current according to the duty ratio of the isolated pulse width modulation wave. The field devices comprise dangerous side devices such as transmitters, flow meters and the like, mainly receive 4-20mA output signals and belong to peripheral connection devices.
Firstly, a power supply is electrified to generate a power supply voltage VDA, and due to the voltage stabilizing effect of a voltage stabilizing circuit, a reliable reference voltage DAREF with good precision can be provided for an isolation circuit and an adjusting circuit. After the power-on is finished, an I/O port of a main control chip in the pulse width modulation wave control circuit is used for controlling and outputting a pulse width modulation wave with adjustable duty ratio, and the pulse width modulation wave passes through the isolation circuit to generate an isolated pulse width modulation wave (SW). The reference voltage DAREF and the isolated pwm wave act on the adjusting circuit at the same time, when the level of the isolated pwm wave is VDA, the DAREF is output from the pin 4 of the analog switch U4, the level value of the pin 2 of the operational amplifier U3 is DAREF, and the emitter level of the triode Q1 is DAREF according to the negative feedback principle, so that the current output of the adjusting circuit can be calculated as I out = (VDA-DAREF)/R2. Similarly, when the level of the isolated pwm wave is low, the output current of the adjusting circuit is zero, so that the current output is adjusted by controlling the duty ratio of the pwm wave and the filtered voltage (the voltage at the resistor R2).
The positive substitution scheme of the embodiment of the application comprises the following steps:
The isolation function of the isolation circuit may be signal isolation by other isolation methods, such as: magnetic isolation, dedicated chip isolation to achieve the same function. Magnetic isolation is a magnetically coupled isolator based on magnetic isolation technology that uses pulses delivered to the primary side of a given transformer to encode the input logic transitions. These pulses are coupled from the primary winding of the transformer to the secondary winding and detected by the secondary circuit, which then recovers the digital signal at the output, thus achieving isolated transmission of the signal. The special chip isolation can adopt a special signal isolation chip on the market to realize the isolated transmission design of signals, and the periphery of the chip needs to be matched with a corresponding signal processing circuit.
The reference voltage of the voltage stabilizing circuit can be designed by other schemes, for example: the power supply chip is directly adopted for design, and the output voltage is used as a voltage reference value of the back-end circuit. Such as the TI company power chip outputs 2.5V, 3V, 3.3V, 5V power chips; the power chip with micro core force outputs 2.5V, 3V, 3.3V, 5V and the like. The analog switch U4 can be built by switching devices such as triodes, MOS tubes, resistors, capacitors and the like. The chip power pin decoupling capacitors (e.g., C3, C10, etc.) may be eliminated. The two-stage RC filter circuit (fourth filter circuit and fifth filter circuit) may be omitted, one or all of them may be omitted. The TVS tubes D1, D2 may be omitted. The PMOS transistor Q2 may be replaced with a triode.
However, with magnetic isolation and dedicated chips, although the function of signal isolation can also be achieved, the circuit design of magnetic isolation is complex and requires custom magnetic cores. The isolation effect can be achieved by adopting the special chip for isolation, but the price of the special chip is higher, and the development cost of the product can be increased.
Reference voltages are available using integrated power chips, but costs increase accordingly, and circuit designs increase peripheral devices accordingly. The level switching circuit is built by adopting a discrete switching device, so that the level switching function can be realized, but the circuit design becomes complicated, an additional switching control signal is required, the resources of a main control chip are occupied, and the reliability is correspondingly reduced. Decoupling capacitors of power supply pins of the chip are removed, and although circuit functions can be realized, stability can be reduced, and a circuit system is easy to be interfered by noise. Removing one or both RC filter circuits may cause instability of the output signal of the analog switch U4, which may cause abnormal functions of the back-end negative feedback circuit. The TVS tubes D1, D2 are removed, and the output function of the adjusting circuit can be realized, but the circuit is easily damaged and broken down by static electricity, surge, etc. The PMOS tube is changed into a triode, the function can be realized, but the voltage control device is changed into a current control device, so that the power consumption of the circuit is increased, and in the embodiment of the application, breakdown damage is more likely to occur.
In the method, the pulse width modulation wave is isolated by using the isolation circuit, so that the cost is low, the reliability is high, and fewer I/O ports of a main board are occupied; the reference voltage is output through the voltage stabilizing circuit, and the adjusting circuit controls the output current according to the isolated pulse width modulation wave, so that few devices are needed, and the occupied space of the PCB is small.
The present application is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present application are intended to be included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.