Struggling with PID

T

Thread Starter

thucar

I've been making my house smarter for a few years now and one fundamental part of it is controlling the heating. For the past 2 years I've been using a pretty simplistic solution where I would just monitor the Setpoint and turning the heat up/down depending on weather the setpoint has been reached or not (+ some hysteresis)
However since it constantly overshoots or results in warm house but cold radiators, I've decided I need a PID controller to keep things stable.

So I've written up a controller using what seems to be a great set of articles here - http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

and have been trying to tune it while going over this site - http://controlguru.com/

Let me describe my heating system:
It's a radiator based central heating system with solid fuel boiler.
The boiler heats water in a 500l accumulation tank.

The radiators do not have individual thermostats, so they are controlled all as one, via a 3T mixing valve.

The mixing valve takes hot water from the accumulation tank and return water from the radiators and send the result back into the radiators.

I've always treated the system as a two-step thing. I'm not trying to control the valve position directly from the room temperature. Instead I have another controller set up for the 3T valve that is responsible for keeping the radiator temperature at a setpoint value.
And then the room temperature controller adjusts the 3T valve controller setpoint as needed.

And this is where the road bump comes in.
All guides and examples of PID control tuning i've found seem to assume a few things that do not hold true in my case.

First - change in Control Output(CO) is immediate (in my case the valve max travel time is 120sec)

Second - a fixed% in CO corresponds to a fixed Process Value(PV) (in my case the temperature of the mixed water depends on the temperature of the water in the accumulation tank as well as the temperature of the return water from the radiators)

Third - the Sampe Time is constant (in my case it would only be possible if the sample time was set to 120+ seconds as thats the max travel time for the valve. However thats insanely long sample time for a process where major the temperature changes can happen in seconds)

I've tried driving the 3T valve directly with PID controller output values as well as using the PID controller to only "nudge" the valve in the desired direction (currentPos + PID output where PID output is limited to -5 to 5) And I just can't seem to be able to get a working solution.

I'm gonna stop here as this is getting way longer than I planned.

Long story short - does anyone feel like helping a newbie out and giving a few suggestions?
 
Thucar,

you are trying to control a system which is very sluggish as it has a number of elements running after each other. The fact that you are using a two-step control setup definitely helps. But, your controls need to be set to act very slowly, the reason being that (and this you indicated also) you are starting with cold radiators which you need to heat up, which in turn need to heat up the room(s), and in doing so lower the temperature of the accumulator, and then back again to a cold radiator when the room heats up.

First thing I suggest is that with the control in manual, adjust the position of the 3T valve manually (through second controller) to attain a temperature some degrees lower than what you desire in the rooms. Keep it running in this position for quite some time, adjusting slowly as necessary so that you also allow the hot water accumulator and boiler to settle (yes these two are affecting your settings). Repeat the above, setting the 3T valve to give you a room temperature slightly above what you desire in the rooms. In each case measure also the temperature of the water entering the radiator.

The above experiment would give you two open positions on the 3T valve beyond which you do not need to go, i.e. a minimum and a maximum opening. Going below minimum or above maximum will simply make your system oscillate.

Set this minimum and maximum opening setting in your 2nd controller as control output limiters. Set also the temperatures you attained from the experiment as setpoint limiters to the 2nd controller (and also as control output limiters on the 1st controller). Try to put the system in automatic now, but be sure that the controller output (CO) of the 1st stage changes slowly. Use derivative action, such that as soon as the temperature starts rising you lower CO even before you attain desired temperature. The radiator inertia will do the rest. Ensure also that the rate of change of the second CO to 3T valve is slow (but still slightly faster than the 1st).

The above should stabilize your system, but as I said, it is a sluggish system, so do not expect it to adjust fast. And there is no way to improve it from the physical aspect, as the radiators, rooms and hot water accumulator all take a relatively long time to change their temperature.

Finally, if you are starting with an unheated room (e.g. after staying a whole day at work with heating off, and then returning in the evening), still use the above settings. It will take a bit longer to heat up, but then settle better.
 
I know I'm a complete beginner in what comes to process control, but it always seemed a bad idea to me to try to use the 3T valve position as such, for controlling the room temperature.

What if we just forget the whole house heating part and take a look at the water mixing as a stand alone process.

This is a graph from one of my tuning tests:
http://www.upload.ee/image/5363067/PIDgraph.jpg

I had 80C water in the accumulation tank and about 25C water in the radiators.

07:00 -> I set the valve position to 30% and turned on the circulation pump.

07:00 - 07:05 -> The temp fluctuated a bit at the start due to the fact that I had minimum temp cutoff set for the circulation pump and it stopped a few times.

07:27 -> I increased the valve position to 35%

08:40 -> the water temp in the accumulation tank dropped below 55C

As you can see, the inlet temperature is almost always rising. This is due to the nature of the system. the valve is taking a certain amount of water from the tank and is mixing it with the radiator return water. The return water temp will inevitably rise over time and thus, some of the "existing heat" will be added to the inlet temp.

Additionally, the valve position required to achieve a certain Inlet temp depends on how hot the water in the accumulation tank is. It can be anywhere from 20C to 90C.

I'm beginning to wonder if trying to implement a PID controller in this case is the correct approach. Is a PID controller meant for such cases? Is it capable of handing it? Since we're basically dealing with values like "more" and "less" instead of fixed values, maybe I should be looking into a true fuzzy logic instead.
 
The hot/cold water mixing control loop is a classic example of two highly interacting control loops. It is difficult and nearly impossible to tune, even when using two independent PID controllers. You are mixing two streams that have variable temperature and variable flow rates. Whenever you make a flow rate adjustment to one stream, you are making a simultaneous adjustment to the thermal input of that stream as well. Somehow this problem is solved mechanically by every commercial shower mixing valve that always delivers constant flow of a slightly higher than body temperature water even when the nearby toilet is flushed or when the dishwasher or clothes washer starts its rinse cycle.

To solve this digitally requires the addition of two additional decoupling functions to take a portion of the hot water flow and use it as part of the input to the cold water flow control. Also take a portion of the cold water flow and add it to the hot water flow input. You can also use digital computation to develop a heat and material balance feedforward controller measuring both the flow and temperature of both the hot and cold water lines. This is a first principles model reference controller. The problem is simple, but the solution is complex.
 
Thucar,

It seems that your system actually operates in batch mode, or you are trying to operate it in batch mode. From my understanding I thought that once you start taking hot water out of the accumulator, you would have increased the firing of your boiler to compensate and thus reach a steady state. This does not seem to be the case given that your accumulator went from 90C to below 55C. Worse still is the fact that your accumulator can be anywhere between 20C and 90C. As the accumulator temperature falls, you would need more flow out of it (rather than recirculation) to get the required heat input, up to the point when the accumulator temperature is very close to the room temperature, at which point the 3T valve will not circulate any water from radiators buts sends it all to accumulator. PID control will not work in such a situation.

The only way I see to control your setup is use the PID controller to control the outlet water temperature from the 3T valve to 2-3 degrees above room temperature and forget the rest. In such a mode you will see that the valve slowly moves to 0 recirculation (from radiators) as the accumulator cools down, and this will work only until you have usable heat in the accumulator (i.e. accumulator outlet temperature is approx. 6 degrees above the water temperature you set).
 
Top