How to center my prints on the build platform? (Re-calibrate homing offset)
When I print large prints close to (but not exceeding) the maximum dimensions of the heated build platform on my Anet A8, the brim or skirt or the print itself is printed outside the heated bed, while there is some space left at the opposite sites. It appears as if the print is not in the center.
- Why is the print not centered on the bed?
It was centered in the slicer before generating the G-code.
- How can I center the print to make it fit on the heated build platform?
- Why is the print not centered on the bed?
When centered in the slicer correctly, without offsets defined in the slicer, the printer is most probably incorrectly configured! Luckily you can do something about that! Basically, you will have to calibrate the printer for a new center.
First of all, the firmware determines where your origin of the printer is. This implies that you need to properly set bed dimensions and offset values from the end stop switches in the firmware (usually not necessary out-of-the-box, but important when a newer or different firmware version is uploaded). These offsets determine where the origin of the bed plate is located. For Marlin firmware it is very common (for most printers) to have the origin specified at the front left corner (when facing the printer). From the configuration of Marlin we find the origin is e.g. in the front-left corner. Note that this can be rotated 180 degrees in certain printers, so the aft-right. Also be aware that there are a few printers that have the origin in the center, e.g. Delta's and a few Cartesian printers. Marlin definition (edited snippet) of a common bed layout:
* +-- BACK ---+
* | |
* L | (+) | R
* E | | I
* F | (-) N (+) | G
* T | | H
* | (-) | T
* | |
* O-- FRONT --+
* .(-Xh, -Yh)
How do I find the physical origin of the printer?
This can be tested by instructing the head/nozzle to go to e.g. (0, 0, 15) using a terminal/console or a simple G-code file with a move to that coordinate that you print from SD card (e.g.
G1 X0 Y0 Z15 F500); note a Z of 15 is chosen for safety!. When this is performed, the nozzle should be at the (elevated, so X, Y) origin as defined by your firmware. Usually this is at the left front corner of your build plate (there may be clips there, so therefore the elevated value), but this may be different depending on the firmware settings or firmware brand.
Next step is to configure the slicer as such that this coincides with the actual origin. Incorrect slicer settings can cause the slicer to assume the origin is at a different position than your actual position. In Ultimaker Cura, the "Origin at center" is notoriously known for this when the physical origin is not in the center, but in a corner. When the slicer is properly instructed, but the origin is still not at the corner of the build plate (beware! in some printers the origin is in the middle of the plate) you might have incorrect endstop to origin offsets.
Determine the offset first!
To quantify the offset of the center as it is known by the printer software (firmware) it is advised to print a large square that is a few percentage smaller than the maximum size of the bed. E.g. you can create a square hull at e.g. 90 % of the dimensions of the bed (parametric designs are very useful for this purpose, see e.g. this design). There are many things (
.stlmodels) to be found on the internet. If it includes a cross, even better as some platforms have a mark in the center of the bed.
Once printed, measure the distance from every edge from the build platform to the printed square. If you fail to print the square, please check the level of the platform; this is also an excellent test for the level of your bed!
The measurements should give you a notion of the offset of the bed. E.g. for the X-axis you measure a distance of 12 mm on the left and 8 mm on the right (when facing the printer) you can easily deduce that the center is (12 - 8)/2 = 2 mm to the right (positive X direction). This implies that the printer manufacturer has done a lousy job by delivering you a printer with an offset bed; better said incorrectly configured in their firmware. Note this is not uncommon!
How to fix this!
Once you quantified the offset, you want to be sure that your next print prints in the middle of the bed. How to proceed? Basically there are a couple of solutions you can use, each with its own advantages and disadvantages.
A simple solution (i.e. if the printer support this) is to adjust the position of the endstops. Alternatively you can print alternate endstop holders to match the position change as measured from the calibration print.
Another simple and popular solution is applying an offset in the slicer. You could do that in the printer options some of the available slicers. If such options are not available, you could add G-code commands in the start code to create the offset (e.g.
G1X-2 moves to the left and
G92 X0resets the X origin). Note that this is a quick fix and should be applied wisely. The printer does not know where the actual center is! You merely changed if after the homing sequence. Exchanging
.gcodewith fellow enthusiasts with the same printer may have adverse effects.
A far better solution is to fix the center in the firmware so that the printer knows the actual center. This requires some extra effort by uploading firmware (files including configuration settings) to the printer or send G-code commands. The latter option will be discussed first.
- A prerequisite of this method is that it requires the G-code command
[M206](https://reprap.org/wiki/G-code#M206:_Offset_axes)to be supported by your firmware; note that not all 3D printer firmware solutions are able to use this G-code command for axes offset definition. E.g. the stock Anet A8 runs a modified Repetier version that does not support
M206, it would be time to upload a new firmware like e.g. Marlin Firmware making this particular printer safer as the stock firmware does not include thermal runaway protection! See question: "What is Thermal Runaway Protection?". To send G-code commands to a printer you have the option to hook up your computer to the printer over USB and use a 3D printer program that support sending commands to the printer (this is called a terminal; i.e. an interface to the printer). Programs like PronterFace, Repetier-Host, OctoPrint, and probably many more have such an interface. A simple alternative that works also is creating a text file (with
.gcodeextension) with the commands on separate lines and executing the "print". The following codes need to be sent:
M206 X-2 Y2(move center left and to the back, note to use integer values, float values are not allowed!) and store this new center with
The final, best solution is to set it fixed in the firmware. This requires an upload of a more recent configured version of an applicable firmware. See e.g. question: "How to upload firmware to reprap printer?". Note that there are different methods to upload a firmware to the board, it is best to search the internet for the applicable method for your board.
- To do that you will have to be comfortable with computer software and tools to build source files and upload binary code to the printer. This depends on the type of firmware you choose and therefore cannot be described for each firmware in detail. Various sources on the internet describe this process. Generally speaking, it requires you to set the bed and offset values/positions correctly. For Marlin Firmware this comes down to changing the settings in the configuration file, this is similar in other firmware software solutions:
// The size of the print bed
#define X_BED_SIZE 220
#define Y_BED_SIZE 220
// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS -35 ; used to be -33, so 2 mm shift to left now
#define Y_MIN_POS -8 ; used to be -10, so 2 mm shift to the back
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 240