Linear LED driver with MOSFET - Page 1
Forum section: electronics / projects

author: Benik3
author_rank: Contributor
timestamp: September 02, 2018, 06:09:27 pm
content: Hello there.I would like to try to make linear LED driver just with a MOSFET. So in theory it's like electronic load (digitally controlled resistance).What I searched, the electronic load is simply MOSFET driven by DAC (I will use MCU for control) through OP Amp acting as feedback for holding current.Simply like this load:https://www.eevblog.com/forum/projects/smart-electronic-load/and the picture in attachment.But how should I choose the right MOSFET?The driver should be able to drive 20mA-3A with turbo option (MOSFET fully open) where the current can go up to 7A. Input voltage 3-4,2V (single li-ion), load 1x LED (2,8-3,3 Vf).Of course I must choose MOSFET to handle the current, but what about e.g. Vgs threshold voltage? Is better to have lower or higher voltage or it doesn't care for driving?Like this MOSFET has Vgs(th) 0,7Vhttp://www.aosmd.com/pdfs/datasheet/AON7520.pdfAnd this has Vgs(th) 1,75V so the Rds curve is more in higher voltageshttps://assets.nexperia.com/documents/data-sheet/PSMN1R0-30YLD.pdfThank you

author: Benta
author_rank: Super Contributor
timestamp: September 02, 2018, 06:25:51 pm
content: At only 5 V supply, your MOSFET threshold voltage should be a low as possible.I fail to see the purpose of C22. It's a DC application, so why would you want to build an integrator?

author: Benik3
author_rank: Contributor
timestamp: September 02, 2018, 07:00:42 pm
content: Yeah, i also didn't get the capacitor. It should be just negative feedback right?Isn't it like slow startup?As I wrote, this is just screen from the electronic load mentioned in the link.This is better image:

author: langwadt
author_rank: Super Contributor
timestamp: September 02, 2018, 07:06:47 pm
content: Quote from: Benta on September 02, 2018, 06:25:51 pmwithout the extra feedback loop the opamp is very likely going to oscillate

author: Zero999
author_rank: Super Contributor
timestamp: September 02, 2018, 07:10:32 pm
content: Quote from: langwadt on September 02, 2018, 07:06:47 pmYes, the MOSFET's gate capacitance will add an extra phase shift, causing oscillation.

author: David Hess
author_rank: Super Contributor
timestamp: September 02, 2018, 07:42:16 pm
content: Quote from: Benta on September 02, 2018, 06:25:51 pmLike the others said, C22 is needed for frequency compensation of the control loop. The power MOSFET represents a considerable capacitive load to the operational amplifier which can reduce the phase margin enough to cause oscillation. Other solutions include using a slower operational amplifier or one that supports overcompensation. The AD8630 shown is particularly bad about this because it is relatively fast and has poor capacitive load driving capability.As far as the original question, with only a 5 volt supply, a low threshold voltage MOSFET will be required to get full enhancement and the sense voltage across R26 makes this worse. A normal MOSFET might still work since full enhancement is not required but it should be qualified for proper operation.

author: Wolfgang
author_rank: Super Contributor
timestamp: September 02, 2018, 08:14:43 pm
content: Some comments about your circuit:- You would not need a symmetric supply voltage if you change your LM741 for a LM358. This one can sense down to ground.- It is not smart to drive a MOSFET gate without a gate resistor (e.g., 220Ohms). This isolates the huge gate capacitance from the OpAmp output.- The voltage from your current measurement resistor should have a 10K (e..g) resistor to the OpAmp inverting input- Your forgot to frequency compensate your ccontrol loop. You need a few 100pF cap directly from OpAmp output to the inverting input, then oscillations will stop.- Another 1K resistor from OpAmp output to ground speeds up the control loop as well, but this is not absolutely necessary.

