Guide to Setting Up and Optimizing Marlin Firmware for 3D Printers

Leitfaden zur Einrichtung und Optimierung der Marlin-Firmware für 3D-Drucker

Introduction

Marlin firmware is a popular choice for controlling 3D printers due to its flexibility and extensive customization options. In this comprehensive guide, we provide detailed instructions for configuring and optimizing your Marlin firmware to ensure your 3D printer runs optimally. Our goal is to equip you with the necessary tools and knowledge to personalize your firmware and maximize your print quality.

Getting Started with Marlin Firmware Configuration

To customize the Marlin firmware, you need specific software and a basic understanding of the configuration files. The preferred way to edit the Marlin firmware is using Visual Studio Code together with the Platform IO extension.

1. Software Installation

  • Visual Studio Code (VS Code): Download VS Code for free for your operating system (Windows, Linux, Mac).
  • Platform IO: Install the Platform IO extension via the extensions in VS Code. This extension enables easy compiling and uploading of the firmware.

2. Downloading and Setting Up the Marlin Firmware

Visit the Marlin GitHub repository and download the latest version of the firmware. There are two main versions: Bugfix (for the latest features and bug fixes) and the regular version (more stable).

  1. Download: Click on "Code" and then on "Download ZIP." Extract the ZIP file and open the folder in VS Code.
  2. Configuration Files: Add specific printer configuration files if you want to make only minor adjustments to your printer.

3. Selection of the mainboard and processor

Make sure you have configured the correct mainboard and processor model for your firmware. This is done in the configuration.h File.

  • Mainboard: Find the appropriate definition for your mainboard (e.g., Board_Creality_V4 for Creality Ender 3).
  • Processor: Check the processor model in the boards.h file and adjust the default_envs line in Platform IO.

Important Firmware Settings

Serial ports, baud rate, and Bluetooth

In the file configuration.h You can configure the serial ports and set the baud rate. The default baud rate is 115200. If your printer supports Bluetooth, you can enable this option and change your printer's name.

#define BAUDRATE 115200

#define SERIAL_PORT 0

Stepper drivers

The choice of stepper drivers directly affects your printer's noise and performance. Common drivers are TMC2208 and TMC2209. In the firmware, you can specify the driver used and adjust its parameters.

#define STEPPER_DRIVER_TYPE TMC2209

Sensorless homing

Sensorless homing is a feature that allows reference movement without physical endstops. This method can improve printer calibration and reduce costs.

#define SENSORLESS_HOMING

Microstepping and StealthChop

Microstepping increases movement accuracy, while StealthChop reduces noise. Both options can be set in the configuration.h can be configured.

#define MICROSTEPS 16

#define STEALTHCHOP

PSU control

The control of the power supply on and off can be managed via the firmware to save energy and extend the power supply's lifespan.

#define PSU_CONTROL

Thermal settings

Correct configuration of thermistors and maximum/minimum temperatures is crucial for the safety and performance of your printer.

#define TEMP_SENSOR_0 1
#define HEATER_0_MAXTEMP 250
#define HEATER_0_MINTEMP 5

PID settings

PID controls provide precise temperature regulation. These values can vary depending on the heated bed and hotend.

#define PIDTEMP

#define PID_MAX 255

Safety settings

To ensure your safety, configure protection mechanisms such as cold extrusion and thermal runaway.

#define EXTRUDE_MINTEMP 170

#define THERMAL_PROTECTION_HOTENDS

Mechanical settings

For special printer models like CoreXY or Delta, the mechanical parameters must be adjusted.

#define COREXY

#define DELTA

Endstop settings

Make sure the endstop configurations are set correctly to ensure accurate printer movements.

#define ENDSTOP_PULLUP

Movement settings

Configure acceleration and other motion settings to optimize print quality and speed.

#define DEFAULT_ACCELERATION 1000

#define DEFAULT_MAX_ACCELERATION {500, 500, 100, 1500}

Z-Probe and Bed Leveling

A well-configured Z-probe and precise bed leveling are crucial for print quality.

#define AUTO_BED_LEVELING_BILINEAR

#define Z_PROBE_SPEED_FAST 100

Bed Size

Adjust the bed size to correctly define the print area.

#define X_BED_SIZE 220
#define Y_BED_SIZE 220

M600 - Filament Change

Configure the filament change via the M600 function to pause the printing process if necessary.

#define FILAMENT_CHANGE_FEATURE

 

Additional Features

Marlin offers many additional features such as EEPROM storage, preheat settings, nozzle cleaning, and more. These can be enabled and configured as needed.

#define EEPROM_SETTINGS

#define AUTO_BED_LEVELING_UBL

#define AUTO_BED_LEVELING_BILINEAR

 

Conclusion

By carefully adjusting the Marlin firmware, you can significantly improve the performance and reliability of your 3D printer. With the information and configuration examples provided in this guide, you are well equipped to optimally configure and customize your firmware. Use this guide as a reference to achieve the best possible results in your print projects.

RELATED ARTICLES

Leave a comment

Your email address will not be published. Required fields are marked *

Please note, comments must be approved before they are published