3D Printer Heated Build Plate Arduino Controller

7,777

34

11

Introduction: 3D Printer Heated Build Plate Arduino Controller

NOTE: Some of the components for this instructable are no longer available. I will be posting an updated version shortly. In the mean time, please use this instructable as a learning guide for your own design.

Heated build plates allow printing larger parts while minimizing warping. They also help hold the part while printing and allow for easy removal after the plate is cooled. There are many good instructables for creating heated build plates. A heated build plate requires a flat glass or metal build surface with an integrated resistive heating element, a high current power supply, and a method to control the current supplied to the build plate to maintain the desired temperature. Temperature control units commonly use relays which open and close depending on the plate temperature. Relays generally result in considerable temperature overshoot/undershoot because the current is either completely on when the relay is closed or completely off when it is open. The high current relays also tend to be expensive. Other methods based on PWM (pulse width modulation) can provide better temperature control because the on/off cycles are much faster than a relay is capable of doing, but they generally require building a custom circuit board. This instructable describes a robust, easy-to-build PWM heated build plate control unit based on an Arduino Uno microcontroller and an inexpensive motor drive shield.

A list of parts needed for this project includes:

  • Arduino Uno Microprocessor ($10)
  • Monster Moto Shield VNH2SP30 30A Motor Driver Module ($10 - make sure to shop around for best price)
  • DC Power Supply 12V 30A ($20)
  • PCB Heatbed RepRap MK2a ($20)
  • BCP NTC3950 100K Thermister (5 for $8)
  • 9 kohm 1% resistor
  • Silicone Wire 10 AWG black/Red ($10)
  • Thermal grease
  • Kapton tape
  • Toggle switches, LED (optional)
  • 3D printed case (optional)

Step 1: Wire Up the Motor Shield Power Cables

The motor drive shield is has two motor drive chips, but we only need one to drive the heat-bed. The outputs for driver chip 1 are labelled A1 and B1. Solder lengths of 10 gauge silicone wire to these outputs, black to A1, red to B1. (The polarity really does not matter for this application.) Solder the other ends of the wires to the power inputs of the PCB heat-bed.

Solder lengths of 10 gauge cable to the power inputs of the motor shield labelled ' + ' and ' - '. Attach the other ends to the appropriate screw terminals of the power supply. You can add a 20A fuse into the positive supply wire to protect the circuit and power supply and yourself.

Step 2: Wire the Thermistor

There is a very nice write-up about thermistors here:

http://mathscinotes.com/2011/07/thermistor-mathematics

Basically, we need to solder the thermistor wires (the thin wwhite wires in the above photos) between +5V from the arduino and an analog pin A5 (or another pin of your choice). We also need to solder a 9kohm resistor, visible in the photo, between A5 and ground. The voltage on A5 can be read by the arduino and translated into a temperature in code.

The measuring end of the thermistor should be kapton taped to the underside of the heated build plate, near the center. Use some thermal grease between the thermistor and the build plate for good thermal contact and more accurate temperature measurement.

Step 3: Add Control Inputs (Optional)

If you want to add switches to control features such as turning the control on/off or setting the temperature set point for PLA or ABS , you can solder some wires to the analog or digital pass-through pins on the motor shield. These pins simply connect to the corresponding arduino pins and can be read in code as described later. I added two switches and I used glue from a hot glue gun to relieve stress on the solder joints. I also added an LED output to monitor when the unit is heating. The switches simply switch an arduino input pin to ground when closed (set the pins to pull up internally). You can detect when the pins are grounded in code and do something like set the plate target temperature or turn the system on/off. The LED is powered by an arduino output pin through a current limiting resistor in standard LED fashion. You can see in the code that I used the following Arduino pins for my switches and LED:

int startPin = 11; // turns heater on/off
int tempPin = 12; // sets temp PLA or ABS
int ledPin = 13; //controls LED

Step 4: Attach the Motor Shield to the Arduino

