Hi, I'm trying to make a heater controller that would heat up the heater to 100C over an hour, hold it there for about 2 hours and cool it down to room temperature over another hour. I wasn't able to find anything on that topic. Is it even possible to do such a thing?
Yes, of course
Which Arduino are you planning to use ?
Have you got any code to measure the temperature, if so which sensor are you planning to use, and to turn the heater on and off and how will you do it ?
I'm planning to use a custom board I made with atmega32, for the sensor I will use MAX6675 so I have a basic code to measure the temperature. For controlling the heater I will probably use a MOSFET or TRIAC.
- You can measure the temperature
- miilis() will be good enough to measure the periods
- you can control whether the heater is on or off
- Given the known rate of change of temperature to achieve 100C over 1 hour you can adjust the current target temperature using a PID for accuracy
Start with a basic system that does not use a PID for temperature control just to get a feel for how well the system works then introduce the PID for finer control. The Arduino PID library available from the Library Manager has examples
Thanks for the guidance, but I'm not very familiar with PID systems. Also, I don't really know how would I adjust the rate of 1.67C per minute.
As I suggested, do not use a PID to start with
Suppose the system is in its first minute, has just been turned on and you have calculated that at the end of that minute the temperature must have been raised to current temperature + 1.67.
Crudely what you do is to turn on the heater and when the temperature reaches the target temperature you turn it off and turn it on again if it falls below the target temperature.
At the end of the first minute you add 1.67 to the target and do the same thing again and again until the required period has passed
There are several problems with this approach but whether they matter or not depends on how accurate the temperature must be. One factor is whether the heater can actually raise the temperature to the required level in one minute
The accuracy would be improved if you reduced the period over which you aim to reach the target temperature but the heater may not be able to keep up
Using a PID improves things all round by controlling how much heat is supplied such that as the system nears the target temperature the time that the heater is on or off is adjusted to reduce overshoot in either direction and a PWM signal may be used too to vary the power supplied to the heater
Obviously the more accurately you can measure the temperature the better and isolating the environment from outside influences such as draughts helps too
Overall what you are trying to do is not simple. What is the application ?
Ok, that makes sense, thanks for the explanation, I'll try to build a simple model. For the application, it's mostly a learning project, but I hope I will end up with an Arduino-controlled oven.
If it an oven that you are trying to control then do a search for "reflow oven control". It is common for toaster ovens to be hacked and controlled by a microprocessor to produce the required temperature curve to reflow PCB solder joints using surface mount components
Another worthwhile experiment would be to turn the heater on and print the temperature at intervals. You can graph the data in your favorite spreadsheet to see how it performs and use that information to figure out how much to run the heater at any particular temp.
You define the setpoint temperature as a function of time, for instance:
float desired_temperature (float time_hours)
{
if (time_hours < 1.0)
return 20 + 80 * time_hours ; // ramp from 20 to 100 over 1 hour
if (time_hours < 3.0)
return 100; // hold at 100 between hours 1 and 3
if (time_hours < 4.0)
return 20 + 80 * (4.0 - time_hours) ; // then ramp down from 100 to 20 over 1 hour
return 0; // otherwise inactive
}
unsigned long start_time_ms = 0 ;
void loop ()
{
float desired_temp = desired_temperature ((millis () - start_time_ms) / 3.6e6) ; // convert ms to hours
...
...
}
Will definitely do that, thanks for the help!
Great idea, I'm familiar with PLX-DAQ so I'll try to graph everything.
Thanks for the help, I appreciate it.
This float value, do I just write it to a MOSFET or something else.
Thanks!
Clearly you are not very familiar with PID control!
Time to read up - they take a setpoint, my function gives the setpoint.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.