A circuit compatible with PWM and analog output

By introducing a filter circuit and a switching circuit into the circuit to automatically switch the output of analog signals or digital signals, the problems of low safety and high cost caused by manual operation in the existing technology are solved, and the circuit design is simplified and the cost is reduced.

CN112104350BActive Publication Date: 2024-10-22SHENZHEN ENVICOOL INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010849151.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-21
Publication Date
2024-10-22
Estimated Expiration
2040-08-21

AI Technical Summary

Technical Problem

Existing circuits require manual operation when switching between analog signal and digital signal output, resulting in low safety, high cost and complex PCB design.

Method used

Design a circuit that is compatible with PWM and analog output, realizes automatic switching through the filter circuit and switching circuit, and switches the switch state according to the control signal to output an analog signal or a digital signal.

Benefits of technology

Analog and digital signal output can be achieved without manual operation, which improves circuit safety, simplifies PCB design, reduces costs, and supports remote control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112104350B_ABST
    Figure CN112104350B_ABST
Patent Text Reader

Abstract

The present invention discloses a circuit compatible with PWM and analog output, the circuit comprising a filter circuit for filtering an input PWM signal to form a first output signal; a switch circuit for receiving a control signal and switching the switch state of the switch circuit based on the control signal to control whether the filter circuit works; when the switch circuit is in an on state, the filter circuit works, and the first output signal is an analog signal; when the switch circuit is in an off state, the filter circuit does not work, and the first output signal is a digital signal. The present invention can realize both analog signal output and digital signal output without manual operation, improves circuit safety, facilitates PCB design and structural design, and can output analog signals or digital signals through remote control, while reducing costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power electronics, and in particular to a circuit compatible with PWM and analog output. Background Art

[0002] In industrial sites, a large number of application scenarios use analog signals and digital signals to transmit command signals and feedback signals. Therefore, many industrial controllers, actuators, sensors, monitoring modules and other equipment need to output both analog signals and digital signals.

[0003] Currently, there are circuits that support both analog signal output and digital signal output. In the prior art, the switching between analog signal and digital signal output requires manual operation by the user, which is prone to poor contact and electric shock during operation, which is unsafe. It also brings difficulties to PCB design and high costs.

[0004] How to provide a circuit that supports both analog signal output and digital signal output, achieve simple design, improve circuit safety, and reduce costs is an urgent problem to be solved by technical personnel in this field. Summary of the invention

[0005] Based on this, it is necessary to propose a circuit compatible with PWM and analog output to address the above problems in order to simplify the design, improve circuit safety and reduce costs.

[0006] A technical means adopted by the present invention is to provide a circuit compatible with PWM and analog output, the circuit comprising:

[0007] A filter circuit, used for filtering the input PWM signal to form a first output signal;

[0008] A switch circuit, used for receiving a control signal and switching a switch state of the switch circuit based on the control signal to control whether the filter circuit works;

[0009] When the switch circuit is in an on state, the filter circuit works, and the first output signal is an analog signal;

[0010] When the switch circuit is in the off state, the filter circuit does not work, and the first output signal is a digital signal.

[0011] Due to the adoption of the above technical solution, the circuit compatible with PWM and analog output provided by the present invention outputs analog signals or digital signals through a filter circuit and a switch circuit. The switch circuit is used to receive a control signal and switch the switch state of the switch circuit based on the control signal to control whether the filter circuit is working, thereby realizing that the circuit compatible with PWM and analog output supports both analog signal output and digital signal output. The present invention can realize both analog signal output and digital signal output without manual operation, improves circuit safety, facilitates PCB design and structural design, and can output analog signals or digital signals through remote control, while reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0013] in:

[0014] Figure 1 is a structural block diagram of a circuit compatible with PWM and analog output in one embodiment;

[0015] Figure 2 The circuit principle of a circuit compatible with PWM and analog output in one embodiment Figure 1 ;

[0016] Figure 3 The circuit principle of a circuit compatible with PWM and analog output in one embodiment Figure 2 ;

[0017] Figure 4 The circuit principle of a circuit compatible with PWM and analog output in one embodiment Figure 3 ;

[0018] Figure 5 The circuit principle of a circuit compatible with PWM and analog output in one embodiment Figure 4 . DETAILED DESCRIPTION

[0019] In order to make the purpose of the invention, technical scheme and technical effects of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described in this specification are only for explaining the present invention, not for limiting the present invention. In the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.

[0020] The terms "first", "second", etc. (if any) in the specification and claims and the above drawings are used to distinguish similar parts, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated herein.

