Electrical – When to use analog PID

analogconstant-currentoperational-amplifierpid controller

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.

  1. 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?
  2. 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.
  3. If I only need to lower the gain – how should it be selected?
  4. What could be the requirements for the error amplifier opamp?

enter image description here
enter image description here

Best Answer

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?

If you don't need to adjust the I or D component, then don't include them. Many controllers are only PI controllers. The question is, "what do you need to be adjustable?", and "what controller is suitable for the final design?". No two components are created equal, if component tolerances affect the operation of the controller (which they almost always do) then you'll most likely need to adjust the gain. If the pole is changing with component tolerances then it might be wise to include I to compensate for changes in frequency.

The best thing to do would be to include the full PID controller for testing, and then reduce it to a bare minimum for production.

If I only need to lower the gain - how should it be selected?

Either by trial and error, preferably with a variable resistor or by actually calculating what the gain should be with a controller/plant model and by using control theory.

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.

The feedback path of a simple voltage follower has a gain of 1, and the plant has a gain of 1 which makes it a stable system. The problem with control systems is they go unstable when the phase on any given frequency reaches -180, then you get positive feedback.