Linear PID PSU - Is this valid as a transfer function for the pass BJT? - Page 1
Forum section: electronics / projects

author: Verdefluox
author_rank: Contributor
timestamp: March 25, 2023, 03:08:19 pm
content: Hi folks,first of all, I'd like to say that I'm studying in another engineering field, hence most of my electrical knowledge is self-taught. The nearest course I have is a control theory one with some hints on electrical systems, but nothing more than that. This is why this project is based on the theory learned there, and hopefully valid.THE PROJECTA 0-15 V, 0-1 A linear PSU, with CC-CV modes, 10 mV - 1 mA resolution, controlled by Arduino+external DACs. Aim is also to made two and use them in series, so I could drive easily op-amps (aka. dual-rail); or to use one and have a second one for any convenience. Generally, it is meant for relatively low power loads, using the same architecture used in my other power supply (the famous Elektor PSU), made by a single pass transistor driven by two lines via two diodes (one for CC and one for CV, should be an XOR logic if I'm right, where only one at the time drives the pass transistor). In the jpeg attached below I have drawn a general schematic for the CV mode. I'd like to go with some jelly-bean op-amp, and the pass will be probably something like 2N2222 + BD241 in Darlington config (based on what I have around), hence take that image just as a reference.WHY PIDNot only because (if feasible) I could do some design better based on my knowledge (design the regulator R(s) based on the PID theory), but also because I could decide that, maybe, for some applications I'd like to have a simple, 1st order behaviour while for some others I may not care much about some overshoot, and I may prefer a faster response (hence more of a 2nd order behaviour). This may be achieved by using some digital pots in P, I, D or some basic trimmer, btw.THE QUESTIONSFirst of all, I'd like to ask if it is doable to proceed with something like this (even though I'm aware it is not the most usual architecture).Furthermore, this post aims mainly on the plant/process transfer function (aka. G(s), however you want to call it). I made some basic calculations (hoping that they are right), presented in the short PDF attached, and I'd like some feedback about those. My questions are:1- I concluded that I have one zero and one pole. The zero given by the ESR, (located at high frequency I guess), while the pole is given by the load andshould be the dominant one. Is this right, or am I missing something else?2- Since I'm learning more about op-amps in the while, I'm aware that usually those are built with a dominant pole at very low frequency (for the LM324, at about 7 Hz if I remember correctly from the datasheet), but given the model here presented I don't honestly know how to include it (since it's not a *single* op-amp but a PID made by those), hence for now I went with a fixed op-amp impedance. Note that a mistake may lie exactely here, but I have no clue on how to do differently. Is this reasoning valid, given that in closed loop I would hopefully operate the op-amps at a much lower gain level?In case you need some more clarifications, please feel free to ask me.Thank you in advance to anyone who can help me

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2023, 05:32:26 pm
content: The circuit looks more like made for learning, demonstrating the principle, not very practical.From the practical point the emitter follower with a capacitive load a the output may become unstable on it's, even without the OP-amp part. So usually one would want at least a small series resistor (e.g. the shunt for the current limit / measurement.The D part of the regulator is a bit tricky - there is no perfect differentiator and thus no true PID regulator. There is aways some bandwidth limit to the D part - e.g. in the form a resistor in series to C3.So a PID regualtor has an additional 4 th parameter for the BW limit that is often ignored in the simple theory, but it has to be there, as there is no such thing as gain going up with frequency with no limit.There are simpler way to get PID response. E.g. the P and I part can be combined with a single OP-amp with the resistor and capacitor in series in the FB path.The D part is often more like a phase boost for a rather limited frequency range, that can be realized with some RC element in parallel to a resistor.The integrator part of the regulator can provide the dominant pole for a simple regulator. The full PID regulator is normally about going beyond the simple dominant pole compensation. The P and D part add extra phase shifts just before the critical region of the loop, usually to make a faster than the simple 1 pole loop.

author: Verdefluox
author_rank: Contributor
timestamp: March 26, 2023, 09:23:05 am
content: Thank you for the answer. These are things I will surely consider and that I'm already aware of, but they were not the purpose of the question. Again, the scheme was quite general.Let me rephrase that, I tried to set up a simple setup based on LTSpice, hoping that I did it right. If I'm doing wrong something, tell me, since I have not so much experience in AC analysis (ex. I'm not sure if the AC source should have this magnitude: I went with the idea to have it on the entire voltage swing I would allow it in reality, more or less. Sorry if I can't phrase it better).The setup is shown in the first attachment. My point is to understand the relation between the input variable V2 (control variable) and the output voltage.Note: In the AC analysis below I left the zero given by the ESR, but that confirms my calculations so I'm good.Now, the problem is the following: based on my analysis, the pole should depend entirely on the output (hence, pOut = 1/(2*pi*R2*C1, following the sim notation). I tried also to do also using the .step tool two times, for both R2 and C1.As you can see, by changing C by an order of magnitude the pole frequency behaves shifting by one decade,BUTit doesn't happen the same if I change R by the same logic. Why does this happen?My guess is that, the pass device acts as a resistance (which should be, considered how a linear regulator works), so the pole actually depends on both R2 and the "resistance" of the NPN (aka. changing R2 I also change this Rp -resistance of the pass device-). Now, is there a way to model it so that I can insert it into a transfer function (talking about Rp, if that is the missing point)? Because in that case I should redo the model presented in the PDF, and the pass device should be modeled by linear components, but in that case I don't know which model I should follow (I've seen some browsing, but I would like to ask if I'm correct so far or if I'm totally missing the point).

