The requirements

I want to control PWM fans to maintain some HDDs in a server at about 35°C, the absolute value isn't critical, however I want the temperature to be stable regardless of the ambiant temperature (within reasonable limits of course, if the ambiant temperature is 40 °C then obviously it can't work).

I already designed a controller based on a LM35 (which will be attached to the case of one of the drives) but it was proportional only. Then I modified it to add an integral term to avoid any steady-state error (mainly due to the ambiant temperature changes).

The circuit

You can find the circuit diagram here.

U1:A is the error amplifier
U1:B is the triangle wave generator (I know it'll not generate a perfect triangle signal, it's ok for me)
U1:C is the final comparator who generate the PWM signal (not connected because it doesn't matter for now)
U1:D is the PI filter

The problems

1) I don't know how to chose the values for R9, R10 and C3 (they're just placeholder for now) because all I can find on PI(D) controllers is for software controllers (and, no, I don't want to use an arduino or any other MCU).

2) I don't know how I can control the Kp and Ki parameters independently and what their values should be for this application.

3) I'm not sure of the components arrangement around U1:D.

NB: The drives have a huge thermal inertia so I guess the loop will probably be very stable without too much tuning, but if someone can confirm it would be great. Minimizing system settling time isn't a concern at all here.

Thanks to anyone who can help :)

  • \$\begingroup\$ Tuning a regulator loop is not a simple task whether analog or digital. For typical independent PID controllers, you have separate generators for each term, in your diagram, that would be a separate op-amp for each term, summed together finally. Then you use pots to tune it. There isn't any realistic way of calculating the requirements for each term ahead of time. \$\endgroup\$
    – R Drast
    Commented Oct 30, 2015 at 11:02
  • \$\begingroup\$ I know it's possible to aggregate all the terms on one op-amp. I did found a very good web page or video (can't remember) a while ago (didn't bookmarked it because I didn't needed it at the time...) but I can't find it anymore. Each term was very well explained and in the end the guy explained how you can use only one op-amp to do the same job. I know I'll need to use pots for Kp and Ki but I don't know where to put them exactly. Thanks ;) \$\endgroup\$
    – Biduleohm
    Commented Oct 30, 2015 at 15:55
  • \$\begingroup\$ You put the pots where they adjust something. The time constant of the integrator, the gain of the proportional error, and the rate of the derivative term. \$\endgroup\$
    – R Drast
    Commented Oct 30, 2015 at 17:02
  • \$\begingroup\$ So I need to replace R9 and R10 with pots if I understand correctly. \$\endgroup\$
    – Biduleohm
    Commented Oct 30, 2015 at 18:01
  • \$\begingroup\$ C3 is an electro .Double check the volts across it .It could get reverse polarity the way I see it .If in doubt use two electros back to back with reverse diodes across them . \$\endgroup\$
    – Autistic
    Commented Nov 4, 2015 at 10:41

1 Answer 1


In your case I would just play with the settings until I got a decent control response.

In general, the proportional term allows for an instantaneous response to any disturbance in the controlled variable. The integral term, slower, takes care of zeroing steady-state error.

If settling time isn't a concern (and I would also believe that your system's dynamics are relatively simple), you could start by using only the integral term, starting from a low setting for Ki. This would be sufficient for eventually controlling the temperature.

Then you could start experimentally raising the Ki and adding some Kp to quicken the response.

Regarding the component values, I don't recall it for the moment but I would suggest checking analog implementations of PI controllers using opamps. It's a very common application.


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.