Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

PID autotune

Status
Not open for further replies.

FrankWz

Computer
Nov 5, 2009
5
0
0
DE
Is there a PID expert here?

I need help on how to implement a PID autotune function for a heating application (small boiler).

My current PID autotune function produces no reliable results. I use the relay feedback method (Åstrom and Hägglund) but it seems that the ultimate period Tu - one of the paramteres determined with the relay feedback test - is directly correlated to the relay output step u. u is an arbitrary value which makes Tu an arbitary value. Since Tu is required to compute Ti and Td (e.g. Ti = 0.5 Tu = Ziegler-Nichols), autotune is not possible.

I believe this is because the machine heats very quickly (1500W boiler) and cools down very slowly, so the process value isn't a sinusoid. An example is attached, green line is setpoint, red plot is process value and the grey vertical bars represent heat output u.

Regardless of u, the temperature always dips the same, small amount below setpoint - because the machine cools slowly, the temperature can not fall far below setpoint before it's reacting to the heat. It then shoots up by an amount that is proportional to u. As a result, the plot resembles mountains above setpoint, not a sinus. If u is large, temperature will shoot high above the setpoint and take very long to cool down. Big mountains, so Tu gets large: Tu ~ u = my problem.

Since all PID temperature congtrollers have Autotune, there must be a solution for this problem. Any ideas?
 
Replies continue below

Recommended for you

Expert? Nope. On the other hand I've fought with more than a couple of loop controllers where the auto-tune has produced unreliable or unrepeatable results and my conclusion is that some processes just don't auto-tune. You have to do it the old-fashioned way. Long transport delays are normally awkward to tune out using auto-tune. Processes with peculiar response times also tend to confuse the auto-tune. It's just an algorithm written in the code, and if the process has characteristics which the algorithm wasn't written to deal with then it produces poor results.


----------------------------------
image.php

If we learn from our mistakes I'm getting a great education!
 
Absolutely as Scotty sez. There are 2 or 3 autotune methods. None of them work for all applications. None of them work really well at all.

I would have to say out of about 40 auto-tune attempts I have had good-enough tunes about 5 times.

Just give it a try yourself.


BTW why not reduce the heater power? It's obviously too much heat for the job. Hook up a Variac between the power and the heater. Mess with it until you have the PID calling for heat 50% of the periods.

Alternatively run your heater only with the Variac and when some knob setting gets you steady state at your desired setpoint you can measure the voltage and the RMS current and see what size heater you should actually be using.





Keith Cress
kcress -
 
Gas or electric heat? If SSR or SCR, can be set to a shorter cycle time. If gas, on/off actuator or position actuator? Slow actuator response = sluggish response. Is your sensor fast? If it isn't bottomed out in the thermowell, could be sluggish response. If the sensor is located near the heat source, it may see the rapid rise but be out of sync with the true temp in the boiler. Might need two sensors, tied together, to work off of the average temperature.
 
> If the sensor is located near the heat source, it may see the rapid rise but be out of sync with the true temp in the boiler

The sensor is mounted on the outside of a thick die-cast aluminium boiler (walls > 10mm) with small internal volume (200ml). Two strong heating elements are on the outside of it. Essentially the whole boiler is a heating element. It's not possible to measure the temperature of the water in it directly, so I settle for controlling the temperature of the boiler walls. The sensors is fairly close to a heating element and aluminium is a good heat conductor, so as you say the PID sees rapid rises and slow declines (the original thermostat, which was replaced by the PID, was slightly closer to the heating element). Cycle time is 1s, electric heat, solid state relay.
 
"It's not possible to measure the temperature of the water in it directly..."

Why not? It is routinely done at temperatures and pressures far greater than an aluminium box with 10mm walls could ever hope to contain. If your process measurement doesn't represent the process conditions then your controller is never going to perform welll.


----------------------------------
image.php

If we learn from our mistakes I'm getting a great education!
 
> Why not?

No technical reason - I just do not expect that users of the PID controller are willing to drill holes into the boilers of their coffee machine for which it is an add-on.

Btw, the 'abysmal' design is a Gaggia Classic's boiler ( It's a pretty common machine, has been on the market for decades, so Autotune should work with it.
 
A coffee machine! [LOL] I guess the designers don't need very tight control of their 'process' for it to work acceptably well.

