Electronic – How to implement an analog PI controller using op amps

analogoperational-amplifierpid controller

I'm working on an analogue PI controller as a hobby project and I would like to have some advice on practical implementation and some feedback on the critical points of the circuit. I have 4 questions asked below.

The objective is to design a controller that takes an input voltage (ideally through a potentiometer) as a set_point and should be able to follow the input signal (steps, square waves, triangular and sine waves) within reason, i.e.:

  • A rise time in the step of some 30ms is more than acceptable.
  • Signals should be in the 0-10 Hz range (0 being the step)
  • Overshoot would be interesting to see just for fun, but preferably it should be avoided.
  • Delay is not really an issue
  • Supply voltage should be in the 10V range for the op-amp

The output voltage can then be buffered and used in another part of the circuit.

As a first step, I decided to use an integrator op amp circuit as follows (click here to download the ltspice file)
enter image description here

This circuit seems to satisfy most of my requirements:

  • No overshoot
  • Rise time of about 30ms (pole at 1/(R6C1))
  • Unity gain at low frequencies
  • Follows mentioned signals reasonably well

Using Matlab I simulated the transfer function and double checked the frequency response, poles and closed loop behaviour. Everything looks fine.

However, I'm a bit worried when it comes to implementing the circuit, my questions are the following:

  1. Is the op-amp LT1007 a good choice or is there a better one? What should I look for in a "PID op amp"? I have no experience with other than the LM741 which works horribly in LTspice in my experience, that's why I chose this one for the simulation.
  2. The integrator at low frequencies is basically an inverting amplifier, with gain given by the classical formula. Is it really performing integration of the error? My answer is yes, it still performs integration (the LTspice traces seem to support this) however, for theoretical purposes (read: in class) at low frequency it can be approximated as a simple inverting amplifier.
  3. Is the differential amplifier block good enough for this application or should I be using a different configuration? (For instance, instrumental differential amplifier)
  4. Things seems to go HORRIBLY wrong (output saturate even with very small signals and low closed loop gains) as soon as I add a derivative and/or a proportional block and a summating block. Why is this happening? Matlab seems to disagree in this case, still showing a stable closed loop but with complex roots and therefore overshoot with oscillations, I wonder if this has to do with the op-amp in the sum block, see the example below of such implementation (click here for the ltspice file)
    enter image description here

By the way, the final amplifier with a 2x gain is just for inverting the sign of the PID output.

Thanks

EDIT:
In my short lab experience, derivative block with LM741 seems to be a pain in the *** due to noise from other circuits, so I'm not really thinking of using it, aside from the fact that it is theoretically not needed. But I still wonder what went wrong in the spice simulation and would like to know.

Best Answer

  1. TL072/74 is a good op amp with low offsets in case you want to increase your time constants with high value resistors.

  2. It will integrate on the high side of the cutoff frequency.

  3. If you need high Z or high CMRR then an instrumentation amp will be better but I do not think that is an issue.

  4. you have quite a bit of gain from your Proportional (50) and the last stage (20) plus you have the gain in your integrator too. Have you looked at the step response? I am not sure how to do that with LTSPICE. You can also balance or tune things by incr.decr R12, R13 and R16.

I am playing around with a similar circuit for a temp controller too. THanks for the look.