<p>As to <strong>why</strong> this happens, particularly with a budget printer the end-stop mountings may not be particularly precisely located, or the moving part may actuate the endstop slightly differently in each build. In my case, replacing the hot end (and thus the whole carriage) gave me an offset of some cm. With this upgrade, it was impossible to retain the stock calibration since the extruder dimensions are quite different.</p>

<p>As to <strong>how to fix it</strong>, the easiest way for me was to modify the 'start g-code'. This fix only applies to the particular slicer, means that what I slice for my A8 won't be centred on the work maker-club Prusa, but doesn't need me to mess about with firmware or apply a per-model update.</p>

<p>After the Z-home operation, I already have a pre-extrude step. Prior to this, I set the actual position of what I want my homed point to be, using <code>G92</code></p>

<pre><code>M82          ; absolute extrusion mode
G28          ; home all
G92 X17 Y-12 ; re-define origin
G92 E0.0     ; reset extruder distance position
</code></pre>

CC BY-SA 4.0
2018-07-12T12:33:24.917Z
Limit switch mount errors should be considerably less than a millimeter.  My impression of the OP is that he's off-center by a large amount consistent with failure to include head offset in the slicer.
Carl Witthoft
CC BY-SA 4.0
2018-07-12T12:39:49.953Z
With the A8, I thought the limit switch mounts used a screw-in-slot - or maybe that was only for Z. I can imagine the actual switch provided might vary between batches too, so it could be a few mm...
Sean Houlihane
CC BY-SA 4.0
2018-07-12T07:55:06.553Z
2018-08-13T17:13:55.743Z
2018-08-13T17:13:55.743Z
Sean Houlihane
<p>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.</p>
<h2>Printer origin?</h2>
<p>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 <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/Configuration.h" rel="nofollow noreferrer">configuration of Marlin</a> 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:</p>
<pre>
 *      +-- BACK ---+
 *      |           |
 *    L |    (+)    | R
 *    E |           | I
 *    F | (-) N (+) | G
 *    T |           | H
 *      |    (-)    | T
 *      |           |
 *      O-- FRONT --+
 *    (0,0)
 * .(-Xh, -Yh)
