NB: During typing all this I inadvertently POSTED the darned thing before I was done. I hope the 'remove' button works correctly, as I'm doing it all again.
Hi Thor-Arne,
Firstly, it's important to inform you that almost ANYONE in this forum has a lot more knowledge / skill / experience than ME, so I suggest you verify EVERYTHING that I type for yourself. (OK, that's my 'legal disclaimer' out of the way... LOL)
I just loaded up your LTSpice. I quickly noticed how you've added an RC network and discharge to the voltage ref input with R23, C5 and D6.
(Intriguingly, I've done something pretty similar albeit perhaps for other reasons than you?. I might cover that in some other post).
In your case, the chosen RC time constant is a lot larger than what I'd played with, but that's not hugely significant.
You've mentioned you're experiencing 'issues' with current limiting if you attempt to set a fairly low current limit. I came to the same conclusion and that's why I started 'playing' with LTSpice in the first place... Let's use your LTSpice '.asy' as our reference circuit.
In the circuit, you're feeding in 15mV as your Current_Ref (and thus you're 'expecting' current to be limited to 15mA). Your Voltage_Ref input is 10V so you've set the desired CV output to 10V. You've placed a 1ma load (I1) on the output, and, as it is, the circuit happily tries to push 10v @ 1ma through your output load. However.... There's still some 'gotchas' in there. And here's my 'findings' in no specific order.
1: With your simulation set to run for 100mS (.tran 100ms startup), the voltage reference input to U1 is not quite 10V yet. (C5 is still charging up a tiny last bit). Instead of the expected 10V reference, you've effectively got a 9.9981157V reference after 100mS). I'm first to admit this is 'bugger all', but I still thought I should mention it. After initially adding a similar RC circuit on my version, I ripped it out again on future simulation runs to avoid adding in 'creeping errors'. (It's quite probable that the RC circuit WILL be in my final design as a 'poor mans DAC', but I wanted to eliminate it in the design stage so I can aim for accuracy in the rest of the circuit).
2: Take a look at R24 (1k). This resistor places a permanent 'load' on the output. The current flowing through this 'load' is directly proportional to the output voltage. (Basic Ohms law). Since you're simulation is aiming at a 10V output, this 1k load is effectively drawing 10mA from the supply. That's not a huge problem other than one small detail. This 10mA load is ALSO flowing through the 'current sense' resistor (R22). You have also added the fixed 1mA load on the output (I1). Therefore, between R24 and I1 we're drawing 11mA through our 'load sense' resistor. That's gonna hurt accuracy in a HUGE way at low currents! Luckily, there's quite a simple 'cure'. Simply place the load sense resistor (R22) AFTER R24 in the circuit.
EDIT: I just looked closer and noticed that the original preload resistor is still present at the right place - R21! Why is R24 there at all in your circuit?
Also, it's important to realise that your R23 will inevitably form 1 leg of a resistive voltage divider with any other 'load'. In your case, this would be through D6 and the output load (R24 + I1). In order to minimise these errors, I'd use a MUCH smaller value for R23! I'm guessing that your reason for including D6 is to speed up the discharge of C5 when you decrease the 'set' voltage. Without D6 in circuit, C5 can only 'discharge' through the near infinite input impedance of U1 (truly negligible), or through R23. I'd seriously consider dropping D6 altogether and lowering both R23 and C5.
For the rest of this post, I'm going to remove R23, C5 and D6 entirely and feed the voltage reference directly into U1 non inverting input. (Just trust me on this one for now).
3: Several posts back, I mentioned the need to replace a 1N4148 diode with a Schottky. In your simulation, D2 is still the original 1N4148! This REALLY needs to be swapped to a Schottky! Change it to something like a BAT54 in LTSpice. You'll be amazed! (I think I ended up throwing in a 1N5819).
PLEASE make this change too as I'm using this 'mod' as an assumption in the rest of this post.
4: In my case, I wanted to drag out more AMPS than the original design intended. However, the higher the output current, the higher the effective voltage drop across the 1 ohm current sense resistor (R22) and this equates to more 'losses' within the regulator. Therefore, I dropped R22 from 1 ohm to 0.1 ohm but in doing this, I had effectively decreased my current set resolution. Previously, using Current_Ref=1V would set a 1A current limit, but lowering R22 to 0.1 ohm meant that a 1V input would now set a 10A current limit. That would have made things rather 'difficult' if I ever wanted to attempt setting current limit to mere mA! But wait... We already have U3 in there as a current sense anplifier set to unity gain in the circuit. By simply replacing R17 and R19 with 10k resistors, we can bump up the gain from 1 to 10 thereby restoring our 1V = 1A reference. (After a LOT of simulation runs, I came to the conclusion that 10005 ohm is the 'ideal' value for these two resistors. This is within 0.05% of 10k, so I'm not going to be TOO anal about it. I think the additional 5 ohms would simply help to overcome the input offset voltage of U3).
5: I see in your simulation, you've set the current reference to 15mV (and therefore, an intended current limit of 15mA). If you look at the current going through the sense resistor (R22), you'll see that it's below this threshold, and therefore, the regulator is in 'constant voltage mode'. However, if I change the Current_Ref input down to 5mv (i.e. 5mA current limit), things become a little messy. The voltage across the 1 ohm sense resistor (R22) only reaches 1.5863mV instead of our expected 5mV! Weird huh? However, the OUTPUT of the U3 current sense amplifier manages to reach 6.2709mv!!! "Houston, we have a problem!". If we feed X volts into a 'unity gain' amplifier, we _EXPECT_ to get X volts out of it right? Well, kinda... U3 is NOT 'ideal'. It's got an input impedance, an output impedance, an input offset voltage and an input offset current. All such things conspire against us, and they really become 'visible' once we start reaching the limits of our chosen devices. Soooo... What can we do about this 'issue'? In this case, neither the input / output impedance of the op-amp nor the input offset current (which is a few nano amps) define the limit we've hit. It's almost exclusively the input offset voltage causing us grief!. Since it's always been my intention to 'program' my supply with a microcontroller as opposed to simple pots, it's not difficult to 'calibrate out' such discrepancies. As far as I know, the input offset voltage of an op amp is fairly consistent across the entire input range (perhaps not so much when it's close to either output rail though... LOL). In your circuit, 1.58632mA through the current sense resistor is creating a U3 output of 6.27168mV when we EXPECTED it to produce 1.58632mV! If we simply feed in those few extra mV into the current reference amplifier (U2), we can 'null out' the discrepancy. If we then take a look at the opposite end of the scale (i.e. at the higher output current limits), we find that a similar absolute 'offset' in our Current_Ref input brings improved accuracy. In my design, I've increased the gain of the current sense amplifier from 1 to 10 (along with making the current sense resistor 1/10 the value) and I think this causes a corresponding gain of the input offset voltage.error on the U3 output. The corresponding microcontroller 'calibration' of the Current_Ref input dramatically improves the accuracy at low current limits. IIRC, I needed somewhere around 19mV of Current_Ref 'bias' to be added by the microcontroller).
6: There's a few components in the original design that have me mildly perplexed.
6a: D1 is an LED and as far as I know, an LED needs a few volts before it begins to emit (circa 2.1V for a normal red LED). Given the load of base-emitter junction of Q9 in conjunction with 68 ohm R10, I cannot see how this would EVER illuminate. Why bother having it there at all?
6b: I'm sure there's a reason for R30 (470ohm) and R11 (4k7), but I cannot determine it. I don't have them on my design and it seems to be reasonable in LTSpice.
6c: I note that you're using a 1N5822 for D3. I moved this diode to the OTHER side of the current sense resistor, and used a MBR20100CT instead. (The 'other' diode in the pack serves to 'protect' the supply from a 'car-battery-in-reverse' connected to the output. The voltage sense pickup is, of course, placed AFTER the diode to keep it accurate. (I really should throw an output fuse in there too... LOL)
6d: Perhaps the most significant change I made was to move away from an LDO regulator design to a STANDARD regulator (NPN as the series pass transistor - a darlington pair to be accurate). Something like a TIP142 or MJ11032 (I think that's the correct parts?) were installed instead of R9, R10, Q9 and Q8). The MJ11032 in a TO3 is 'rated' for 300W Pd (which is WAY more than I'd ever need). The downside of a standard regulator is an increased 'dropout' voltage. Instead of Vce(sat) of the PNP series pass transistor in the LDO design, it increases be 2 * Vbe volt drops to become 2*Vbe+Vce(sat). This is NOT a concern for me as I'm not running it from batteries!
6e: The next issue faced on ANY linear supply is that the series pass transistor must 'dissipate' quite a lot of power. With an input voltage of V(in), an output voltage of V(out) at a current of I(out), our series pass transistor is forced to dissipate (V(in)-V(out))*I(out) as heat. It's quite common on lab supplies to use several transformer output taps to keep this heat dissipation within the SOA of the transistor. In my design, the source voltage comes from a modified SMPS PC PSU and the microcontroller can instruct the PSU to supply a nominated voltage as input. Therefore, this will keep the dissipation to a minimum and thus my heatsinking requirements.
I cannot think of much more at the moment. When I get back to working on my version, I'll post up the specifics here. (I have a different 'project' that has 'jumped the project queue'. I want to go and melt some plastic! (i.e. A 3d printer).