How Are Power Supply Feedback RC Values Determined?  - Page 1
Forum section: electronics / projects

author: Trurl
author_rank: Regular Contributor
timestamp: January 17, 2024, 05:27:29 pm
content: I have some basic knowledge of SMPS voltage regulation feedback circuit concepts, and basics of control systems theory, mainly conceptually. I've hacked various PSUs and 5V battery chargers to make them variable voltage supplies.I'd like to learn some more about how power supply engineers determine the values of the capacitors and resistors used in feedback circuits, and would like to mod the following 5V battery charger to output 7.5V as a relatively simple example.[ The Power Supply ]Type: 5V Battery Charger[ Primary Side Controller ]STGL LY6805 - Flyback PWM ControllerTopology : QR FlybackOperation Frequency : VariableMax Vdd : 28VFrequency Shuffling : Y...Application Example Schematic[ Note 1 ]In the schematic above, on the lower right (secondary side) there is an "IC2"(programmable zener) which could be say a TL431, but in the 5V charger of interest there is the "DK450" instead.[ Secondary Side Voltage Reference ]DongKe DK450 - 5V Voltage Stabilizing ControllerCircuit DiagramApplication Example Schematics[ Notes 2 ]1. As indicated in the DK450's example schematics above, the 5V charger does not include the resistors(R1,R2, R3) and capacitor(C2) needed in a "normal circuit without DK450", since the DK450 is already optimized for 5V regulation.2. As I'd like to 'adjust' the output voltage up to 7.5V, I'm thinking that it will be necessary to add in the absent resistors(R1,R2, R3) and capacitor(C2).[ Questions ]1. How are the values for the resistors(R1,R2, R3) and capacitor(C2) determined?2. What is a good introductory source(book, web article, YouTube tutorial etc.) that would demystify this topic?Thanks in advance...

author: coromonadalix
author_rank: Super Contributor
timestamp: January 17, 2024, 06:10:45 pm
content: many smps or psu use the tl431 or other references, they use them with "some condition" to trigger an opto coupler and shutdown the main ic smps etc ...the conditions can be over current, over temp, short circuit etc .... it depends on how you want to protect the psu ...maybe search in smps designs you can find some answersi would see and read your last photos are simulated examples as they wrote, not an actual working circuit, some miss-interpretationmany "old" computer psu have similarities and tons of their schematics have been put on the webthe most recent ones have PFC, and many added protections ... witch is another ball game

author: Andy Chee
author_rank: Super Contributor
timestamp: January 17, 2024, 06:18:08 pm
content: Christophe Basso has published a few books on SMPS feedback analysis, particularly relating to the nuances of the TL431 (and clones).http://powersimtof.com/Downloads/PPTs/The%20TL431%20in%20Switching%20Power%20Supplies.pdfhttps://d1.amobbs.com/bbs_upload782111/files_46/ourdev_681062C8YAQ1.pdf

author: Trurl
author_rank: Regular Contributor
timestamp: January 17, 2024, 06:30:16 pm
content: Thanks for the suggestions on reading materials!If anyone else has other suggestions or pointers, please do comment. Thanks

author: Trurl
author_rank: Regular Contributor
timestamp: January 17, 2024, 07:17:08 pm
content: Let me clarify... my true interest is not so much in changing a 5V supply to 7.5V, my real interest is in learning more about the process of determining the actual RC values in feedback(compensation) circuits. I'm hoping to find material that is not too advanced(which seems to be more common than introductory materials).The 5V charger I mentioned above is just as an example, intentionally mentioned so that any comments would be kept simple "in context" as opposed to getting too crazy. : )In the 5V charger example I mentioned above, it is not a TL431 but the DK450, and there are no 'external components' (such as the voltage divider you mention). It would be easy to hack in that case. So in this case(without original RC components already on the PCB), how should one begin to assess the optimal values needed for R6, R7, R8, and C6 (from scratch) as in the first example diagram?I'd like to understand more about the design process related to stabilizing the feedback loop.Quote from: edavid on January 17, 2024, 06:47:53 pm

