SMPS Buck: FB compensation for varying V_OUT  - Page 1
Forum section: electronics / beginners

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 04, 2012, 10:04:15 pm
content: Hello there,I am making this circuit with the LM25085. The datasheet states:QuoteI understand this. I do the calculations and learn that I need to use different values of R3*C1 to get 25mVpp at the junction. This is because the voltage at R3 will vary as a function of VOUT.For VOUT 16V: R3*C1 has to be 1E-4For VOUT 2V: R3 * C1 has to be 1.5E-3What is the best method to make a filter that works over the range of output voltages (1V25 - 16V)?Thank you for your time.Kind regards,Marius

author: codeboy2k
author_rank: Super Contributor
timestamp: June 04, 2012, 11:47:12 pm
content: It's an integrator, not a filter. Use the smaller value of R3*C1. Not the larger one.The large RC time constant at the maximum output voltage will yield a smaller than designed for ripple into the FB pin. i.e. it will be less than 25mv.The smaller RC time constant at the minimum output voltage will yield a larger than designed for, ie. larger than 25mv you need. This is good.(NOTE: The smaller value R3*C1 is called R3xC1max in my calculations, because it's based on the maximum output voltage. The result of the calculation is actually smaller than R3xC1min )So you will get 25mV ripple at maximum voltage, and about 100mV ripple at the minimum voltage (that's my calculations, where I madesome assumptions about your Vin and switching frequency, since you didn't say.See my attached calculations for you. (made with SMath Studio, a free MathCAD clone)Cheers!PS: edited to include the SMath Studio source file that I created as well, so you (or other members) can play around with itif you decide to download SMath StudioPSS: edited again, I mixed up larger and smaller in the text but the calculations are still correct. I fixed it now.

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 05, 2012, 06:46:24 am
content: Thanks manthat makes sense. The assumptions you made were reasonable. Thank youM

author: codeboy2k
author_rank: Super Contributor
timestamp: June 05, 2012, 07:54:39 am
content: Quote from: king.oslo on June 05, 2012, 06:46:24 amYou're welcome. Please re-read my write-up, I originally got the smaller and larger R3*C1 mixed up in the text writeup, but the calculation sheet is still correct.I just fixed the writeup.

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 05, 2012, 09:04:15 am
content: I want to understand what is happening.The PFET conducts current, some of it moves through R3 and charges up C1. As C1 is charging up, the voltage at their junction rises and is ac coupled through C2 to V_FB.So I expected:At 16V_OUT: the resistor had to be bigger because the FET has longer duty-cyle.At 2V_OUT: the resistor had to be smaller because the FET has shorter duty-cyle.Our maths suggest the opposite. Where is my understanding of what is happening wrong?Thank you for your time.Kind regards,Marius

author: codeboy2k
author_rank: Super Contributor
timestamp: June 05, 2012, 11:58:55 am
content: It's because the resistor is on the input rail, and the capacitor is on the output rail, not at ground reference, and more importantly, the PFET is one-shot pulsed on with aconstant on time, it's not PWM like you might think.So lets take some extremes to illustrate the point better.at VIN= 20V, VOUT=19V, there is only 1V difference between the top of the resistor and the bottom of the capacitor. The PFET switches on for a constant time, Ton, and must permit the capacitor to charge up to 25mv during this on-time. 1-volt during time Ton. There's not a lot of potential energy between 20V and 19V (just 1 V difference) so the RC time constant has to be smaller to permit the capacitor to charge up to 25mv in the fixed on-time period. 25 mv of 1V is 2.5% of the total voltage. So in time Ton, the capacitor has to charge up to 2.5% of the maximum voltage 1V.at VIN=20V, VOUT=2V, there is now 18V potential difference between the top of the resistor and the bottom of the capacitor. The on-time is the same, and it now has more total energy available (18V during time Ton) to charge the capacitor in the same time period. So it must reduce the charging rate which means a larger RC time constant at smaller output voltages. In this case, 25mv is 0.139% of 18V, so it only has to reach a very small percentage of maximum voltage, in the same time period Ton.This is why the calculations use (Vin - VA)*Ton .... this is the potential difference across the series RC.. times the on-time and divided by the voltage you want to reach (Vos, the 25mv ripple), it gives the RC time constant needed to get there.This is indeed opposite to what you would expect with a PWM based controller, but this controller is constant on-time, and the frequency is set by Vin and the resistor RT. For this controller, the period of the frequency is the duration of a constant on-time one-shot pulse of the PFET. It does this whenever the voltage drops below the Vout setpoint.

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 06, 2012, 10:05:27 am
content: THat was an excellent reply. Thank you!M

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 06, 2012, 05:54:52 pm
content: What is the greatest VPPI can have at the RC junction? You said 100mV is no problem. What about 225mV? And what about really high voltages. Like 1VPP?What problems will arise from really high ripple at FB-pin?

author: codeboy2k
author_rank: Super Contributor
timestamp: June 07, 2012, 09:44:30 am
content: Quote from: king.oslo on June 06, 2012, 10:05:27 amYou're welcome, no problem.Quote from: king.oslo on June 06, 2012, 05:54:52 pmThe FB divider resistors on the output create a 1.25V FB voltage from Vout. With 25mv of ripple added, the FB pin will 1.225V to 1.275V ; with 100mv ripple it will be 1.150 to 1.350V . With 225 mv of ripple the FB pin will go between1.025and1.475The ripple generated and supplied to the FB pin will be compared against the 1.25V reference and used to gate the FET on for one Ton period, when it falls below 1.25V - 25mv = 1.225V. A 1 volt ripple is pretty high, and I would not recommend it, but it would still work in the same manner. It will also turn off the FET when the ripple voltage reaches 1.6V (see below)According to the datasheet, and looking at the block diagram, there is an over-voltage comparator on the FB pin. If the FB pin exceeds 1.6V, it will shut off the gate drive and turn off the FET until the FB pin is below 1.6V again. The gate will remain off until the FB pin drops even further, to below 1.25V-25mv=1.225V. That's the level set on the regulation comparator. That's the normal operation. But in this case, it only exceeded 1.6V because of the fake ripple that was added. So as soon as the output turns off, it will immediately drop below 1.225V, and will slam back on again; then it exceeds 1.6V again, and repeats. So, with too much FB ripple added, the output voltage will not regulate well. This will addrealripple. This tells me you will need to increase the Cout value to reduce thisrealripple. The 1.6V comparator serves to keep the maximum FB ripple to 350mv (1.6V - 1.25V). This will translate into amaximum real output rippleof 350mv * (FB1+FB2)/FB1I'm looking back at your schematic, but you clipped the bottom resistor of the feedback divider. Are you making that a variable resistor, in order to vary the output voltage?The problem with trying to use one value of R*C for a wide output range is that you have to pick the one that gives 25mv ripple into the FB pin at the highest output voltage, but this will give 100mv ripple at the lowest output voltage. This will affect regulation at the lower voltages, and generaterealripple that you need to account for with a larger output cap Cout that takes this into consideration. In some applications, the larger output ripple won't be a problem, for example, if this is a pre-regulator to a following linear stage, then more output ripple won't matter. But it really depends how you are using the output.So in summary, the regulation is done using comparators, not an error amplifier, and it doesn't matter if you have 100mv, 200mv 300mv, etc. of fake added ripple, but the added ripple will translate to more real output ripple as it messes with the ability of the device to regulate well. Large amounts of fake FB ripple will cause the FET to be on more than it needs to be to maintain regulation, and this will result in higher output voltages (i.e. morerealripple on the output). And the output voltage will be slightly higher than the set (calculated) value using the feedback resistors.

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 07, 2012, 10:27:02 am
content: Alright. I understand. Thank you.Attached is the whole circuit.As you guessed, the problem is variable VOUT. Because the LM25085 has fixed on-time, I need a variable voltage at RT pin to get a fixed fSWfor the range of VOUT. In the final design, I thought I would get rid of R4 and R5 and feed a variable voltage straight into the pin from a MCU. That way the LM25085 fSWcan vary as a function of VOUT.But this means that I will get fake ripple of 100mV for VOUT1.25V and 25mV for 16V. What is worse, I will get 225mVPPfor VOUTof ~5-12VDC, . Check it out in the attached spreadsheet.I suppose I will need to swap fixed R5 with a digital pot in the final design. Do you agree? Or can I use some simple analog ciruitry to get fixed VPPof 25mV instead?Thank you for your time.Kind regards,Marius

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 08, 2012, 08:59:39 pm
content: Bump!M

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 08, 2012, 10:06:04 pm
content: If I place the cap across to a variable 0-5V supply which varies as a function of TON. With the right R6, is this going to yield a constant 25mV ripple?Please keep in mind I want to drive the RT-pin with a voltage to get a variable TON.MThank you for your time.

author: codeboy2k
author_rank: Super Contributor
timestamp: June 11, 2012, 08:11:41 am
content: Quote from: king.oslo on June 08, 2012, 10:06:04 pmI've been busy with work for a few days, now I have time again. I did some thinking, and tried some things out, I'll upload some stuff in the next post. First, why do you want to vary Ton? The Ton value is usually constant for a chosen output voltage, you don't need to change it as you change output voltages. And in fact you'll soon discover that changing it won't affect the output voltage at all (but it will affect the output ripple, the ripple that is divided down and appears at FB , and any fake ripple you generate via the integrator with the chosen RC value).As for the variable 5V on the RC integrator, you can do it, and it's a good idea too, that makes it very simple to get what you need. But you don't need to vary it at all ( and you don't really want to, as then you have the original problem again). You only need to keep it fixed at some constant voltage, say 5V. I did some LTspice modeling that I'll upload. In my simulation I chose a very low 1.2V. because I think its probably better to keep it near to ground and charge it up to add a ripple charge to it. Their is a problem that I didn't solve yet. Each time the switch is on, the current gives a little boost to the capacitor in the RC circuit. Since it's not connected to Vout anymore, it never discharges. With a bias voltage holding it up, it has no path to discharge and the voltage across it keeps growing. It will need a bleed resistor to ground somewhere, so it can bleed off charge when the switch is off. I haven't figured that out yet.

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 11, 2012, 08:46:12 am
content: Quote from: codeboy2k on June 11, 2012, 08:11:41 amWhy I want to vary TON: If we vary TONas a function of VOUT, I can get a fixed switching frequency for variable VOUT. In my case: 400KHz. The constant switching frequency seemed to simplify the design of the RC-integrator to get a fixed 25mV fake ripple. How? You taught me that the ripple would be higher when there was a large drop in voltage across RC. But with a fixed frequency, TONwill be reduced as a linear function of the potential drop across RC. That will yield a smaller variance in ripple. I thought this would simplify the design of the RC-integrator (and be more elegant too). Do you think this is a bad idea for my variable VOUTpower supply?To solve the problem with the bleed resistor to discharge the capacitor, is it possible to use a npn transistor to ground which opens as a function of desired VPPof the fake ripple? Is this a good idea?Thank you for your time.Kind regards,Marius

