Search
  • ThriftyBuilder

Closed-loop Heater for Melting Wax

Updated: Aug 29, 2020

In this project, I built a simple closed loop resistive wire heater to melt wax, and hold molten wax at an optimal temperature for dipping candles. The construction of the heater uses readily available materials sourced from McMaster-Carr, Amazon, and Digi-Key. The controller works on the Arduino Nano platform, which controls solid state relays (SSRs) with a PWM schema. I included an encoder knob and a display to control the system. The temperature measurement is achieved with a thermistor, which is read through a voltage divider circuit, and the voltage signal is mapped linearly to temperature. The heating element is a Kanthal wire, which is insulated in a fiberglass sheath, and wrapped around a steel tube, which holds the wax.


I have included my Arduino program (github repo), and a parts list. I hope this proves useful for you to build any heater, not just for melting wax. 🙂


Control Loop


I found that the hysteresis controller resulted in too much overshoot for the temperature sensitivity of the candle making process. Hysteresis, or bang bang, is a simple on or off control schema, applying full power or no power. When there is thermal resistance between the heat source and the measurement point, and capacitance in the system, this results in some overshoot. I was hoping that the candle dipping process would not be sensitive to the overshoot, but this was not the case. So, in the name of DIY, I built a custom PID controller with a programmable micro-controller (Arduino) and a solid state relay.


I'm using a typical, yet custom PID (poportional + integral + derivative) control loop that maps to a PWM (pulse width modulation) duty cycle, which controls an SSR (solid state relay) on a 5VDC digital pin. I set my PWM frequency to ~30Hz (relatively low, but plenty for a slow thermal system).


Changing PWM frequencies on Arduino controllers

How to change the PWM frequency of an Arduino digital output pin


Cheap solid state relay (SSR)

I found some cheap Chinese SSRs that have some bad reviews, but I'm confident they will last for my application because I am only using about 10% of the rated power.


Since I'm controlling two heaters, I wrote a custom class based PID control loop that is very similar to your typical discrete-time PID loop for Arduino (C++). I have done the initial calibration manually, through guess and check. There is still a large overshoot, but it settles down within 1 or 2 waves. I found that disabling integral control when the temperature error is more than a small amount (~2degC) made calibration much easier. Otherwise, it was an easy mistake to accumulate way too much integral, and have massive overshoot (or undershoot). Theoretically, I believe the restricted integral window is unnecessary, and maybe bad practice. If and when I do the math, I'll update this section with a higher level optimization!


Multi-tasking the Arduino - Part 1

This guide helped me convert my PID controller from a function to a class (object oriented)


mpenadoll/cotopaxi

Github repo for my Arduino program



Temperature Measurement

The sensitivity of the thermistor depends on the voltage divider circuit, which should be designed to be most accurate at the operating temp.



Voltage Divider Circuit Calculator - For NTC Thermistor







With an NTC thermistor (resistance decreases as temperature increases), Vout will decrease as temperature increases. The Steinhart and Hart Equation describes how semiconductors respond to temperature:


This reduces to the "Thermistor Equation":





where:


Solving for Beta:



Finding a thermistor, and optimizing Rs


The size of the series resistor will affect the precision of the measurement. The Arduino analogRead maps analog voltage readings from 0 to Vref (5V for Arduino Uno analogRef pin) to digital outputs of 0 to 1023. Resolution is 5V / 1024 units, 4.9 mV/unit.


From experience, the desired operating window is known. Using the equations above (in Kelvin), B should be ~ 5000 (maybe less maybe more depending on R0 and Rs) to maximize the "steps per degree" around the operating window. Based on this rough Beta parameter, max expected temperate, and form factor, I selected these thermistors:


TTS-10KC3-BZ

THERMISTOR NTC 10KOHM 3977K BEAD, Mfg P/N: TTS-10KC3-BZ, Digi-Key P/N: 1912-1017-ND


From a Mathcad file I put together, I used the above equations to optimize for an Rs = 2.2kOhm, such to maximize the "steps per degree" around the operating window.



Noise in the signal, and a moving average