author: mawyatt
author_rank: Super Contributor
timestamp: January 17, 2024, 08:56:46 pm
content: If you want to understand feedback systems, then best to start with pure Analog {Continous Time Continous Ampltude, CTCA} systems. A Google search should turn up a number of good references.After you understand Poles and Zeros, Bode Plots and Root-Locus diagrams, then you'll grasp the meaning of Phase and Gain Margins and how the components and values begin to effect these critical parameters in various analog feedback circuits.Then migrate into the Discrete Time Continous Amplitude {DTCA} domain where sampling becomes another important element and how this effects various parameters such as Gain and Phase Margins. Here you'll begin to see why certain rules apply wrt to sampling rate and such, and how these interact in the feedback system.Almost all common feedback systems can be "distilled" into an approximate second order system, where one should consider spending time and effort understanding such, as this will pay future dividends and reveal the relationships with the above mentioned parameters and how they effect the Time and Frequency Domain System responses. This is probably the most overlooked area for students venturing into Control Theory and Feedback Systems, and once mastered gives one a quick intuitive view into complex feedback system responses and behavior, and how the various system parameters interact and influence the System Stability and Response.Best,

author: Trurl
author_rank: Regular Contributor
timestamp: January 17, 2024, 09:49:47 pm
content: Thanks for the heads up topics. Some such as poles, zeros, Bode plots, Root-Locus diagrams, phase and gain margins I've had some exposure, but others you mention, I'll have to keep them in mind.Thanks to Andy Chee, I've got a hold of Christophe Basso's "Designing Control Loops for Linear and Switching Power Supplies A Tutorial Guide". It seems to explain a whole lot on the topic, "rigorously" according to some cat at the Jet Propulsion Lab! It's probably gonna make me drink more coffee and freak out more than usual, but I'm gonna take the deep dive!If someone finds a "for Dummies"-like book on the topic, I'm ALL ears!LOLCheers~

author: Terry Bites
author_rank: Super Contributor
timestamp: January 19, 2024, 03:15:24 pm
content: Short answer:Think of the power supply as an amplifer of the reference voltage. In this case the TL431's 2.5V .You set the gain and compensate it in a very similar way to any amplifier (or system) with negative feeback applied.You need to have the switcher's charcteristics to hand of course. Most switcher ic application notes help you design the feedback loop.In your diagram, when the junction of R6, R7 reaches 2.5V the TL431 starts to conduct an the opto's LED turns on, that applies control to the switcher.You want an opto to isolate the output side from the mains side.At equilibruim the output voltage will be (1+(R6/R7))*2.5 Volts . If the feedback cap is too large the regulator will be very slow to respond to load changes or undershoot.To small and it will oscillate or overshoot killing your precious load. The aim is usually to acheive "critical damping".The long answer can be found in the subject of "control theory".

author: Trurl
author_rank: Regular Contributor
timestamp: January 19, 2024, 06:39:20 pm
content: Quote from: Terry Bites on January 19, 2024, 03:15:24 pmThank you for the summary. I've had exposure to introductory "control theory", and even recall viewing a cool YouTube video of an engineer demoing several feedback cap values to show on an oscilloscope their resulting effects(initially with oscillations and gradually toward almost none), so I understand there would be an iterative process, but he didn't get into the general initial process or any general "rule of thumb" starting values or formulas.When I started this thread, I thought perhaps some folks on this forum might be able to suggest such general "rule of thumb" values or formulas for the RC values or the general first steps in testing/analysis to get started based on a relatively simple 5V charger example, but perhaps it's not that easy or I've not provided enough info?Finishing up the 1st chapter of Christophe Basso's "Designing Control Loops for Linear and Switching Power Supplies A Tutorial Guide", I'm really grateful this material exists as the introduction is very thorough and the math is "understandably explained"(which is rare), and not just whipping out fancy equations to show their geek muscles. 'Haven't thought so many exclamations(e.g. "holy $*%!", "Oh My Got!"...) so often while reading in a while! LOL."Recovering Electrical Engineer..." LOL.

author: TimNJ
author_rank: Super Contributor
timestamp: January 20, 2024, 02:05:28 am
content: You can definitely do a more brute force guess and check approach. The theory is helpful in understanding what you are changing about the frequency response when you make X,Y, or Z component value changes.You might as well change the DK450 chip out for an ‘431 variety, although DK450 just is pretty much a “pre-biased” ‘431 anyway. Try a lower power variety like AP431S.R1 = 100R-1KR3 = 1-10KR2 scaled accordinglyC2 = 10-100nFJust ballpark values. YMMV. These will scale with output voltage, in general. So a 25V power supply might have 5x higher value of R1, for example, to set the 431 bias current to roughly the same value (which influences the “master gain” or DC gain).A practical approach is to check the output voltage step response with a load step applied. Laplace and control theory says that a system which exhibits a well behaved step response is a stable system.

