ISO 9001 Factory

3D Marlin Firmware printer firmware the most detailed basic configuration of the history

Callidus Assassin 3D Print

MarlinBasic firmware configurationPreview

As we all know, the Sprinter firmware is the most used 3D printer firmware, while Marlin firmware and the Repettier-Firmware firmware derive from it. In addition, the user base of these two firmware is very active and no one has maintained the Sprinter firmware. Among these two, Marlin firmware is more widely used, and many printer control software is compatible with Marlin firmware. Generally, users only have to modify certain parameters in the Configuration.H file when using Marlin firmware, which is very practical. This is a very good advantage for ordinary 3D printing players. Today, Shanrong Sanwei will share with you this guide. This is a simple user guide, indicating to users basic information on the settings, how to use these settings and formulate special functions according to the different needs.
GitHub Address of Firmware Marlin:

MarlinFirmware features

Marlin has many advantages compared to Sprinter, which are as follows:
1. Pre-acceptance function (look-ahead):
Sprinter must stop the printer at each corner before accelerating and continuing to operate, while pre-acceleration will only slow down or speed up a certain speed value, so that the vector speed change will not exceed Xy_jerk_velocity. To reach such an effect, the next step of movement must be treated in advance. This accelerates the printing speed and reduces consumable accumulation in the corners, which makes the curve the printing more fluid.
2. Support for the support arc
Marlin firmware can automatically adjust resolution to print an arc at an almost constant speed to obtain the most fluid arc. Another advantage is to reduce the traffic in serial ports. Because the arc can be printed via a 1 G2 / G3 command, without having to place several G1 commands.
3. Temperature overtime
In order to reduce noise interference and make it more efficient PID temperature control, Marlin samples 16 times to calculate the temperature.
4. Automatic temperature setting (automatic)
When the printing task requires a major change in the extrusion speed or the printing speed is changed in real time, the printing speed must also be modified. In general, higher printing speeds require higher temperatures. Marlin can use the M109 S command B F To automatically control the temperature.
Using the M109 command without F settings will not automatically adjust the temperature. Otherwise, Marlin calculates the maximum extrusion speed (in steps / sec) of all the movement instructions in the cache, which is the so-called “max”. The value of the target temperature then passed through the formula t = tempmin + factor * max, while being limited between the minimum temperature (tempmin) and the maximum temperature (tempmax). If the target temperature is lower than the minimum temperature, the automatic setting will not work. Ideally, the user can use the M109 SBF at the start and the M109 S0 at the end without controlling the temperature.
5. Non -volatile memory (EEPROM)
Marlin firmware stores certain commonly used parameters, such as acceleration, maximum speed and units of each axis, in the EEPROM. Users can adjust these parameters during the printer calibration, then store them in the EEPROM. These changes take effect after restarting the printer and are saved permanently.
6. LCD menu (LCD menu)
If the equipment supports it, the user can create an offline intelligent controller (LCD screen + SDC + Encoder + Keys location). Users can adjust the temperature, acceleration, speed and speed in real time via the LCD menu, select and print the G code file in the SD card, preheat, deactivate the step -to -step engine and other operations. The most commonly used are the LCD2004 controller only and the LCD12864 controller only.
7. Support folders in the SD card (SD card files)
Marlin firmware can read G code files in sub-folders in SD cards, not necessarily files in the root directory.
8. Automatic printing of the SD card
If there is a file with the auto file name (0-9) .G in the root directory of the SD card, the printer will automatically start to print the file once it has been set up.
9. Endstop trigger reports
If the printer meets a limit switch during operation, Marlin will send the trigger position of the limit switch to the serial port and give a warning. This is useful for users to analyze the problems encountered during printing.
10. Coding paradigm
Marlin firmware adopts modular programming, allowing users to clearly understand the entire program. This offers a great convenience to upgrading the firmware to arm the system in the future
11. Temperature measures based on interruption
Stop all the way to manage the ADC conversion and check the temperature changes, which reduces the use of microcontroller resources.
12. Supports several mechanical structures
Ordinary XYZ orthogonal machinery, Corexy machinery, Delta machines and Scara machines.