author: Benta
author_rank: Super Contributor
timestamp: September 02, 2018, 10:11:34 pm
content: If the amplifier really needs to be as heavily compensated as this circuit suggests, select a different one. Jeez, 1 nF and 1 kohm?

author: Benik3
author_rank: Contributor
timestamp: September 03, 2018, 05:58:52 am
content: Thanks for the tips!So slower OPamp would be better choise? Something around few ms settle time or it's too high?BTW why also no one use direct control from DAC with back feedback through MCU? Is it too slow so it will oscilate?

author: Zero999
author_rank: Super Contributor
timestamp: September 03, 2018, 07:55:05 am
content: Quote from: Benik3 on September 03, 2018, 05:58:52 amYes, slower is better.No one uses the MCU as a controller, because if it crashes or there's a bug in the code, the LED will fry.

author: Benik3
author_rank: Contributor
timestamp: September 03, 2018, 08:15:48 am
content: OK, so it's just protection feature

author: Benik3
author_rank: Contributor
timestamp: September 03, 2018, 06:46:58 pm
content: Ok, so is this workable?I tried to choose components, but I'm not 100% sure...

author: Wolfgang
author_rank: Super Contributor
timestamp: September 03, 2018, 06:49:52 pm
content: Almost. In order for the ccompensation to work, you need a resistor (say, 10K) before the inverting input of your OpAmp. The compensation cap directly goes from OpAmp output to the inverting OpAmp input. If you omit this, it will not work as a frequency compensation.

author: Benik3
author_rank: Contributor
timestamp: September 03, 2018, 07:08:37 pm
content: Yeah, thanks, I forgot him

author: Wolfgang
author_rank: Super Contributor
timestamp: September 03, 2018, 07:11:34 pm
content: Still wrong. The compensation cap goes DIRECTLY from OpAmp output to OpAmp inverting input. The resistor I meant goes from OpAmp inverted input to the output of the MAX.. current sensor IC.

author: Benik3
author_rank: Contributor
timestamp: September 03, 2018, 07:17:40 pm
content: Aha, OK

author: Wolfgang
author_rank: Super Contributor
timestamp: September 03, 2018, 07:45:17 pm
content: YES !!!

author: Benik3
author_rank: Contributor
timestamp: September 03, 2018, 08:49:47 pm
content: Thank you!Another lesson learnedAnd now, if I want to make "turbo" mode - open fully MOSFET, what is a good way?I assume that put voltage into output of OPAmp (from MCU) to open the gate is not the right way.I thought about bypassing R1 (with transistor) and setting DAC to max, so the OPamp will be also fully saturated (as it will try to reach 10A).

author: Wolfgang
author_rank: Super Contributor
timestamp: September 03, 2018, 08:56:23 pm
content: You really want an uncontrolled, unlimited current thru your LEDs ?? They could blow out in a split second !

author: Benik3
author_rank: Contributor
timestamp: September 03, 2018, 09:03:18 pm
content: Yes, I really want!The LEDs are pretty thought, but you must have them on direct copper PCBYou can look e.g. here, the XP-L has max current 3A by datasheet

author: Wolfgang
author_rank: Super Contributor
timestamp: September 03, 2018, 09:10:40 pm
content: Well then, what you need then is not a driver OpAmp for the MOSFET, but just about 10V of gate voltage. The source resistor should be removed, too.The MOSFET will then go into full conduction, exhibiting only its small Rdson resistance. Select a type that can easily digest your maximum current (add a safetey margin of ca. 2).Current limiting must then be done in your power supply (or your shack will start smelling strange soon ...).

author: Benik3
author_rank: Contributor
timestamp: September 04, 2018, 03:24:32 pm
content: Yeah, that would be bestBTW I have one more question.If I have MCU with ADC and max input voltage on pin 5,5V, but I use Vref external let's say 1V, is problem if I put higher voltage between 1-5,5V on the pin (I mean if it can damage the MCU, of course that the value of ADC would be at maximum)