How to configure Marlin Firmware yourself? Heated print bed problem

I
isphording90 Cura Commander Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 21, 2013 - 10:56 AM  

Hi there,

at the moment I'm building a heated bed for my ultimaker. But Daids Marlin Builder ist not working at the moment and I don't really know how to configure the Firmware myself and install it on the ultimaker.

Is there anyone who has a Tutorial for that or or can tell me how to do this?

What I already know is that I can install firmware through Cura but don't know where to change the code and how to compile it to make it installable...

I have the newest electronics (1.5.7) and used an epcos 100k thermistor.

Or is there even someone who already has a working Marlin build for a heated bed with an epcos thermistor and would share it with me?

I have never done something like this and would be very greateful for any kind of help!

Regards,

Lukas

33 replies
 23431
Sort 
I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 21, 2013 - 11:20 AM

I already installed the arduino 0022 version like told in the wiki and downloaded the source code from

https://github.com/ErikZalm/Marlin

But now i don't know how to continue? What do I have to change in the code? Do i have to upload the new firmware through arduino like said in the wiki or can I also somehow compile it as a hex file and install it via cura?

I
illuminarti Points: 3095
Posts: 2794

Posted by
I
illuminarti

Posted Apr 21, 2013 - 7:20 PM

If you have the arduino software installed, then you need to find the 'Makefile' inside of the inner Marlin directory, and read and edit the start of that. Set the motherboard to type 7, and set the Arduino install path, avr tools path, and arduino version.

Then from a command prompt, if you change into that Marlin directory, and then type 'make' it should compile the firmware. You'll be left with a .hex file in the applet subdirectory. You an then use cura to upload that firmware as a custom hex file.

To get the settings you want, you will need to edit the configuration.h and possibly configuration_adv.h files. In spite of what the wiki says, you might be better off starting from the Ultimaker/Marlin fork on github - it has more Ultimaker friendly settings as the default.

