0
\$\begingroup\$

I'm making a temperature-controlled box. Issue I'm having is that it overshoots and undershoots a lot because it takes a long time between turning the heater on/off and seeing a difference in temperature in the box. I have a SHT30 sensor with 0.1°C accuracy measuring the ambient temperature.

enter image description here

I've reached the conclusion that I need feedforward control, so I've calibrated a NTC thermistor and put it on the heater. The temperature of the heater is my feedforward signal.

...now what?

I checked online and with ChatGPT how one would go about this, but I see nothing useful.

Basically, at 50°C, the box is just below its max temperature, and I want the feedforward to contribute very little to decreasing the PID output. At 30°C, the box is close to room temperature, and I want the feedforward to contribute more to decreasing the PID output. At 30°C setpoint, there are oscillations of +/-2.5°C. Closer to 50°C, these oscillations are less than 1°C, which is fine. My goal is to have all oscillations for any setpoint temperature to be less than 1°C.

The peaks of the overshoots and undershoots are maybe 5 minutes apart. It's only a 20W resistive heater (with a fan) for a 10L insulated box, so changes to both heater and air temperature are very slow.

(The reason why I'm not considering changing my PI tuning is because it has the correct idea of putting output to max right away. It takes ages to heat up the box as is, so I really don't like the idea of having very small PI values.)

\$\endgroup\$
6
  • 2
    \$\begingroup\$ you don't want to change the PI tuning, but what about D? It should well be possible to get rid of overshoots while still having minimum settling time with a well-tuned PID controller. I guess you're using a software PID on some kind of microcontroller? \$\endgroup\$
    – Sim Son
    Commented Sep 14, 2023 at 16:00
  • \$\begingroup\$ Had this issue when trying to heat a large oven. Problem was, PID controller wouldn't accept a value large enough - little thing was never intended to control something with a 5-minute propagation time. Replacing the PID controller (using very different PID values) was the answer. \$\endgroup\$
    – rdtsc
    Commented Sep 14, 2023 at 16:21
  • 1
    \$\begingroup\$ Embrace the D \$\endgroup\$
    – Aaron
    Commented Sep 14, 2023 at 17:07
  • \$\begingroup\$ Your controller is probably saturating, so using an anti-integral-wind-up scheme might also help reduce the overshoot. \$\endgroup\$
    – fibonatic
    Commented Sep 14, 2023 at 22:05
  • \$\begingroup\$ But if you want to do feedforward control you need to have a model of your system. Probably first order plus dead time might be sufficient. Feedforward control essentially uses the inverse of this model, so your setpoint needs to be sufficiently smooth, or in case of the delay you need to know what the setpoint will be in the near future. \$\endgroup\$
    – fibonatic
    Commented Sep 14, 2023 at 22:08

2 Answers 2

3
\$\begingroup\$

The best way to do temp control (I've done temp control for 10 years and been able to do controllers/systems that do microdegrees) is to use a PID. There also needs to be a decent mechanical/thermal setup.

For adequate thermal control there needs to be enough control authority in the heater to change the temperature and hold it. One way you can find this out is run the heater at full power (if it won't damage anything) and see what the end temp is compared with ambient. If the heater can't warm the box up more than a few degrees then you will need more insulation, it would be good to have a heater that could warm 30C or more above ambient. Insulation is always a good idea to keep room temp swings (which can be 2 to 10C) out of the box, the more the better.

The sensor (NTC in this case) also needs to be located close to the heater but not so close that it causes instability. A fan may also be needed to be able to avoid convection from the heater and keep the entire box temp homogeneous (there will be globs of hot air in a still air environment that will come off the heater and cause issues for temp control). A good way to do this would be to use a heatsink on the heater with a fan on it and place the NTC anywhere from a 1/2" to an inch away from the fan toward the edges.

The accuracy of the setpoint will be determined by the NTC, you will need an sensor system that is not noisy and not thermally noisy, most NTC sensors and electronics should be able to maintain 1C.

\$\endgroup\$
1
\$\begingroup\$

If you need to control temperature in the box, then sense temperature in the box, not on the heater. Then PID can solve your problem, but you have to find adequate P,I,D parameters (in your case D solves "delays" or "thermal mass" problems). If you can sense only temperature of heater and outside box (and not enviroment inside box), then you can measure thermal parameters of your box (box-ambient thermal resistance eventualy heater-box resistance and heater and box thermal mass) and calculate temperature in box by model.

\$\endgroup\$

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.