author: codeboy2k
author_rank: Super Contributor
timestamp: June 11, 2012, 08:53:17 am
content: Here's some spice I did. At first attempt I thought about using an amplifier to boost the low level ripple at the output to a 25mv ripple to feedback to the controller. This works really well, but its hard to set the amplifier gain because I am using a common base amplifier. These are not easy to get a fixed designed for gain. The common base is needed so that you don't cause a phase inversion which will cause the output to oscillate. If you have a spare opamp on your board, you can do this with an opamp in non-inverting mode. If you don't then the discretes are cheap to add to your BOM.The second attempt I decided to model the controller a little better and try your method, to connect the capacitor of the integrator to a 5V supply. I chose 1.2V, actually, it's called Vbias on the spice simulation. In normal mode with the cap connected to the output, the simulation gets 5V output, with 6mv ripple and 30mv of feedback ripple at the integrator junction of the resistor and capacitor. It doesn't work so well when you connect it to the bias. You need to change the RC constant, or make the bias 5V with those RC values on the simulation. After that the capacitor continues to build up charge, and eventually this creates a voltage offset that gets into the feedback pin and it thinks its hit the output voltage level before it actually does, so the output is too low from the value set with the divider resistors.I'll attach the LTspice files. You can continue to experiment.

author: codeboy2k
author_rank: Super Contributor
timestamp: June 11, 2012, 09:13:45 am
content: Quote from: king.oslo on June 11, 2012, 08:46:12 amThe idea seems sound, I just thought it might complicate things instead of make it easier. I really like the bias idea you had, because then the capacitor always sees a fixed bias voltage instead of a varying Vout. and the top resistor always sees Vin. Vin o---/\/\/\/\---o---||---o Vbias This is easy to make a fixed RC as long as Ton is also fixed. The trick is to discharge the capacitor during Toff.Quote... maybe you can tap off the gate drive and bleed the cap with a small mosfet to ground. Check it in spice, I won't have time for a day or so.QuoteNo problems. It's still fun

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 11, 2012, 12:30:21 pm
content: Alright, thanks codeboy2kThis is my best suggestion of today. Tell me what you think.Kind regards,MariusPS: I have used variable TONand (and fixed frequency).PSS: I drive the bottom of the VFB-divider with a voltage 0-1.25 to set VOUT1.25V-16.6V.PSSS: The NPN transistor is driven with a voltage.

