The core print settings, such as the nozzle temperature, the bed temperature, and the print speed, are the first things that come to mind for the topic of print optimization, as the correct configuration of these values is crucial for the printing process to succeed.
On the other hand, while it doesn’t get mentioned as often, ensuring that your 3D printer is calibrated correctly is equally essential as configuring the print parameters optimally, as proper calibration is the only way for your 3D printer’s calculations to match the real-world values and conduct the printing process without problems.
In today’s article, we will learn more about setting the home offsets of your 3D printer by using the M206 and the M428 G-codes in Marlin firmware, which is a crucial step of calibration to get the 3D printer ready before the print starts.
So, how can you set home offsets with the M206 and M428 G-codes in Marlin firmware?
To set your home offsets with the M206 G-code command, you will need to specify the X, Y, and Z offsets you would like to use while you’re issuing the M206 command to your 3D printer.
On the other hand, to set the home offsets with M428, you will need to move the printhead to the position you would like to be the new home position and then issue the M428 G-code command to your 3D printer.
Next up, we will take a more detailed look into the process of setting home offsets with both the M206 and the M428 G-codes in Marlin firmware and discuss the differences between the M851 and the M206 G-codes that are often confused with one another.
Table of Contents
How to Set Home Offsets with the Marlin M206 (Set Home Offsets) G-Code?
As the auto-homing process that the 3D printer follows isn’t always accurate due to reasons such as the endstops not being correctly positioned, setting the home offsets often becomes a necessary procedure.
When setting the home offsets of your 3D printer with the M206 G-code command in Marlin, all you need to do is to specify for which axes you would like to set the offsets by passing the corresponding parameters alongside the values that you would like the offsets to become.
The three parameters that the M206 G-code command accepts are X, referring to the X home offset, Y, referring to the Y home offset; and Z, referring to the Z home offset, with each parameter accepting a millimetric value that determines the new offset value.
For instance, if we are to set the X home offset to 2 millimeters and the Z home offset to minus 0.5 millimeters, the corresponding command to execute would be as follows:
M206 Z-0.5 X2
In this example, we have used the X parameter for the X home offset with a value of 2 millimeters and the Z parameter for the Z home offset with a value of minus 0.5 millimeters.
If you would like to make the offsets that you have set with the M206 G-code command persistent, remember to execute the M500 (Save Settings) G-code command to save the modification to the EEPROM.
How to Set Home Offsets with the Marlin M428 (Home Offsets Here) G-Code?
While the M428 G-code doesn’t do anything extra that is not possible with the M206 command, it offers an alternative way to set the home offsets of your 3D printer, which can be more straightforward to utilize in some scenarios.
To successfully set the home offsets with the M428 G-code command in Marlin, you will first need to move the printhead to the correct location with the G0 (Linear Move) command, and once the printhead is appropriately positioned, execute the M428 command.
To follow the example from the previous section, let’s assume that you will be setting the X home offset to 2 millimeters and the Z home offset to minus 0.5 millimeters once more, but this time, with the M428 G-code command.
G0 X-2 Z0.5
In this example, we have moved the X-axis to the position of -2 and the Z-axis to the position of 0.5 on the coordinate plane before invoking the M428 G-code command to make this position the new home of the 3D printer.
What this means is that the X-2 position became the new X0 and the Z0.5 position became the new Z0, essentially offsetting the X-axis by 2 millimeters and the Z-axis by minus 0.5 millimeters.
Once again, remember to use the M500 G-code command to carry the settings over to the EEPROM if you would like to make the new home offsets permanent.
What Is the Difference Between M851 (XYZ Probe Offset) and M206 (Set Home Offsets)?
The M851 and the M206 G-codes are perhaps the two G-codes that 3D printing enthusiasts confuse with each other the most, as they are both related to setting offsets, as apparent from their description.
The M206 G-code command sets the home offsets, which essentially are the X, Y, and Z positions relative to the positions of the endstops where the printhead will move as a result of executing the Auto Home (G280) command, also known as the home position.
On the other hand, the M851 G-code command configures the probe offsets, which are the values that determine the X, Y, and Z distances between an automatic bed leveling probe (such as the BLTouch) and the nozzle.
While configuring both the home offsets and the probe XYZ offsets is vital for a successful 3D printing process, these values (and hence the G-code commands) are entirely different from each other except that they both contain the word “offset” in them.
As both the M428 and the M206 G-codes essentially fulfill the same duty of allowing you to set the home offsets of your 3D printer, you can feel free to use the one that you think would be the most convenient in the current scenario.
To quickly recap, while setting the home offsets with the M206 G-code command allows you to conduct the process with a single line of G-code that contains the coordinate information, using the M428 command requires you to manually move the position of the printhead to the desired position first.
Between the two, we can consider the M206 G-code to be more straightforward to use in general. On the other hand, as using the M428 G-code will allow you to see the printhead’s position physically, it may produce more accurate results.
Mike started his 3D printing journey with the Anet A8 when it first came out back in 2017, and has been obsessed with 3D printers ever since. Nowadays, he primarily uses his Ender 3 to print functional parts that make his life more convenient whenever possible.