In the power industry where steam at over 100 Bar and nearly 600 Celcius is commonplace we used to avoid strap-on thermocouples like they were ridden with plague. It costs a lot of money to install a thermowell into a high alloy steel pipe and get it tested and certified but we do it because pipe surface temperature measurements give lousy control. What you're doing isn't far removed from that situation. But point taken, I agree that most coffee machine users won't want to take a drill to their machine. [smile]

I think you're going to have to do the tuning by hand. On the positive side, once you have good settings they should be fairly interchangeable for all machines of that model because of the mass-produced nature of the equipment.


----------------------------------
image.php

If we learn from our mistakes I'm getting a great education!
 
> A coffee machine! LOL

Err, no, a third generation pressurized beverage supply system with hybrid electrical-mechanical brew control which allows significant gains to be made in extraction of coffee diterpenes and coffee oil from coffee grounds.
 
Hilarious, this one almost belongs in the pub. I admit that the tiny volume of water was the giveaway, but still.

Obviously what is being proposed has been done to death in the coffee world, but not many have looked at the requirements from a control systems perspective.

Is part of the difficulty in terms of the heating element position compared to other coffee makers? I'm aware that the Rancilio Silvia is a popular unit to fit a PID controller to, but I cannot comment on how effective it is, or whether the average coffee drinker notices the difference in operation.

Can you get a replacement boiler as a spare part, and consider what can be fitted that way?

I think, though, that ScottyUk alluded to the truth behind the situation, for the most part most coffee makers don't notice the temperature sensitivity in the process.
 
Err, no, a third generation pressurized beverage supply system with hybrid electrical-mechanical brew control which allows significant gains to be made in extraction of coffee diterpenes and coffee oil from coffee grounds.

Hahahahaha, just imagine what techno-babble nonsense you could dream up if you worked with complex stuff like a power plant or a refinery. It's a freakin' coffee machine! [rofl2]


----------------------------------
image.php

If we learn from our mistakes I'm getting a great education!
 
As itsmoked correctly noted, you've got too much power.

You are trying to do something that the equipment was not designed to do. I'm quite sure that the original design goal was to heat the water as quickly as possible, with no consideration at all to maintaining a set temperature.

Just install a dumb thermostat to cut-out three of the four elements when you get close to the desired set point. Then tune the fourth element.
 
MintJulep has an excellent point. Except I suspect those four terminals represent 2 heating elements not four.

Once the temperature is within some limit have the temp controller alarm output dump one of the two elements via a normally closed relay. This will drop your heat by 50% and your control should markedly improve.

You should also try to find somewhere on the housing that is as far as possible from the heaters to minimize the problem of sensing the heater's rather than the water.

Keith Cress
kcress -
 
What you'll probably find if itsmoked is correct, and I know the inside of a coffee machine (don't hold me to the latter part) is that the two elements may perform different functions.

If its an espresso machine with facility for frothing milk, there are two temperature setpoints required, one for making coffee, and one for steam. On my coffee machine there is one element, but two thermostat elements, one for each setpoint.

If there are indeed two boiler elements, then you obviously only want one on for the lower setpoint, but two on for the higher setpoint.

At one stage I aspired to own a two boiler machine, now I don't get so excited about it, rather I just drink the coffee. Theres no bounds to what an engineer can tinker with, and as Scott Adams (Dilbert) once said, when engineers don't have any problems to solve, they go looking to create them.

Good luck with the coffee machine though.
 
> your control should markedly improve.

An assumption seems to have crept into recent replies that control is bad. That is not the case at all. Control is fine, minimal deviation from setpoint, little overshoot: There is no overshoot during warm-up. After preparing an espresso - when at 9 bar, fresh water poors into the boiler at 250cc/min, turning it almost into a contuous-flow-heater - there is a brief <=1.5 degree overshoot at the sensor when the pump is apruptly stopped. I'm just a bit frustrated that the algorithm doesn't give me constant values for Ti and Td (it does produce a nearly constant Kc). I've now adjusted autotuning to use mininmal excitation: just large enough to produce peaks that I can parse with the sensor's resolution. This approach has led to +-10% output steps (ie. 0% - 20% - 0% ...). The result comes fairly close to manual tuning: Ti=2.5s instead of Ti=1.6s.

> the two elements may perform different functions

Not in this case. In the 230V EU version, they are serially chained and in the 110V US version, they are in parallel to compensate for the lower voltage - I believe that's the reason for the design.
 
Status
Not open for further replies.
Back
Top