If I'd only had an idea on which values to start Some suggestions have been made here, already and I'll try them out but other than that, I'm completely lost, as someone else has done the compensation the way is currently is...
It's hard to give more than estimates, from a schematic; it's often easier to just do it in person.
The safe approach is typically: use too large of a capacitor (yes, like 100nF is probably "too large" enough), and adjust the resistor to get a stable response that looks good. Then reduce the capacitor until the response looks about as fast as can be. Tweak the resistor up and down and so on until it looks worse in all directions.
The adjustments are quite gross at first, by factors of 2, even 5 or 10. It's rare that one needs to (or even
should) tune this kind of control loop much more precise than, like, +50/-33% or so.
So, easiest way is to tack two wires onto the circuit nodes and stick them in a solderless breadboard, and grab a selection of resistors, 1k, 2.2k, 4.7k, 10k, 22k, 47k, 100k, 220k..., and similarly for capacitors, say 100pF to 100nF. Start with an average value like 10k for the resistor, and large for the capacitor. You're exploring a 2-dimensional solution space, by taking pretty big steps over it; the space should be pretty smooth, varying slowly from step to step, so a wide sampling should still be alright. And by going back and forth between R and C adjustments, you're doing a gradient descent towards the optimal point in that space. (It's so simple, a computer could do it.
)
Can also try with a small C in parallel with the R. This can be helpful when R is especially large. This has the effect of only C in the feedback path (like a pure integrator) at the highest frequencies. This can reduce phase margin near cutoff (bad), but it can also improve noise immunity (by reducing gain). Sometimes a little helps, sometimes not.
Which, you've kinda got already. The---I don't have the schematic open at the moment, I remember seeing one across the volt error amp though? Being directly across, it's just slowing down an already slow integrator, so it seems a bit odd, and maybe a better solution exists -- but maybe it's the best solution after all, and a little testing can prove that out.
Also, you know what I mean by load step testing, right? -- scope the output waveform and see how it moves, transiently, in response to a step change in load. A good step load is to take two resistors, one always wired to the output as base load, the other wired to a MOSFET driven by a modest rate clock generator (say 10Hz to a few kHz, enough to see the transient fully decay). It's simply putting the second resistor in parallel with the first, so the load current is alternating, exercising the controller. With a selection of resistors, and a range of setpoints, you can have the voltage or current, bounce up and down, or alternate between CV and CC modes.
Or the simplest possible realization, don't bother with the clock and switch at all, just touch the extra resistor on by hand, manually. Harder to get a clean scope trigger, but can work in a pinch!
Regarding the awful op-amp: I have heard that several times now :-) This is/was supposed to be a relatively cheap-ass PSU with okay-ish performance, so I chose to go with a cheap op-amp. Easy, cheap alternatives are welcome, as long as the necessary compensation values come with it to get at least the performance I'm having now - cause I for myself would have absolutely no clue where to start when it comes to compensating stuff :-)
Regarding the limiter circuit I have understood the R5 to R8/R9 thing but not how I would put in R10/C11 or how to compensate both (which) paths and what 'FN' means, I'm sorry, absolute cluelessness here
Unfortunately I want to fly a plane without knowing how to open its door...
'FN', I was abbreviating (Frequency Network), should've written that "F.N.".
I forget offhand what some better, but still jellybean, low precision, single-supply op-amps are; among the precision types, OPA4171 comes to mind for example. At lower voltages, I might reach for TLV2374, which... (see level shifters below)
You mean reduced in terms of max. opamp supply voltage? I wanted it to be stabilized and I'm creating it from a 24VAC transformator which also does the voltage for the PSU output, so 27V seemed reasonable. I'm not aware of what wasting 11V ripple peaks means, would a higher supply voltage be better for the circuit and if so, why?
Also I didn't quite manage to wrap my head around the level shifter idea (which seems nice, though). What kind of level shifter, that would have to be some gain/multiplier device which in the end again would have to have 27V or something, no? I mean, at some point I will have to have the 27V or so to get to my 25V output voltage?
24VAC should give around 34V peak, less FWB diode drops say 32V, and, I don't know how much ripple you'll have; 1000uF I think would be enough capacitance for ripple to be around 10%, i.e. 3Vpp.
Hmm, maybe I shouldn't use that phrasing, "less" in this sense can pretty much be substituted with "minus". So, "less ripple peaks" as in, sure the peak supply voltage might be 32V, but we can't operate at 32V all the time, if the ripple is 3V then we need to stay below that or else the regulator can't regulate.
Anyway, with a 27V supply, and the LM324 dropping about 2V when pulling up to +V, and the Darlington emitter follower output dropping about 2V (2 * Vbe), I'm guessing you're getting more like 21V max out. Or 22, 23 because I rounded up most of those drops. But I don't think you're going to get the full 25V range you indicated.
A good choice for level shifter is an NPN common base amplifier. The base voltage can be set from a voltage divider, say 2V quiescent; the emitter is driven by the error amp, through a small series resistor (the amp's output range might be 0 ... 5V, but it really only needs 0 ... 1.4V to work), and the collector goes to the pass transistor base. A current source pulls up on the collector, rated for required base current (a few mA should do). The common base amplifier is noninverting, so you don't have to swap around anything with feedback polarity or anything, and gain is given by the emitter resistance (specifically, it sets transconductance). You may still need compensation, in the form of an R+C network from collector to ground, or collector to base (for which it helps to set base voltage by a resistor divider, instead of say, a few diodes in series, where that wouldn't work so well).
Typical current sources/sinks:
https://sound-au.com/ism.htmOr, if an inverting stage is acceptable, an NPN or PNP common emitter amplifier can be used. This can be wired with a combination bias and negative-feedback resistor from collector to base (and a resistor from base to +V/GND to set bias, and one more from base to error amp output for actual signal drive). Because of the C-B feedback, an emitter resistor may not be needed [to keep it biased stable], and this allows the transistor to saturate very near to +V/GND. The error amp inputs will have to be swapped, but not the compensation networks; and the wired-OR arrangement for the CC/CV I guess needs to be swapped as well (i.e. flip the diode).
There are more complicated arrangements, using a few more transistors, with various advantages, but also with more complexity than I'll have any luck describing in text here...
An alternative might be making D6 into a current mirror of sorts; this may take more voltage headroom than is available here (i.e. IC3B might need -1V or so VEE to make this work), but the basic idea would be to turn D6 into a PNP, with the B-E junction as shown where the diode is currently. Then, collector current is sourced into a near-GND sense resistor, and reflects the current shunted from R6. That sense resistor can be relatively large (some kohms) so that it acts like a comparator, and it could be sensed adequately with an NPN inverter into a digital pin (or keep on sampling it with the ADC, it's just a bit more CPU work that way).
as minimal load, you mean? I'd have to try to wrap my head around that Although I'm quite happy with the current minimal load circuit...
Ah, the C/V operating mode sense circuit that is.
I have attached grounds.png where I marked the ground connection points. There is a "star ground" for AGND/GND in the lower right corner, which buggers of using a wire to the left where the transformers and VREGs are. The 27V AGND supply also has a wire to the left, I wasn't sure about whether I should wire an extra ground there or just rely on the star ground in the lower right corner for that...
P_VSS and the other grounds join on the left where the transformers and VREGS are as well.
Regarding IC8 (DAC) I tried to separate I2C crap from the analog part, but as neither the DAC nor the Atmega (1284p) do have separate AGND/DGND, I tried to manage it like I did, using a ferrite bead and ceramic caps (basically an LC filter of some sort). and putting the ground slot beneath IC8.
The 10 bit ADC of the Atmega doesn't seem to be too bad, it actually does the job quite well for what it is needed here. At least I'm happy with it
But in essence you're saying I should just join all the grounds together and leave it be?
Ah, I had a suspicion that's what those connectors were for.
Yes -- better to wire it all together on the PCB already. You can do a bit of a star ground near the output terminal, perhaps, but for the most part, just cover the bottom with copper, it'll be more robust.
And you can always just let currents flow wherever the hell they do, and use differential sensing to make the measurement properly. Instead of reading a single ADC channel for output voltage, for example, you might read two in quick succession, one for VOUT and one for GNDOUT, and subtract the measurements. The control circuit can do the same, using a differential amplifier, the "REF" side of which gets tied to OUTGND (or a remote sense, if you want to get into that kind of thing). This way, there could be whole volts between grounds, and the signals remain perfectly reasonable because that offset is subtracted out. (I mean, whole
volts wouldn't be very pleasant, it would noticeably eat into the controller's voltage range, or something. But with good grounding and non-catastrophic fault currents across it, yeah, maybe a few mV if that?)
Regarding ESD:
No user-touchable points* on the front panel are connected electrically to any circuitry or conductive part, however I can't of course rule out some really high voltage ESD could get through and zap stuff. Currently I don't have any ESD protection on the HMI other than the fact that the front is basically made out of plastic (*except for the bindig posts of course lol). The whole case is made out of plastic, resulting in a class 2 insulated device.
Ah... that's kind of good, but also not. The catch is: while that solves the matter of direct strikes, the fact is, an ESD event is a small EMP blast that radiates outward from the spark. A typical test is IEC 61000-4-2's coupling planes: a metal plate is simply placed
nearby the EUT, and sparked. The radiation from the ESD gun and plate, couple all sorts of nasties into the nearby circuit -- and since it's largely electric or electromagnetic in nature, it goes right through a plastic case. So you should imagine the effects that an influence of some tens to hundreds of volts, between exposed traces, or even between grounds, might have on your circuit. It's only very brief -- some nanoseconds -- but this is more than enough to upset semiconductors, or even damage them. (Probably not damage at this level, direct hits (8kV+) are much more destructive; but upset, or just plain old interference -- quite possible.)
Will your LCD be hiding behind a clear bezel or something? Those usually (always?) have a metal frame, that might be worth insulating just in case...
Mmm, ground plane...
The issue with this project is, that I have put quite some time into it already and I'd love to get it to an end within reasonable time without having to redo a whole lot of it. It is not that I don't want to learn or don't want to do it right, there's just a whole lot of other stuff to be done and I'd like to get this thing out of my head. At some point I may revisit the Lab PSU topic and maybe even start from scratch, trying to inherently improve things but for now, I'm getting a bit tired of it, if you know what I mean :-)
Yes, the paradox of progress...
Fortunately, you've already done most of the work, and done it right; what's left is mostly pretty easy to fix, like adjusting component values; even if you've already ordered boards, those can be fixed -- just scrape off soldermask and solder on wire/braid/foil patches!
Tim