Opamp Design - I Suck - Page 1
Forum section: electronics / projects

author: MattHelm
author_rank: Newbie
timestamp: August 16, 2010, 07:06:53 pm
content: I am trying to control a voltage regulator with an opamp. The reason why isn't too important at the moment.So far, all I have done with it is in LTSpice. The design below works - kind of. It has a nasty ripple of around 200mV. While investigating the ripple, I notice that the net noted by the red arrow shows a ripple also. What is up with that?What did I expect? I expected the voltage between R3 and R4 to be a flat 2.5V. If that is less than the voltage between R5 and R6, the opamp's output should swing higher, causing the regulator to bring its output down - thus decreasing the voltage between R5 and R6, ad nauseam.Like I said, it works mostly.Mostly isn't good enough, so I fail.

author: Simon
author_rank: Unknown
timestamp: August 16, 2010, 08:34:48 pm
content: where does VDD come from ? why do you need the opamp ? you should put a capacitor between the + input of the opamp and ground

author: MattHelm
author_rank: Newbie
timestamp: August 16, 2010, 08:57:54 pm
content: Vdd is coming from a 5V source (on the far right of the schematic).

author: Simon
author_rank: Unknown
timestamp: August 16, 2010, 09:01:14 pm
content: what voltage is the output of the regulator ? why do you need the opamp in the feedback ?

author: MattHelm
author_rank: Newbie
timestamp: August 16, 2010, 09:13:37 pm
content: Output of the regulator as drawn should be 25VDC. That is, it should be 10x the voltage of the net between R3 and R4.Why? Now it is somewhat of an academic exercise - however, it was originally because I want to replace R3 and R4 with a digipot.

author: MattHelm
author_rank: Newbie
timestamp: August 16, 2010, 09:16:16 pm
content: I think I understand my stupid error.This is what happens when you drop out of Electrical Engineering in college and do software development for 15 years.

author: TechGuy
author_rank: Regular Contributor
timestamp: August 16, 2010, 09:58:56 pm
content: I recommend adding a PI filter, Just add another LC filter after the voltage regulators output to smooth out the voltage fluxuations. I would also recommend using a TL431 adjustable zener diode instead of using a resistor voltage divider, since it will provide a much stabilier reference voltage. Your reference voltage is suspitable to the Vdd noise. A second TL431 in the voltage feed back divider will also add to stability of the feedback loop. Using a small 100 pf to 10 nf cap across r5 would also increase feed back stablity. A small cap will smooth out some of the switching noise and help prevent the Op-amp from over-compensating the switching noise that tends to cause a feedback amplication of the switching noise. For output loads with fast current demand changes a bigger cap will be need to keep the feedback circuit stable.Google for "TL431 voltage regulator feedback" for example designs. You also need a decouping cap across the the op-amps voltage supply since the 5V input noise will impact the output of the op-amp.FWIW: adding the external op-amp is likely making the problem worse, especially if your powering the op-amp from the regulator output. The regulator built in circuitry will likely provide a more stable, and lower noise output then you will achieve using an external Op-amp feedback controller.Choosing the right switching inductor also makes a big difference. The low value induction you choose will provide lower noise when the output load is near the middle of the PWM duty cycle. At low output current it will create more noise. If your application has a low current demand choose a higher inductor value. Also the input voltage is a factor in the inductor size. If your using a high input voltage you want to use a higher inductor value. if the input voltage is low than you want to use a lower inductor value. With a small inductor and a high input current, the PWM duty cycle will drop very low. This makes it difficult for the regulator circuity to accurately turn on and off the the switching transistor. Try connecting a probe to the input side of the inductor and monitor the duty cycle. If it's very small, than try adding a bigger value inductor.For low output noise with a Buck regulator an LC filter is a must. Add a second inductor and cap after the output to dramatically reduce your output noise. If you need a low\zero ripple output than try adding a coupled inductor as your output inductor:http://www.hamill.co.uk/pdfs/ciabfbb_.pdf(Coupled inductor filters)A coupled inductor is a inductor with a bifilar pair winding. One Winding is connected between source and output. The other between source a low esr cap and ground. The second winding absorbs the AC noise (ripple) and diverts it to ground.

