<p>If you enabled <code>Z_SAFE_HOMING</code>, then automatically the printer homes Z at the middle of the build plate, if the bed size dimensions are correctly defined (in your case <code>X_BED_SIZE</code> and <code>X_BED_SIZE</code> should be defined as 300).</p>
<p>In <code>Configuration.h</code> you can find:</p>
<pre><code>#define Z_SAFE_HOMING

#if ENABLED(Z_SAFE_HOMING)
  #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2)    // X point for Z homing when homing all axes (G28).
  #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2)    // Y point for Z homing when homing all axes (G28).
#endif
</code></pre>
<p>If <code>Z_SAFE_HOMING</code> was enabled, and the bed properly dimensioned, it could be that the steps/mm are incorrectly defined.</p>
<p>Note that if a probe is used, the offset of the probe to the nozzle center is taken into account, this implies that the probe is moved to the center, not the nozzle. The code responsible for this is found in <code>G28.cpp</code>:</p>
<pre><code>/**
 * Move the Z probe (or just the nozzle) to the safe homing point
 * (Z is already at the right height)
 */
destination.set(safe_homing_xy, current_position.z);

TERN_(HOMING_Z_WITH_PROBE, destination -= probe.offset_xy);
</code></pre>
<p><em>I.e. the ternary operation (<code>TERN_</code>) determines the addition of the probe offset.</em></p>

CC BY-SA 4.0
2020-05-08T21:01:07.310Z
It worked perfectly. The only comment is that it centers the BL TOUCH probe instead of the extruder nozzle. Do you recommend to subtract the distance between the probe and the extruder nozzle and modify the Z_SAFE_HOMING_X_POINT value accordingly or there is a smarter way to input that distance in an initialization stage of the code?
STATHIS
CC BY-SA 4.0
2020-05-09T06:07:53.120Z
@STATHIS You **should probe the middle of the bed with the probe**, not the nozzle! This way the probe determines the height of the bed for the nozzle. But yes you can alter the values if you want, but that wouldn't be necessary.
0scar
CC BY-SA 4.0
2020-05-07T15:49:50.227Z
2020-10-06T21:48:12.783Z
2020-10-06T21:48:12.783Z
0scar
<p>I have a printer with the following dimensions: L300 x W300 x H400. After flashing Marlin software, the extruder keeps homing at X77 Y50 instead of X150 Y150 that is the center of the printing area for me. Where can I find the appropriate line in config file in order to edit it with preferred coordinates. Unfortunately I can only find info on how to change offset of origin point. In my case origin point is correcty set.</p>

CC BY-SA 4.0
2021-02-04T02:14:10.123Z
Hi, did the answer help your problem or did you find a solution yourself? If the answer helped then please mark it as the accepted answer, otherwise post please post your own solution and mark it as the accepted answer. That way the question will be removed from the unanswered question queue. Many thanks.
Greenonline
<homing>
Define coordinates for Z homing
STATHIS
# Define coordinates for Z homing

(Asked by: username_0 on 2020-05-07)

I have a printer with the following dimensions: L300 x W300 x H400. After flashing Marlin software, the extruder keeps homing at X77 Y50 instead of X150 Y150 that is the center of the printing area for me. Where can I find the appropriate line in config file in order to edit it with preferred coordinates. Unfortunately I can only find info on how to change offset of origin point. In my case origin point is correcty set.

**Tags:** homing

> **Comments:**
> **username_1**: Hi, did the answer help your problem or did you find a solution yourself? If the answer helped then please mark it as the accepted answer, otherwise post please post your own solution and mark it as the accepted answer. That way the question will be removed from the unanswered question queue. Many thanks.  

---

## 1 answers

### Answer by username_2 on 2020-05-07. Score: 1

If you enabled `Z_SAFE_HOMING`, then automatically the printer homes Z at the middle of the build plate, if the bed size dimensions are correctly defined (in your case `X_BED_SIZE` and `X_BED_SIZE` should be defined as 300).

In `Configuration.h` you can find:

```
#define Z_SAFE_HOMING

#if ENABLED(Z_SAFE_HOMING)
  #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2)    // X point for Z homing when homing all axes (G28).
  #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2)    // Y point for Z homing when homing all axes (G28).
#endif

```

If `Z_SAFE_HOMING` was enabled, and the bed properly dimensioned, it could be that the steps/mm are incorrectly defined.

Note that if a probe is used, the offset of the probe to the nozzle center is taken into account, this implies that the probe is moved to the center, not the nozzle. The code responsible for this is found in `G28.cpp`:

```
/**
 * Move the Z probe (or just the nozzle) to the safe homing point
 * (Z is already at the right height)
 */
destination.set(safe_homing_xy, current_position.z);

TERN_(HOMING_Z_WITH_PROBE, destination -= probe.offset_xy);

```

*I.e. the ternary operation (`TERN_`) determines the addition of the probe offset.*

> **Comments:**
> **username_0**: It worked perfectly. The only comment is that it centers the BL TOUCH probe instead of the extruder nozzle. Do you recommend to subtract the distance between the probe and the extruder nozzle and modify the Z_SAFE_HOMING_X_POINT value accordingly or there is a smarter way to input that distance in an initialization stage of the code?  
> **username_2**: @username_0 You **should probe the middle of the bed with the probe**, not the nozzle! This way the probe determines the height of the bed for the nozzle. But yes you can alter the values if you want, but that wouldn't be necessary.  

---

