Episode 1309 My friend wants me to design a circuit. 0-1A 0-100% PWM LED driver. Be a Patron: / imsaiguy
Пікірлер: 60
@leosbagoftricks37322 жыл бұрын
Your 1 Khz triangle won't triangle. It's lacking positive feedback and hysteresis.
@IMSAIGuy2 жыл бұрын
I changed it. this schematic was just thinking out loud
@plainedgedsaw16942 жыл бұрын
@@IMSAIGuylemme guess, threw a schmitt instead of op amp in there.
@absurdengineering2 жыл бұрын
A mosfet gate and its nice capacitance (hundreds or thousands of pF) on an op amp output needs at least an output-to-negative-input stabilizing capacitance. The gate series resistor needs to be sufficient since it provides isolation as well. A few tens of ohms is the ballpark. For better results with a capacitive load, the op-amp needs nonlinear feedback. A squarer in the feedback, although the exponent can be tweaked. Most feedback analysis is unfortunately done as linearizations, but reactances are nonlinear - their behavior depends on their state. Just as you’d use a Park transform to minimize error and improve response of a BLDC current controller, so you can use a monomial model in the feedback loop to linearize a reactance. Slow op amps (
@analoghardwaretops39762 жыл бұрын
Being a non critical application...The brightness/dimming is not being controlled ...so negative f.b. loops are unnecessary...but led effective voltage & current range & curve profile (min- max) scaled proptionatly w.r.t. that of its brightness should suffice for a reliable open loop circuit operation.
@bayareapianist2 жыл бұрын
You can use a couple schmitt triggere and a simple transistor to limit the current like a what it's done to limit current in power supplies. You are using open collector comparators. Then get rid of the MOSFET and 10k and connect the output of your oscillator directly to non-inverting input. One of the things I learned in college (good prof) was the difference between schmitt trigger and opamp. The op-amps besides not having the hysteresis, always ring in the low frequency because it has a gain issue. Schmidt trigger should not ring because it has a hysteresist and RS flip flop in it. You are like me an old fashion designer and don't like the simulators like spice to simulate your circuits :D Just thought about it again tonight. Your design requirement has a hole in it. It does not specify whether the current should 1A max or RMS. If you want to calculate the RMS current using a low pass filter, the output current limit will depend on the switching frequency. You can use one of the 100s pwm switching powers chips in the market. They have all you need in them. A software guy may tells you all you need is an Arduino controller and an h bridge!
@analoghardwaretops39762 жыл бұрын
The first pwm led control is just an ON- OFF ratio modulator...since there's no led voltage sense..vis-a-vis the min-max led operating voltage range...so only the peak brightness "duration time" is varied...so it cannot be called a brightness or dimming controller... Since even at very low duty cycles the peak brightness is always the same...this is the reason for the irritating glare and eye strain @ any pwm setting ... The second modulator..can and does always override the first when active ...but here too led current variable reference is not scaled to compare actual led cueernt min- max range..
@roboanalogtom2 жыл бұрын
For op amp PWM I use a singe op amp and a transistor. It's a common square wave generator with a voltage input to the positive op amp input through a resistor (usually the same value as the feedback resistor). It will be variable frequency in this configuration (like 500 Hz around 1 and 99%, 1 KHz at 50%) but that usually does not matter. I've ran motors, high power COB array LEDs and heating elements with this circuit. I'll often then use another op amp for P control (or PI, PID, etc) of the PWM op amp assuming I have an analog sensor like a thermistor. I've tightly temperature stabilized a wide variety of things with this.
@plainedgedsaw16942 жыл бұрын
A wee 2 transistor multivibrator is another thing that can do this job. Though it may not work reliably above 90% or below 10% DC.
@roboanalogtom2 жыл бұрын
@@plainedgedsaw1694 Yup! If you look at my videos I have a 2 transistor balancing robot. 2T multivibrator that uses a few photocells, extra capacitor for the derivative function, and a servo modified for continuous rotation. I've done the same balancing trick thing with the 555 timer.
@Enigma7582 жыл бұрын
@@roboanalogtom Hey, love your channel, I've been a long timer subscriber!😊
@byronwatkins25652 жыл бұрын
What resistance is between pin 7 and the gate? Combined with the gate capacitance, that forms a first-order pole. Try 30 pF in parallel to cancel the pole with a LF zero... across the resistor might work, but I would go straight to the inverting input.
@PhattyMo2 жыл бұрын
Hmm. Maybe put the LED between the two FET's? The upper one doing the PWM,and the lower one setting the maximum current. Maybe that's a terrible idea -it's late,I'm tired.
@rfburns56012 жыл бұрын
I presume you put the cap on pin 6 of the op amp instead of pin 5? That problem in audio amps is transient intermodulation (TIM) distortion - it occurs when the feed back loop has higher frequency response than the amp circuit. So did I guess right. You coulda told us; but then you'd have to kill us! Ha!
@GeorgeGraves2 жыл бұрын
Your use of a saw tooth wave and a compaitor is a classic. Do you know thise buildinging blocks - or look them up? And how do EE get so many tricks up thieri sleves ?
@Manf-ft6zk2 жыл бұрын
Besides the concept of linear control at higher currents there might be an option to control the max current with a module of the type: "LM2596 LED Driver DC-DC Step-down Adjustable CC/CV Power Supply Module". .. and to override the control input of the LM2596 with the signal of a 555 module that is controlled at input 5.
@byronwatkins25652 жыл бұрын
That triangle generator is not gonna work. First, you need to take the output across the capacitor so that approximately constant charging current gives constant slope, dV/dt = I/C. Next, you need some positive feedback to establish hysteresis and the triangle peaks. Given +12 V and ground, you need the center to be +6 V and I would arrange about 1 V hysteresis. Given 10 k, the average charging current will be 60 uA. For 1 kHz, dt = 0.5 ms and C = (60 uA)(0.5 ms)/1 V = 30 nF. You can tweak the parameters to obtain convenient component values. There is also no overwhelming need for the triangle to be symmetric to generate PWM and this can allow you to reduce the center (average) voltage some if the resulting range is inconvenient for the comparator... but this will complicate the math a bit.
@unregistereduser22 жыл бұрын
Agreed, the triangle generator won't work as is. Also, I'd use an opamp as the comparator too, so that I could just plop in an lm324 and make it a single-ic solution.
@andymouse2 жыл бұрын
So where did you find the best place for the Cap please ? so many ways to do this !...cheers.
@TheEmbeddedHobbyist2 жыл бұрын
cheeky eek 🙂
@andymouse2 жыл бұрын
@@TheEmbeddedHobbyist Squeaky eek !
@RideGasGas2 жыл бұрын
Kelvin hertz (KHz), should be kilo hertz (kHz) 😊
@TheEmbeddedHobbyist2 жыл бұрын
With feedback i always have problems with my poles and zeros, no matter how i place the poles the little zeros just keep falling off.
@MUHAMMADYAWARIFRAHEEM2 жыл бұрын
Using 555 is fun...
@ViniciusMiguel19882 жыл бұрын
you could replace the first two opamps with a 555
@Chris_Grossman2 жыл бұрын
The current source MOSFET has capacitance from the gate to source and gate to drain. The effective gate to source capacitance is small, since the mosfet acts as a voltage follower. The resistor in the gate along with the MOSFET capacitance introduces phase shift into the feedback loop that may make your current source unstable. I would try eliminating the gate resistor and drive the gate directly to reduce the loop phase shift.
@plainedgedsaw16942 жыл бұрын
It's pretty generic building block, many people built loads based on it, All report that it is a reliable oscillator, even with bjt.
@Chris_Grossman2 жыл бұрын
@@plainedgedsaw1694 I build them all the time with a BJT and have no stability issues so long as I am careful with GBW of the op-amp and the additional phase shift in the loop.
@RexxSchneider2 жыл бұрын
I'd do the opposite because the ringing is most likely an LCR resonance in the loop from opamp output through the mosfet gate-source and the return via ground. The clue for me would be noting that it's "layout dependant". If the opamp/mosfet combination really were acting as a voltage follower, then you'd have difficulty getting any oscillation with a gain of less than one.
@analoghardwaretops39762 жыл бұрын
All this is operating at a few 100's of Hz..not in GHz/MHz range...so effect of series r_g,& g-s cap. is not an issue...also there's no closed loop control..nor any need for one ..this is not a mission critical app.
@RexxSchneider2 жыл бұрын
@@analoghardwaretops3976 The PWM frequency is 1KHz - see 4:07 for the timebase. But PWM isn't a sine wave; it requires fast edges to prevent the mosfet from operating in its linear region and overheating. The ringing is at 150KHz - see 4:17 for the timebase - and the edge has a risetime of around 5μS. So we're not talking about a few hundreds of Hz; we're talking about hundreds of KHz. That's a pretty big difference. The IRF540 has a typical input capacitance around 1.7nF and that needs less than 700μH of inductance without any other parasitic capacitance to produce ringing at 150KHz. You'll find the parasitics are significant on any breadboarded prototype like this.
@mr1enrollment2 жыл бұрын
WHAT NO MICRO? LOL, fun to see how other people solve problems. There are so many approaches for solution. And yes I would resort to Spice first. Other engineers may disagree and that is fine. At the very least Spice removes the base level of stupidity like getting +/- reversed etc. But correct, it does not reveal issues of stray LCR or layout problems. cheers dan
@danharold30872 жыл бұрын
Just depends on your background and what's in your toolbox. It screams uC to me. I want that baby programmable.
@RexxSchneider2 жыл бұрын
The problem with Spice is that you're not modelling the stray capacitances and inductances in the actual prototype. Whenever you drive a mosfet gate from an opamp you should expect oscillations from the combination of LCR in the loop between the opamp output, the mosfet gate, its source and the return through ground. The simplest first thing to try is to increase the value of the gate drive resistor because the resonance of an LCR circuit will be damped by increasing R. You just have to be careful not to overdamp because it leaves the mosfet in its linear region longer during transition and that will heat it up. Only if that doesn't fix it should you turn to reducing the bandwidth of the opamp.
@mr1enrollment2 жыл бұрын
@@RexxSchneider and why is this comment directed at my comment?
@RexxSchneider2 жыл бұрын
@@mr1enrollment Which bit of _"The problem with Spice is that you're not modelling the stray capacitances and inductances in the actual prototype."_ didn't you understand?
@mr1enrollment2 жыл бұрын
@@RexxSchneider it seems to me that in my original post I acknowledged the same, so I assume that reading is not your strong point.