3D Printer Project – Heatbed Upgrade Part 2

Time to get down and dirty with the Marlin firmware for the RAMPS 1.4.

Luckily bq have made the Hephestos firmware avaliable as a well documented github repository, just what you need to get started.

Sourcing the firmware:

As this is a an open source printer, there is no issue in retrieving the firmware used for the RAMPS 1.4 breakout for the Arduino MEga 2560 controller

Simply take a look at the Marlin package and specifically the Hephestos fork.

(13-02-2015: v1.4 of the Hephestos fork released on 10-02, link above now links to V1.4, the changes below still stand.)

Modifying the firmware:

Change Those Settings:

In configuration.h

#define TEMP_SENSOR_BED 1

The value 1 is uesd because i am using 100Kohm thermistor, you can specify other values that are indicated in the well commented configuration file.

#define X_MAX_POS 215
#define X_MIN_POS 0
#define Y_MAX_POS 180
#define Y_MIN_POS 0
#define Z_MAX_POS 170
#define Z_MIN_POS 0

These were set to define my print area.

I have lowered the Y Max Pos to 180 mm, from 210 mm, as the bed kept slamming into the end-stops.

I have lowered the Z Max Post to 170 mm, from 180 mm, because the print head returns to the very top position and as i have raised the print bed by nearly 1 cm, including the z-stop, this change stops the printer from overshooting the top end of the z-axis

I found it helpful to send the print-head home then use the jog dial to indicate the values used.

You can also change a couple of lines in language.h to name your printer; I chose to name mine Salti Heph.

Compiling the firmware:

  1. Grab yourself the older version of the Arduino IDE, The repository we are using recommends Arduino 0023
  2. Download and unpack the IDE files
  3. Download and unpack the Marlin Source Code
  4. Start the IDE and load the Marlin.ino
  5. Select Tools > Board > Arduino Mega 2560
  6. Select Tools > Serial Port and take note of what is currently available.
  7. Connect the Arduino to your computer via USB, be sure to power the Arduino directly (not just off USB)
  8. Select Tools > Serial Port and select the new one.
  9. Hit the “Play” button just under the file menu to Verify and compile your code.
  10. Last step, upload your firmware to the device and wait for the upload to complete.

 Testing:

Having selected a better model from thingverse.com it was time to test that heatbed… again.

I started the printer and saw the LCD startup show “Salti Heph,” good start!

I then started the print of the model and saw the display change to “Bed Heating” and then BOOM! red light on front of the heatbed with temperature rising.

Startup time is a little longer while you wait for the heatbed to warm up but boy oh boy does that filament stick to the heated glass.

Further Upgrades:

  1. Change the longer screws for ones that can be turned with Alan Keys/Hex Keys: This is to make levelling the bed easier as it is very hard to use a standard screwdriver when the print head is in the way.
  2. Replace the M4 nuts with washer stack or cut tubing
  3. More thought out secondary support layer of cork to allow for clamps

 

