0
\$\begingroup\$

I have a task to design a driver to drive 3W power LED. I have only 4 wires to dim 7 LEDs individually, so I decided to use WS2811 "magic" driver for PWM. The rest of the circuit is to provide constant current for the LED.

enter image description here

U1A, U1B create loop to control current through the LED. D1 (zener) and RV1 (trimmer) allow to set maximum current. Q2 shorts this set voltage to ground with frequency of 2Khz and variable PWM, to control LED brightness. So - I'm not changing current throught the LED - I turn it on (maximum set) and off to set the brightness. I know this is not simplest way to do it, but I've got boards for it for free.

What is the problem?

At lower duty cycles it works ideally. Probe is connected between Q1 drain and ground, 12V is stable. Set current is about 310mA, and when Q1 conducts it has 400mV voltage drop, so it's limiting the current well.

enter image description here

However, at higher duty cycle circuit "has time to think" and it starts to oscillate.

enter image description here

It has always higher voltage drop, so no damage to LEDs, it works well, but I would love to have it working 100% correct. And one more thing: using a resistor as a load instead of diode also makes it completly stable.

How to make it more stable, keeping ability to dim with 2kHz?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

It took some time to get it working, but in the end I'm kindof proud of it. It regulates nicely, no oscillations nor overshoots. Maybe somebody wants to replicate, I'm providing working schematic and simulation file from ltspice. Main issue was feedback compensation and transistor drive.

What it does?

Circut allows from dimming led using pwm (for example from WS2811 chip) keeping maximum current at set level. double op-amp LM358 ensures current regulation (current is sensed od 1 Ohm reistor) and compared with reference voltage (created by zener and adjusted by potensiometer). MOSFET transistor is driven in the way to keep current stable. Shorting reference voltage (high impedance) to ground by small Q2 mosfet allows for decreasing current to 0, so pwm regulation is achieved.

Version 4
SHEET 1 880 680
WIRE 336 -416 208 -416
WIRE 208 -400 208 -416
WIRE 336 -48 336 -416
WIRE 352 -48 336 -48
WIRE 352 -32 352 -48
WIRE -112 -16 -128 -16
WIRE -16 -16 -32 -16
WIRE -128 48 -128 -16
WIRE -112 48 -128 48
WIRE -16 48 -16 -16
WIRE -16 48 -48 48
WIRE 208 80 208 48
WIRE -224 144 -240 144
WIRE -128 144 -128 48
WIRE -128 144 -144 144
WIRE -112 144 -128 144
WIRE -16 160 -16 48
WIRE -16 160 -48 160
WIRE 0 160 -16 160
WIRE 160 160 80 160
WIRE -112 176 -304 176
WIRE 208 256 208 176
WIRE 208 256 64 256
WIRE -240 272 -240 144
WIRE -32 272 -240 272
WIRE 0 272 -32 272
WIRE 208 272 208 256
WIRE 96 288 64 288
WIRE -304 320 -304 176
WIRE -304 320 -320 320
WIRE -208 320 -224 320
WIRE -208 336 -208 320
WIRE -512 368 -624 368
WIRE -384 368 -432 368
WIRE -368 368 -384 368
WIRE -624 384 -624 368
WIRE -32 384 -32 272
WIRE -16 384 -32 384
WIRE 96 384 96 288
WIRE 96 384 64 384
WIRE 208 384 208 352
WIRE 96 400 96 384
WIRE -208 416 -320 416
WIRE -208 432 -208 416
WIRE -32 432 -32 384
WIRE 96 432 96 400
WIRE 96 432 32 432
WIRE -624 480 -624 464
WIRE 96 496 96 480
FLAG 208 384 0
FLAG -80 128 12V
FLAG 32 304 12V
FLAG 32 240 0
FLAG -80 192 0
FLAG 96 496 0
FLAG 352 48 0
FLAG -608 48 0
FLAG -608 -32 12V
FLAG -208 432 0
FLAG -624 480 0
SYMBOL nmos 160 80 R0
SYMATTR InstName M1
SYMATTR Value BSB015N04NX3
SYMBOL res 192 256 R0
SYMATTR InstName R1
SYMATTR Value 1
SYMBOL lib\\sym\\ZZZ\\OpAmp\\LM358_AB -80 96 R0
SYMATTR InstName U1
SYMBOL lib\\sym\\ZZZ\\OpAmp\\LM358_AB 32 336 R180
SYMATTR InstName U2
SYMBOL res -128 128 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL res 80 368 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R3
SYMATTR Value 10k
SYMBOL res 112 496 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R4
SYMATTR Value 2k2
SYMBOL res 96 144 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R5
SYMATTR Value 10
SYMBOL voltage 352 -48 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 15
SYMBOL voltage -608 -48 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value 12
SYMBOL voltage -208 320 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V3
SYMATTR Value 2
SYMBOL cap -48 32 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C1
SYMATTR Value 100n
SYMBOL res -208 304 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R7
SYMATTR Value 1k
SYMBOL Misc\\signal -624 368 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V4
SYMATTR Value SINE(0 1 2000)
SYMBOL res -416 352 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R8
SYMATTR Value 100
SYMBOL res -16 -32 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R9
SYMATTR Value 220k
SYMBOL npn -384 320 R0
SYMATTR InstName Q1
SYMBOL cap 32 416 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C2
SYMATTR Value 1n
SYMBOL diode 224 48 R180
WINDOW 0 24 64 Left 2
WINDOW 3 24 0 Left 2
SYMATTR InstName D1
SYMATTR Value BZX84C6V2L
SYMBOL diode 192 -80 R0
SYMATTR InstName D2
SYMATTR Value 1N4148
SYMBOL diode 192 -144 R0
SYMATTR InstName D3
SYMATTR Value 1N4148
SYMBOL diode 192 -208 R0
SYMATTR InstName D4
SYMATTR Value 1N4148
SYMBOL diode 192 -272 R0
SYMATTR InstName D5
SYMATTR Value 1N4148
SYMBOL diode 192 -336 R0
SYMATTR InstName D6
SYMATTR Value 1N4148
SYMBOL diode 192 -400 R0
SYMATTR InstName D7
SYMATTR Value 1N4148
TEXT -400 520 Left 2 !.tran 0.01 uic

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.