I was previously doing these posts as part of Jan Cumps' WIP Programmable Electronic Load blog, but that's now so extensive it's getting quite cumbersome to work with and, since this is all of fairly general interest, I thought I'd carry on with separate blogs rather than pile everything into the one container. This way it will be possible to have comments with each piece, rather than them getting tangled up in the way they do with a very long blog, and it will keep them from confusing all the work in progress stuff.
There are several more things I want to investigate with the circuit for Jan and Peter's load and they all relate to its dynamic behaviour. I'm doing this with a simulator (TINA-TI), so it's also an investigation of how useful, or otherwise, simulation is in this kind of context. So far it's proving to be very useful, giving me a 'feel' for what's going on that I never had looking at equations on a whiteboard.
I want to try and understand how the system works as a servo system (it has differential and (sort-of) integral terms as well as the gain to give a proportional term, so it's more than just a regulator (technically, regulator means a system with only the difference error term, though the word is often used more loosely than that). I don't have a background in control system theory, so this is a learning exercise generally, as well as being an examination of the specifics of this particular circuit. I'm curious as to how this differs, if it does, from compensation of feedback loops, and what the advantages of treating it as a control system are. I also want to look at what effect the output load has on the performance and how that affects the stability of the whole system. Furthermore, I wanted to look at the effect of the large intrinsic capacitances of the power MOSFETs that we might use, how sensitive the loop is to substitutions of different parts, and what the advantage of using the power MOSFET is compared to a BJT [Bipolar Junction Transistor] solution. The aim here is to understand it well enough to at least be able to 'tune' the servo loop and also be fairly confident of the stability when built as a physical circuit.
One of the things I'll be doing here is shuffling my way towards a specification (what I want the spec to be, that is) for the instrument. I don't know what Jan and Peter's specs are - I suspect they are both different: Jan seems to want accuracy at low speed, with some ac performaance, Peter seems to be interested in power stuff and high currents. My starting point is that I'm interested in good ac performance but at modest currents and with low inductance loads (testing dc-dc converters where the load is going to be capacitative and the wire inductance can be controlled by the operator being sensible). I have a hunch that we're not going to please all three of us with exactly the same circuit, but we'll see. (One idea that I've had in the back of my mind is letting the microcontroller adjust the compensation. That way, the dynamic performance could be tailored, either on-the-fly or as a one-off. Whether that would actually be feasible, I don't know.)
I thought, initially, that I would be able to treat the different aspects of this quite separately, but unfortunately they tend to interact and it's difficult to know how to structure this and where to start. After playing for a while with the simulator, it because evident that a) with the original circuit values, the servo desperately needed 'tuning' [the output waveform, following a square wave input, is quite poor as it stands] and b) inductance on the output had an effect on the stability, taking it from the sort of stability margins that looked like a textbook example, and as solid as the proverbial rock, through to something that would easily ring.
A quick recap of the circuit and how it operates. Here is Peter's programmable load circuit.
It's the same as he set out in the WIP blog except that:
a) I've substituted OPA192 op-amps for the TLE2144. That's because they have much lower input bias currents, which we need in order to get a reasonable dc accuracy to the output current;
b) Peter has identified some 'linear' MOSFETs that he'd like to use and I've put the model of one of them into the circuit;
c) I've removed the zener that limited the gate voltage to 6V because the new MOSFET isn't a 'logic level' device with a low threshold voltage and the gate voltage will need to operate up at 6 or 7 volts with what we're doing here.
One obvious question here is what is a linear MOSFET? All MOSFETs have a linear region, so we're not talking about a different kind of device, instead it appears to mean two things, firstly that the device is properly characterised by the manufacturer for operation in that region, where power dissipation is going to be very high and we need to be sure that the device will survive (when used as a switch this is much less of a concern as dissipation is comparatively low in both the on and off states and only high for the short transition between the two), and secondly the manufacturer has made some attempt to linearise the transfer function by shaping the geometry of the gate and channel (the device physics tends to lead to something like a square law with a simple, regular channel). I hope I've got that right - say if you think I'm wrong - I'm not a power electronics specialist.
Circuit operation is fairly simple. The programmable load controls the output current using a power MOSFET as a pass element. The MOSFET is controlled by the voltage at its gate - raising the voltage increases the output current, lowering it decreases the current. A complication to bear in mind, as it has consequences for the dynamic performance and stability, is that a power MOSFET able to handle these kind of currents has a considerable amount of intrinsic capacitance. That's because a power MOSFET is made up of multiple MOSFETs in parallel on a chip and parallel capacitances add. In particular, the gate capacitance present (we're talking nanofarads here, not the tens of picofarads you'd see with a small-signal MOSFET) means that we can't instantly change the gate voltage, instead we supply a current and wait for it to charge or discharge. You'll notice therefore that the device starts to look very different at ac to the dc situation where it has an extremely high input resistance and seems to be purely voltage operated. The gate capacitance is further complicated because it changes as the device turns on (because of charge flowing along the channel) so we can't model it as a simple capacitor. The current in the output circuit that flows through the MOSFET also has to flow through the current sense resistor, so the voltage across that resistor will be in proportion to the current. That's amplified by U2 acting as a differential amplifier. The output of U2 moves negative as the current increases. That voltage is applied to one end of the R5/R9 pair of resistors, with the other end being driven by the input voltage. The centre point is compared with zero volts by U1. The output of U1 then drives the MOSFET. U1 will act in such a way that the loop will come to rest when the output of U2 is the negative of the input voltage, and because that voltage is proportional to the current, the output current should follow the input voltage.
Here is the output current waveform when the circuit input is driven by a 200Hz 2V squarewave.
You can see that even at that frequency, the output is far from ideal. The current steps part of the way, pauses, and then completes the rest of the transition in something that looks exponential. You can easily see from that that we only need to raise the frequency to around 500Hz and we won't even manage the full scale swing on the output. I'll be seeing if I can improve on that in the next post.