So I am building a rather simple constant current load to test power supplies. I am using an INA138 for high-side current measurement with only 5V power (and I have reasons for that, unfortunately) and a couple of opamps to control the current through the Q1 mosfet. On the schematic, VCC is 5V power, CURSENSE is the voltage proportional to the current passing through the R1 resistor and Q1 mosfet and CONTROL is some voltage setting the constant current (e.g. DAC output or well-filtered PWM straight from a uC). The power input is on the left.
At first, I tried to simply put an opamp in a comparator mode. The schematic started oscillating and crashing in the simulation. Then I tried to lower the error amplifier gain to 100 V/V (second schematic). This schematic kinda works in the simulation, however, that raised a number of questions in my head.
- Since I've essentially created an analog PID controller with only proportional coefficient in the second schematic - do I need to implement a full-scale analog PID controller (like the one in this question) with an integrator and differentiator or will the second schematic be sufficient?
- When exactly (excluding cases with mechanical systems and such) do I need to implement a PID controller or lower the error amplification gain? For example, a simple opamp voltage follower is also essentially a controller that tries to set it's output voltage equal to the input one and somehow it is fine without PID or gain reducement.
- If I only need to lower the gain - how should it be selected?
- What could be the requirements for the error amplifier opamp?