Due to noise in the signal, which I think is mostly due to noise in the 5V Aref pin, I am using a moving average for the temperature measurement. I liked the 5 point moving average, but due to low memory issues, I resorted to a 3 point moving average. There are probably better ways to reduce memory usage, but this was one of the easy fixes. I might go back if performance needs to be improved, but I don't expect there will be issued do to a noisy temp reading because the thermal system is quite slow.


Update: After improving speed by linearizing the signal (see below), I have upped this to a 4 point moving average.



Linearization of Signal


The Arduino Uno has some stability issues with sample times less than 200ms. I would like to run at 100ms to make the display and controls feel snappy, adding more measurements to the moving average would be nice as well (see above), and finally it would be helpful to do some Serial monitor printing for debugging / analyses purposes during regular operation. I'm running into stability issues with all of these things, and I believe the big bottleneck is the natural log function in solving for temperature.


The resistance of the thermistor is highly non-linear with respect to temperature, but the voltage reading through the sensing circuit (voltage divider) is actually quite linear with respect to temperature. This is something I discovered in my Mathcad worksheet:

So, solving for temperature directly from voltage yields this equation, which we will linearize as shown here as well:






Resistive Wire Sizing


I selected Kanthal wire for my resistive heating wire. Kanthal is highly corrosion resistant at high temperatures, which makes it a great heater. It's also readily available on Amazon. I wanted to make the entire unit (two heater) powered off of a single standard 110V, 15A outlet. I figured 5A each (total 10A) gave me a good safety margin. I ran a crude sanity check calculation to check that this was enough power to melt that wax in a reasonable amount of time. Note, it is crude and doesn't even include latent heat, not to mention heat losses.



Building the Melting Vessels


Tubes

I constructed the wax melting tubes from 2in steel pipe, and copper end caps, sourced from McMaster. I decided to braze the copper caps to the steel pipe for high heat resistance and strength. This was my first time brazing. It requires heating the materials to ~800degC, and adding a filler material that will wick to whatever materials you are using (in my case it was steel and copper).

After testing, I have noticed that the copper does oxidize, leaving behind the typical green pigment in the wax. Future vessels will be be an all steel construction, or potentially aluminum.

I leak-tested the system by double boiling the tubes for a long time (about an hour). Boiling water dissolves the flux that is left over from the brazing, which can "hide" leaks. Two of the four tubes were leaky, so I went ahead and re-brazed all of them.



Resistive Wire

Now that the tubes were complete, I wrapped them in the Kanthal heating wire. After trying several configurations, I have settled on using a fiberglass sheath, and wrapping that around the tube tightly. To reduce the wire temperature, which helps prevent the wire from burning through the insulation, I reduced the operating power to about 370 watts by using more length that originally planned (you can see this in my math above).


Insulation

I leak-tested the system by double boiling the tubes for a long time (about an hour). Boiling water dissolves the flux that is left over from the brazing, which can "hide" leaks. Two of the four tubes were leaky, so I went ahead and re-brazed all of them.


Thermistor Installation

At first, I placed the thermistor directly into the wax with a long clip around the top edge of the heater. Although this provided a direct, and accurate reading of wax temperature, it was a difficult to manage and led to over-heating scenarios. To improve reliability and ease of use, I screwed the thermistor into the side of the heater through a 1/2"-20 vented bolt, that I drilled out myself. The installation was tricky, but it has been working nicely.


Electronics Box

All the controlling electronics fit inside the e-box. The entire e-box is connectorized, so it can be separated from the actual heating vessels. The micro controller is an Arduino Nano, which controls the SSRs, display, and takes inputs from the knob, button, and thermistors. To improve safety, the high voltage side of the box is grounded, and the main power line is fused (10A slow).



Parts List




References


Thank you to all the people who make the internet such a rich source of information!


Changing PWM frequencies on Arduino controllers

How to change the PWM frequency of an Arduino digital output pin.


Multi-tasking the Arduino - Part 1

This guide helped me convert my PID controller from a function to a class (object oriented)


Voltage Divider Circuit Calculator - For NTC Thermistor

Nice, visual resource showing how to connect a thermistor using a voltage divider


Make an Arduino Temperature Sensor (thermistor tutorial)


Adafruit: Using a Thermistor


Electronics Tutorials: Thermistors and NTC Thermistors


Wikipedia: Steinhart-Hart equation

230 views0 comments

Recent Posts

See All