author: MattHelm
author_rank: Newbie
timestamp: August 16, 2010, 10:28:22 pm
content: Using a 0.7V ref for the opamp's ground reference worked wonders for the stability. The opamp "hunts" less because its natural state is to output 0.7V when the inverting and non-inverting inputs match.0.7 is what the regulator wants to see when everything is stable - so, everything is a little happier.However, I don't like to feel like I am throwing components at something. This is a bit of hassle just to control a regulator with a digipot.

author: gonnafail
author_rank: Contributor
timestamp: August 17, 2010, 02:31:06 am
content: I believe that R3 should be connected to the output of the op-amp not VDD.The gain of the op-amp will be vin*(1 + R3/R4) with both being 50k you will have a gain of 2.

author: MattHelm
author_rank: Newbie
timestamp: August 17, 2010, 03:08:50 am
content: @gonnafall:I understand what you are saying. However, The gain from the opamp isn't too important. That is, I believe the way I am using it would be viewed more as a comparator.If the inverting and non-inverting inputs are equal, then all is wee with the world.R3 can't be connected to the opamp's output because R3 and R4 for a simple voltage divider that will be replaced with a digipot. So, imagine the voltage at the inverting input of the opamp as being adjustable from 0V to 5V.ETA: The regulator is intended to do the regulating. The purpose of the opamp is just to act as a buffer of sorts between a digipot and the regulator. Unfortunately, that does mean that the stability of the switching regulator will only be as good as as the 5V supply being divided and fed to the inverting input of the opamp.

author: Simon
author_rank: Unknown
timestamp: August 17, 2010, 06:49:58 am
content: I'd power the opamp from the main supply or from a higher voltage (like 15V) linear reg, you have a 25 V output and a 5V supply to the opamp, ok you have reduced the 25V to about 2.5 but it could swing higher

author: RayJones
author_rank: Frequent Contributor
timestamp: August 17, 2010, 09:31:27 am
content: I afraid gonnafail has nailed it.It really is going to fail as you have it.You have no feedback whatsoever over your "op amp", so it will abruptly switch rail to rail (limited by it's slew rate) as the voltage at the junction of r5/r6 crosses 1/2 Vdd (2.5V).You are dealing with an input to the LT3693 that expects a linear feedback of the output voltage, not something that jumps from rail to rail.

author: Simon
author_rank: Unknown
timestamp: August 17, 2010, 11:35:04 am
content: of course, was failed by the non conventional layout, it's a non inverting config gone wrong

author: jahonen
author_rank: Super Contributor
timestamp: August 17, 2010, 05:42:48 pm
content: You'll need a frequency compensation for your external error amplifier, i.e. some capacitors and resistors around it (R9 and C2). With some tweaking, it seems to work acceptably stable, however not perfect. After initial startup to 20 volts, the switch is closed (@1.5 ms) and output voltage changed to 10 volts. There is some over/undershoot. R3 and R4 are leftover from initial check, just ignore them.However, it is generally better to let the regulator deal with the compensation internally as the external error amplifier compensation can be tricky. Changing voltage in this configuration can be accomplished with external resistor to feedback node, and no external error amplifier at all. The output voltage can be then adjusted by feeding the extra resistor with control voltage (it kinda fools the regulator to think that there are different voltage at the output). The design requires some basic circuit design techniques. Second simulation demonstrates this technique (first to 10V and then to 20V @ 1.5 ms). Feedback network is designed so that 0 volt at "adj" node corresponds to 30V out and 5 volt 0 volts. I'm not however sure that the regulator will work properly to such low voltages.Regards,Janne

author: Simon
author_rank: Unknown
timestamp: August 17, 2010, 05:48:46 pm
content: you could use a mosfet as a voltage controlled resistor to control the output