author: codeboy2k
author_rank: Super Contributor
timestamp: June 12, 2012, 05:18:49 am
content: If you can make it work for you and you have all those voltages available..... But I don't like the transistor there in that configuration. It's not going to be fully on, thus it's dissipating power, and taking a lot of transients right next to the switching diode. Plus the fact that you have to varying 3 different voltage setpoints just to get a single fixed output voltage. I guess they can all be scaled from a single voltage setting, but still.. there should be something simpler... I always like to find a simple and elegant solution. I would love to use a varactor (varicap) here, this circuit is calling out for it... you have a varying voltage and need a capacitance inversely proportional to the voltage--> that's a varactor!

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 12, 2012, 04:22:22 pm
content: Yes you are right. My solution is ugly. I agree now that you have pointed out its flaws.I had never heard of varicaps before, but now that I have had time to admire them @ wikipedia. Whilst I was at it, I looked up "varistor" too. I have found at least one problem with varicaps:At 1/2 duty cycle, the ripple at the RC junction is circa three times that of VOUT= 1.25V. My guess is that this is because at 1/2 duty cycle, the cap has closest to equal discharge/recharge period, hence the ripple is greatest then.In short: Perhaps varicaps can take out a bit of the error, but the R or C is not inversely proportional to the voltage.The second problem (which may not be a problem at all) was that when I simulated in LTSpice with the only varicap in its library, it created an sawtooth ripple. Perhaps the shape of the waveform isnt that important (after all, all we want is to keep the FB-loop stable).I will try to think of something better, but in the meanwhile, what are your views?Thanks.M