23 thoughts on “3D Printer Project – Heatbed Upgrade Part 2

  1. Hi. Thanks for this info, I have spent many hours looking for this kind of ‘ tutorial’ as I also want to add a heat bed to mine at some point. 🙂

  2. Have you noticed how the code downloadable from Git for v1.3.1_hephestos is significantly different to supposedly the same version from BQ’s website? Differnt temps, different users who made the changes “Antonio Castro” for eg, SD card and LCD commented out, Endstoppullup commented out and so on?

    I’ve been looking to enable heatbed in my firmware and having compared the differences between what BQ published on their web site and that which Reprap.me published on their shop page I had wondered where the differences had crept in.

    It’s good to know that you only required minimal changes to get this going as I’d found an awful lot more between reprap.me’s version and BQ’s, now I know why – BQ aren’t publishing the same source on their site as to what’s available in GIT……gaarrgghhhhh!

    • Nick,

      I can see the difference;
      1) It looks like the “Download” supplied on the BQ product page (http://www.bq.com/gb/products/prusa-hephestos.html) points to an uploaded file on reprap.org (http://reprap.org/wiki/File:Marlin_Hephestos.zip).
      2) There is also an updates section that links to the github fork (https://github.com/bq/Marlin/tree/v1.3.1_hephestos)- This is the source i used for the above post.

      Having diffed my Configuration.h against both (at the time of this post) it looks like the download configuration offered in the zip by “Antonio Castro” does have some weird changes in it. All very annoying.

      Summary of diff
      Using notation:

      [ GIHUB V1.3.1 HEPHESTOS | “Antoni Casto” ]

      Line 19: [ #define STRING_CONFIG_H_AUTHOR “(bq Hephestos FW v1.3.1)” | #define STRING_CONFIG_H_AUTHOR “(Antonio castro, bq Hephestos)” ]

      The above just shows author info so wont cause an issue.

      Line 157: [ #define HEATER_0_MAXTEMP 260 | #define HEATER_0_MAXTEMP 275 ]
      Line 158: [ #define HEATER_1_MAXTEMP 260 | #define HEATER_1_MAXTEMP 275 ]
      Line 159: [ #define HEATER_1_MAXTEMP 260 | #define HEATER_1_MAXTEMP 275 ]

      Looks like Antonio like higher temperatures but nothing above 160 is really needed for PLA or ABS so maybe Antonio lives somewhere cold and need that extra umph?

      Line 272: [ #define ENDSTOPPULLUP_XMAX | // #define ENDSTOPPULLUP_XMAX ]
      Line 273: [ #define ENDSTOPPULLUP_YMAX | // #define ENDSTOPPULLUP_YMAX ]
      Line 274: [ #define ENDSTOPPULLUP_ZMAX | // #define ENDSTOPPULLUP_ZMAX ]
      Line 275: [ #define ENDSTOPPULLUP_XMIN | // #define ENDSTOPPULLUP_XMIN ]
      Line 276: [ #define ENDSTOPPULLUP_YMIN | // #define ENDSTOPPULLUP_YMIN ]
      Line 277: [ #define ENDSTOPPULLUP_ZMIN | // #define ENDSTOPPULLUP_ZMIN ]

      Here Antonio commented out the Endstop Pullup definitions. Not really an issue as this section is skipped anyway as in line 268 ENDSTOPPULLUPS is defined.

      Line 445: [ #define HOMING_FEEDRATE {2000, 2000, 150, 0} //{50*60, 50*60, 4*60, 0} set the homing speeds (mm/min) | #define HOMING_FEEDRATE {2000, 2000, 150, 0} // set the homing speeds (mm/min) ]

      Here Antonio seems to have removed the comment that defines the calculation used.

      Line 463: [ #define DEFAULT_XYJERK 10.0 // (mm/sec) | #define DEFAULT_XYJERK 20.0 // (mm/sec) ]

      Antonio seems to have increased the defauly XYJERK from 10 to 20. Not sure why?

      Line 508: [ #define PLA_PREHEAT_HOTEND_TEMP 200 | #define PLA_PREHEAT_HOTEND_TEMP 180 ]
      Line 509: [ #define PLA_PREHEAT_HPB_TEMP 0 | #define PLA_PREHEAT_HPB_TEMP 70 ]

      Antonio seems to have set the default preheat settings here to what he requires, I assume this is because he wants these preset temps? But you can set the preheat temps in the output .gcode files so why bother?

      Line 517: [ #define ULTRA_LCD //general LCD support, also 16×2 | //#define ULTRA_LCD //general LCD support, also 16×2 ]
      Line 519: [ #define SDSUPPORT // Enable SD Card Support in Hardware Console | //#define SDSUPPORT // Enable SD Card Support in Hardware Console ]

      Here Antonio disables the general LCD support and SD Card Support, or so it seems.
      Not really an issue as on line 524, ULTIPANEL is defined this causes the SDSUPPORT and ULTRA_LCD to be defined anyway (Lines 654 onwards)

      To summarise the changes to note are:
      Lines 157 to 159: Increase in max temperature, not sure why?
      Line 463: Increase in the XYJERK, again not sure why, perhaps the steppers on the XY can handle the 10 mm increase?

  3. I did a full diff on the two releases (Git 1.3.1 versus BQ) – there’s a fair bit that changes but mostly it’s moving stuff around, I can’t get at the ouput of the diff I produced but from memory their were changes in configuration_adv.h and Marlin_main.cpp plus a few others, language.h was significantly different although I was less concerned with that.

    it turns out that yesterday ironically enough, BQ released v1.4 on their downloads pages (no source though 🙁 ) that includes the following:

    Optimised screen navigation, improved speeds and responsiveness.
    Improved compatibility with Repetier.
    Optimised filament unloading.
    Improved filament change procedure during printing.
    Invalid or corrupt file detection.
    Improvements for use with heated bed.
    Confirmation of stop print safety feature.

    I haven’t flashed it yet but will do once I’ve modded 1.3.1 as per your method (to prove my bed / thermistor / wiring) and I’ll see what’s what.

    Would be nice to have a peak at the 1.4 source and compare that to 1.3.1 they published.

    • Changes have been made to the following:

      • Marlin_main.cpp
      • motion_control.cpp
      • planner.cpp
      • temperature.cpp
      • ultralcd.cpp
      • vector_3.cpp
      • watchdog.cpp
      • Configuration.h
      • language.h
      • Marlin.h
      • planner.h
      • ultralcd.h
      • ultralcd_implementation_hitachi_HD44780.h
    • Also worth mentioning that looking at the diff, the changes to 1.3.1 can be applied with the same affect to 1.4. (assuming EPCOS 100k (4.7k pullup) thermistor)
      Compiled but not tested

      What value thermistor are you using?

      • I have TEMP_SENSOR_BED set to 1, it’s an EPCOS 100k bought from a UK supplier but I forget which one (changed jobs so put this project down for a while).

        • Well, I have fully tested the compiled version of 1.4 and it looks like it has all the fixes mentioned on the “main” bq release.
          All the mods confirmed as working too.
          Good luck in your new job!

  4. I think I’ve broken something – the heatbed thermistor read in line with the extruder for about 10 mins – but now reads circa 135C all the time. The heatbed reads this value whether a thermistor is plugged in or not. If I short the pins for T1 then I get “MAXTEMP” so there’s some life in T1 still. This temp reads no matter which firmware I use (there’s some precompile with HB support on reprap.org / reprap.me).

    Any ideas?

  5. If I put the heatbed thermistor on T0 – then the extruder temp reads fine, so the thermistor is fine. whether I put either of my working thermistors on T1 – the temp never changes (plugged in or not – it reads circa 135C).

    I’m tempted to swap the pins in pins.h so I can use T2 for the heatbed thermistor – but without knowing how I’ve broken T1 I’m loathe to do it and break T2.

  6. Sounds like a strange problem, I only have questions at the moment!

    From what I have read there are two options:
    1 – It could be a loose connection on the RAMPS for the T1 connector on the shield/Arduino. You should probably check the connections all the way to the Arduino with a multimeter. Is your RAMPS a prefab or did you solder it yourself?
    (If you have got access to a Multimeter I would confirm the thermistors are reading 100K at room temp.)
    2 – it could be a symptom of shorting the T1 connection to 12v (dont know how this is possible, it seems more common with the extruder due to the 12v input for the heater.)

    From your post above, it looks like you have already tested both Extruder and Heatbed Thermistor on T1 with the same results?
    This would point to T1 disconnect being the issue.
    There are a couple of posts here>, here and here that discuss the same problem.

    Fingers crossed its a dodgy connection rather than a phantom short!

    I would suggest the easiest way to confirm it all works is to:
    1 -Test the thermistor for 100K at room temp
    2 – Move the pin to T2 as you have suggested
    3 – Test T2 with the thermistor (before installing)
    This will basically avoid having to take the thing apart just to test soldered connections.

  7. Thanks Salti,

    So I have the heatbed working though I can’t claim to have gotten to the bottom of it.

    I tested the PSU (Xbox 360 for the heatbed only) – it’s circa 12.17v, but the soldered ends (that goto the screw terminals in the plug on the Ramps board) were a little contaminated – such that when probed with a Fluke didn’t always register a voltage – so I resoldered and cleaned these up to resolve this issue. My bed may well never have powered up because the RAMPS board never saw the 12v required?

    I changed the pin assignment in pins.h to use T2 for the heatbed and everything works as it should. I did this as T1 even without a thermistor attached (a known good thermistor) and thus open circuit – registered 135C, attaching a thermistor that measured out to ~100Kohms didn’t change this value, and heating said thermistor (held soldering iron near) also didn’t change this value. The only thing that registered was shorting the pins (to simulate max temp) at which point the corresponding error was shown.

    So – everything works and I’m left with a question about T1, I think I’ll recompile with the pins assigned as normal and see what happens.

    Thanks for your advice!

  8. The thermistor reading 135C means there is a short somewhere….probably touching the hotend…or a bad solder connection, resistor, or capacitor on the board. I have also seen some RAMPS 1.4 Geeetech with incorrect resistors.. I had to help a friend change resistors on the X-axis and T2. Since this problem happened after 10mins, then I suspect a bad capacitor.

    It is VERY important to make sure you all have the correct thermistor setting in the config.h. This will usually be 1 or 5 (for NTC thermistors, but not always.

    Because of the way PID and PWM works, you may or may not get a 12V reading with multimeter. My $300 Fluke measures fine, my cheap $35 multimeter does not.

    I do not know why it is recommended to use Arduino 0023…the top level programmers of Marlin specifically say to use Arduino 1.6.5 and last week were critical of someone using Arduino 1.5.

    For the main Marlin repository, the default value for XY Jerk is 20. So he only raised it back to the default.

    It makes no sense to have a value of 0 for the extruder feedrate, unless he has defined it somewhere else. There is a reason for doing this, but it would have been easier to make a change in a different file.

    Unless there is a specific reason (which usually only applies to those manufacturing 3D printers or testing new features), there is usually no sense in using anything other than the official releases of Marlin. https://github.com/MarlinFirmware/Marlin

    The Marlin are pushing to make another official release soon. I would suggest using the main release of Marlin while debugging, then go back to this version…you should only have to change the configuration.h, pins.h, and maybe configuration_adv.h

    Best of luck to you all!!

    • NiteWing76,

      Cheers for the additional information.

      I have stuck to this release as it is recommended by the company that produced the specific build of the machine and presumably they have tuned it to be more compatible with the specific model. I have not been brave enough to use the man rep and make the changes myself.

      Have you managed to compile with Arduino 1.6.5?

      • Just found this post. Life saver -exactly the info I was looking for.

        I’m using a copy of the 1.4.2 firmware sent to me directly from BQ.

        Your steps work perfectly and it all compiles and uploads directly from Arduino 1.6.5r5 – Now have a nice little extra H and a temp on the LED and watching the temp climb in the Machine Control Panel in SImplyfi3D.

        Oddly the version of 1.4.2 in the links seems to be missing configuration.h but it might just be badly tagged.

        Happy to provide the zip file from BQ on request.

        Best

        John

  9. Hi Here, I went trough the hassle and compiled the new Version 1.4.2. for the Prusa i3 Hephestos with the following changes:

    #define TEMP_SENSOR_BED 1
    #define X_MAX_POS 215
    #define X_MIN_POS 0
    #define Y_MAX_POS 180
    #define Y_MIN_POS 0
    #define Z_MAX_POS 170
    #define Z_MIN_POS 0

    as the original article here suggests from salti.

    I used Arduino 0023.

    Happy Printing

  10. Hi,
    Arduino 1..0.1, Rapms 1.4 and Arduino 2560.
    Need help for configuration heat bed 300×300 print are and MK8 dual extruder.

    Laco

Leave a Reply to Salti Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.