LED Dimming (the difference between analog dimming and PWM dimming)
LED is a solid-state electric light source and a semiconductor lighting device, and its electrical characteristics are highly discrete. It has the characteristics of small size, high mechanical strength, low power consumption, long life, easy adjustment and control and no pollution, etc. It is a new type of light source product with great development prospects. There are two types of LED dimming methods: analog dimming and digital dimming, in which analog dimming is achieved by changing the current in the LED loop; digital dimming, also known as PWM dimming, is turned on and off by PWM waves LED to change the conduction time of forward current to achieve the effect of brightness adjustment. The analog dimming adjusts the brightness of the LED by changing the current in the LED loop. The disadvantage is that the adjustable gear is limited within the adjustable current range; PWM wave dimming can be arbitrarily changed by changing the duty cycle of the high and low levels. The turn-on time of the LEDs increases the number of levels for brightness adjustment. This article intends to use two methods to work together to achieve the effect of adjusting the LED brightness.
1 LED dimming method
Analog dimming is to achieve dimming by changing the current in the LED loop, the power supply voltage remains unchanged, and the current in the loop is changed by changing the resistance value of R, so as to achieve the effect of changing the brightness of the LED. Many other analog dimming are extensions of this method. The advantage is that the current can be continuous, but the range of adjustable current is often limited by hardware, and there are not many adjustment gears. For high-precision lighting equipment that requires sensitivity to brightness sensitivity, This method is not ideal.
Digital dimming, also known as PWM dimming, turns on and off LEDs through PWM waves to change the on-time of forward current to achieve the effect of brightness adjustment. This method is based on the fact that the human eye is not sensitive enough to brightness flicker, so that the load LED is bright and dim at times. If the frequency of bright and dark is more than 100 Hz, the human eye sees the average brightness, not the LED flickering. PWM adjusts the brightness by adjusting the proportion of bright and dark time. In a PWM cycle, because the human eye flickers for light greater than 100 Hz, the perceived brightness is a cumulative process, that is, the bright time occupies the entire cycle. The larger the ratio, the brighter the human eye feels. But for some high-frequency sampling devices, such as high-frequency sampling cameras, it is possible to capture the image when the LED is dark during sampling. Therefore, this paper combines analog and digital to design the driving circuit of LED.
2. PWM regulation method using inductance
2.1 Drive circuit
In the circuit, when there is current flowing through the inductor, the inductor will generate a magnetic field, that is, part of the current is converted into magnetic energy and "stored" in the inductor; when the current is no longer applied to the inductor, the inductor will pass the magnetic energy through the current. released from the circuit. This is also the reason why the current on the inductor cannot change abruptly. Based on this "charge and discharge" principle of the inductor, it can be used to average the discontinuous current generated in the PWM wave dimming. Equations (1) and (2) are the charging and discharging process of the LR circuit and the relationship between current and time, respectively.
Among them, If is the final stable current, I0 is the initial discharge current, τ (τ=L/R, L is the inductance value, R is the loop resistance) is the time constant of the LR circuit.
Figure 1 shows the drive circuit, the selection of the inductance value and the frequency selection of the PWM wave are very important in this drive circuit. The C8051330 chip is selected as the output of the PWM wave, and the timer is used to control the time of the high and low levels, so as to control the duty cycle of the PWM wave.
Figure 1 Drive circuit
It is necessary to ensure that the PWM period is less than the τ time of the inductor, because if the PWM period is greater than τ, it is very likely that when the duty cycle of the PWM changes, the current in the circuit can reach the saturated DC current of the inductor, which affects the LED. current regulation. When the clock frequency of C8051330 is 25 MHz, the selection of the PWM period has a great influence on the current changing gear. If the period is larger, the PWM duty cycle has more gears, and vice versa. It is planned to use a duty ratio of 256 gears, so the frequency of the PWM wave should be selected below 100kHz, that is, the period should be above 10 μs, and the DC inductance should be 10Ω. At this time, the inductance value should be selected to be greater than 0.1 mH. Figure 2 is the PWM frequency. Simulation results of circuit current values at 100kHz, 90% duty cycle, and inductance of 0.1 mH, 1 mH and 40 mH.
(a) Current versus time when the inductance value is 0.1mH
b) Current versus time when the inductance value is 1mH
(c) Current versus time when the inductance value is 40mH
(d) Partial enlarged view of curve c
Figure 2 Variation of current with time under different inductance values.
A 40 mH inductor can be preliminarily selected as the driving circuit through the simulation. Figure 3 is the voltage waveform obtained by the oscilloscope. This voltage is the voltage on a 20 Ω resistor connected in series in the circuit. After stabilization, the voltage is 340 mV, that is, The current in the circuit is 17 mA. Because of the current loss in the actual circuit, the actual current value is smaller than the simulated current value, but the change trend of the entire current is basically the same as the simulation.
Figure 3 Voltage variation of series resistance in a circuit with an inductance value of 40mH
2.2 The relationship between current and PWM duty cycle
Figure 4 shows the charging and discharging curves of the LED drive circuit, Imax is the maximum current of the circuit under DC conditions. It is assumed that when the PWM duty cycle is m, the current value in the circuit fluctuates around the current value at time t1 on the charging curve. At this time, the following conditions should be met: the slope of the charging curve at point t is k1, and the slope of the discharge curve at point a is k2, there should be k1mT=|k2 |(1-m)T, so the current in the drive circuit is maintained at a constant value and fluctuates slightly.
Analysis shows that after starting the driving circuit, the current reaches a relatively stable value after several charging and discharging cycles, and then the current fluctuates around this stable value. As shown in Figure 5, for each cycle, the slope of the current curve decreases continuously during charging; the absolute value of the slope of the current curve continues to increase during discharge; when the conditions in Figure 4 are met, the current is relatively stable. Therefore, when the time constant τ of the LR circuit is constant, the relationship between the inductor current and the PWM duty cycle is:
where m is the PWM duty cycle.
Figure 5 is the experimental result curve of the inductor current changing with the PWM duty cycle. The curve is measured when a 22 Ω resistor is connected in series in the circuit when the inductance value is 40 mH. Analyzing the theoretical formula and experimental results, it can be found that the current value on the inductor changes linearly with the PWM duty cycle when the PWM duty cycle is 36% to 86%, and the change trend is consistent with the theoretical derivation.
For the high duty cycle interval, since the slope of the charging curve has approached the same, the current value also tends to the maximum value at this time, while in the low interval, due to the short charging time, the loss in the circuit is large, and the current on the inductor The value also approaches zero.
2.3 PWM duty cycle adjustment method
Use the computer to control the change of the PWM duty cycle online through RS-485, select from 256 gears according to the needs, and use the computer to send two-byte hexadecimal commands to the RS-485 each time, thereby changing the C8051 to generate The duty cycle can achieve the purpose of changing the LED brightness.
The main functions of the RS-485 interface circuit are: Convert the transmission signal TX from the microprocessor into the differential signal in the communication network through the "transmitter", and also convert the differential signal in the communication network into the received signal through the "receiver". RX signal received by the microprocessor. At any one time, the RS-485 transceiver can only work in one of the "receive" or "transmit" modes. Therefore, the circuit shown in Figure 6 is adopted, and the R/D signal output by the microprocessor directly controls the transmitter/receiver enable of the SN75LBC184 chip: if the R/D signal is "1", the transmitter of the SN75LBC184 chip is valid, The receiver is disabled, at this time the microprocessor can send data bytes to the SN75LBC184 bus; if the R/D signal is "0", the transmitter of the SN75LBC184 chip is disabled, the receiver is valid, at this time the microprocessor can process the data from the RS-485 bus data bytes. In this circuit, only one of the "receiver" and "transmitter" in the SN75LBC184 chip can be in a working state at any time.
Whether from a simulation or an experimental point of view, adding an inductor to a PWM dimming drive circuit can successfully "average" the widely varying current in the circuit and stabilize it around a value that can be calculated theoretically. This paper combines the common advantages of analog dimming and digital dimming, and can use RS-485 to change the duty cycle of the PWM wave through the functional relationship between the PWM wave and the current on the LED in the drive circuit, so that the LED has an ideal LED. current value, and use the computer to change the brightness of the LED in real time and in detail.
Contact:
Phone: +86-13510672827
E-mail: contact@vtecklite.com
Add: 6FL, Chuangcheng Mansion,Taiwan Industrial Estate,Shiyan Shenzhen China