Basic configuration

Open Marlin.ino with the Arduino IDE, switch to configuration.h to display and modify the file. Or you can use any text editor (notepad, Notpad ++, etc.) to open the configuration directly.h. The configuration of the Marlin firmware mainly includes the following aspects:
1. Communication BADS Rate
2. Type of motherboard, the type of motherboard used
3. Type of temperature sensor, including the extrusion head temperature sensor and the heating temperature sensor
4. Temperature configuration, including nozzle temperature and heating bed temperature
5. PID temperature control parameters, including cutting temperature control and heating temperature control
6. Limit switch
7. 4 Direction of the engine steps in steps
8. The initial position of the three axes of coordinates of X / Y / Z
9. Printer movement range
10. Automatic leveling
11. Speed ​​of motion
12. Movement resolution of each axis
13. Offline controller

According to my experience, Configuration.H in the firmware of Marlin modularizes each configuration, which is very easy to read and modify, and the annotations are very detailed. Friends with good English can easily understand the meaning of each parameter. Note that the Marlin firmware is written in language C, and the comments instructions are followed by “//” and will not affect the function of the code. In addition, #define is widely used in Marlin firmware. In short, this means the definition, including the definition of the value of a certain parameter and the definition of if there is a certain parameter.
The first two lines of unsuccessful declarations define the version and the author of the firmware. The default version number is compilation time. This does not need to be changed. Just change the author in your own name. Be careful not to include Chinese, otherwise it will be blurred.
#define string_version_config_h __date__ “” __time__ // Date and time of construction
#Define String_Config_H_AUTHOR “www.hfsrsw.com” // which made the modifications.

When the computer and the printer communicate via the serial port, you must define the port and baud rate. Here, the rate of origin and bauds of the 3D printing motherboard is defined. Simply use the default value for the port number. The default Baud rate of Marlin firmware is 250,000, which can also be changed to other values, such as 115,200, which is the standard Bauds rate value.
#define serial_port 0
#define Baudrate 250000

The type of motherboard is defined below. Marlin firmware supports a wide variety of 3D printer cards, such as common control cards such as ramps1.3 / 1.4, Melzi, Printrboard, Ultimainboard, Sanguinololu and other control tables. It should be noted that different motherboards use different ports and numbers of feet. If this definition is incompatible with the motherboard used in the Arduino IDE, it will certainly lead to the failure of the compilation. The author uses 1.4 and D8, D10 ramps controls a nozzle heating, heating heating and a fan outlet, so it is defined as 33.
#Ifndef motherboard
#Define Motherboard 33
#endif

Then has just defined the number of extruded heads and the type of power. The author uses a single head printer, so it is defined as 1. There are two types of food to choose. 1 represents switching power supply and 2 represents the X-Box 360 203 volts power supply. Generally, switching food is used, so it is defined as 1.
#Define extruders 1
#define power_supply 1

Then define the temperature sensor type, including the temperature sensor used for each nozzle (if it is a multi-publicity head) and the type of corridor of the temperature sensor. The commonly used temperature sensors include two categories: thermocouple and thermistor, and the thermists are divided into many types. Currently, 3D printers mainly use thermistors. You should judge which thermistor is for yourself or ask the seller. If nothing unexpected occurs, these are all NTC thermists of 100K, that is to say 1. According to the notation, 1 requires a tensile resistance of 4.7K, while according to the Wiki Reprap, almost all 3D printers use a 4.7K thermistor traction resistance. The author observed the circuits diagrams of several printed circuits cards and found that they all used a traction resistance of 4.7K, as shown in Figure 1.
// 1 is a 100k thermistor – Best choice for EPCOS 100K (4.7K Pullup)
The author’s printer is a single nozzle, so the temperature sensor of the first nozzle is configured like 1, the others are configured like 0 (0 means unused), and the temperature sensor of the heating bed is also configured as 1.
#define temp_sensor_0 1
#define temp_sensor_1 0
#define temp_sensor_2 0
#define temp_sensor_bed 1


Figure 1 4.7K Traction resistère

