Author Topic: How Are Power Supply Feedback RC Values Determined?  (Read 1966 times)

0 Members and 1 Guest are viewing this topic.

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
How Are Power Supply Feedback RC Values Determined?
« on: January 17, 2024, 05:27:29 pm »
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 Controller
Topology : QR Flyback
Operation Frequency : Variable
Max Vdd : 28V
Frequency 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 Controller

Circuit Diagram


Application 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...

« Last Edit: January 17, 2024, 06:40:02 pm by Trurl »
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 6522
  • Country: ca
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #1 on: January 17, 2024, 06:10:45 pm »
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 answers


i would see and read  your last photos are simulated examples as they wrote, not an actual working circuit,  some miss-interpretation

many "old" computer psu  have similarities and tons of their schematics have been put  on the web   

the most recent ones  have PFC,  and many added protections ...  witch is another ball game
 
The following users thanked this post: Trurl

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1024
  • Country: au
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #2 on: January 17, 2024, 06:18:08 pm »
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.pdf

https://d1.amobbs.com/bbs_upload782111/files_46/ourdev_681062C8YAQ1.pdf
« Last Edit: January 17, 2024, 06:21:18 pm by Andy Chee »
 
The following users thanked this post: Trurl

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #3 on: January 17, 2024, 06:30:16 pm »
Thanks for the suggestions on reading materials!

If anyone else has other suggestions or pointers, please do comment. Thanks
 
 

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #4 on: January 17, 2024, 07:17:08 pm »
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.


Your subject question is too general to be answered.

Since you actually just want to know how to change a 5V supply to 7.5V, please update the subject.

If you use a TL431 as shown in the first schematic, you can program the output voltage using R6 and R7.  For this minor change, you probably wouldn't need to change anything else.  Without the actual schematic of the 5V version, that's about all we can say.
« Last Edit: January 17, 2024, 07:36:58 pm by Trurl »
 

Offline mawyatt

  • Super Contributor
  • ***
  • Posts: 3777
  • Country: us
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #5 on: January 17, 2024, 08:56:46 pm »
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,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: Trurl, 2N3055

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #6 on: January 17, 2024, 09:49:47 pm »
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!LOL

Cheers~
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2498
  • Country: gb
  • Recovering Electrical Engineer
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #7 on: January 19, 2024, 03:15:24 pm »
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".
 
The following users thanked this post: Trurl

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #8 on: January 19, 2024, 06:39:20 pm »
...
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".

Thank 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.
« Last Edit: January 19, 2024, 07:00:12 pm by Trurl »
 

Offline TimNJ

  • Super Contributor
  • ***
  • Posts: 1702
  • Country: us
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #9 on: January 20, 2024, 02:05:28 am »
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-1K
R3 = 1-10K
R2 scaled accordingly
C2 = 10-100nF

Just 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.


« Last Edit: January 20, 2024, 02:07:02 am by TimNJ »
 
The following users thanked this post: Trurl

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #10 on: January 20, 2024, 08:38:53 am »
TimNJ, you's my savior fo the day!

That's exactly the kind of starter info I was seekin'! I think I WILL swap 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 "east category"("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~!!!
« Last Edit: January 28, 2024, 09:51:11 am by Trurl »
 

Offline TimNJ

  • Super Contributor
  • ***
  • Posts: 1702
  • Country: us
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #11 on: January 20, 2024, 02:56:03 pm »
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.
 
The following users thanked this post: Trurl

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
  • Doing electronics since the 1960s...
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #12 on: January 20, 2024, 08:17:45 pm »
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 what mawyatt is getting at. This is the cap



and 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 voltage improves the stability margin.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: Trurl, MathWizard

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #13 on: January 21, 2024, 10:04:42 pm »
... be mindful about changing the output voltage in general.
... 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.

Thanks 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.

...
Re control theory,... 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 what mawyatt is getting at. This is the cap



and 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.
...
One thing which can bite you is the ESR of the output caps (C5).
...
In most cases, increasing the output voltage improves the stability margin.

Thanks 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 where should it be if it ain't C3?

What clues would indicate that the "ESR of the output caps" just bit me? LOL

Cheers~
« Last Edit: January 21, 2024, 10:20:39 pm by Trurl »
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
  • Doing electronics since the 1960s...
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #14 on: January 22, 2024, 08:58:01 am »
I can't find an LY6805 data sheet.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #15 on: January 22, 2024, 02:45:48 pm »
I can't find an LY6805 data sheet.

"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!  LOL

On 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 do absolutely NOTHING! 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...
« Last Edit: January 22, 2024, 03:03:21 pm by Trurl »
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 4048
  • Country: gb
  • Doing electronics since the 1960s...
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #16 on: January 22, 2024, 06:37:56 pm »
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 anything :)

Slowing 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.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: Trurl

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #17 on: January 23, 2024, 03:00:20 am »
Thanks again to you(and everyone) for your tips... I really appreciate 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~
« Last Edit: January 23, 2024, 03:06:20 am by Trurl »
 

Offline TrurlTopic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: kr
Re: How Are Power Supply Feedback RC Values Determined?
« Reply #18 on: June 12, 2024, 04:20:25 pm »
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).

2288603-0  2288607-1

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!
« Last Edit: June 12, 2024, 07:53:13 pm by Trurl »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf