PWM generator using LM393 and discrete components
The PWM generator built through the LM393 comparator and discrete components solves the problems of insufficient cost and performance in the prior art, realizes flexible duty cycle control and high frequency output, and is suitable for a variety of electronic control applications.
Patent Information
- Application Number
- CN202510083070.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-07-29
AI Technical Summary
Existing PWM generators have shortcomings in cost, performance stability, regulation flexibility and output frequency range, especially in applications that are cost-sensitive or have strict power consumption requirements.
The PWM generator is built using the LM393 comparator and simple discrete components, including a relaxation oscillator module, an LM393 comparator module and a pull-up circuit module. The triangular wave signal is generated through the relaxation oscillator, and the LM393 comparator module performs signal comparison. The pull-up circuit module adjusts the output signal level to achieve adjustable PWM signal output.
Reduces cost and complexity, while maintaining the basic functions of the PWM signal generator, implementing flexible duty cycle control and output frequency up to 100KHz, suitable for applications where there are strict requirements for cost and power consumption.
Smart Images

Figure CN120389734A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic circuits, and more specifically, the present invention relates to a PWM generator using LM393 and discrete components. Background Art
[0002] In the field of electronics, a PWM generator is an important component, widely used in various applications such as speed regulation, dimming, and power management. Traditional PWM generators are mostly implemented using integrated circuits or microcontrollers. Although these solutions are powerful, they have certain limitations in terms of cost, power consumption, and complexity. Especially in some applications that are sensitive to cost or have strict requirements for power consumption, a simpler and lower-cost PWM generator solution is needed. Some existing PWM generator designs based on discrete components, although reducing costs to a certain extent, still have deficiencies in terms of performance stability, adjustment flexibility, and output frequency range.
[0003] In the process of implementing the embodiments of the present invention, the inventors found that there are at least the following problems or defects in the prior art: There are challenges in achieving a balance between the implementation cost and performance of existing PWM generators. Especially in occasions that require high stability and precise control, traditional discrete component solutions are difficult to meet the requirements, and these solutions are also relatively limited in terms of output frequency and duty cycle adjustment, restricting their applicability in a wider range of applications. Summary of the Invention
[0004] The present invention provides a PWM generator using LM393 and discrete components, including:
[0005] A relaxation oscillator module for generating a triangular wave signal. The relaxation oscillator module includes a power input terminal, a ground terminal, and a triangular wave signal output terminal. Its power input terminal is connected to the power supply VCC, and the ground terminal is grounded.
[0006] An LM393 comparator module including a triangular wave signal input terminal, an external voltage input terminal, and a PWM signal output terminal. The triangular wave signal input terminal is connected to the triangular wave signal output terminal of the relaxation oscillator module, and is used to compare the triangular wave signal with the input voltage to generate a PWM signal. Among them, the PWM signal output terminal of the LM393 comparator module is the output terminal of the PWM generator.
[0007] A pull-up circuit module, one end of which is connected to the power supply VCC, and the other end is connected to the PWM signal output terminal of the LM393 comparator module, for adjusting the output signal level.
[0008] Further, the relaxation oscillator module includes:
[0009] The first resistor R1, the second resistor R2, the third resistor R3, the fourth resistor R4, the fifth resistor R5, the sixth resistor R6, the first capacitor C1, the first diode D1, the first comparator U1A;
[0010] One end of the first resistor R1 is connected to the power supply VCC as the power input terminal of the relaxation oscillator module, and the other end of the first resistor R1 is connected to one end of the second resistor R2;
[0011] The other end of the second resistor R2 is connected to the positive input terminal of the first comparator U1A;
[0012] The negative input terminal of the first comparator U1A is connected to one end of the first capacitor C1;
[0013] The other end of the first capacitor C1 is connected to one end of the third resistor R3, and the other end of the third resistor R3 is grounded as the ground terminal of the relaxation oscillator module;
[0014] One end of the fourth resistor R4 is connected to the power supply VCC, and the other end of the fourth resistor R4 is connected to the output terminal of the first comparator U1A;
[0015] One end of the fifth resistor R5 is connected to the output terminal of the first comparator U1A, and the other end of the fifth resistor R5 is connected to the connection point of the second resistor R2 and the positive input terminal of the first comparator U1A;
[0016] One end of the sixth resistor R6 is connected to the connection point of the first capacitor C1 and the third resistor R3, and the other end of the sixth resistor R6 is connected to the anode of the first diode D1;
[0017] The cathode of the first diode D1 is grounded;
[0018] The output terminal of the first comparator U1A is used as the triangular wave signal output terminal of the relaxation oscillator module.
[0019] Furthermore, the LM393 comparator module includes:
[0020] The first comparator U1A and the second comparator U1B;
[0021] The output terminal of the first comparator U1A is connected to the positive input terminal of the second comparator U1B, and this connection point is used as the triangular wave signal input terminal of the LM393 comparator module;
[0022] The negative input terminal of the second comparator U1B is connected to the external input voltage as the external voltage input terminal;
[0023] The output terminal of the second comparator U1B is used as the PWM signal output terminal of the LM393 comparator module.
[0024] Furthermore, the pull-up circuit module includes:
[0025] The seventh resistor R7, the eighth resistor R8, and the second capacitor C2;
[0026] One end of the seventh resistor R7 is connected to the power supply VCC as the connection end of the pull-up circuit module to the power supply VCC, and the other end of the seventh resistor R7 is connected to the output end of the second comparator U1B; one end of the eighth resistor R8 is connected to the output end of the second comparator U1B, and the other end of the eighth resistor R8 is connected to one end of the second capacitor C2; the other end of the second capacitor C2 is grounded.
[0027] Furthermore, the resistance values of the first resistor R1, the second resistor R2, the third resistor R3, the fourth resistor R4, the fifth resistor R5, the sixth resistor R6, the seventh resistor R7, and the eighth resistor R8 are 47 KΩ, 47 KΩ, 47 KΩ, 2.2 KΩ, 47 KΩ, 470 Ω, 2.2 KΩ, and 47 KΩ respectively;
[0028] The capacitance values of the first capacitor C1 and the second capacitor C2 are 470 pF and 470 pF respectively.
[0029] Furthermore, the voltage range of the power supply VCC is 3.3 V - 18 V.
[0030] Furthermore, the range of the external input voltage is 1 / 3 VCC - 2 / 3 VCC.
[0031] Furthermore, the duty cycle of the PWM signal changes with the change of the external input voltage.
[0032] Furthermore, the output frequency of the PWM wave is determined by the third resistor R3 and the first capacitor C1, and the output frequency does not exceed 100 KHz.
[0033] Furthermore, by changing the supply voltage level of the connection end to the power supply VCC in the pull-up circuit module of the seventh resistor R7, the output signal level and the supply voltage are made different.
[0034] According to the above embodiments of the present invention, it has at least the following beneficial effects: This PWM generator is constructed using an LM393 comparator and simple discrete components, which can effectively reduce costs and complexity while maintaining the basic functions required by a PWM signal generator. By generating a stable triangular wave signal through the relaxation oscillator module and combining the precise comparison function of the LM393 comparator module, it can achieve a sensitive response to the external input voltage, thereby generating a PWM signal with a variable duty cycle. This design can not only improve the flexibility and adaptability of the system, but also reduce power consumption due to its simple structure, and is suitable for application scenarios with strict requirements for cost and power consumption.
[0035] In addition, the design of this PWM generator allows the output frequency to be set by adjusting the parameters of resistors and capacitors, with a maximum up to 100 KHz, which can meet the requirements of most electronic control applications. The design of the pull-up circuit module enables the output signal level to be flexibly adjusted to adapt to different supply voltage requirements, enhancing the compatibility of the system. This design can provide a cost-effective and reliable PWM signal solution, suitable for various electronic systems that require precise control. Description of the Drawings
[0036] By referring to the accompanying drawings and reading the detailed description below, the above and other objects, features, and advantages of the exemplary embodiments of the present invention will become readily understood. In the drawings, several embodiments of the present invention are shown by way of illustration and not limitation, wherein:
[0038] Figure 1 Schematic diagram of the connection of some components in the relaxation oscillator module provided by an embodiment of the present invention;
[0039] Figure 2 Schematic diagram of the circuit of the relaxation oscillator module provided by an embodiment of the present invention;
[0040] Figure 3 Schematic diagram of the change in the duty cycle of the PWM signal output by the LM393 comparator module provided by an embodiment of the present invention;
[0041] Figure 4 Schematic diagram of the power-related of the circuit provided by an embodiment of the present invention under 5V voltage;
[0042] Figure 5 Schematic diagram of the circuit related after adjusting R3 provided by an embodiment of the present invention;
[0043] Figure 6 Schematic diagram of the oscillation capacitor waveform in the circuit provided by an embodiment of the present invention;
[0044] Figure 7 Schematic diagram of the circuit waveform after R3 is restored to normal connection provided by an embodiment of the present invention;
[0045] Figure 8 Schematic diagram of the waveform change of the output pin of the LM393 provided by an embodiment of the present invention;
[0046] Figure 9 Schematic diagram of the circuit part for generating dead time modification provided by an embodiment of the present invention;
[0047] Figure 10 Schematic diagram of the waveform of the improved circuit used as the control part of the BUCK circuit provided by an embodiment of the present invention;
[0048] Figure 11 Schematic diagram of relevant characteristics after circuit improvement provided by an embodiment of the present invention. Detailed implementation manners
[0049] The principles and spirit of the present invention will be described below with reference to several exemplary implementation manners. It should be understood that these implementation manners are provided only to enable those skilled in the art to better understand and then implement the present invention, rather than limiting the scope of the present invention in any way. On the contrary, these implementation manners are provided to make the present invention more thorough and complete, and to be able to convey the scope of the present invention fully to those skilled in the art.
[0050] Those skilled in the art know that the implementation manners of the present invention can be realized as a system, a device, an equipment, a method, or a computer program product. Therefore, the present invention can be specifically realized in the following forms, namely: completely hardware, completely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0051] It should be noted that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.
[0052] Below with reference to Figure 1 , Figure 1 Schematic diagram of the structure of a PWM generator using LM393 and discrete components provided by an embodiment of the present invention. As Figure 1 shown, a PWM generator 100 using LM393 and discrete components includes:
[0053] A relaxation oscillator module for generating a triangular wave signal. The relaxation oscillator module includes a power input terminal, a ground terminal, and a triangular wave signal output terminal. Its power input terminal is connected to the power supply VCC, and the ground terminal is grounded;
[0054] An LM393 comparator module includes a triangular wave signal input terminal, an external voltage input terminal, and a PWM signal output terminal. The triangular wave signal input terminal is connected to the triangular wave signal output terminal of the relaxation oscillator module, and is used to compare the triangular wave signal with the input voltage to generate a PWM signal; wherein, the PWM signal output terminal of the LM393 comparator module is the output terminal of the PWM generator;
[0055] A pull-up circuit module, one end of which is connected to the power supply VCC, and the other end is connected to the PWM signal output terminal of the LM393 comparator module, and is used to adjust the output signal level.
[0056] It should be noted that this embodiment describes a PWM generator designed using an LM393 and simple discrete components. The generator includes a relaxation oscillator module, an LM393 comparator module, and a pull-up circuit module. The relaxation oscillator module is used to generate a triangular wave signal, and the LM393 comparator module compares the triangular wave signal with an external voltage to generate a PWM signal. The pull-up circuit module is used to adjust the output signal level to ensure that the signal is compatible with the power supply voltage.
[0057] Specifically, the relaxation oscillator module is composed of a series of resistors and capacitors. The first resistor R1 is connected to the power supply VCC as the power input terminal. The second resistor R2 is connected to the positive input terminal of the first comparator U1A, and the first capacitor C1 is connected to the negative input terminal of U1A and the third resistor R3, and the other end of R3 is grounded. The LM393 comparator module consists of two comparators U1A and U1B. The output terminal of U1A is connected to the positive input terminal of U1B. The negative input terminal of U1B is used as the external voltage input terminal, and the output terminal of U1B is the PWM signal output terminal. The pull-up circuit module is composed of the seventh resistor R7, the eighth resistor R8, and the second capacitor C2. R7 is connected to the power supply VCC, R8 is connected to the output terminal of U1B, and the other end of C2 is grounded.
[0058] Preferably, the resistance values of the resistors R1 to R8 are 47KΩ, 47KΩ, 47KΩ, 2.2KΩ, 47KΩ, 470Ω, 2.2KΩ, and 47KΩ respectively, and the capacitance values of the capacitors C1 and C2 are both 470pF. The voltage range of the power supply VCC is 3.3V - 18V, and the range of the external input voltage is 1 / 3VCC - 2 / 3VCC. The duty cycle of the PWM signal changes with the change of the external input voltage, and the output frequency of the PWM wave is determined by the third resistor R3 and the first capacitor C1, and the output frequency does not exceed 100KHz. By changing the supply voltage level of the connection end of the pull-up circuit module of the seventh resistor R7 to the power supply VCC, the output signal level and the supply voltage can be made different, such as a supply input of 12V and an output level of 5V, etc.
[0059] As Figure 1 、 Figure 2 shown. In some embodiments, the relaxation oscillator module includes:
[0060] The first resistor R1, the second resistor R2, the third resistor R3, the fourth resistor R4, the fifth resistor R5, the sixth resistor R6, the first capacitor C1, the first diode D1, the first comparator U1A;
[0061] One end of the first resistor R1 is connected to the power supply VCC as the power input terminal of the relaxation oscillator module, and the other end of the first resistor R1 is connected to one end of the second resistor R2;
[0062] The other end of the second resistor R2 is connected to the positive input terminal of the first comparator U1A;
[0063] The negative input terminal of the first comparator U1A is connected to one end of the first capacitor C1;
[0064] The other end of the first capacitor C1 is connected to one end of the third resistor R3, and the other end of the third resistor R3 is grounded as the ground terminal of the relaxation oscillator module;
[0065] One end of the fourth resistor R4 is connected to the power supply VCC, and the other end of the fourth resistor R4 is connected to the output terminal of the first comparator U1A;
[0066] One end of the fifth resistor R5 is connected to the output terminal of the first comparator U1A, and the other end of the fifth resistor R5 is connected to the connection point between the second resistor R2 and the positive input terminal of the first comparator U1A;
[0067] One end of the sixth resistor R6 is connected to the connection point between the first capacitor C1 and the third resistor R3, and the other end of the sixth resistor R6 is connected to the anode of the first diode D1;
[0068] The cathode of the first diode D1 is grounded;
[0069] The output terminal of the first comparator U1A serves as the triangular wave signal output terminal of the relaxation oscillator module.
[0070] It should be noted that this embodiment describes in detail the composition and working principle of the relaxation oscillator module, which is a key part of the PWM generator for generating triangular wave signals. The relaxation oscillator module includes a power input terminal, a ground terminal, and a triangular wave signal output terminal, where the power input terminal is connected to the power supply VCC and the ground terminal is grounded. The module internally contains multiple resistors and capacitors, as well as a comparator U1A, which work together to generate the required triangular waveform.
[0071] Specifically, the relaxation oscillator module is composed of a first resistor R1, a second resistor R2, a third resistor R3, a fourth resistor R4, a fifth resistor R5, a sixth resistor R6, a first capacitor C1, and a first diode D1. One end of the first resistor R1 is connected to the power supply VCC, and the other end is connected to one end of the second resistor R2; the other end of the second resistor R2 is connected to the positive input terminal of the first comparator U1A; the negative input terminal of the first comparator U1A is connected to one end of the first capacitor C1; the other end of the first capacitor C1 is connected to one end of the third resistor R3, and the other end of the third resistor R3 is grounded; one end of the fourth resistor R4 is connected to the power supply VCC, and the other end is connected to the output terminal of the first comparator U1A; one end of the fifth resistor R5 is connected to the output terminal of the first comparator U1A, and the other end is connected to the connection point of the second resistor R2 and the positive input terminal of the first comparator U1A; one end of the sixth resistor R6 is connected to the connection point of the first capacitor C1 and the third resistor R3, and the other end is connected to the anode of the first diode D1; the cathode of the first diode D1 is grounded; the output terminal of the first comparator U1A serves as the triangular wave signal output terminal of the relaxation oscillator module.
[0072] Preferably, the specific parameter selection of the resistors and capacitors in the relaxation oscillator module has an important impact on the shape and frequency of the triangular wave signal. For example, the resistance values of the first resistor R1, the second resistor R2, the third resistor R3, the fourth resistor R4, the fifth resistor R5, and the sixth resistor R6 are 47 KΩ, 47 KΩ, 47 KΩ, 2.2 KΩ, 47 KΩ, and 470 Ω respectively, and the capacitance value of the first capacitor C1 is 470 pF. The setting of these parameters ensures the stability of the triangular wave signal and the working performance of the PWM generator.
[0073] Furthermore, as an alternative, these parameters can be adjusted according to actual application requirements to adapt to different working conditions or optimize performance. For example, increasing the capacitance value of the first capacitor C1 can reduce the frequency of the triangular wave, while decreasing the resistance value of the sixth resistor R6 can accelerate the discharge speed of the capacitor, thereby affecting the slope of the triangular wave. Through these adjustments, the characteristics of the PWM signal can be flexibly controlled to meet specific application requirements.
[0074] As Figure 3 shown. In some embodiments, the LM393 comparator module includes:
[0075] a first comparator U1A and a second comparator U1B;
[0076] The output terminal of the first comparator U1A is connected to the positive input terminal of the second comparator U1B, and this connection point serves as the triangular wave signal input terminal of the LM393 comparator module;
[0077] The negative input terminal of the second comparator U1B serves as an external voltage input terminal and is connected to an external input voltage;
[0078] The output terminal of the second comparator U1B serves as the PWM signal output terminal of the LM393 comparator module.
[0079] It should be noted that this embodiment elaborates in detail the composition and functions of the LM393 comparator module, which is a key part of the PWM generator for comparing the triangular wave signal with an external voltage and generating a PWM signal. The LM393 comparator module includes two comparators U1A and U1B. The output terminal of U1A is connected to the positive input terminal of U1B and serves as the triangular wave signal input terminal; the negative input terminal of U1B serves as the external voltage input terminal; the output terminal of U1B serves as the PWM signal output terminal.
[0080] Specifically, the working principle of the LM393 comparator module is that U1A, as the output terminal of the relaxation oscillator module, provides a triangular wave signal to the positive input terminal of U1B. The negative input terminal of U1B receives the external voltage input for setting the threshold of the PWM signal. When the level of the triangular wave signal exceeds the level of the external voltage input, U1B outputs a high level; otherwise, it outputs a low level, thereby generating a PWM signal. This design allows the duty cycle of the PWM signal to change with the variation of the external input voltage, achieving precise voltage control.
[0081] Preferably, to ensure the stability and accuracy of the PWM signal, the external voltage input terminal of U1B can be designed to be adjustable to adapt to different input voltage ranges. For example, the range of the external input voltage can be set from 1 / 3VCC to 2 / 3VCC, which can ensure that the duty cycle of the PWM signal varies between 0% and 100%.
[0082] Furthermore, to increase the output frequency of the PWM signal, resistors and capacitors of appropriate sizes can be selected to configure the parameters of U1A and U1B. For example, the supply voltages of U1A and U1B can be set to 3.3V, 12V, or 18V to adapt to different working voltage requirements.
[0083] Even further, as an alternative solution, other models of comparators can be considered, or the behavior of the comparator can be adjusted through software programming to adapt to specific application scenarios. Through these adjustments, the performance of the PWM generator can be optimized to meet different design requirements.
[0084] In some embodiments, the pull-up circuit module includes:
[0085] The seventh resistor R7, the eighth resistor R8, and the second capacitor C2;
[0086] One end of the seventh resistor R7 is connected to the power supply VCC as the connection end of the pull-up circuit module to the power supply VCC, and the other end of the seventh resistor R7 is connected to the output end of the second comparator U1B; One end of the eighth resistor R8 is connected to the output end of the second comparator U1B, and the other end of the eighth resistor R8 is connected to one end of the second capacitor C2; The other end of the second capacitor C2 is grounded.
[0087] It should be noted that this embodiment describes the structure and function of the pull-up circuit module, which is used to adjust the level of the output signal of the PWM generator to match the supply voltage of the system. The pull-up circuit module includes the seventh resistor R7, the eighth resistor R8, and the second capacitor C2, and these components work together to ensure the stability and compatibility of the output signal.
[0088] Specifically, the design of the pull-up circuit module enables the PWM signal output terminal to be pulled up to the level of the power supply VCC. One end of the seventh resistor R7 is connected to the power supply VCC, and the other end is connected to the output end of the second comparator U1B; One end of the eighth resistor R8 is connected to the output end of the second comparator U1B, and the other end is connected to one end of the second capacitor C2; The other end of the second capacitor C2 is grounded. Such a configuration can provide a stable level at the output end and can also filter out possible noise to ensure the cleanliness of the signal.
[0089] Preferably, in order to further optimize the performance of the pull-up circuit module, specific resistor and capacitor values can be selected to adapt to different application requirements. For example, the resistance values of the seventh resistor R7 and the eighth resistor R8 can be set to 2.2 KΩ, and the capacitance value of the second capacitor C2 can be set to 470 pF. The selection of these parameters helps to reduce power consumption while maintaining signal integrity. As an alternative, different resistor and capacitor values can be considered, or a variable resistor can be introduced to adjust the output level under different operating conditions.
[0090] Furthermore, different pull-up strategies can also be adopted, such as using transistors or operational amplifiers to achieve the pull-up function, which can provide more flexibility and control ability to adapt to a wider range of application scenarios. Through these refinements and alternatives, it can be ensured that the PWM generator can work reliably in various environments.
[0091] As Figure 4 shown. In some embodiments, the resistance values of the first resistor R1, the second resistor R2, the third resistor R3, the fourth resistor R4, the fifth resistor R5, the sixth resistor R6, the seventh resistor R7, and the eighth resistor R8 are 47 KΩ, 47 KΩ, 47 KΩ, 2.2 KΩ, 47 KΩ, 470 Ω, 2.2 KΩ, and 47 KΩ respectively;
[0092] The capacitance values of the first capacitor C1 and the second capacitor C2 are 470 pF and 470 pF respectively.
[0093] It should be noted that this embodiment details the specific parameter settings of each resistor and capacitor in the PWM generator. These parameters are crucial for the performance and stability of the circuit. The values of the resistors and capacitors directly affect the operating frequency of the circuit and the shape of the signal. In this embodiment, the resistance values of the first resistor R1, the second resistor R2, the third resistor R3, the fourth resistor R4, the fifth resistor R5, the sixth resistor R6, the seventh resistor R7, and the eighth resistor R8 are 47 KΩ, 47 KΩ, 47 KΩ, 2.2 KΩ, 47 KΩ, 470 Ω, 2.2 KΩ, and 47 KΩ respectively; the capacitance values of the first capacitor C1 and the second capacitor C2 are both 470 pF.
[0094] Specifically, the values of the resistors and capacitors are set according to the requirements of the circuit design and performance parameters. For example, the resistance values of the first resistor R1 to the eighth resistor R8 are precisely selected to ensure that the relaxation oscillator module and the comparator module can generate a triangular wave signal with the required frequency, and the LM393 comparator module can accurately compare this signal with an external voltage to generate a stable PWM signal. The values of the capacitors C1 and C2 determine the rate of charge accumulation and discharge in the circuit, thereby affecting the slope of the triangular wave and the duty cycle of the PWM signal. The setting of these parameters ensures that the circuit can operate within a wide voltage range of 3.3 V to 18 V while maintaining the stability and accuracy of the signal.
[0095] Preferably, in order to further optimize the performance of the circuit and adapt to different application scenarios, fine-tuning of the values of the resistors and capacitors can be considered. For example, if it is necessary to increase the frequency of the PWM signal, the capacitance values of the first capacitor C1 and the second capacitor C2 can be appropriately reduced; conversely, if it is necessary to decrease the frequency, the capacitance value can be increased.
[0096] Furthermore, if the circuit needs to operate at a lower voltage, resistors with lower resistance values can be considered to reduce power consumption. As an alternative, variable resistors (potentiometers) can be used to dynamically adjust the resistance value, thereby dynamically adjusting the performance of the circuit under different operating conditions. Through these refinements and alternative solutions, the flexibility and adaptability of the circuit can be improved, enabling it to meet a wider range of application requirements.
[0097] In some embodiments, the voltage range of the power supply VCC is 3.3 V - 18 V.
[0098] It should be noted that this embodiment elaborates on the applicable voltage range of the power supply VCC of the PWM generator. The power supply VCC refers to the power supply voltage that provides energy for the circuit, and its voltage range is one of the basic parameters for the normal operation of the circuit. In this embodiment, the voltage range of the power supply VCC is set to 3.3 V to 18 V, which means that the circuit design can adapt to various power supply environments from low voltage to relatively high voltage.
[0099] Specifically, the voltage range of the power supply VCC from 3.3V to 18V covers many common power supply voltage levels, enabling this PWM generator to be applied to different electronic devices and systems. For example, 3.3V is suitable for low-power electronic devices, while 18V is suitable for industrial control systems that require higher voltages. When designing the circuit, it is necessary to consider that within this voltage range, all components, including resistors, capacitors, and the LM393 comparator, can operate stably, and circuit performance parameters such as the output frequency and duty cycle adjustment range will not be affected.
[0100] Preferably, to further ensure the stability and reliability of the circuit under different voltages, some additional design measures can be taken. For example, a voltage regulator or voltage stabilizer can be introduced to ensure that the circuit can still operate normally when the power supply voltage fluctuates. In addition, some protection circuits, such as overvoltage protection and undervoltage protection, can be designed to prevent abnormal voltages from damaging the circuit.
[0101] Furthermore, as an alternative solution, components with a wide voltage range can be considered, which can reduce the requirements for power supply stability while improving the adaptability of the circuit. Through these refinements and alternative solutions, the flexibility and robustness of the PWM generator can be improved, enabling it to operate reliably within a wider voltage range.
[0102] In some embodiments, the range of the external input voltage is 1 / 3VCC - 2 / 3VCC.
[0103] It should be noted that this embodiment describes the range of the external input voltage, which is a key parameter for setting the duty cycle of the PWM signal in the PWM generator. The external input voltage refers to the reference voltage supplied to the comparator module, which determines the duty cycle of the PWM signal. In this embodiment, the range of the external input voltage is set to 1 / 3 to 2 / 3 of the power supply VCC, and such a design allows the duty cycle of the PWM signal to vary between 0% and 100%.
[0104] Specifically, the range of the external input voltage is directly related to the adjustment ability of the PWM signal. When the external input voltage is 1 / 3 of the power supply VCC, theoretically a 100% duty cycle can be obtained; when the external input voltage is 2 / 3 of the power supply VCC, a 0% duty cycle can be obtained. This design enables the PWM generator to flexibly adjust the duty cycle of the PWM signal according to the change of the external input voltage, and is suitable for application scenarios that require precise control of the output power. When designing the circuit, it is necessary to ensure that the comparator module can accurately identify and compare voltage changes within this range.
[0105] Preferably, to improve the flexibility and adaptability of the PWM generator, it is possible to consider fine-tuning or expanding the range of the external input voltage. For example, a voltage divider can be introduced to adjust the actual range of the external input voltage, enabling more precise control of the duty cycle of the PWM signal. Additionally, an adjustable voltage source can be designed as the external input voltage, allowing users to dynamically adjust the duty cycle according to needs to adapt to different application requirements.
[0106] Furthermore, as an alternative, digital or analog potentiometers can be considered to dynamically adjust the external input voltage, thereby achieving more precise duty cycle control. Through these refinements and alternatives, the adjustment ability and application range of the PWM generator can be enhanced.
[0107] In some embodiments, the duty cycle of the PWM signal changes with the variation of the external input voltage.
[0108] It should be noted that this embodiment describes the adjustment mechanism of the duty cycle of the PWM signal. The duty cycle refers to the proportion of the high level within the period of the PWM signal. In this embodiment, the duty cycle of the PWM signal can change with the variation of the external input voltage, which means that by adjusting the external input voltage, the duty cycle of the PWM signal can be controlled, thereby achieving precise control of the load.
[0109] Specifically, the adjustment of the duty cycle of the PWM signal is achieved through the LM393 comparator module. When the external input voltage changes, the comparator module adjusts the duration of the high level of its output signal, i.e., the duty cycle, according to this change. For example, if the external input voltage increases, the comparator module compares the triangular wave signal with a higher reference voltage, resulting in a reduction in the high level time of the output signal, thereby decreasing the duty cycle. Conversely, if the external input voltage decreases, the duty cycle increases. This design enables the PWM generator to dynamically adjust the output signal according to needs to adapt to different control requirements.
[0110] Preferably, to further optimize the adjustment accuracy and response speed of the duty cycle of the PWM signal, it is possible to consider adjusting the parameters of the comparator module. For example, the response characteristics of the comparator can be changed by selecting different models of comparators or adjusting the feedback resistors of the comparator. Additionally, a microcontroller or a digital signal processor (DSP) can be considered to implement more complex control algorithms to achieve non-linear or specific mode duty cycle adjustment.
[0111] Furthermore, as an alternative, a programmable analog circuit, such as an analog switch or a variable gain amplifier, can be used to dynamically adjust the comparison point between the external input voltage and the triangular wave signal, thereby achieving more precise duty cycle control. Through these refinements and alternatives, the performance of the PWM generator can be improved to meet a wider range of application requirements.
[0112] In some embodiments, the output frequency of the PWM wave is determined by the third resistor R3 and the first capacitor C1, and the output frequency does not exceed 100KHz.
[0113] It should be noted that this embodiment details how the output frequency of the PWM wave is determined by specific resistors and capacitors in the circuit and the specific limitations of this frequency. In this embodiment, the output frequency of the PWM wave is jointly determined by the third resistor R3 and the first capacitor C1 because of the RC network formed by them in the relaxation oscillator module. This network controls the rising and falling slopes of the triangular waveform, thus affecting the output frequency. The output frequency does not exceed 100KHz, which is considered in view of the response speed of the LM393 comparator and the stability of the circuit design.
[0114] Specifically, the output frequency of the PWM wave is directly related to the RC network in the relaxation oscillator module. The RC network consists of the resistor R3 and the capacitor C1, and their combination determines the time constant of the circuit, which in turn affects the period of the triangular wave. The time constant τ is calculated by the formula τ = R * C, where R is the resistance value and C is the capacitance value. The period T of the triangular wave is twice the time constant, so T = 2τ. By adjusting the values of R3 and C1, the period of the triangular wave can be changed, and thus the output frequency of the PWM wave can be changed. For example, reducing the value of R3 or C1 can increase the output frequency, and vice versa.
[0115] Preferably, in order to further optimize the output frequency and stability of the PWM wave, precise selection of the values of R3 and C1 can be considered. For example, if a lower output frequency is required, a larger resistance value and / or capacitance value can be selected. In addition, temperature-compensated resistors and capacitors can be considered to reduce the influence of ambient temperature changes on the output frequency.
[0116] Furthermore, as an alternative, a digital control method can be considered, such as using a microcontroller to dynamically adjust the output frequency of the PWM wave, which can provide more precise and flexible control. Through these refinements and alternatives, the adaptability and reliability of the PWM generator can be improved to meet a wider range of application requirements.
[0117] In some embodiments, by changing the supply voltage level of the connection terminal to the power supply VCC in the pull-up circuit module of the seventh resistor R7, the output signal level is made different from the supply voltage.
[0118] It should be noted that this embodiment describes how to achieve an output signal level different from the supply voltage by changing the supply voltage level of the connection terminal to the power supply VCC in the pull-up circuit module. The role of the pull-up circuit module is to raise the output signal level to the required level to match different supply voltage requirements. In this embodiment, by adjusting the supply voltage level on the seventh resistor R7, the output signal level can be made different from the supply voltage. For example, an output level of 5V can be achieved with a 12V supply input.
[0119] Specifically, the pull-up circuit module includes a seventh resistor R7, an eighth resistor R8, and a second capacitor C2. The seventh resistor R7 is connected to the power supply VCC and the output terminal of the second comparator U1B, and the voltage level thereon determines the high-level state of the output signal. The eighth resistor R8 is connected to the output terminal of the second comparator U1B and one end of the second capacitor C2, and the other end of the second capacitor C2 is grounded. By changing the power supply voltage connected to the seventh resistor R7, the high-level potential of the output signal can be changed, thereby achieving the matching of the output signal level under different supply voltages. For example, if the power supply VCC is 12V, the output signal can have a high level of 5V by setting the voltage on the seventh resistor R7 to 5V.
[0120] Preferably, in order to further optimize the matching and stability of the output signal level, an adjustable voltage source or a variable resistor can be considered to dynamically adjust the supply voltage level on the seventh resistor R7. This allows for flexible adjustment of the output signal level according to different application requirements to adapt to different supply environments. In addition, a voltage monitoring circuit can be considered to ensure that the output signal level always remains within a safe and effective range.
[0121] Furthermore, as an alternative, a digital potentiometer can be used to achieve precise adjustment of the voltage on the seventh resistor R7, which can provide finer control and allow the output signal level to be configured through software. Through these refinements and alternatives, the adaptability and flexibility of the PWM generator can be improved to enable it to meet more diverse application requirements.
[0122] To further verify the present invention, as Figures 5 - 11 shown.
[0123] As Figure 5 shown, the connection method of R3 is changed and is only used to charge the capacitor. The discharge of the oscillating capacitor C1 is responsible for the small-value R6 resistor and the high-speed switching diode 1N4148 connected in series therewith. This connection method ensures precise control of the capacitor discharge process. At this time, it can be observed from the circuit that the discharge ramp of the oscillating capacitor becomes extremely steep, and this change has a significant impact on the electrical characteristics of the circuit, laying the foundation for further adjusting the circuit to achieve dead-time control.
[0124] like Figure 6 As shown in the figure, due to the changes to R3 and the associated discharge circuit, the capacitor discharge waveform exhibits a steeper slope. This phenomenon indicates that the capacitor discharge rate has changed under the new circuit structure, in stark contrast to the circuit's behavior before the modification. This waveform change reflects the new laws of energy storage and release in the circuit and is key to understanding the dynamic changes in the circuit's electrical characteristics during the improvement process. It also provides important clues for subsequent analysis of whether the circuit can achieve dead time control.
[0125] like Figure 7 As shown in the figure, the circuit is further adjusted to restore R3's normal connection. At this point, the waveforms in the circuit change accordingly; for example, the shape and characteristics of the triangular wave and other signals differ from their previous configurations. This change reflects the impact of R3's restoration of its normal connection on the entire circuit's signal transmission and processing, indicating that the interactions between the various components of the circuit have reached a new equilibrium under this adjustment. By observing and analyzing these waveforms, we can gain a deeper understanding of the circuit's operating mechanisms under different configurations and the contribution of each component to overall circuit performance.
[0126] like Figure 8 The figure below shows the change in the waveform at the LM393 output pin after the triangle wave's waveform changes, causing the square wave value to decrease. The original 50% duty cycle square wave undergoes significant changes during this process, affecting its duty cycle, amplitude, and characteristics such as rising and falling edges. This change clearly demonstrates the tight coupling between the circuit's internal signals: changes in the triangle wave signal directly lead to changes in the output signal through the LM393 comparator. This diagram provides a deeper understanding of the signal processing and conversion logic within the circuit, as well as the combined impact of various circuit parameters on the final output signal.
[0127] like Figure 9 As shown in the figure, at the end of each cycle, the capacitor discharges, using clever circuit design to directly lower the reference voltage of the third comparator. Although relatively simple and straightforward, this design effectively changes the circuit's reference voltage, thereby introducing dead time. The figure clearly shows the connection location and method of the newly added components (such as those used to lower the reference voltage). These components work together with the existing circuit to achieve the dead time generation, providing a key diagram for understanding the dead time generation principle and circuit functionality expansion.
[0128] like Figure 10As shown, in this application scenario, the waveform output by the circuit clearly demonstrates its role in regulating the duty cycle. By observing the waveform, it can be seen that the duty cycle of the output signal can be adjusted accordingly according to the design requirements and input conditions of the circuit, so as to achieve precise control of the power switch tube in the BUCK circuit. This illustration effectively verifies the function and performance of the improved circuit in practical applications, indicating that it can meet the requirements of a specific circuit system for PWM signals, providing strong support and basis for the practical application of the circuit.
[0129] As Figure 11 shown, in various working states, the circuit exhibits stable electrical characteristics. For example, under different input voltages and load conditions, the output signal of the circuit remains stable without obvious fluctuations or distortions. In terms of signal changes, whether it is the generation of the triangular wave signal, the comparison process with the input voltage, or the final output of the PWM signal, all show predictable and stable behaviors. When working in cooperation with other modules, the circuit can cooperate well with the peripheral circuit without signal interference or compatibility problems, ensuring the stable operation of the entire system. This figure comprehensively reflects the comprehensive performance of the optimized and improved PWM generator circuit in practical applications, proving that it can efficiently achieve the expected functions and meet diverse practical needs, which is an intuitive presentation and comprehensive summary of the entire circuit design and improvement results.
[0130] The above embodiments of the present invention have the following beneficial effects: The PWM generator design described in the present invention can provide a solution with a simple structure and low cost. By generating a stable triangular wave signal through the relaxation oscillator module and using the LM393 comparator module to achieve precise voltage comparison, a PWM signal with an adjustable duty cycle can be generated. This design can not only simplify the circuit but also reduce the dependence on external power supplies and components, improving the reliability and stability of the system. At the same time, by carefully selecting the resistance and capacitance values, an output frequency of up to 100KHz can be achieved, meeting the requirements of various electronic control applications.
[0131] In addition, the voltage range of the power supply VCC is set to 3.3V - 18V, and this generator is suitable for a variety of power supply environments. The range of the external input voltage is set to 1 / 3VCC - 2 / 3VCC, which can enhance the adaptability to input voltage changes. The duty cycle of the PWM signal changes with the change of the external input voltage, providing a more flexible control method. By changing the supply voltage level of the connection terminal to the power supply VCC in the pull-up circuit module, the output signal level can be different from the supply voltage, which can further enhance the flexibility and applicability of the system. These improvements enable the PWM generator to maintain good performance and stability in different application scenarios.
[0132] Further, the storage medium of the embodiment of the present application stores program instructions capable of implementing all of the above methods. Among them, the program instructions can be stored in the above storage medium in the form of a software product, including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, or terminal devices such as computers, servers, mobile phones, and tablets.
[0133] The above description is only some preferred embodiments of the present invention and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present invention is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the embodiments of the present invention.
Claims
1. A PWM generator using LM393 and discrete components, characterized in that, Comprising: A relaxation oscillator module for generating a triangular wave signal. The relaxation oscillator module includes a power input terminal, a ground terminal, and a triangular wave signal output terminal. Its power input terminal is connected to the power supply VCC, and the ground terminal is grounded. An LM393 comparator module, including a triangular wave signal input terminal, an external voltage input terminal, and a PWM signal output terminal. The triangular wave signal input terminal is connected to the triangular wave signal output terminal of the relaxation oscillator module, and is used to compare the triangular wave signal with the input voltage to generate a PWM signal. Among them, the PWM signal output terminal of the LM393 comparator module is the output terminal of the PWM generator. A pull-up circuit module, one end of which is connected to the power supply VCC, and the other end is connected to the PWM signal output terminal of the LM393 comparator module, for adjusting the output signal level.
2. The PWM generator using LM393 and discrete components according to claim 1, wherein The relaxation oscillator module includes: A first resistor R1, a second resistor R2, a third resistor R3, a fourth resistor R4, a fifth resistor R5, a sixth resistor R6, a first capacitor C1, a first diode D1, and a first comparator U1A. One end of the first resistor R1 is used as the power input terminal of the relaxation oscillator module and is connected to the power supply VCC, and the other end of the first resistor R1 is connected to one end of the second resistor R2. The other end of the second resistor R2 is connected to the positive input terminal of the first comparator U1A. The negative input terminal of the first comparator U1A is connected to one end of the first capacitor C1. The other end of the first capacitor C1 is connected to one end of the third resistor R3, and the other end of the third resistor R3 is used as the ground terminal of the relaxation oscillator module and is grounded. One end of the fourth resistor R4 is connected to the power supply VCC, and the other end of the fourth resistor R4 is connected to the output terminal of the first comparator U1A. One end of the fifth resistor R5 is connected to the output terminal of the first comparator U1A, and the other end of the fifth resistor R5 is connected to the connection point of the second resistor R2 and the positive input terminal of the first comparator U1A. One end of the sixth resistor R6 is connected to the connection point of the first capacitor C1 and the third resistor R3, and the other end of the sixth resistor R6 is connected to the anode of the first diode D1. The cathode of the first diode D1 is grounded. The output terminal of the first comparator U1A is used as the triangular wave signal output terminal of the relaxation oscillator module.
3. A PWM generator using LM393 and discrete components according to claim 2, characterized in that, The LM393 comparator module includes: A first comparator U1A and a second comparator U1B. The output terminal of the first comparator U1A is connected to the positive input terminal of the second comparator U1B, and this connection point is used as the triangular wave signal input terminal of the LM393 comparator module. The negative input terminal of the second comparator U1B is used as the external voltage input terminal and is connected to the external input voltage. The output terminal of the second comparator U1B is used as the PWM signal output terminal of the LM393 comparator module.
4. A PWM generator using an LM393 and discrete components according to claim 3, wherein, The pull-up circuit module includes: A seventh resistor R7, an eighth resistor R8, and a second capacitor C2. One end of the seventh resistor R7 is used as the connection end of the pull-up circuit module to the power supply VCC and is connected to the power supply VCC, and the other end of the seventh resistor R7 is connected to the output terminal of the second comparator U1B; one end of the eighth resistor R8 is connected to the output terminal of the second comparator U1B, and the other end of the eighth resistor R8 is connected to one end of the second capacitor C2; the other end of the second capacitor C2 is grounded.
5. A PWM generator using an LM393 and discrete components according to claim 4, characterized in that, The resistance values of the first resistor R1, the second resistor R2, the third resistor R3, the fourth resistor R4, the fifth resistor R5, the sixth resistor R6, the seventh resistor R7, and the eighth resistor R8 are 47 KΩ, 47 KΩ, 47 KΩ, 2.2 KΩ, 47 KΩ, 470 Ω, 2.2 KΩ, and 47 KΩ respectively; The capacitance values of the first capacitor C1 and the second capacitor C2 are 470 pF and 470 pF respectively.
6. A PWM generator using an LM393 and discrete components according to claim 5, characterized in that, The voltage range of the power supply VCC is 3.3V - 18V.
7. A PWM generator using an LM393 and discrete components according to claim 6, characterized in that, The range of the external input voltage is 1 / 3VCC - 2 / 3VCC.
8. A PWM generator using LM393 and discrete components according to claim 7, characterized in that, The duty cycle of the PWM signal changes with the change of the external input voltage.
9. A PWM generator using LM393 and discrete components according to claim 8, characterized in that, The output frequency of the PWM wave is determined by the third resistor R3 and the first capacitor C1, and the output frequency does not exceed 100 KHz.
10. A PWM generator using an LM393 and discrete components according to claim 9, characterized in that, By changing the supply voltage level of the connection terminal to the power supply VCC in the pull-up circuit module of the seventh resistor R7, the output signal level and the supply voltage are made different.