Then come a few configurations for temperature detection, including the double nozzle temperature difference, the M109 detection configuration and the configuration of the safe temperature. The author will explain it one by one below.
First, the following sentence configures the maximum temperature difference between the double spray head. If the temperature exceeds this value, the printer puts an end to the work. Therefore, for double spray head printer players, this parameter must be paid.
#Define Max_Redant_Temp_Sensor_DIFF 10
The following section configures the indicators to complete the M109 command. We know that the M109 command defines the temperature and the expectations of the nozzle. So when is it? The following three parameters control this time. The first parameter means that the temperature is “firm” and that the target temperature must last 10 seconds before the heating is considered to be finished. The second parameter means that the difference between the target temperature and the target temperature is “firm”. The third parameter means that the moment starts from the difference between the temperature and the target temperature does not exceed 1 degrees. From this moment, the target temperature and temperature last almost 10 seconds, and the heating is finished.
#define temp_residency_time 10
#define temp_hysteresis 3
#define temp_window 1
The lower and upper limits of the safe temperature range are arranged below, including each nozzle and heating bed. If the temperature exceeds the lower limit, the printer is launching a MINTEMP error and completes the work. If the upper limit is exceeded, the printer launches a Mixtemp error and ends the work. Marlin thus protects 3D printers. The minimum configuration temperature below is 5 °, the maximum nozzle temperature is 275 ° and the maximum temperature of the hot bed is 150 °.
#define heating_0_mintemp 5
#define heating_1_mintemp 5
#define heating_2_minttemp 5
#define bed_mintemp 5
#define heating_0_maxtemp 275
#define heating_1_maxtemp 275
#define heating_2_maxtemp 275
#define bed_maxtemp 150
If you want the M105 command to signal the power of the nozzle and the heating bed when declaring the temperature, you can remove the “//” in the previous two sentences. The specific power value must be calculated by the user.
#define extruder_watts (12.0 * 12.0 / 6.7)
#define bed_watts (12.0 * 12.0 / 1.1)
Then, a temperature control method is configured. Marlin provides two temperature control methods. One is the simple control of Bang-Bang. This control method is relatively simple and has a bad effect. The other is the control of the PID, that is to say the proportional-integral-differentia control method, which has a better control effect. Therefore, the author uses PID control. For detailed information on PID control, please check it yourself. Regarding the adjustment of PID parameters, it does not have a significant impact on ordinary 3D printer players. General settings can meet the temperature control needs, so you can simply use the default PID Ultimaker settings. For heating beds, use the default control method.
#define pidtemp

After having passed the temperature control method, it is time to protect the configuration of the extruder, in particular the prevention of extrusion and cold extrusion over long distances. To prevent cold extrusion means that when the temperature of the nozzle is less than a certain temperature, the extrusion action is not valid, while extrusion over long distances means that the extrusion distance cannot be greater than a certain length. The first sentence is to prevent the extrusion of cold, and the third sentence consists in defining the temperature of the extrusion of the cold, that is to say 170 °. Friends playing with chocolate or food printers must pay attention to this temperature value. The second sentence is to prevent long extrusion. The fourth game indicates the value of this distance, which is the sum of the length of the X axis and the length of the Y axis.
#Define prevent_dangeous_ extrude
#define prevent_lengthy_ extrude
#Define extrude_mintemp 170
#define extrude_maxlength (x_max_length + y_max_length)

The following large section has been set to prevent the temperature from becoming uncontrollable and cause fire. The author met this situation. At that time, thermistor was not placed on the nozzle then the heated all the time, which finally burned and exploded. The specific principle of this configuration is that if the difference between the measured temperature and the target temperature is greater than a certain value for a long time, the printer will end automatically, thus protecting the printer. Marlin comments on these sentences by default, that is to say that there is not such protection. If the user wants to make such protection, he has only anchoring the comment. The first sentence is to configure the detection time and the second sentence is to control the temperature gap. There are similar configurations for heated beds. It should be noted that the increasingly major heat beds are used, which leads to a very slow heating speed, so you should prevent it be incorrectly.
#define thermal_runaway_protection_period 40
#define thermal_runaway_protection_hysterese 4
#define thermal_runaway_protection_bed_period 20
#define thermal_runaway_protection_bed_hysterère 2

