Confusion regarding pid controller?

I want to implement a PID-based temperature control system using an Arduino. I plan to use a fan for cooling (decreasing temperature) and a lamp/heater for heating (increasing temperature). I am confused about how the process flow should be.

The fan and heater should simultaneously run together (not at full values but some partial values).

or

Fan and heater should not simultaneously run together.

For example, if our setpoint temperature is 25°C and current temperature is 23°C, apparently in this case only the heater should be on since we need a temperature rise, but what if the fan is also running at slow speed?

Another example: if our setpoint temperature is 25°C and current temperature is 27°C, apparently in this case only the fan should be on since we need a temperature decrease, but what if the heater/lamp is also running at slow intensity?

In my understanding, if the fan and the heater should not simultaneously run together, it will be purely on/off control, and that can't be termed/labelled as PID.

and if the fan and the heater should simultaneously run together (at intermediate values: between minimum 0% and maximum 100%) that case will be PID control and it can be done through PWM pins available on arduino

Why run the cooler, if you need a heating?
By doing this, you are simply wasting more energy on heating.

I think what you want to do is always calculate your PID control word but alternately set the device that is enabled.

If you are above set temperature, enable the fan. If you are below set temperature, enable the heater instead. In both cases output the control word (PWM), but you're just directing which device it goes to.

In this case OP doesn't need the PID, he only require the ON/OFF control, probably with hysteresis

Not true. You can translate Output to actions such that the two are not on at the same time. For example if you set the Output range to -255..+255 you can use:

  if (Output < 0) {
    analogWrite(HeaterPin, 0);
    analogWrite(FanPin, -Output);
  } else {
    analogWrite(HeaterPin, Output);
    analogWrite(FanPin, 0);
  }

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.