[0021] The embodiment of the present invention provides a circuit 1 compatible with PWM and analog output, such as Figure 1 As shown, in one embodiment, the circuit 1 compatible with PWM and analog output may include a filter circuit 11 and a switch circuit 13. The filter circuit 11 is used to filter the input PWM signal to form a first output signal; the switch circuit 13 is used to receive a control signal and switch the switch state of the switch circuit 13 based on the control signal to control whether the filter circuit 11 works. When the switch circuit 13 is in the on state, the filter circuit 11 works, and the first output signal is an analog signal. When the switch circuit 13 is in the off state, the filter circuit 11 does not work, and the first output signal is a digital signal. Specifically, one end of the filter circuit 11 can receive a PWM signal, and the other end of the filter circuit 11 can be connected to the switch circuit 13. The switch circuit 13 receives a control signal PWM-EN. The PWM signal can be provided by a PWM signal generating device. The PWM signal generating device can be a microprocessor, such as an MCU (single-chip microcomputer), or can be composed of a timer and a transistor. The timer controls the conduction and disconnection of the transistor to achieve the output of the PWM signal. The control signal PWM-EN can be provided by the I / O interface of the single-chip microcomputer, or by other means. The circuit 1 compatible with PWM and analog output provided by the embodiment of the present invention can realize both analog signal output and digital signal output without manual operation, thereby improving circuit safety, facilitating PCB design and structural design, and outputting analog signals or digital signals through remote control, while reducing costs.

[0022] In one embodiment, Figure 1As shown, the circuit 1 compatible with PWM and analog output may further include a power supply 14, and the power supply 14 is used to power the circuit 1 compatible with PWM and analog output. Further, the power supply 14 may be a power interface connected to an external power supply device, or may be an energy storage device, such as a rechargeable battery, or may be a power module, a power chip, etc.

[0023] In one embodiment, Figure 2 As shown, the filter circuit 11 may include an RC filter circuit composed of a first resistor R1 and a first capacitor C1, one end of the first capacitor C1 receives the PWM signal via the first resistor R1, and the other end of the first capacitor C1 is connected to the switch circuit 13. When the switch circuit 13 is in an on state, the first capacitor C1 is used to filter the PWM signal, and the first output signal is an analog signal. When the switch circuit 13 is in an off state, the voltage difference between the two ends of the first capacitor C1 is zero, and the first output signal is a digital signal. The filter circuit 11 may also use other types of circuit structures, and the present application does not make any special restrictions here. As long as it can meet the conditions that when the switch circuit 13 is in an on state, the filter circuit 11 works, then the first output signal is an analog signal, and when the switch circuit 13 is in an off state, the filter circuit 11 does not work, then the first output signal is a digital signal.

[0024] In one embodiment, Figure 2 As shown, the switch circuit 13 may include a switch component, and the control end of the switch component is used to receive the control signal and make the switch component in an on state or a off state based on the control signal. The switch component may be a MOS tube, a transistor, a thyristor, a relay, etc., and of course, it may also be other switches that can receive a switch control signal and then realize the switch operation.

[0025] In one embodiment, Figure 2 and Figure 3 As shown, the switch component may be a transistor Q1 or a MOS transistor Q2. Figure 2 The transistor Q1 shown in the figure is an NPN transistor. Figure 3 The MOS tube Q2 shown in the figure is an NMOS tube, but it can be replaced by a PNP tube or a PMOS tube. Figure 2 As shown, the switch component is a transistor Q1, and the switch circuit 13 may further include a second resistor R2, one end of the second resistor R2 receives the control signal PWM-EN, the other end of the second resistor R2 is connected to the base of the transistor Q1, the collector of the transistor Q1 is connected to the filter circuit 11, and the emitter of the transistor Q1 is connected to the ground GND. Figure 3As shown, the switch component is a MOS tube Q2, and the switch circuit 13 may also include a third resistor R3, one end of the third resistor R3 receives the control signal PWM-EN, the other end of the third resistor R3 is connected to the gate of the MOS tube Q2, the drain of the MOS tube Q2 is connected to the filter circuit 11, and the source of the MOS tube Q2 is connected to the ground GND. The embodiment of the present invention can support both analog signal output and digital signal output without manual operation, improve circuit safety, facilitate PCB design and structural design, and can output analog signals or digital signals through remote control, while reducing costs.

[0026] In one embodiment, Figure 1 As shown, the circuit 1 compatible with PWM and analog output may further include a signal amplifying circuit 12 , wherein the signal amplifying circuit 12 is connected to the filtering circuit 11 , and the signal amplifying circuit 12 is used to amplify the first output signal output by the filtering circuit 11 .