Finally, we arrived at the mechanical configuration part, and the first thing we must configure is the limit switch. The general configuration is that all limit switches use sweater resistors and that the mechanical limit switch is connected to the normally closed section. In normal circumstances (not triggered), the signal terminal (signal) is a low potential. When the limit switch is triggered, the switch is in an open circuit state and the signal terminal is a high potential. It is the same as the logic of default limit switching in Marlin.

First, continue to use tensile resistances.
#Define endstopullups
Then, all limit switches use tensile resistances.
#ifdef endstopullups
#define endstoppullup_xmax
#define endstoppullup_ymax
#define endstoppullup_zmax
#define endstoppullup_xmin
#Define Endtupullup_ymin
#define endstoppullup_zmin
#endif
The following is the logical configuration of the limit switch. If the limit switch connection method is that the GND terminal connects to the limit switch terminal of the limit switch and the signal terminal connects to the normally closed terminal (NC) of the limit switch, define the logic corresponding to the limit switch to False, if not adjusted to True. If the printer used only has the minimum value limit switch, keep the default settings.
Const Bool x_min_endstop_inverting = False;
Const Bool y_min_endstop_inverting = False;
Const Bool Z_Min_EndStop_InVERTING = FALSE;
Const Bool x_max_endstop_inverting = True;
Const Bool y_max_endstop_inverting = True;
Const Bool z_max_endstop_inverting = True;
Some printers do not use 6 boundary switches. In most cases, they use 3 minimum limit switches, while none of the maximum value limit switches is used. Marlin firmware allows the user to specify the limit switch used. The following two lines can be selected to indicate to the printer which limit switches are not used. The author only uses limit switches to the three minimum values, so the maximum value limit switches are disabled. This is the commentary on the first line “//”.
#Define disable_max_endstops
// # Define disable_min_endstops

The step-by-step engine is configured below. The front and opposite steering of the step -by -step engine is mainly configured. You can change the configuration according to the real situation. If you notice that the movement of movement of a certain step -by -step engine is incorrect, modify the corresponding configuration in opposite value.
#define invert_x_dir True
#define invert_y_dir false
#define invert_z_dir True
#define invert_e0_dir false

Then, the initial regression bit position is configured, -1 means that the initial position is at the minimum coordinate value, and 1 means that the initial bit is the maximum coordinate value. The configuration of the author’s printer is as follows:
#define x_home_dir -1
#define y_home_dir -1
#define z_home_dir -1

Then comes how Marlin determines the position where the steps in step has reached the border. The flexible limit consists in determining whether the coordinate value of the nozzle has exceeded the printer range, otherwise it is determined if it is out of the basis of the state switch’s condition. Since the author’s printer limit switches are all at the minimum value, in order to record IT resources, only the soft limit mode is necessary for the maximum value. The configuration is as follows:
#define min_software_endstops false
#define max_software_endstops True
Then, in order to properly determine if the nozzle is out of charge, it is necessary to correctly configure the printer print beach. Max is the maximum coordinate and Min is the minimum coordinate. The author’s printers beach is 200 × 200 × 160 mm, so the configuration is as follows:
#define x_max_pos 200
#define x_min_pos 0
#define y_max_pos 200
#define y_min_pos 0
#define z_max_pos 160
#define z_min_pos 0
The next large automatic level control section is that the author believes that current 3D printers have an unequal platform problem, so automatic leveling does not work much, so automatic leveling is not used to ensure that the following sentence is in annotated condition.
// # Define Active_Auto_Bed_Leveling

Then it is time to configure the movement options of the steps step by step. First, define the number of axes. For single head machines, it must be 4 axes, namely the X axis, the Y axis, the Z axis and the E axis. Then there is the speed of regression to the initial bit, note that the unit is millimeters per minute. The speed of regression of the Z axis at the initial bit is relatively slow, and there is no initial bit in the axis E, so it is set on 0.
#Define NUM_AXIS 4
#define homing_feedrate {50 * 60, 50 * 60, 4 * 60, 0}