author: Hideki
author_rank: Frequent Contributor
timestamp: June 12, 2012, 09:13:52 pm
content: My view is: Pick a different switch controller chip that doesn't require changing a capacitance to make it work properly.

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 12, 2012, 09:18:30 pm
content: Hideki, do you know a controller which does what I want?I need VOUT1.25-16V.Variable current limit.I need to set these from a mcu. 400KHz is a good frequency.I gave up finding one which was more suitable.Thanks.M

author: codeboy2k
author_rank: Super Contributor
timestamp: June 13, 2012, 01:56:18 am
content: It's hard to do a variable output switcher, but not impossible. Most of the time the calculations are for one output voltage and are not suitable for a different output voltage. You often end up making some compromises, and never get the best output at either end of the scale. And it's a very iterative process. And sometimes even impossible with a chosen IC, and that makes you choose another IC and start over.During this exercise I also thought it might be better to pick another controller IC, but I didn't do any searches.However, I definitely like the choice of the constant on-time switcher, I think it's ideally the best choice. If you use a PWM based switcher, then you might run into design problems where you don't have enough PWM range to get the output to vary from the top to the bottom that you want; you also run into loop stability problems, as the feedback gain varies across the range. No, ideally I think the constant on-time switcher, using a comparator in the feedback, not an error amplifier, is much better for a variable switcher.There's a reason why you almost never, if at all, see the manufacturers produce avariablereference design. It's hard to do.

author: megajocke
author_rank: Regular Contributor
timestamp: June 15, 2012, 08:53:44 pm
content: Voltage-mode PWM with a linear ramp/triangle of a buck converter in continuous current mode will actually give a power stage and modulator gain that is independent of output voltage. On the other hand, it's a little tricky to compensate to begin with though.

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 17, 2012, 02:06:55 pm
content: Hello everyone, a week has passed, and I have experimented all I could.The simplest solution I have found is to put a 1K resistor and P-JFET in series between the switching node and the 3n3 capacitor. Then I can open and close the JFET with a voltage.1. What do you think about this solution?2. Which parameters should I pay attention to in order to pick a suitable JFET?Thank you for your time.Kind regards,Marius

author: king.oslo
author_rank: Frequent Contributor
timestamp: June 18, 2012, 04:37:39 pm
content: Here is another one!By changing the voltage V1 as a function of VOUTi can get the ripple I want.What do you think?Kind regards,Marius