Marlin from one printer SW that uses the arduino platform. Marlin is full of option to suit many 3D printers. Download a tagged version from or . 3D printer vendors provide already configured printer firmware for their models. A drawback is that those might create a fork of the original Marlin SW and therefore SW version control might be getting messy.

Test your Marlin board by starting a terminal program as gtkterm and open the port with the correct baudrate (Note: 250000 might not be supported by Linux, in worst case the Marlin SW must be recompiled using the 115200 baudrate). When pressing reset Marlin prints out a lot of useful information how it got compiled and configured.


Marlin is a mature software and includes some features to prevent the printer from damaging itself or doing stupid things. Such a check are:

preventing the extruder to turn when it is cold

Check if temperature is suitable in absolute range (short between two wires or broken wired of sensor) but also dynamically if the temperature regulation sees something not as expected.

Compiling Marlin

Unfortunately compiling Marlin on Linux might end up in some troubles.

  1. If the Avr compiler binary is downloaded and added to some directory than it can not be found. A workaround is opening a console and PATH=$PATH:/<path to avr>/avr8-gnu-toolchain-linux_x86/bin

    export PATH



    This will set the PATH environmental variable and then start arduino

    Alternatively check what you find in /usr/share/arduino/hardware/tools/avr and if it does not exist add the link

    ln -s /<path to avr>/avr8-gnu-toolchain-linux_x86/bin /usr/share/arduino/hardware/tools/avr

  2. The newest marlin firmware requires an arduino version newer than 1.6.8 and your Linux distribution has just something as arduino version 1.0.5. Use either work with older arduino version or an older marlin software or just download the newest arduino IDE as archive unpack it and run it from there.

  3. On a self built avr compiler everything works well but then the marlin binary does not behave as expected. This might be a compiler problem so try it with the compilers coming from the newest arduino versions or use a binary compiler as from Atmel.

Customizing Marlin

Usually all custom settings are done in the Configuration.h file. For somebody who likes to tune and upgrade his 3D printer it is recommended to move away from the printer vendors Marlin versions and use the official Marlin versions.

Most settings are self explanatory. A bit tricky is the extruder direction that might to be inverted. On the user interface positive values mean extruding and negative retracting.

Regulating the temperature requires some parameters. Those can be parameter can be automatically determined by running the command M303 E<n> S<temp> C<m> from a terminal program as gtkterm or from a 3D printer SW. This heats up Extruder <n> to <temp>°C and stays at the temperature for <m e.g. 12> cycles. Finally Marlin returns PID autotune finished! containing Kp Ki Kd parameters of the PID temperature control.


Those PID parameters depend also on the voltage used and should therefore be verified on each power supply modification.


Consider turning the fan on (M106) before determining the regulator parameters with M303. If the fan cools too much so the target temperature can not be reached, then M303 will fail with a timeout error. Reduce speed and restart and do not forget to tell the slicer that it is not allowed to run the fans at full speed.

The same PID control could also be made for the heated bed where E-1 could be inserted in the M303 command. However this is mostly not done and the bed is operated in Bang-Bang mode (on/off instead of PWM). Therefore no PID parameters are used for the bed (also the extrudes could be configured to run in bang-bang mode). Sometimes the hardware uses a relay to turn on the heated bed and this prevents to use PWM with the PID control.


M303 E-1 will not work when marlin is configured having a Bang-Bang mode heated bed.

Tricky is also to get the steps/mm values for the stepper motors since this depends an the mechanics, motors and stepper drivers micro-stepping setting. There are calculators on the web to determine this Printing something as a test cube should then confirm if the settings are correct.

DEFAULT_MAX_FEEDRATE in mm/s, DEFAULT_MAX_ACCELERATION in mm/s2 and DEFAULT_<n>JERK in mm/s3 are a crucial parameter to not having the stepper motors loose some steps.

There are other acceleration parameters as DEFAULT_ACCELERATION that is used internally be the merlins planner but are then constrained further if needed.

In older marlin versions it was possible to modify parameter values and store then non volatile. This is also possible in the new marlin versions but is disabled per default


will bring it back.


If this EEPROM feature is enabled then it needs to be erased when a new marlin version is programmed. This can be done by selecting Restore Failsafe from the user interface (or via avrdude using the programmer)

Linurs Servernest startpage