Then, four very important parameters are configured, the movement resolution of each axis, that is to say that 1 mm of movement occurs in each direction of the axis and the number of steps in the corresponding step by step. In general, the X axis and the Y axis are synchronous and synchronous belt structures, the Z axes are steps in step by step + screw and the extruder is a step by step + speed of speed structures. These four parameters can be calculated by the calculator (in the tool menu) in the Repetier-Host software.
For the X axis and the Y axis, the calculation principle is that the steps of step by step turns for a 360 ° cycle. At the same time, the synchronization wheel runs for a cycle. If the synchronization wheel is 17 teeth, the length of 17 teeth tasks will be moved to a point of the synchronization belt. If the synchronization belt is a 2 mm dental step, a 34 mm movement will occur. If the PAS engine angle is 1.8 ° and the driver’s subdivision is 1/16, the PAS engine will take 360 ​​/ 1.8 * 16 = 3200 steps. Consequently, the resolution of the X axis and the axis y is 3200/34 = 94.12.
For the Z axis, the step -by -step engine runs for a tour and also runs 3,200 steps. If the lead of the screw is 8 mm, that is to say that the screw turns a tower and the screw nut is 8 mm, then the resolution of the Z axis is 3200/8 = 400.
For extruders, if it is proximal extrusion and that no acceleration or reduction gear is necessary, the engine step by step turns for a turn and leads to the extrusion equipment to turn during a trick, then the consumables are extruded out of the distance “circumference of the extrusion equipment”. If the diameter of the extrusion gear is 10 mm, the resolution of the E axis is 3200 / (10 * 3.14) = 101.86. If the extruder engine has a reducer, this value must be divided by the reduction ratio.
Therefore, the author’s configuration is as follows:
#define default_axis_steps_per_unit {74.12,74.12,400,101.86}

The rest is the configuration of maximum speed and acceleration. In general, the default value is just used. If you notice that the printer is very hard, it may be due to excessive acceleration. You can change the first two values ​​in the second line to 3000 and the default acceleration value of the three lines to 1000.
#define default_max_feedrate {500, 500, 5, 25}
#define default_max_acceleration {9000,9000,100.10000}
#define default_acceleration 3000
#define default_retract_acceleration 3000
#define default_xyjerk 20.0
#define default_zjerk 0.4
#define default_ejerk 5.0

The motherboard that I use is ramps1.4, and many offline smart controllers can be used, that is to say that you can control the printer without using the menu online in the display screen. The author uses the LCD12864 controller, then delete comments in the following sentence and tell the firmware to use this controller.
#define reprop_discount_full_graphic_smart_controller
Another commonly used controller is the LCD2004 controller. Using this model, you must delete comments from the following sentence and comment on other controller options. Users can also choose other controllers, just make the corresponding configuration.
#define repri_discount_smart_controller
The intelligent controller has a preheating menu, that is to say to select PLA preheating and preheating abs, and the specific temperature can be modified. When I print plans, the temperature of the nozzle is generally set to 210 ° and the temperature of the heating bed is set to 40 °; During ABS printing, the temperature of the nozzle is set to 230 ° and the temperature of the heating bed is set to 60 °. Therefore, the configuration is as follows:
#Define PLA_PEHEAT_HOTEND_TEMP 210
#Define PLA_PEHEAT_HPB_TEMP 40
#Define PLA_PEHEAT_FAN_SPEED 255
#Define Abs_pereat_hotend_Temp 230
#Define Abs_PEREAT_HPB_TEMP 60
#Define ABS_PEREAT_FAN_SPEED 255

At this stage, Marlin’s basic configuration is over. You can select the type of port and card corresponding via the Arduino IDE, then compile it and download it from the motherboard. You can debug the printer via repeat-host or printrun software. If you find problems, adjust the firmware settings and download them again until the printer works normally.

Tags :

Share this :

Leave a Reply

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

Contact Us for Assistance: Your Questions Matter!

Great Light can handle your 3D Printing whether you need a few parts or over 10,000 end-use units. Check out the variety of custom 3D Printing services we offer to take your designs from concept to reality quickly and accurately.