If you do use the ErikZalm version (which is the official 'any printer' version of Marlin, and so may have a few non-ultimaker-relevant updates, and non-ultimaker default settings) at the very least you will want to uncomment a line in order to enable the Ulticontroller if you have one (see the latter stages of a google group discussion yesterday: https://groups.google.com/...nWvJp7w/ssStjjfTJrAJ )

gr5 Points: 8307
Posts: 7139

Location: Boston, United States Printers: Ultimaker 2, Ultimaker Original, Ultimaker 2 Extended, Ultimaker 2 Go
Posted by
gr5

Posted Apr 21, 2013 - 9:13 PM

configuration.h is pretty easy to edit but to be sure to get it right, I recommend grabbing a few. Get the one from github/ultimaker/marlin and try to use daid's web page to create one (configuration.h). Then compare the 3 configuration files, plus read it and I think it's pretty clear what you want to do.

Also look at the thermistertables .h file to make sure you have the right thermistor selected. It's pretty simple.

You can use illuminarti's command line "make" method above or you can use only the IDE (the gui) and do it that way. If you google "how to build marlin for arduino" or something similar, there are detailed directions.

Oh - daid's page is here - only use it for configuration.h:

http://daid.mine.nu/~daid/marlin_build/

I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 21, 2013 - 10:14 PM

I downloaded the source from https://github.com/Ultimaker/Marlin but can't find a Marlin.pde file to open the project in arduino? Is that correct?

I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 21, 2013 - 11:33 PM

Never mind, I found a version with the Marlin.pde file. But when I compare the configuration.h file from github with the one from the broken builder than there are things I can't find. For example: #define THERMISTORBED 6 is from the broken builder but is not in the version from github.

The only thing I really found was that I have to change

#define TEMP_SENSOR_BED 0 to #define TEMP_SENSOR_BED 6.

Is that correct? I'm really just asking this much because I don't want to do something wrong and harm my ultimaker... :oops:

T
tigrouxmaker Level: 19 Points: 217
Posts: 17

Posted by
T
tigrouxmaker

Posted Apr 22, 2013 - 11:26 AM

This is strange...

When i generate the config file i got :

#define TEMP_SENSOR_BED 1

#define BED_USES_THERMISTOR

#define THERMISTORBED 1

For an 100k thermistor...

See ya.

V
vincentp Level: 20 Points: 262
Posts: 32

Posted by
V
vincentp

Posted Apr 22, 2013 - 4:43 PM

I'm in the same situation, I'm going to try the above.

However, I didn't see defined on WHICH temp sensor input the heated bed is defined ? ultimaker wiki suggests that you can use either temp sensor input #2 or #3, is there one set by default in the firmware ? or something to change in the config.h file ?

thanks !

I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 22, 2013 - 10:55 PM

@TigrouxMaker

If you read the Configuration.h file there is a commented part with a table with all numbers for the thermistors. There you can read that 1 (as in #define THERMISTORBED 1) stands for 100k thermistors. So nothing strange there. For a 100k thermistor the settings are ok.

@ vincentp

If you don't want to change anything to the firmware than you have to use sensor input #3 for the heat bed (as shown in the picture in the ultimaker wiki). Sensor input #2 is made for a second extruder.

gr5 Points: 8307
Posts: 7139

Location: Boston, United States Printers: Ultimaker 2, Ultimaker Original, Ultimaker 2 Extended, Ultimaker 2 Go
Posted by
gr5

Posted Apr 23, 2013 - 4:53 AM

@TigrouxMaker

If you read the Configuration.h file there is a commented part with a table with all numbers for the thermistors. There you can read that 1 (as in #define THERMISTORBED 1) stands for 100k thermistors. So nothing strange there. For a 100k thermistor the settings are ok.

No!!! "6" is also a 100k thermister and that is the epcos one.

I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 23, 2013 - 8:57 AM

Quote from configuration.h:

//===========================================================================

//=============================Thermal Settings ============================

//===========================================================================

//

//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table

//

//// Temperature sensor settings:

// -2 is thermocouple with MAX6675 (only for sensor 0)

// -1 is thermocouple with AD595

// 0 is not used

// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)

// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)

// 3 is mendel-parts thermistor (4.7k pullup)

// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!

// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan) (4.7k pullup)

// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)

// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)

// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)

// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)

// 10 is 100k RS thermistor 198-961 (4.7k pullup)

//

// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k

// (but gives greater accuracy and more stable PID)

// 51 is 100k thermistor - EPCOS (1k pullup)

// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)

// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan) (1k pullup)

So you can use both 1 and 6 for the epcos. 1 is intended for other (normal?) thermisters but also for the epcos. Its the preffered table alo for the epcos because its more accurate in its readings.

You can also use 6 for the epcos (this one is only for the epcos) but the readings wont be as accourate as they would be if you choose 1.

V
vincentp Level: 20 Points: 262
Posts: 32

Posted by
V
vincentp

Posted Apr 23, 2013 - 9:31 AM

thanks a lot

I'm having issues compiling with arduino.

I took the ultimaker branch archive, copied the source code in my arduino subdir. Edited a few things for the heated bed in the configuration.h file (really a few things).

Renamed the ultimaker-main file to .ino

opened it with arduino 1.01

compiled, got errors. Any ideas ? missing a file / dir location ???

The SPI and liquid crystal libs are part of arduino, so including them with #include should find them but I have a no go with LCD class.

<pre class="_prettyXprint">
In file included from ultralcd.cpp:27:
ultralcd_implementation_hitachi_HD44780.h:27: error: 'LiquidCrystal' does not name a type
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_init()':
ultralcd_implementation_hitachi_HD44780.h:113: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_clear()':
ultralcd_implementation_hitachi_HD44780.h:126: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_printPGM(const char*)':
ultralcd_implementation_hitachi_HD44780.h:134: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_status_screen()':
ultralcd_implementation_hitachi_HD44780.h:194: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_drawmenu_generic(uint8_t, const char*, char, char)':
ultralcd_implementation_hitachi_HD44780.h:305: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_drawmenu_setting_edit_generic(uint8_t, const char*, char, char*)':
ultralcd_implementation_hitachi_HD44780.h:327: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t, const char*, char, const char*)':
ultralcd_implementation_hitachi_HD44780.h:349: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_drawedit(const char*, char*)':
ultralcd_implementation_hitachi_HD44780.h:400: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_drawmenu_sdfile_selected(uint8_t, const char*, const char*, char*)':
ultralcd_implementation_hitachi_HD44780.h:414: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_drawmenu_sdfile(uint8_t, const char*, const char*, char*)':
ultralcd_implementation_hitachi_HD44780.h:434: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_drawmenu_sddirectory_selected(uint8_t, const char*, const char*, char*)':
ultralcd_implementation_hitachi_HD44780.h:454: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_drawmenu_sddirectory(uint8_t, const char*, const char*, char*)':
ultralcd_implementation_hitachi_HD44780.h:475: error: 'lcd' was not declared in this scope
/ultralcd_implementation_hitachi_HD44780.h: In function 'void lcd_implementation_draw_line(uint8_t, const char*)':
ultralcd_implementation_hitachi_HD44780.h:503: error: 'lcd' was not declared in this scope
</pre>

V
vincentp Level: 20 Points: 262
Posts: 32

Posted by
V
vincentp

Posted Apr 23, 2013 - 10:37 AM

fixed (sorry). Couple of things, sorry if it's been detailed elsewhere, I'm trying to find a straight forward way to compile the source code without making a arduino specific (at least not too much) version of it. This is supposed to help people like me which are make-impaired (windows based env.)

issue with the LCD lib : for some reasons, having the lib included where it's requested isn't enough to have the cpp file compiled. Various articles I've read this morning say that you need to request it in the main file (sketch).

Therefore, I took the inclusion code from ultralcd_implementation_hitachi_HD44780.h and copied it in the marlin.ino file, right after the inclusion of the SPI code. This worked and forced the compilation of the LiquidCrystal class.

I suppose we could get the same result using a #include "LiquidCrystal.h" (with quotes) with a local lib along with the rest of the source code but that would kill the link with the stock arduino lib I suppose (dirty fix).

I suppose that the following code has to be added after marlin.h is parsed as it includes configuration.h where you can definde the language of your choice.

<pre class="_prettyXprint">
#if DIGIPOTSS_PIN > -1
#include <SPI.h>
#endif

#if LANGUAGE_CHOICE == 6
#include "LiquidCrystalRus.h"
#define LCD_CLASS LiquidCrystalRus
#else
#include <LiquidCrystal.h>
#define LCD_CLASS LiquidCrystal
#endif
</pre>

I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 23, 2013 - 4:23 PM

I downloaded the firmware from: https://github.com/Ultimaker/Marlin (branch: Marlin_v1)

There is nor Marlin.pde in the marlin directory so I can not open it directly in Arduino. Is that correct?

I opened the makefile and changed the beginning:

# This defined the board you are compiling for (see Configuration.h for the options)

HARDWARE_MOTHERBOARD ?= 7

# Arduino source install directory, and version number

ARDUINO_INSTALL_DIR ?= Users/IsphordingDesign/Applications/Arduino

ARDUINO_VERSION ?= 22

# You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin)

AVR_TOOLS_PATH ?= /Users/IsphordingDesign/Desktop/Marlin-Marlin_v1/ArduinoAddons/Arduino_0.xx/hardware/tools/avr/etc

#Programmer configuration

UPLOAD_RATE ?= 115200

AVRDUDE_PROGRAMMER ?= arduino

UPLOAD_PORT ?= /dev/arduino

#Directory used to build files in, contains all the build files, from object files to the final hex file.

BUILD_DIR ?= applet

Now when i get into the marlin directory with the makefile in it and type "make" I get this error message:

make: *** No rule to make target `applet/wiring.o', needed by `applet/Marlin.elf'. Stop.

Have I done something wrong? Did I downloade the wrong marlin brand from github? I'm a little desperate at this point so any kind of help will be highly appreceated.

I
illuminarti Points: 3095
Posts: 2794

Posted by
I
illuminarti

Posted Apr 23, 2013 - 8:37 PM

Here's the relevant section of my makefile (this is on a Mac - but it should be more or less the same for you):

# This defined the board you are compiling for (see Configuration.h for the options)

HARDWARE_MOTHERBOARD ?= 7

# Arduino source install directory, and version number

ARDUINO_INSTALL_DIR ?= /Applications/Arduino.app/Contents/Resources/Java

ARDUINO_VERSION ?= 23

# You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin)

AVR_TOOLS_PATH ?= /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/

Notice that the avr tools path is under the Arduino application, not part of the project structure. Also, I'd be inclined to get the older 0023 version of the tools and use that - that's what the instructions reference, and I'm not sure if the code as-is will compile for the 1.x series Arduino tools (I've never tried, because the older one works fine).

I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 23, 2013 - 9:52 PM

Now it works! Thank you very much!

Now I get a bunch of files in the applet folder. Do I only use the hex file for the upload through cura?

I
illuminarti Points: 3095
Posts: 2794

Posted by
I
illuminarti

Posted Apr 23, 2013 - 10:04 PM

Yes, just the hex file.

gr5 Points: 8307
Posts: 7139

Location: Boston, United States Printers: Ultimaker 2, Ultimaker Original, Ultimaker 2 Extended, Ultimaker 2 Go
Posted by
gr5

Posted Apr 23, 2013 - 10:10 PM

Yes, you only need the hex file.

You can use Cura or other software. I think I used pronterface but they both do it. Also I think the arduino IDE can possibly do it also.

It's strange you had to do all this stuff. I didn't have to do any of it. I just followed the build instructions on some website - it was basically just a few button clicks. No editing. Not sure why you had to do so much editing.

My only editing was Configuration.h.

I think I might have followed these directions:

http://reprap.org/...ing_and_compilation:

I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 23, 2013 - 10:46 PM

I also went that way with the Arduino IDE, just changed the configuration.h file and uploaded directly through arduino. But I had a problem that with the new firmware the feeder-stepper motor didn't work properly anymore and was very loud. Changed back to the default firmware and the problem was gone. Now I wanted to compile the firware first as an hex file via "makefile" and then upload through cura to see if the problem is still there.

From where did you download the source-code? From ErikZalm or from Ultimaker on gitHub? If you downloaded from ether one from github, which brand did you download? There is just too much you can choose from that its quiet dificult for someone new to this all to download the "right" one... :/

I
isphording90 Level: 19 Points: 248
Posts: 48

Posted by
I
isphording90

Posted Apr 24, 2013 - 12:03 AM

I got it working now to compile the hex file and upload it via cura. But just like before with the new firmware the stepper driver from the feeder is very loud and misses steps while retraction so that almost no filament gets extruded. What happened there? I just changed the hardware to 7 (Ultimaker) in config.h and left everything else!

What do I have to do to get it right? :/

gr5 Points: 8307
Posts: 7139

Location: Boston, United States Printers: Ultimaker 2, Ultimaker Original, Ultimaker 2 Extended, Ultimaker 2 Go
Posted by
gr5

Posted Apr 24, 2013 - 12:24 AM

There was a bug in Marlin where you could ask for a retraction speed of for example 40 and it would actually do something more like 10mm/sec. This bug was fixed in the latest Marlin but a speed of 40mm/sec is much much too fast apparently. So lower your retraction speed in your slicer (e.g. Cura) and stick with your new Marlin.

I
illuminarti Points: 3095
Posts: 2794

Posted by
I
illuminarti

Posted Apr 24, 2013 - 12:49 AM

The latest firmware has retraction working at the correct speed - see:

http://umforum.ultimaker.com/...ction-speed/?p=12079

Retraction used to work much slower than the speed asked for, so that people ended up asking for impossibly fast speeds like 70mm/s or more. In actual fact, when they did that, the printer gave them about 25 usually, or sometimes about 45, depending on the circumstances. You now get the speed that you ask for, subject two limits - the VmaxE speed set in your firmware (can be adjusted with the Ulticontroller, or via gcode) and an absolute upper limit of around 48mm/s (equivalent to 40,000 steps per second - see the post above).

So, you need to reduce your retraction speed setting for new gcode slices to something in the 20-40 mm/s range (I find that 4.5mm at 30mm/s works well for PLA). If you have to reprint old gcode, without reslicing, try setting your VmaxE to 25 or so, and increase it from there.

I
illuminarti Points: 3095
Posts: 2794

Posted by
I
illuminarti

Posted Apr 26, 2013 - 4:43 AM

In order to write it up, I have been trying to set up a clean machine to compile Marlin, and kept running into the same error as the original poster about 'No rule to make target `applet/wiring.o'. I was also getting an error about 'unary operator expected'.

The problem ended up being an extraneous character at the end of the ARDUINO_INSTALL_DIR line. Once it removed that, everything compiled fine.

C
carl-jones Level: 11 Points: 125
Posts: 5

Posted by
C
carl-jones

Posted Aug 13, 2013 - 3:22 PM

I have just installed the heat bed onto my ultimaker, It has an epcos 100k resistor.

In cura all i done in the settings was select i had a heated bed. but when i went to print the hot end reached temp but then the ulticontroller just said heating bed and it didnt heat up. is there any other setting i need to change.

gr5 Points: 8307
Posts: 7139

Location: Boston, United States Printers: Ultimaker 2, Ultimaker Original, Ultimaker 2 Extended, Ultimaker 2 Go
Posted by
gr5

Posted Aug 13, 2013 - 5:15 PM

According to Daid (author of Cura) if you tell Cura you have a heated bed it will tell you that you need to build your own Marlin.

The version of Marlin that comes form Cura is more than 6 months old and I believe it has a bug in it that prevents the heated bed from working (it's been a while since I tried to get my heated bed working with the Marlin that came with Cura).

Anyway you have to build your own. You can do it the easy way and build it here at this new website which is tailored for ultimakers:

http://marlinbuilder.robotfuzz.com/

That's what I recommend. Although it's not that hard to build it yourself. Or you could do a combination - use the above website to get the Configuration.h file created (the most time consuming step) and then build it yourself:

http://www.extrudable.me/...marlin-from-scratch/

WHATEVER YOU DO, make sure you:

Save the resulting Congifuration.h file and the resulting hex file in a permanent location that you never ever change and date it and explain why you built it so that when you need to build another Marlin a year from now you can do a diff of Configuration.h to see what you did differently from the "norm". And if your arduino dies and you need to reload marlin you will have the hex file ready to go.

C
carl-jones Level: 11 Points: 125
Posts: 5

Posted by
C
carl-jones

Posted Aug 14, 2013 - 3:08 PM

Hi i went to the website <a href="http://marlinbuilder.robotfuzz.com/" title="External link">http://marlinbuilder.robotfuzz.com/</a> but when i have clicked build it the only thing i can download and save is the configuration file. So i attempted to build this myself and uploaded it but when i turned the ultimaker back on the ulticontroller had the two lines. so i uploaded the firmware from cura and it works again.

Does anybody have the file i need to upload as i have never created any form of code before now. My Ultimaker is one of the newset ones with an ulticontroller and a Epcos 100k Thermistor.

33 replies
 23431
Sort