[0027] In one embodiment, Figure 2 As shown, the signal amplification circuit 12 may include a fourth resistor R4, a fifth resistor R5, a sixth resistor R6, a seventh resistor R7, an eighth resistor R8, a second capacitor C2 and an operational amplifier U1, and the filter circuit 11 has a first output terminal and a second output terminal; one end of the fourth resistor R4 is connected to the first output terminal of the filter circuit 11, and the other end of the fourth resistor R4 is connected to the non-inverting input terminal of the operational amplifier U1, the output terminal of the operational amplifier U1 is connected to one end of the eighth resistor R8, and is connected to the inverting input terminal of the operational amplifier U1 via the seventh resistor R7, the inverting input terminal of the operational amplifier U1 is connected to the ground via the sixth resistor R6, and is connected to one end of the fifth resistor R5, the other end of the fifth resistor R5 is connected to the second output terminal of the filter circuit 11, the other end of the eighth resistor R8 is connected to the ground via the second capacitor C2, and the other end of the eighth resistor R8 is the output terminal OUT of the signal amplification circuit 12. The signal amplification circuit 12 may also use other types of signal amplification circuits, and this application does not make any special restrictions here.

[0028] Furthermore, if Figure 2 As shown, the first output end of the filter circuit 11 is connected to one end of the first capacitor C1, and the second output end of the filter circuit 11 is connected to the other end of the first capacitor C1.

[0029] Furthermore, if Figure 2As shown, when the switch component of the switch circuit 13 is a transistor Q1, the collector of the transistor Q1 is connected to the other end of the first capacitor C1. When the switch circuit 13 is in an on state, the first capacitor C1 is used to filter the PWM signal, and the first output signal is an analog signal. When the switch circuit 13 is in an off state, the voltage difference across the first capacitor C1 is zero, and the first output signal is a digital signal. That is, when the control signal PWM-EN is at a high level, the transistor Q1 is turned on, the first capacitor C1 is used to filter the PWM signal, and the first output signal is an analog signal; when the control signal PWM-EN is at a low level, the transistor Q1 is turned off, the voltage difference across the first capacitor C1 is zero, and the first output signal is a digital signal.

[0030] Furthermore, if Figure 3 As shown, when the switch component of the switch circuit 13 is a MOS tube Q2, the drain of the MOS tube Q2 is connected to the other end of the first capacitor C1. When the switch circuit 13 is in an on state, the first capacitor C1 is used to filter the PWM signal, and the first output signal is an analog signal. When the switch circuit 13 is in an off state, the first capacitor C1 is disconnected, and the first output signal is a digital signal. That is, when the control signal PWM-EN is at a high level, the MOS tube Q2 is turned on, the first capacitor C1 is used to filter the PWM signal, and the first output signal is an analog signal; when the control signal PWM-EN is at a low level, the MOS tube Q2 is turned off, the voltage difference between the two ends of the first capacitor C1 is zero, and the first output signal is a digital signal.

[0031] In one embodiment, Figure 4 As shown, the circuit 1 compatible with PWM and analog output may further include a single-chip microcomputer U2 , and an I / O interface of the single-chip microcomputer U2 is connected to the filter circuit 11 for providing the PWM signal to the filter circuit 11 .

[0032] In one embodiment, the I / O interface of the single-chip microcomputer U2 can be configured as a push-pull output mode or an open-drain output mode. Figure 4 As shown, when the I / O interface of the single-chip computer U2 is configured as a push-pull output mode, the signal amplification circuit 12 can adjust the resistance values ​​of the fourth resistor R4, the fifth resistor R5, the sixth resistor R6, the seventh resistor R7 and the eighth resistor R8 to correct the amplification ratio and achieve the lowest cost output of analog signals or digital signals.

[0033] In one embodiment, Figure 5As shown, when the I / O interface of the single-chip microcomputer is configured as an open-drain output mode, the circuit also includes a ninth resistor R9 and a first power supply 15. Specifically, the first power supply 15 has a positive output terminal VDD and a negative output terminal GND1, one end of the ninth resistor R9 is connected to the positive output terminal VDD, and the other end of the ninth resistor R9 is respectively connected to the I / O interface of the single-chip microcomputer and the filter circuit 11.

[0034] It should be noted that the power supply 14 has a positive output terminal VCC and a negative output terminal GND, and the positive output terminal VCC and the negative output terminal GND output a power supply voltage that can provide a working voltage for the circuit 1 compatible with PWM and analog output, such as 5V, 12V. Of course, the power supply voltage can also be other voltage values ​​required for adaptation. The negative output terminal GND refers to the power ground, which is used for grounding. The impedance between the negative output terminal GND1 of the first power supply 15 and the negative output terminal GND of the power supply 14 is low. Normally, the negative output terminal GND1 of the first power supply 15 and the negative output terminal GND of the power supply 14 are connected together.

[0035] Specifically, the signal amplification circuit 12 can be expressed by the formula:

[0036] Vout=V1*(Rf*Dr / (Rc*(1-Dr)+Rf*Dr))

[0037] Where: V1 is the target voltage;

