PID autotune
PID autotune
(OP)
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?
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?





RE: PID autotune
----------------------------------
If we learn from our mistakes I'm getting a great education!
RE: PID autotune
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 - http://www.flaminsystems.com
RE: PID autotune
RE: PID autotune
Fe
RE: PID autotune
RE: PID autotune
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.
RE: PID autotune
Sorry you have to use it.
Never fun being stuck with something like that.
Keith Cress
kcress - http://www.flaminsystems.com
RE: PID autotune
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.
----------------------------------
If we learn from our mistakes I'm getting a great education!
RE: PID autotune
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 (http://www.cerinicoffee.com/Boiler_Gaggia.asp). It's a pretty common machine, has been on the market for decades, so Autotune should work with it.
RE: PID autotune
RE: PID autotune
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.
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.
----------------------------------
If we learn from our mistakes I'm getting a great education!
RE: PID autotune
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.
RE: PID autotune
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.
RE: PID autotune
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!
----------------------------------
If we learn from our mistakes I'm getting a great education!
RE: PID autotune
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.
RE: PID autotune
Fe
RE: PID autotune
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 - http://www.flaminsystems.com
RE: PID autotune
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.
RE: PID autotune
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.
RE: PID autotune
There are many coffee-forum postings for adding PID, but have a look at results for preheaters. The steady state control temp is one thing, but once the pump is running, you get a steady decline in water temp; -10degC recorded.
Most people tube the pump to the boiler with 5ft or so in copper tube wrapped around the boiler. Here is a link to one guy who went a bit further and plotted the results.
http://www
Also interesting is where he is taking his temp reading.
This doesn't help your autotune question, but it does improve controllability, which I guess is the ultimate goal.
RE: PID autotune
Keith Cress
kcress - http://www.flaminsystems.com
RE: PID autotune
If you're not concerned with settling time, why not use PI instead? The D part could cause instability to your system.
Is your autotuner computer-based? If yes, then it would be very easy to adjust its parameters and make some nondestructive experiments to determine the best combination of P, I, and D.