Marlin from one printer SW that uses the arduino platform. Marlin.ino is the file to open in Arduino IDE.

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 minicom 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 marlin firmware might require 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.

Load Marlin.ino in the Arduino IDE, edit Configuration.h then Sketch compile/Verify, Tools Port to check the port and then Sketch upload.

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 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 A 1.8° (200 steps per revolution) motor driving a Z axis with 1.5mm thread pitch has therefore a resolution of 1.5mm/200=7.5um.


Not all layer heights are possible. If the steps do not match with the layer heights then an aliasing effect might (or might not) be visible on the vertical surfaces.

Layer heights that are a multiple of 7.5mm as 0.15mm and 0.3mm are possible. Layer heights as 0.1mm, 0.2mm or 0.4mm should be avoided.

To set a odd looking layer height as 0.105mm, 0.21mm or 0.405mm give then complete steps.


This is without micro stepping. Micro stepping requires to have power in the z motor, if power is turned off the motor moves to a complete step.

The 3rd number in DEFAULT_AXIS_STEPS_PER_UNIT is the number of steps (including micro steps) required to lift 1mm. (200 * 16) steps / 1.5 mm = 2133.33 steps/mm

Printing a cube will confirm that the dimensions 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)

The AUTOTEMP feature increases the hot-end temperature depending on the amount of material flowing through the nozzle. It can be configured with M109 and M104

Linurs startpage