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.


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.

  • \$\begingroup\$ I bet the derivative amplifier is going unstable. It needs a capacitor in parallel with the feedback resistor such that frequencies amplified do not exceed the OPAMPs bandwidth. \$\endgroup\$
    – Tony
    Jan 2, 2017 at 22:49
  • \$\begingroup\$ The final amplifier appears to have a x20 gain, which could be your problem \$\endgroup\$
    – Matthew
    Jan 2, 2017 at 23:04
  • \$\begingroup\$ @Matthew that's not it. By fixing it (setting it to 2 instead of 20) I get a 20kHz output clipped 28 V pp triangle wave whatever the input (even with a 0.01V step). Even setting very low gains gives this oscillating output. Furthermore if you look the frequency response, at low frequencies, the gain is about -77mdB. \$\endgroup\$
    – mickkk
    Jan 2, 2017 at 23:07
  • \$\begingroup\$ do you mean in parallel with R10? \$\endgroup\$
    – mickkk
    Jan 2, 2017 at 23:12
  • \$\begingroup\$ Yes. Technically you should add 2 poles such that frequency response is decreasing 40db/dec before the opamps bandwidth is reach. But because most opamps are unity gain stable it will probably work fine without it. \$\endgroup\$
    – Tony
    Jan 2, 2017 at 23:22

1 Answer 1

  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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.