For 3D pinting, different filament (ABS, PLA etc) requires a suprising accurate temperature for extrusion to get the best results. Then, even using a specific type, different colours may work better at different temperatures.
I converted a X2 mill into a CNC controlled mill. Not part of this project!
However, turning this into a 3D printer only requires a printing head, and temperature controller... So I needed a little temperature controller to accurately control the printing head temperature as well as the mat or base temperature for the printed project.
This controller will at least take care of the temperature side.
Using a little Arduino Micro, OLED display, Thermistor(s) and heating elements, I have a working breadboard example.
But this controller can also be used in other areas, keeping a rabbit hutch cozy over winter, protect delicate outdoor plants from frost, etc etc.
Design goals (in no special order)
- Modular or expandable - easily adaptable for other uses.
- Affordable and easy to build - Using standard Arduino, piggy backed onto PCB negates the need for SMD skills and tools.
- Easy to use - turn a knob and temperature is set. Visual feedback on parameters.
- Verbose with data - this helps to fine tune filament type/colour temperature requirements with actual results.
1 - PID Controlled
I am using a PID control loop to control the target temperature for the printing head and Mat by PWM switching a MOSFET and thus the 12V/40W heating element. It settles within 0.5 Degrees of the target temperature! Im using a Potentiometer to set the Target temperature - its easy to dial in the target temperature.
2 - Sensor - DHT or Thermistor
The channels can use either a DHT snesor (e.g DHT22) or Thermistor.
Steinhart-Hart equation for Thermistor
As for the thermistor, its a 100K glass bead one and I'm using the Steinhart-Hart equation to calculate the temperature from the thermistor and a PID control loop with three sets of PID parameters. I had to use a little Java program to determine the three coefficients not wanting to use a long lookup table. I added a PC Fan to control temperature overshoots.
3 - Logging
Temperatures and PID parameters are sent via the USB cable to the PC for logging perhaps. With the expansion port, an I2C bus can be used to interface to other devices, Alternatively, a Network, WiFi, or XBee module can be used.
4 - Display
The OLED display shows the current Head temperature, the Target and deviation, the last highest and lowest temperatures since switch on (or reset stats button was pressed) Top right hand corner shows the PID parameters in use (set x of 3)
3 - Agressive - far from target temperature
2 - Normal - approaching target
1 - Sensitive - on target
The display alternates between Ch1 and Ch2 every 5 seconds.
The PID Display photo shows the info for Ch1. Top left is a spinner, showing that the controller is not hanging - in which case a watchdog timer will retart it. Then Ch1 (or Ch2), Top right in  is the current PID stage (1 of 3).
The Temperature, humidity (if using DHT), Target Temperature with [difference],
and the High and low statistics.
Im not a Process Control expert at all and the PID loop can be greatly improved. At the moment it takes about 5 minutes for the temperature to settle on the target and the initial overshoot is perhaps to much. Anybody with PID experience?
The graphics library I used does not co-exist with the PID Auto-tune library. Causes havoc with the display...
Final Version: Version 4.1
I have enough working prototypes from various versions now and this is it.
As I had problems with the WizNet module getting it to work with an Arduino Micro. Anyway, getting graphics, IP and PID squeezed in was leaving very few bits for expansion.
So, this PID controller does just PID controlling. Its a 2 Channel PWM controlled module with an OLED display, extension bus and I2C header.
One can either use thermistors (by means of the Steinhart-Hart coefficients) or the DHT22 sensors.
The OLED display can either be configured in SPI or I2C mode. I opted to use it in SPI mode - its not using the standard Ardiono SPI library and use specific pins. This leaves the I2C bus for communicationg with the world.
Most of the important spare pins are also available on a header should one have specific needs or other plans. The I2C pins are also available on a smaller header.
This temperature controller will be part 1 of a 3 part solution. This module works as a standalone unit. Part 2 is an I2C level convertor with Part 3 a Raspberry Pi with webserver and database for statistics and GUI control.
Next -Remote Comms
Using a Raspberry Pi, mySQL, rrd, php and Apache, one can access the stats and change parameters - perhaps not needed for 3D printing but ver useful for other temperature controller applications. I have started writing the software but its far from ready. The Pi will simply poll the I2C pins and get or set the current temperature thus dealing with specific schedules or cycles e.g warmer between 3 to 4 am.
The Pi can easily provide network connectivity via ethernet or a suitable wirless dongle. So this and the IP stack is sorted.
Communications between the Pi and Temperature Controller Module(s) will be via I2C. Besides the issue of different bus voltages between the Pi and Arduino, isolation is also necessary. In theory then it should be possible to add other controllers (or I2C) slaves and control them.
I have designed and built a suitable I2C isolator for this purpose and its also available on the elektor Labs site.