author: Trurl
author_rank: Regular Contributor
timestamp: January 20, 2024, 08:38:53 am
content: TimNJ, you's my savior fo the day!That's exactly the kind of starter info I was seekin'! I think IWILLswap out the Dongke* 450 with a regular '431 variety as you suggest since better documentation & examples are available.* Pronounced by the swell folks of China, "Dong Kuh" as in "eastcategory"("eastern"), not like how James Brown sings "honky" tonk women~.I just read about step response as one of the analytical techniques in Basso's intro. Well, now I'm sure I'm gonna get that new Rigol DHO804 all the kids are goin' crazy about, and understand why mawyatt's wallet's empty!Cheers~!!!

author: TimNJ
author_rank: Super Contributor
timestamp: January 20, 2024, 02:56:03 pm
content: Not related to feedback/control loops really, but also be mindful about changing the output voltage in general.The drain-source voltage across the primary side MOSFET in fact depends on the output voltage, turns ratio, input voltage, and the primary-side clamp’s ability to suppress the transformers leakage spike.You probably don’t know the turns ratio, but it might be between 10-20. So, if you increase the output voltage by 1.5x, the reflected voltage seen by the primary MOSFET goes up by n*1.5…so probably by 15-30V. That generally probably won’t pose a problem if designed with enough margin but keep it in mind. And be mindful of secondary side components ratings too.

author: peter-h
author_rank: Super Contributor
timestamp: January 20, 2024, 08:17:45 pm
content: The TL431 is tricky in that no bypass cap is stable, a large bypass cap is also stable (above 10uF or some such) but values in between are not, and amazingly they vary with the package!Re control theory, one can get very clever but I think most people just put in a feedback cap which is very large and then it will "nearly always work" and then they reduce it until it goes unstable and then they increase it by say 10x. I think this is basically whatmawyattis getting at. This is the capand not the ones which slow down the feedback like C3 and C6 - if you make those too big the system will never be stable! I struggle to see where the LY6805's feedback cap is.I've designed hundreds of power supplies, bith linear and switching, this simple way.One thing which can bite you is the ESR of the output caps (C5). I am very careful to stick to the same brand and P/N.In most cases, increasing the output voltageimprovesthe stability margin.

author: Trurl
author_rank: Regular Contributor
timestamp: January 21, 2024, 10:04:42 pm
content: Quote from: TimNJ on January 20, 2024, 02:56:03 pmThanks TimNJ for the pointer about the effects on the primary side, and to be mindful of the secondary side components.On the secondary side, I checked that the output caps are rated above 7.5V (10V). This is why I attempted to hack it, especially because its housing is the same as another charger I hacked which had a seemingly common 6-pin BCD(eaten by Diodes Inc.) "Low-Power Off-line Primary Side Regulation Controller" IC with an easily hackable voltage divider off the FB(Feed Back) pin, but unfortunately this unit with the Dongke DK450 has no base RC components and voltage divider already set. It's the first odd ball charger I ran into... made me feel like I'd just fell right on my face! Humbling indeed. I thought that's it, I'm a gonna demystify this RC selection process.For immediate needs, I'll just use another USB charger I already hacked successfully, but this one has 6.3V 5x9mm(tiny) secondary output caps so I'll have to get some 10V versions(luckily available online!). This USB charger is another that has the seemingly common 6-pin BCD "Low-Power Off-line Primary Side Regulation Controller" with an easily hackable voltage divider right off the chip's FB(Feed Back) pin.Quote from: peter-h on January 20, 2024, 08:17:45 pmThanks peter-h for sharing those "tips and tricks", very helpful!Regarding the LY6805's "feedback cap", isn't C3 a "feedback cap"? I ask since it's hangin' off the "FB" pin on the schematic. Or what is a "feedback cap" in your mind, and whereshouldit be if it ain't C3?What clues would indicate that the "ESR of the output caps" justbitme? LOLCheers~

author: peter-h
author_rank: Super Contributor
timestamp: January 22, 2024, 08:58:01 am
content: I can't find an LY6805 data sheet.

