tumi2 said:
2) PID and Overshoot logic
I brewed on the weekend and tried to use PID logic rather than Overshoot. Last time i used overshoot it massively oversshot my mash target. The PID logic seemed to work better but it was continuously switching my SSR in a pretty consistent pattern of 4 seconds Power Off and one second Power On. This concerned me a little as i wondered if it would damage either the SSR or my heating element. Due to this i reverted to Overshoot with a setting of 2. Provided i frequently stirred the mash to ensure an even spread of temp the overshoot worked much better. I also set the temp probe quite close to the base of the pot so it would read the water as it is heated. The lesson here was stir the mash to ensure even temp distribution and the Overshoot logic works fine.
SSR's are fairly resilient that is why they are preferred over Electro-mechanical Relays (EMRs) these days. The mean time before failure of an EMR is about 100K where as an SSR will operate between 50-500 million times before failure. Implementation of PID logic for temperature is generally as follows.
Take the total output power of a system (say 2400W)
Take the error; which is the difference between the setpoint and measured temp.
Then the error is used to determine the proportional, integral and derivative which basically try and ramp temperature up as fast as possible without overshooting or creating a 'ripple effect' by measuring the changes to error over time.
This gives a % of power required at any given (preferably regular) interval at which the calculation is performed.
If the system is analog then you can simply set the power i.e 1200W for 50% etc.
However to use a digital system which only does on and off you select a window (5 seconds for example) and set a duty cycle from this; so for your 1 second on 4 seconds off it is working at 20%.
What you should see is it on all the time at the beginning and as you approach set temp it to spend more time off than on.
Given the above failure times and the use in this application i wouldn't worry to much about the SSR and the heating element won't know the difference between being operated like this and having a lower current passing through it because it is just a big resistor.
In comparison overshoot just realises that the element will still be hot when the power has gone and therefore it will continue to rise until it reaches equilibrium; so we take a punt at what the residual temperature rise will be. Obviously you can easily measure this by manually heating water, turning it off and measuring overshoot.
PID is a bit more complicated as you need to balance P, I and D to ensure that actually temp is reached; and in a timely manner and that it doesn't overshoot.... which is short, is a sod.
So why PID? When set properly the temperature will rise evenly without overshoot and then stay within about 0.1 degree C.
However, PID systems usually control systems where the setpoint changes and you don't want too much overshoot i.e. a missile guidance system where the target moves and you don't want it flying too far left then too far right etc etc.
Water heating on the other hand is a simple system so it may be considered overkill for this application; a bang-bang temperature control should be able to keep you within 1 degree easliy and probably better.
The choice is yours of course; in the past I have gone for PID because I spent ages perfecting the algorithm for another application on Arduino.....
On the other hand, I also like to drink beer so spending ages calibrating a system may fall further down on my priority list...