How to Edit the Marlin Configuration.h File for Your Prusa i3 3D Printer - dummies

How to Edit the Marlin Configuration.h File for Your Prusa i3 3D Printer

By Kalani Kirk Hausman, Richard Horne

Editing this file is the heart of the Prusa i3 3D printer configuration process. This section provides an overview and specific recommendations. Keep in mind that there is a text file in computer programming language. Do not fundamentally change its structure or add extra items; it you do, it won’t compile and operate.

You’ll see a lot of helpful comments in the code that start with . Anything after the double slash is a comment that the firmware ignores; it’s just there to help you configure your machine and remember why you made specific changes. You can add more comment lines in the code to make it clear what parts you are changing and why.

Note that some of the code has been commented out — having in front of it. Such code is inactive; you may have to re-enable lines and disable others, as indicated in the comments. You’d normally do so only for nonstandard settings, but this capability may be important, depending on the electronics type you’re using with your RepRap printer.

Another key setting in firmware is a value, which is an important way to let the firmware know what parts of your machine are enabled. For example, the firmware needs to know if your printer has more than one extruder and a heated-bed.

At the top of the file, you can find the choice of electronics used on the RepRap 3D printer. Here you see a long list of comments that give each different set of electronics a unique number. (For example, RAMBo is 301 and different versions of RAMPS are 3, 33, or 34.)The section below this list shows a #define MOTHERBOARD 80 (see the figure below), indicating that this firmware is currently configured to use RUMBA electronics. If you want to change the firmware to use RAMBo electronics, all you do is use the comments to change the setting to #define MOTHERBOARD 301.


You can use the same approach to the other settings by reading down the rest of the configuration.h file and taking one of three actions:

  • Changing the #define numbers.

  • Un-commenting the parts you want to make active.

  • Commenting out the parts you want to make inactive.

The key settings to check are as follows:

  • TEMP_SENSOR:This setting usually has more than one value, indicated by _0 _1 _2 and will have a list of types with a number for you to enter from the information. The most commonly used is type 1 (EPCOS 100k). It is essential you match the type being used in your hot-end with one on this list and enter the number for all active hot-ends.

  • TEMP_SENSOR_BED:Exactly the same as the setting just listed, normally this one uses the same electronics type as your hot-end.

  • PID settings: These settings determine the proportional control loop that takes care of heating your hot-end correctly to a target temperature that you set in Slic3r. The settings below indicate to the firmware how your hot-end responds to temperature heating and detection of change. It’s very important to have this correctly set.

    The settings you will need to change are

    • DEFAULT_Kp (the proportional element)

    • DEFAULT_Ki (the integral element)

    • DEFAULT_Kd (the differential element)

All these settings may sound complicated but don’t be too worried. All you need to do is enter in the numbers that the RepRap printer’s firmware calculates from doing a number of test heating and cooling cycles with the machine’s hot-end.