author: Trurl
author_rank: Regular Contributor
timestamp: January 22, 2024, 02:45:48 pm
content: Quote from: peter-h on January 22, 2024, 08:58:01 am"Shenzhen Stronglink Eiectronics(sic) Co.,ltd" as its only documentation on its website indicates, has horrid documentation, and only in bitmap Chinese. Perhaps they don't want the other company spying on them to swipe their toiled over text or figure out their secret sauce! At least there is the value omitted schematics! LOLOn page 14(as marked on the catalog) of their only documentation(attached below) on their website*,*http://eng.stglsemi.com/products.asp?cid=101&id=4100(Warning: the website above has "Download" > "Datasheet" cells that doabsolutelyNOTHING! LOL)is information on the LY6805. I tried copying the text to enter it into Google Translate, but the text is a bitmap image so only accessible for those that can read the Chinese. But even if language were not an issue the documentation is more of a catalog for marketing(perhaps to purchasing folks) than a proper datasheet for in depth engineering reference.What would you be seeking to check specifically? If you would share that info, I'd check on other datasheets for such feature's function(s) etc. for future reference on other ICs. Thanks...

author: peter-h
author_rank: Super Contributor
timestamp: January 22, 2024, 06:37:56 pm
content: Honestly, don't waste your time with chips like that. Even if you are making a one-off, your time is worth 100x more than the saving on this part.In general, the capacitor in question is like I described above: it goes between the output of the error amplifier and its -ve (inverting) input.To make the cap effective the signal at the -ve input must be via a resistor, otherwise the cap won't do anythingSlowing down the feedback signal (the feedback from the "process variable" in classic control terms) is usually no good; there you merely want to remove the switch mode caused ripple there.

author: Trurl
author_rank: Regular Contributor
timestamp: January 23, 2024, 03:00:20 am
content: Thanks again to you(and everyone) for your tips... Ireallyappreciate every little pointer, some likely to sink in later at an "ah ha~" moment.The "feedback cap" you are not finding seems to be due to the DK450's internalized components. In the LY6805 schematic the closest thing to the "feedback" cap would be C6 following the R6+R7 voltage divider near the secondary side's suggested IC2(programmable zener).As suggested by the DK450's datasheet, the C6, R6+R7, and R8 (as marked in the LY6805 schematic) are not present in the charger I attempted to hack as these "external components" have been internalized in the DK450.I agree with you fully about not wasting time with chips like those from STGL, the reason I'm looking into chargers sittin' around the house is that these types of power supplies are relatively simple, and I just got curious about this odd ball charger I ran into. It's made me determined to explore deeper into the workings of compensation circuits, which I consider the fruit of my efforts if any with this thing.Cheers~

author: Trurl
author_rank: Regular Contributor
timestamp: June 12, 2024, 04:20:25 pm
content: Well, with nothing to lose even if this charger were to blow up, I decided to have some fun and hack the Dongke DK450, to boost the 5V charger's output to at least 7V.I initially had the goal of boosting it to about 7.5V, for use as a supply for a 5V regulator, and tried inserting a (1 to 2/3 ratio)voltage divider with 2k+4k(variable variable to 5k). The reasoning was that 7.5V x 2/3 = 5V, and that the DK450 will regulate an initial lowered feedaback voltage "back up to" 5V and in effect output 7.5V. In actual operation, the initial divider setting resulted in about 6.3V, but adjusting the variable pot up to about 5.1k(pot's maximum) resulted in triggering what seemed to be the charger's OVP(Over Voltage Protection) threshold voltage of about 7.3V.After some more final tests to confirm the above observations, I used 3 resistors for a 2K(R1)+5K(R2: 3k+2k) divider between the opto-coupler and DK450's "Reference" pin. The "R" pin was desoldered, lifted out of its hole, bent in a "J" shape. A wire was soldered in the "R" pin's hole so that the divider's input lead could be connected. The divider's "output" wire got connected to the DK450's "J" shape bent "Reference" pin, and the ground end of the divider got linked with a black wire soldered to the negative output's ground point. The photos below show the divider before placing the shrink tubes and final linking with the grounding wire(for better visibility & clarity).After reassembling the charger, it now outputs a steady 7.27V and powers a 5V regulator LM7805 with no issues. Of course now the issue I have is that the ammeter I'm trying to tame is not behavin' unless a particular power source is used, but that's a whole other issue raised in another thread:https://www.eevblog.com/forum/beginners/current-sense-output-disrupting-ammeter-powered-with-most-smps-but-not-all()/In hindsight, this did not require studying compensation circuits, LaPlace transforms, Bode plots, Nyquist diagrams etc. etc., but I'm so glad (and humbled) that I did take that deep dive, as now I have some idea of the wild things that go on in the AC realm of DC circuits!Cheers!