You may have to solder the headers onto the arduino at this point. Be careful not to short any pins with solder. Also try to keep the headers straight and lined up properly. It is sometimes useful to plug the loose headers onto a spare shield to hold them in place while soldering them to the arduino board.

Step 5: Program the Arduino

The attached program contains all of the necessary code to control the heated build plate. Use the standard arduino development environment on your PC or MAC to upload the code to the arduino micro controller board using a USB cable (https://www.arduino.cc/). You may have to adjust the code if you do not want to use control switches or an LED status light. This should be straightforward if you study the code a bit.

Also, since the control unit is not integrated into the 3D printer, it does not know when the print is completed. There is therefore a maximum heating time after which the heat-bed automatically turns itself off. You can adjust this time based on the expected maximum printing time for the part you are printing. A welcome improvement might be to add a motion sensor to detect movement of the print head. When the print head stops, the heat-bed can power down.

Step 6: Add a Case (Optional)

Since you probably have a 3D printer, you can print out a case for your heated build plate controller using the attached .stl files. I recommend printing the case after you get the heated build plate set up and working.

Enjoy!

First Time Author Contest

Participated in the
First Time Author Contest

Be the First to Share

    Recommendations

    • Plywood Challenge

      Plywood Challenge
    • Plastic Contest

      Plastic Contest
    • Battery Powered Contest

      Battery Powered Contest

    11 Discussions

    0
    dos2
    dos2

    Question 2 years ago on Step 5

    Something is wrong with the code, you chage it to turn on if no switch is connected, and if I conect pin 11 to GND the arduino freeze (maybe your shutdown feature).

    And if is running (no jumper on 11 to GND), the heatbed wont turn on, but i get some message on terminal, no drive lights on the Monster pcb, only the red power led. But With another code, the one example for using normal motors plugged on it, runs fine.

    What is wrong?

    0
    dcaditz
    dcaditz

    Reply 1 year ago

    The behavior
    you describe seems to be consistent with a fault situation on the motor
    driver. If the motor driver thinks there is an unusual situation on
    their drive transistors they will shut down. See the data sheet (https://cdn.sparkfun.com/datasheets/Dev/Arduino/Shields/10832.pdf) and specifically the fault status pins ENA/DIAGA, ENB/DIAGB described in Table 4 and page 20 of the data sheet. This could be caused by mis-wiring or by having a heat plate with different resistance than the one that I the system tested with.

    Another user reported similar behavior when the Arduino pwm got below a certain value (50 in his case). I suggested that he try modifying the arduino code to add a MINPWM value as follows:


    In the header:

    #define MINPWM 60 \\ minimum allowable PWM

    In function heatup():

    if (temperature > targetTemp )
    {
    pwm = max(pwm - 1, MINPWM);
    }
    else
    {
    pwm = min(pwm + 1, MAXPWM);
    }

    See if this makes any difference.....

    0
    herij43
    herij43

    Reply 4 months ago

    Hi

    I have also added the code but sill my bed is cold. please advise.

    cheers
    herjun

    0
    herij43
    herij43

    Reply 4 months ago

    fyi, I do not use the control onput (optional) so pin 11,12,13 were not using?

    0
    jodyhart
    jodyhart

    Question 7 months ago on Step 3

    Hi,

    Thank you for this Instructable. I purchased all the materials and just realized that I can’t tell from the instructions or photos which pins go with which switch/LED. If you don’t mind, please post which pin goes with which wire.

    Many thanks,

    JHart

    0
    dcaditz
    dcaditz

    Answer 7 months ago

    Hi Jody. Thanks for your question and thanks for pointing out that I didn' t specify the pins. Actually you can tell from the arduino code which pins connect to the switches. LED, etc. (and you can change them in the code if you wish.) HEre are the relevant lines:

    int startPin = 11; // turns heat on/off
    int tempPin = 12; // sets temp PLA or ABS
    int ledPin = 13;

    I'll update the Instructable to make that more clear.

    Thanks!

    0
    dcaditz
    dcaditz

    1 year ago

    A few users have mentioned that the heat bed stops heating under some conditions. I believe this is due to the motor driver detecting what it thinks is a fault and latching off. This may be because the heating element some people are using has too little resistance. The ultimate solution would be to add some inductance to the circuit in series with the heat bed. After all, the motor driver expects to drive a motor winding, not a purely resistive heating element.

    If such a fault is detected, then pins 1 and/or 2 on the Moto Shield will be pulled low. You can check this with a volt meter or by a digitalRead(enpin[i]) in the arduino code.

    To reset the Moto Shield you need to pull the inApin[i] and/or inBpin[i] momentarily low. You can add a reset function such as the following:

    void clearFault(uint8_t motor){
    digitalWrite(inApin[motor], LOW);
    digitalWrite(inBpin[motor], LOW);
    delay(10)
    digitalWrite(inApin[motor], HIGH);
    digitalWrite(inMpin[motor], HIGH);
    }

    and call clearFault(i) in the main loop if a fault is detected on drive i (i.e., enpin[i]==LOW):

    if (digitalRead(enpin[i]) == LOW ) {
    clearFault(i);
    }

    Note: This code is untested.

    In any event, you will have to determine the cause of the fault - Perhaps a short in the power wiring, too small resistance of the heating element, overheating of the motor drive. Studying the data sheets may help:

    https://cdn.sparkfun.com/datasheets/Dev/Arduino/Sh...


    https://cdn.sparkfun.com/datasheets/Dev/Arduino/Sh...


    Note: I have not seen this latching behavior with my system. I am using a RepRap MK2a 300mm x 200mm heating element, which has about 1.5 Ohm resistance. The leads from the driver board to the heater are about 76 cm, which adds a bit of inductance to the circuit.
    0
    Quant882
    Quant882

    Reply 8 months ago

    Nice project, I have this pretty well built but it is not heating. The switches work as expected and I can see them affect the output to the serial monitor. I have two problems:

    1. My temperature reading on the monitor stays pegged at 273.15 and won't even move when I put external heat on the thermistor. I am using the included integrated thermistor that came with the heat pad and I plan to test it with a different thermistor.

    2. I seem to have the issue you describe below with the shield detecting a low draw fault. I am using a 12v 200watt flexible Silicon Matt heater and I get a the bright light that the shield is getting powered but no I have no voltage on the output pins.

    I added a read of inApin and inBpin to the serial monitor and I see inApin holding on value of 1, and inBpin cycling through values. In one attached screen shot you can see my inApin is reading a constant "1" and inBpin, decreases from 160 with each loop itteration.


    My added monitoring code:
    ~~~~~
    int Astatus=digitalRead(inApin); //mod
    int Bstatus=digitalRead(inBpin); //mod
    Serial.print(" inApin: "); //mod
    Serial.print(Astatus); //mod
    Serial.print(" inBpin "); //mod
    Serial.print(Bstatus); //mod
    ~~~~~
    The only direct question I have, is with the below snip from your code. I think it has to be in a loop—is it intended for inclusion in one of the existing loops or a new loop?
    ~~~~~
    if (digitalRead(enpin[i]) == LOW ) {
    clearFault(i);
    }
    ~~~~~

    Thanks!

    Screen Shot 2020-03-14 at 21.47.44.pngIMG_0355.jpeg
    0
    Quant882
    Quant882

    Reply 8 months ago

    Update, I ordered a PCB based heater bed, also with its own integrated thermistor, and the original code worked first try. It is reading from the thermistor properly and adjusting the power output accordingly.

    Later I might circle back around to try to get the silicone heating mat to work, but I want to get the heat bed functioning on my printer.

    1
    dcaditz
    dcaditz

    Reply 8 months ago

    Thanks for your message! Looks like you are making progress. Regarding the code question, yes that fault detection snippet would go in the main loop. It is untested and only intended to give some guidance for those having trouble with the bed not heating.