author: Kleinstein
author_rank: Super Contributor
timestamp: March 26, 2023, 09:56:26 am
content: The emitter follower output stage has a rather low output resistance. A first approximation is something like 26 mV/I + base input resistance / hfe.Quite often the load (R2) is not relevant and more like a minor disturbance.A difficulty is that the output resistance changes a lot with the current. To get a better control and also for paralleling multiple BJTs or current limiting there are often resistors at the emitter. The other point is to add a minimum load so that the output resistance does not go too high.

author: jonpaul
author_rank: Super Contributor
timestamp: March 26, 2023, 01:35:29 pm
content: faster to just build it and experiment.perhaps 30 min you will learn a lotPID is not needed for PSU, see all IC and PSU, SMPS, Linear app notes on power supply stability and compensation.j

author: Verdefluox
author_rank: Contributor
timestamp: March 26, 2023, 08:30:50 pm
content: QUICK EDIT: Forgot the ideal diode in the model on the right, but when inserted the situation doesn't change almost at all, hence should be valid anyway.QuoteThis was actually quite useful, lead me to discover the equivalent emitter follower model (or at least, one of the many). Sorry, doing it as a hobby I tend to go random with theory and such, but it wasn't hard to understand (hoping that I did it right).For what can be possible to arrange from zero in a Sunday afternoon, I tried to implement it based on various sources from the internet and to test it in parallel with the standard configuration.I think that from this I should be able to recover a transfer function. It is still not perfect, but when tested under various Rloads it behaves more or less the same. Didn't do the analytical derivation yet, but I think that when recovered the TF, the pole should depend not only on the load (R and C per se) but also on the other parameters BJT on some degree. Actually with 1kOhm load is the best I got in terms of similarity, and still shifts a bit with the other ranges, but maybe both the model isn't perfect/valid in all those ranges, or I am ignoring additional effects (capacitances of some sort?).The other point is to add a minimum load so that the output resistance does not go too high.Yes, thought to put it in the feedback (which I would need to rescale the output anyway). Maybe 10s of kOhm for an upper limit in the load (every "proper" load would go in parallel in the end). Also, considering the purpouse maybe I could try to lower the max current capabilities and focus more on the resolution, but in that case I should evaluate a diff amp made for the purpouse.faster to just build it and experiment.perhaps 30 min you will learn a lotThis is obviously the best solution overall for this project, I was just curious to see if I could go a little bit more theoretical in order to apply better the regulator according to theory. At least I got a model, not sure how much accurate but in the end the idea was to design it considering a worst case scenario.PID is not needed for PSU, see all IC and PSU, SMPS, Linear app notes on power supply stability and compensation.Consider that, as stated before by Kleinstein, this circuit is more of a proof-of-concept. I don't mind if, in general, has a slow response (compared to classical solutions) or such, as long as the PI(D) controller can somehow work based on the theory I'm studying right now. Worth a try anyway for me.Unless someone sees some error in the equivalent scheme, the only doubt that remains is about the gain in dB I got, but at least I obtained some reasonable values for the pole frequency, which was the main point here. Gain changes with the AC generator amplitude, so I'm not completely sure if I should use 1V (to express it as "above 0 dB") or 15V (which I used as I expect the last op-amp to swing in that range - which would be a little less, but you got the idea). Still learning about LTSpice too beyond the classical transitory analysis.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 26, 2023, 08:51:53 pm
content: For a voltage regulator there are 2 main variants. One is with an emitter follower typ output stage with a relatively low output resistance to start with. This type usually does not need a ful PID regualtor, and a PI type rgulator (sometimes even skipping on much of the P part) is usually sufficient.The other type is with a more current controlling output stage, like found in most low drop regulators. These regualtors are actually usually PID type regulators. The only point is that the PID regulation is usually not done with 3 parallel paths, but P and I are combined at 1 OP-amp and the D part is implemented as a phase boost at some stage, e.g. in as an extra capacitor or RC elelemt at the feedback divider.This somewhat limits the parameter range for the D part, but it still covers the relevenat range.Besides the parts in the feedback loop the load capacitance and ESR can be an important factor for the loop.A voltage regulator looks simple and with a fixed load impedance it is also relatively simple. With a variable load impedance, like for a lab supply it can however become tricky. In the normal control therory the problem is than looking for a robust regulator, so a regulator that can work reasonable even when the system to control changes within limits.

author: xavier60
author_rank: Super Contributor
timestamp: March 26, 2023, 09:38:29 pm
content: It's worth mentioning that the Harrison topology that most linear bench PSUs are based on is the current controlling type.https://www.hpmemoryproject.org/an/pdf/an_06-65.pdf