1) How do you find out the transfer function of a standard NPN linear regulator (With Opamp feedback)?
Because in the feedback path you've got the BE junction of the transistor, like how do you take that into account?
There are some complications:
1. The Ft (and hfe) of the bipolar transistor is not constant and drops at high current, so the transfer function depends on operating point.
2. The emitter resistance varies with current so the pole formed with the output capacitance shifts with output current. This is especially a problem with common emitter output stages which may require special compensation to operate at low output currents because their output resistance can be very high.
See below where I describe how I work back to calculate the response of the output transistor.
2) I've seen designs where they use Opamps and they've put a capacitor in the feedback path of the opamp (between inverting terminal and the output pin). I understand it's for compensation and stuff but how do you find the right value of capacitance to use?
You may also see a capacitor in parallel with the top resistor of the feedback divider to add phase lead. And either or both capacitors may have a series capacitor and resistor in parallel for pole-zero compensation. When I layout PC boards, I include spots for these parts even if I do not eventually use them.
3) What about the value of the output capacitor? How do we calculate that? Do we use the trial and error method to find a suitable value?
As a practical matter, the output capacitor will be 25 to 100 microfarads per amp. If you get deep into the design outside of the regulator, then the output capacitor actually has nothing to do with the regulator itself. Its real purpose is to provide an AC termination for the transmission line formed by the power distribution wiring. When this is done, then the output capacitance combined with the output resistance of the regulator produces dominant mode compensation which is what limits the dynamic performance of the regulator. Of course the larger the output capacitance, the slower the regulator can be and still provide sufficient load response.
Fast response regulators lack this output capacitor and are designed like a class-AB audio output stage with a series RC network on the output to provide stability. A book about audio power amplifier design is helpful here. Below is an example of a fast 10 amp regulator where the output capacitance is 0.22 microfarads in series with 10 ohms.
4) How are CC/CV power supplies designed commercially? For example, do they just pick the parts, put them together and then find the stability and/or stabilize the feedback loops and/or improve the transient responses?
The way I find that works best, at least if you lack a network analyzer and maybe if you even have one, is to empirically (trial and error) adjust the compensation for critical dampening. Then it is possible to work backwards to calculate the response of the output stage, but keep in mind that the frequency response of the transistor and output stage varies considerably with output current.