I'm beginning with arduino and I'm trying to use the PID Adaptive Tuning Example with a relay to control a water heating element but I must be missing something because the PID doesn't switch between the aggressive and conservative mode.
I want to use this mode to make it reach it's temperature faster.
The cel value is the temperature in Celsius.
I found this piece of code when I looked how to get the temperature from the sensor in Celsius.
I added to my code a line that is displayed on the LCD when it is in aggressive mode or conservative,
it correctly changes when we reach the gap limit,
also the gap value between the setpoint and the temperature measured is right.
It seems the part controlling the relay is not working.
For example when I'm testing it, it displays that it is in aggressive mode but the relay isn't activated.
(I tested that the relay is working with the "blink" exemple)
For example when I'm testing it, it displays that it is in aggressive mode but the relay isn't activated.
What value do you get for Output? Input is the value read from the analog pin (NOT the temperature calculated from the sensor's measured value. Setpoint is 93, which looks vaguely like a temperature. Given that the input and setpoint are in completely different units, I would not expect much of Output.
How do you think the Output value relates to time?
So, I guess that what that means is that for the next period of time, until you Compute() again, the relay should be on, since the desired temperature has not been met.
I'm not sure that aggressive vs. conservative parameters mean anything, when the relay can be on or off only.
I have a very hard time seeing any advantage in using a PID to control a process as slow as heating water. I would think a simple on/off control with a small hysteresis would work just as well, and be a lot simpler.
I was thinking of using that aggressive/conservative function because I want to control the heating of a coffee water boiler, with a standard PID it takes a loooong time to heat as it uses the settings to maintain the temperature during all the heating process.
I tried something like RayLivingston is speaking about and it seems to work.