Dimming control device and method for improving pwm signalTechnical Field
The invention relates to the technical field of power electronics, in particular to a dimming control device and method for improving pwm signals.
Background
The existing control signal of the LED driving circuit mainly controls a 'DIM' pin of LED driving through a pwm (pulse width modulation) dimming signal, so that the brightness adjustment of LED lamp beads is realized, and the related technical principle is as follows:
the TIM timer of MCU- & gt pwm dimming signal- & gt LED driving control signal pin- & gt control LED lamp bead brightness, and the general dimming control system comprises an MCU module, an LED driving circuit module and an LED lamp bead module.
Along with the increasingly improved optical effect requirements of stage lighting on lamp products, the dimming smoothness of the lamp in the high-end stage lighting market reaches the degree of almost 'rigor', and the lamp is required to be free from flickering under any fine condition in the dimming process of a darkroom. In the prior art, an improved MCU module is adopted for realizing more precise pwm output and reducing lamplight flickering, the MCU module takes a 72MHz mainstream STM32F103RBT6 singlechip as an example (hereinafter referred to as STM 32), the minimum output pulse is 13.9ns, but the 13.9ns minimum pulse can be output on the basis of specific dimming frequency as determined by the design principle of a TIM timer, and the dimming frequency refers to pwm dimming signal frequency, and the current common pwm dimming signal frequency mainly comprises 600Hz, 1200Hz, 2000Hz, 3600Hz, 4000Hz, 6000Hz, 12000Hz, 25000Hz and the like. In general, the lower the dimming frequency is, the smoother the dimming effect is (because under the condition of low dimming frequency application, the more the single pwm dimming signal period is adjustable, namely the more the single dimming period steps=72 MHz/dimming frequency is, the more the steps in the single period are, the more the dimming is smooth), for example, 600Hz dimming frequency is adopted, the single period adjustable steps=72 MHz/dimming frequency=72 MHz/600 hz=120000 steps >65535 steps, therefore, 16bit dimming signals can be output by STM32 at this time, the dimming effect is very smooth, but under the condition of 600Hz dimming frequency, the high-speed camera for stage can shoot obvious stripes of lamplight, the high-speed camera is required to not shoot lamplight stripes, at least the dimming frequency of the lamplight is required to be ensured to be more than 4000Hz, and 25000Hz dimming frequency is required for many application scenes; if the STM32 is used for outputting 2880 steps only in a single dimming period under 25000Hz dimming frequency, for a high-power LED lamp, a single-step dimming signal of 2880 steps can cause a large dimming variation amplitude of the brightness of the lamp, so that a dimming effect is obviously dithered, and the visual performance of human eyes is poor.
For ultrahigh dimming frequency (25000 Hz), an imported MCU with high cost is used as a dimming chip at present, and the purposes of increasing single period adjustment steps and improving dimming effect can be achieved only by matching with complex program control, so that the stage lighting cost is high, and the program is complex and easy to make mistakes.
Disclosure of Invention
The invention aims to solve one of the technical problems, and provides a dimming control device and a dimming control method for improving a pwm signal, which can adjust the duty ratio of a first initial pwm signal in a large range, have a simple control circuit, do not need an expensive dimming chip to output the pwm dimming signal, and have the advantages of low cost and high efficiency.
In order to solve the technical problems, the invention provides the following technical scheme: the dimming control device for improving the pwm signal comprises a first timer, a second timer, a first NAND gate circuit and a first NOT gate circuit, wherein the first timer and the second timer are both connected with the first NAND gate circuit, and the first NAND gate circuit is connected with the first NOT gate circuit;
the first timer is used for outputting a first initial pwm signal, and the second timer is used for outputting a second initial pwm signal;
the first NAND gate circuit is used for receiving a first initial pwm signal and a second initial pwm signal, performing NAND operation, and outputting a first pwm adjustment signal;
the first NOT circuit is used for receiving the first pwm signal and outputting a second pwm signal after performing non-operation.
Further, the dimming control device further comprises a second NAND gate circuit and a second NAND gate circuit, wherein the first timer and the second timer are both connected with the second NAND gate circuit, and the second NAND gate circuit;
the second NAND gate circuit is used for receiving the first initial pwm signal and the second initial pwm signal, performing NAND operation, and outputting a first pwm adjustment signal;
the second NOT circuit is used for receiving the first pwm signal and outputting a second pwm signal after performing a NOT operation.
Another object of the present invention is to provide a dimming control method for improving pwm signal, which is operated on the dimming control device, and includes the following steps:
s1, a first timer generates and outputs a first initial pwm signal, and a second timer generates and outputs a second initial pwm signal;
s2, a first NAND gate circuit receives a first initial pwm signal and a second initial pwm signal, performs NAND operation, and outputs a first pwm adjustment signal;
s3, the first NOT circuit receives the first pwm signal and outputs a second pwm signal after performing non-operation.
Further, the step S2 further includes: the second NAND gate circuit receives the first initial pwm signal and the second initial pwm signal, performs NAND operation, and outputs a first pwm adjustment signal;
the step S3 further includes: the second NOT circuit receives the first pwm signal and performs a NOT operation, and then outputs a second pwm signal.
Further, the first initial pwm signal frequency is 25000Hz, and the second initial pwm signal frequency is 2KHz.
After the technical scheme is adopted, the invention has at least the following beneficial effects: on the basis of using a common STM32 singlechip, the invention can change the second adjustment pwm signal by adjusting the duty ratio of the first initial pwm signal or the second initial pwm signal, for example, the frequency of the first initial pwm signal is 25000Hz, the frequency of the second initial pwm signal is 2KHz, and the adjustable step number of the second adjustment pwm signal is: (72 MHz/25000)/(72 MHz/2000) =2880×36000= 103680000 steps, so that the adjustable range of the second pwm signal can be increased under the application condition of adjusting 25000Hz dimming frequency in a large range, 16Bit dimming in the true sense is realized, a control circuit is simple, an expensive dimming chip is not required to output 25000Hz pwm dimming signals, and the method has the advantages of low cost and high efficiency; the invention also aims at the situation that the high-power LED lamp is easy to produce high-frequency resonance along with different frequencies and different currents when the magnetic elements such as the inductor and the like work in the dimming change process, so that the harshness high-frequency noise is generated.
Drawings
Fig. 1 is a schematic structural diagram of a dimming control device according to the present invention.
FIG. 2 is a flowchart showing steps of a dimming control method for improving pwm signal according to the present invention.
FIG. 3 is a diagram showing the variation of the first initial pwm signal, the second initial pwm signal, the first adjusted pwm signal, and the second adjusted pwm signal according to the present invention.
Detailed Description
It should be noted that, without conflict, the embodiments and features of the embodiments in the present application may be combined with each other, and the present application will be further described in detail with reference to the drawings and the specific embodiments.
As shown in fig. 1, the present embodiment discloses a dimming control device for improving pwm signal, which includes a first timer 1, a second timer 2, a first nand gate 3, a second nand gate 4, a first nor gate 5 and a second nor gate 6; the first timer 1 is connected with the first NAND gate circuit 3 and the second NAND gate circuit 4, and the second timer 2 is connected with the first NAND gate circuit 3 and the second NAND gate circuit 4; the first NAND gate 3 is connected with a first NAND gate 5, and the second NAND gate 4 is connected with a second NAND gate 6. The STM32 singlechip provides a first timer 1 and a second timer 2.
The dimming control device is mainly divided into two circuits, including a first signal circuit and a second signal circuit, the first signal circuit includes a first timer 1, a second timer 2, a first nand gate 3 and a first not gate 5, the second signal circuit includes a first timer 1, a second timer 2, a second nand gate 4 and a second not gate 6, the first signal circuit and the second signal circuit are both pwm signals which are initially input or pwm signals which are finally output, and the pwm signals of the first signal circuit and the pwm signals of the second signal circuit are identical, so the dimming control device is set into two identical signal circuits, mainly for doubly improving the driving signal capability of the whole circuit.
The first timer 1 is used for outputting a first initial pwm signal, and the second timer 2 is used for outputting a second initial pwm signal.
The first nand gate 3 is configured to receive the first initial pwm signal and the second initial pwm signal, perform a nand operation, and output a first pwm adjustment signal; the second nand gate 4 is configured to receive the first initial pwm signal and the second initial pwm signal, perform a nand operation, and output a first pwm adjustment signal.
The first NOT circuit 5 is used for receiving the first pwm signal and outputting a second pwm signal after performing non-operation; the second not circuit 6 is configured to receive the first pwm signal and perform a non-operation, and output a second pwm signal.
As shown in fig. 2, the present embodiment further discloses a dimming control method for improving pwm signal, which is operated in the dimming control device, and includes the following steps:
s1, a first timer 1 generates and outputs a first initial pwm signal, and a second timer 2 generates and outputs a second initial pwm signal;
s2, a first NAND gate circuit 3 receives a first initial pwm signal and a second initial pwm signal, performs NAND operation, and outputs a first pwm adjustment signal;
the second NAND gate circuit 4 receives the first initial pwm signal and the second initial pwm signal, performs NAND operation, and outputs a first pwm adjustment signal;
s3, the first NOT circuit 5 receives the first pwm signal and outputs a second pwm signal after performing non-operation;
the second not circuit 6 receives the first pwm signal and performs a non-operation to output a second pwm signal.
As shown in fig. 3, the present embodiment specifically illustrates a dimming control method for improving pwm signal by using specific pwm signal, which includes the following steps:
s11, a first timer 1 generates and outputs a first initial pwm signal, and a second timer 2 generates and outputs a second initial pwm signal; specifically, the first initial pwm signal frequency is 25000Hz, and the second initial pwm signal frequency is 2KHz;
s12, a first NAND gate circuit 3 receives a first initial pwm signal with the frequency of 25000Hz and a second initial pwm signal with the frequency of 2KHz, performs NAND operation, and outputs a first pwm adjustment signal;
the second nand gate circuit 4 is configured to receive the first initial pwm signal and the second initial pwm signal, perform a nand operation, and output a first pwm adjustment signal;
s13, the first NOT circuit 5 receives the first pwm signal and outputs a second pwm signal after performing non-operation;
the second not circuit 6 is configured to receive the first pwm signal and perform a non-operation, and output a second pwm signal.
In a specific operation, the pulse waveform diagram of the second initial pwm signal in fig. 3 can freely and widely adjust the pulse width (or duty cycle) of the second initial pwm signal, and by adjusting the pulse width of the second initial pwm signal or the pulse width of the first initial pwm signal, the first initial pwm signal and the second initial pwm signal perform a nand operation, so that the first adjusted pwm signals with a plurality of different pulse widths can be output.
In this embodiment, although the first timer 1 of the STM32 single-chip microcomputer outputs the first initial pwm signal of 25000Hz, and cannot adjust the duty cycle in a large range, the first adjustment pwm signal can be jointly output in combination with the second initial pwm signal, and the range of the duty cycle that can be adjusted by the output first adjustment pwm signal is very wide.
According to the embodiment, on the basis of using a common STM32 singlechip, the duty ratio of a 25000Hz first initial pwm signal can be adjusted in a large range, a control circuit is simple, an expensive dimming chip is not required to output the 25000Hz pwm dimming signal, and the method has the advantages of low cost and high efficiency.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.