[0038] Rc is the charging resistance;

[0039] Rf is the discharge resistance;

[0040] Dr duty cycle;

[0041] To realize the output of any analog signal or digital signal. It should be noted that V1 in the above formula can be a voltage value determined during the hardware circuit design, or a preset value, or a voltage value can be set according to the actual application situation. Vout in the above formula is the voltage value of the output terminal OUT of the signal amplification circuit 12 in this embodiment, and Dr in the above formula is the duty cycle of the PWM signal.

[0042] Further, when the switch circuit 13 is in an open state, the first capacitor C1 is used to filter the PWM signal, and the charging resistor Rc in the above formula is the ninth resistor R9 and the first resistor R1, and the discharging resistor Rf is the first resistor R1. This embodiment can output any analog signal or digital signal through the above formula.

[0043] The embodiment of the present invention can support both analog signal output and digital signal output without manual operation, thereby improving circuit safety, facilitating PCB design and structural design, and outputting analog signals or digital signals through remote control while reducing costs.

[0044] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0045] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A circuit compatible with PWM and analog output, characterized in that: The circuit comprises: A filter circuit, used for filtering the input PWM signal to form a first output signal; A switch circuit, used for receiving a control signal and switching a switch state of the switch circuit based on the control signal to control whether the filter circuit works; When the switch circuit is in an on state, the filter circuit works, and the first output signal is an analog signal; When the switch circuit is in the off state, the filter circuit does not work, and the first output signal is a digital signal.

2. The circuit compatible with PWM and analog output according to claim 1, characterized in that: The filter circuit includes an RC filter circuit composed of a first resistor and a first capacitor; One end of the first capacitor receives the PWM signal via the first resistor, and the other end of the first capacitor is connected to the switch circuit; When the switch circuit is in an open state, the first capacitor is used to filter the PWM signal, and the first output signal is an analog signal; When the switch circuit is in an off state, the voltage difference across the first capacitor is zero, and the first output signal is a digital signal.

3. The circuit compatible with PWM and analog output according to claim 1, characterized in that: The switch circuit includes a switch component, a control end of the switch component is used to receive the control signal and to enable the switch component to be in an on state or an off state based on the control signal.

4. The circuit compatible with PWM and analog output according to claim 3, characterized in that: The switch component is a triode; The switch circuit also includes a second resistor; One end of the second resistor receives the control signal, the other end of the second resistor is connected to the base of the transistor, the collector of the transistor is connected to the filter circuit, and the emitter of the transistor is connected to the ground.

5. The circuit compatible with PWM and analog output according to claim 3, characterized in that: The switch component is a MOS tube; The switch circuit further includes a third resistor; One end of the third resistor receives the control signal, the other end of the third resistor is connected to the gate of the MOS tube, the drain of the MOS tube is connected to the filter circuit, and the source of the MOS tube is connected to the ground.

6. The circuit compatible with PWM and analog output according to claim 1, characterized in that: The circuit also includes a signal amplification circuit; The signal amplifying circuit is connected to the filtering circuit; The signal amplifying circuit is used to amplify the first output signal output by the filtering circuit.

7. The circuit compatible with PWM and analog output according to claim 6, characterized in that: The signal amplifying circuit comprises a fourth resistor, a fifth resistor, a sixth resistor, a seventh resistor, an eighth resistor, a second capacitor and an operational amplifier; The filter circuit has a first output terminal and a second output terminal; One end of the fourth resistor is connected to the first output end of the filter circuit, the other end of the fourth resistor is connected to the non-inverting input end of the operational amplifier, the output end of the operational amplifier is connected to one end of the eighth resistor, and is connected to the inverting input end of the operational amplifier via the seventh resistor, the inverting input end of the operational amplifier is connected to the ground via the sixth resistor, and is connected to one end of the fifth resistor, the other end of the fifth resistor is connected to the second output end of the filter circuit, the other end of the eighth resistor is connected to the ground via the second capacitor, and the other end of the eighth resistor is the output end of the signal amplification circuit.

8. The circuit compatible with PWM and analog output according to claim 1, characterized in that: The circuit also includes a single chip microcomputer; The I / O interface of the single chip microcomputer is connected to the filter circuit and is used to provide the PWM signal to the filter circuit.

9. The circuit compatible with PWM and analog output according to claim 8, characterized in that: The I / O interface of the single-chip microcomputer is configured as a push-pull output mode or an open-drain output mode.

10. The circuit compatible with PWM and analog output according to claim 9, characterized in that: When the I / O interface of the single-chip computer is configured in an open-drain output mode, the circuit further includes a ninth resistor and a first power supply; One end of the ninth resistor is connected to the first power supply, and the other end of the ninth resistor is respectively connected to the I / O interface of the single-chip computer and the filter circuit.