How to set up the Marlin firmware!

Setting up the Marlin firmware can be quite overwhelming if you haven’t done it before, but most of the settings are fairly straightforward if you know what they mean.

Get Marlin and Arduino at marlinfw.org and arduino.cc

This video is sponsored by Alephobjects, Inc! Learn more about their Lulzbot line of open-source 3D printers here http://lulzbot.com/


How to set up the Marlin firmware!

So at some point, you might need to dig into your 3D printer’s firmware configuration, whether it’s to update to a more recent version or even to get your newly-built 3D printer going at all. So where do you get started? Take my hand, i’ll show you the world of C++ configuration files that control everything about your 3D printer.

So the firmware and it’s configuration literally runs your 3D printer, and the firmware in turn runs on a microcontroller on the mainboard. It control everything from the motors over the heaters to an LCD screen and SD card reader, but it’s also responsible for handling more abstract concepts like acceleration, reasonable speed limits, thermal regulation and in some cases even the complex calculations necessary for a delta printer to understand X, Y and Z coordinates. So in this video, i want to teach you the basics of configuring the current version of the popular Marlin firmware. I don’t have any exact numbers here, but in some form, it probably runs 99% of all 3D printers. If you have a 3D printer that Marlin won’t run on because it uses a more modern processor than the AtMega series, your firmware is still going to have many of the same options and you’ll still learn what the configuration options mean and how you can change them to better suit your needs.

So there are a few things you’ll have to know about your 3D printer when configuring any firmware – these are not things that need calibrated or tweaked and tuned, they are constants you’ll be able to plop right into your configuration. And those are:

The type of mainboard used. The Marlin firmware is made for Arduino-compatible boards and and most of them are somewhat interchangeable in regards to the things the firmware cares about, but it’s easy enough to read off the mainboard’s name.

Next up, what sort of 3D printer you’re using, so whether it’s a “normal” cartesian machine or a Delta or something completely different. I’ll be showing you the configuration for a regular cartesian machine.

What goes along with that is the printing area in the X, Y and Z direction, or at least the length in each of those directions the printer will be able to move before bumping into things.

Also, what sort of belts and pulleys are used, as well as the microstepping setting of the stepper motor drivers and the amount of steps the stepper motor needs to do a full rotation. This will let you calculate the steps per millimeter value the firmware needs to position each axis correctly – i’ve made a video on that that explains all those parameters and how to calculate the effective steps per millimeter value, which you can watch here. You also need a steps per millimeter value for the extruder, which is the one thing that you should calibrate – and if you want to know more about that, you can watch the video on that exact topic here.

Next up, which hotend you’re using and heated bed, if you have one. This is important to know the type of temperature sensor it’s using, commonly a thermistor, but you still need the exact type to get accurate readings. Typically the manufacturer will list the exact model used.

Then, the

Now if you can get hold of a preconfigured version of Marlin for your specific 3D printer, you can read all of these parameters from the original configuration file and punch them into the new one. Just don’t copy paste the entire file, that will definitely cause some issues. But even if you can’t get a ready-to-go, but outdated copy, you might be able to extract most of these settings if you already have a version of Marlin running on your 3D printer by sending a M501 command.

So now that we have the basic settings collected and are ready to go on that front, let’s look into what you need as far as software and actual firmware files. As Marlin is based on Arduino, we’re going to use the Arduino software as an easy way to edit and upload the firmware files. You can download it from arduino.cc, and chances are, you already have it installed. Now, the Marlin firmware itself is available from marlinfw.org, right now that only links to the github repository, but i guess there’ll be a direct download available some time in the future. If you’re downloading from github, hit the green “clone or download” button and select “download as zip”. Unpack that file somewhere and you’ll find the Marlin.ino file inside, which will open up with Arduino.

Here’s a couple of basic checks that you can do to make sure you don’t have any major errors in the configuration:

Before you power up your printer’s power supply, connect to the board with your favorite RepRap host software and check that the temperatures it’s reporting are plausible – if not, you probably selected the wrong thermistor. As you turn on the power supply, make sure that these temperatures don’t start rising on their own and that no part of the control board starts cooking or smoking or glowing red hot, those are all things you typically want to avoid. When it passes that test, use the host to move each axis by a bit and check that it moves in the right direction – keep in mind that the movements are taken from the nozzle relative to the bed, so if you have a moving bed and move Y +, the bed should move towards you. Use the right hand rule to get a basic idea of which axis has its positive direction at which end – hold your right hand out like this and from your point of view, this is x, this is y, this is z positive when you’re looking at the printer from the front. If any axis moves in the wrong direction, either change the invert_dir setting for that axis in Marlin or flip the motor’s connector around.

If an axis only moves in one direction, the endstop inverted setting is probably wrong. To get the endstops completely tested, check their functionality by homing one axis at a time, but keep a finger on the power switch. If the axis starts moving away from the endstop, change the home_dir setting for that axis.

Once the axis moves towards the endstop after the home command, try stopping it by triggering the endstop by hand before your 3D printer reaches it, so that the axis doesn’t crash into the endstop if something is setup wrong. If it doesn’t react to the endstop when homing at all, you probably have it hooked up to the wrong axis or swapped some pins – sending M119 to your printer will tell you which endstop you’re actually triggering at the moment, which you can use to manually test each one for whether it’s connected to the right axis and actually functional.

Now, before you start printing anything don’t forget to calibrate your extruder if you used an estimated steps per millimeter value for it, and it’s probably also a good idea to align your bed and set your Z-axis endstop to the correct height.

After that, you should be able to slice and print your first few files!

So i hope this video helped you getting started on your printer’s firmware – there are a bunch more features that you can add, and i’ve already made and will keep making videos on all of those. Now, for this video, if you enjoyed it, leave it a thumbs up, if not, a thumbs down. If you want to stay up to date as new videos come out, get subscribed, and if you’re really into what i’m doing here, drop me a dollar or two on Patreon. And that’s about it, see you in the next one or in the weekly livestream every weekend right here on Youtube.

This video is licensed as Creative Commons Attribution Share-alike thanks to my supporters on Patreon!

Music is Jahzzar – Gross Glee Gross Revisited, licensed CC-BY-SA


You can support me without spending a single penny!