</pre>
<h2>How do I find the physical origin of the printer?</h2>
<p>This can be tested by instructing the head/nozzle to go to e.g. (0, 0, 15) using a <a href="/q/10573">terminal/console</a> or a simple G-code file with a move to that coordinate that you print from SD card (e.g. <code>G1 X0 Y0 Z15 F500</code>); <em>note a Z of 15 is chosen for safety!</em>. 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.</p>
<p>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 &quot;Origin at center&quot; 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 (<strong>beware!</strong> in some printers the origin is in the middle of the plate) you might have incorrect endstop to origin offsets.</p>
<h2>Determine the offset first!</h2>
<p>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. <a href="https://www.printables.com/model/832144-bed-center-calibration-tutorial-using-parametric-c" rel="nofollow noreferrer">this design</a>). There are many things (<code>.stl</code> models) 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.</p>
<p><em>Example of a bed center calibration model</em><br>
<a href="https://i.sstatic.net/9eM3Wm.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9eM3Wm.jpg" alt="bed center calibration model" /></a></p>
<p>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; <strong>this is also an excellent test for the level of your bed!</strong>
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!</p>
<h2>How to fix this!</h2>
<p>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.</p>
<ol>
<li><p>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.</p>
</li>
<li><p>Another simple and popular solution is applying an <strong>offset in the slicer</strong>. You could do that in the printer options some of the available slicers. If such options are not available, you could add <strong>G-code commands in the start code</strong> to create the offset (e.g. <code>G1</code> X-2 moves to the left and <code>G92 X0</code> resets 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 <code>.gcode</code> with fellow enthusiasts with the same printer may have adverse effects.</p>
</li>
</ol>
<p>A far better solution is to fix the center in the firmware so that the printer knows the <strong>actual</strong> 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.</p>
<ol start="3">
<li>A prerequisite of this method is that it requires the <a href="https://reprap.org/wiki/G-code" rel="nofollow noreferrer">G-code command</a> <code>[M206](https://reprap.org/wiki/G-code#M206:_Offset_axes)</code> 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 <code>M206</code>, it would be time to upload a new firmware like e.g. <a href="https://github.com/MarlinFirmware/Marlin" rel="nofollow noreferrer">Marlin Firmware</a> making this particular printer safer as the stock firmware does not include thermal runaway protection! See question: &quot;<a href="/q/8466/">What is Thermal Runaway Protection?</a>&quot;. 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 <a href="http://www.pronterface.com/" rel="nofollow noreferrer">PronterFace</a>, <a href="https://www.repetier.com/" rel="nofollow noreferrer">Repetier-Host</a>, <a href="https://octoprint.org/" rel="nofollow noreferrer">OctoPrint</a>, and probably many more have such an interface. A simple alternative that works also is creating a text file (with <code>.gcode</code> extension) with the commands on separate lines and executing the &quot;print&quot;. The following codes need to be sent: <code>M206</code> e.g. <code>M206 X-2 Y2</code> (move center left and to the back, note to use integer values, float values are not allowed!) and store this new center with <code>M500</code>.</li>
</ol>
<p>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: &quot;<a href="/q/5848">How to upload firmware to reprap printer?</a>&quot;. 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.</p>
<ol start="4">
<li>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 <a href="https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/Configuration.h" rel="nofollow noreferrer">configuration file</a>, this is similar in other firmware software solutions:</li>
</ol>
<pre>
// 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
</pre>

CC BY-SA 4.0
2023-12-28T16:19:20.640Z
Thanks for this very detailed explanation! I have an offset for x of -115mm and y of -123mm when I set the `X_MIN_POS` & `Y_MIN_POS` accordingly, I can't compile the firmware anymore, it says error: `static assertion failed: Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE`. Adapting `X` and `Y_BED_SIZE` results in the same error. It's an _Ender 3_. Any advice? Thanks a lot!
Christian Baumann
CC BY-SA 4.0
2023-12-28T22:15:21.793Z
@ChristianBaumann Your offsets are impossible values, no wonder it doesn't work.
0scar
CC BY-SA 4.0
2018-07-11T20:25:53.417Z
2024-04-18T08:46:55.920Z
2024-04-18T08:46:55.920Z
0scar
<p>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.</p>

<ul>
<li>Why is the print not centered on the bed?<br><em>It was centered in the slicer before generating the G-code.</em></li>
<li>How can I center the print to make it fit on the heated build platform?</li>
</ul>

<heated-bed><calibration><build-plate><knowledgebase><homing>
How to center my prints on the build platform? (Re-calibrate homing offset)
0scar
# How to center my prints on the build platform? (Re-calibrate homing offset)

(Asked by: username_0 on 2018-07-11)

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?

**Tags:** heated-bed, calibration, build-plate, knowledgebase, homing

---

## 2 answers

### Answer by username_0 on 2018-07-11. Score: 20 | Accepted answer

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.
Printer origin?
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 --+
 *    (0,0)
 * .(-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 (.stl models) 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.
Example of a bed center calibration model

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. G1 X-2 moves to the left and G92 X0 resets 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 .gcode with 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 .gcode extension) with the commands on separate lines and executing the "print". The following codes need to be sent: M206 e.g. 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 M500.

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

> **Comments:**
> **username_3**: Thanks for this very detailed explanation! I have an offset for x of -115mm and y of -123mm when I set the `X_MIN_POS` & `Y_MIN_POS` accordingly, I can't compile the firmware anymore, it says error: `static assertion failed: Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE`. Adapting `X` and `Y_BED_SIZE` results in the same error. It's an _Ender 3_. Any advice? Thanks a lot!  
> **username_0**: @ChristianBaumann Your offsets are impossible values, no wonder it doesn't work.  

---

### Answer by username_1 on 2018-07-12. Score: 4

As to why this happens, particularly with a budget printer the end-stop mountings may not be particularly precisely located, or the moving part may actuate the endstop slightly differently in each build. In my case, replacing the hot end (and thus the whole carriage) gave me an offset of some cm. With this upgrade, it was impossible to retain the stock calibration since the extruder dimensions are quite different.
As to how to fix it, the easiest way for me was to modify the 'start g-code'. This fix only applies to the particular slicer, means that what I slice for my A8 won't be centred on the work maker-club Prusa, but doesn't need me to mess about with firmware or apply a per-model update.
After the Z-home operation, I already have a pre-extrude step. Prior to this, I set the actual position of what I want my homed point to be, using G92
M82          ; absolute extrusion mode
G28          ; home all
G92 X17 Y-12 ; re-define origin
G92 E0.0     ; reset extruder distance position

> **Comments:**
> **username_2**: Limit switch mount errors should be considerably less than a millimeter.  My impression of the OP is that he's off-center by a large amount consistent with failure to include head offset in the slicer.  
> **username_1**: With the A8, I thought the limit switch mounts used a screw-in-slot - or maybe that was only for Z. I can imagine the actual switch provided might vary between batches too, so it could be a few mm...  

---

