Pages: [1]   Go Down
Author Topic: What to expect from a PID controller?  (Read 199 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a simple hot air Popcorn popper that I plan to use as a coffee roasting apparatus.

The popper consists of a fan propelled by a DC motor put below a heater wire. The produced hot air is channeled through some vents into a cylinder:

Code:
      |     |
      |     |
     _|     |_
    | :_____: <--- Vents
     \ %%%%% /  <- Heater wire
      |vvvvv|   <- Fan

The heater and the wire are connected so that it was only possible to turn the system on or off as a whole. 
To gain the needed control I already split the circuit. The heater wire is now controlled via a SSR connected to an Arduino. The fan is powered separately and is always on. 
I put a Type K thermocouple in one of the vents to measure the temperature that is entering the cylinder.

I already have a working Arduino sketch that heats the "roasting chamber" according to a time based temperature profile. The PID library is used to control the relay as in the PID_RelayOutput.ino example.

Basically everything works.

The thing I'm having trouble with is tuning the PID parameters. I've already spent several hours tuning. I even tried the Arduino PID Autotune Library.
I get a somewhat stable system. But no matter what I try, I can't get rid of temperature deviations of ~ 5° C to ~ 10° C.

Here's what I tried so far:


Now I'm wondering: What can I expect from a PID controller in the above use case? How accurate will I be able to set the temperature? Am I not tuning correctly or does it just not get any better?

For reference, here are plots of two of the more accurate test runs:



Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 48
Posts: 3419
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks like the issue is windowsize, not your PID parameters, try reducing it. On the cooling side though, unless you can find a way to run the fan by itself, it doesn't look as though the system will be able to follow the setpoint, at least in your first graph.
Logged

Southeast US
Offline Offline
God Member
*****
Karma: 9
Posts: 583
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, the awkward thing with using PID loops in temperature based systems is that it is expected to be a relatively linear system.  However, heating is usually not a linear process, mainly as the time it takes to cool stuff down is not the same as the time it takes to heat it back up.  This means that the value to increase the temperature 5 degrees does not have the same magnitude as one to decrease it 5 degrees from the same value.  Basically, without a way to actively cool it in a relatively similar way than you actively heat it, you'll end up with all kinds of problems.  Especially if you are trying for a temperature profile and not just a particular temperature.

Long story short: PID loops don't work well for temperature controls without some form of active cooling.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11173
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Long story short: PID loops don't work well for temperature controls without some form of active cooling.

You can accommodate the non-linear or asymmetric nature of the system by applying a transform between the (linear) PID and the actual system. For example, if the system has much more authority heating than cooling, you can scale the output differently depending whether it is heating or cooling.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: