<p>As you just flashed your own Marlin, you probably have the <code>marlin.ino</code> and its associated files in the <strong>Arduino IDE</strong> set for your Processor and board and know how to work with them to some degree. This is <em>just the short version</em> <strong>where</strong> to find <strong>what</strong> you need to change the bed size, if the marlin.ino is based on the <strong><a href="http://marlinfw.org/" rel="nofollow noreferrer">marlinfw-release</a></strong>.</p>
<h1>Changing &quot;home&quot;</h1>
<p>In <code>Configuration.h</code> there should be a set of lines that reads akin to this:</p>
<pre><code>// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 200
</code></pre>
<p>Usually it is faster to use <code>Ctrl</code>+<code>F</code> and then typing in <code>X_MIN_POS</code> and adding the hook in front of <em>Search all Sketch Tabs</em> and then moving through all the finds till the right one pops up. This not only brings you right to the lines you want to alter, but also covers up the bases in case the distribution you work with did put the movement limits into a different location like <code>Configruration_adv.h</code>.</p>
<h1>Changing Bed Size</h1>
<p>Alter these minimum positions and make sure that the Maximum positions (usually just after them) to fit the maximum of the bed.</p>
<p>If you reduced your bed size, you also might need to change <code>X_BED_SIZE</code> and <code>Y_BED_SIZE</code>, which (in the marlin.ino) is in the same <code>Configuration.h</code> - I found it to preceede the Travel limits:</p>
<pre><code>// The size of the print bed
#define X_BED_SIZE 200
#define Y_BED_SIZE 200
</code></pre>
<p>Adjust these as needed to fit the new sizing.</p>
<h1>Hint: Getting the Values for Adjusting</h1>
<p>For finding the adjusted values, I have had good experiences using Repetier Host on <em>Manual Control</em> to move the nozzle (lifted 1mm to prevent any accidents) into the correct XY-position and taking this position as adjustments for the minimum positions. Finding your personal settings is a bit of a trial and error still, <em>so take your time</em>.</p>
<h1>Finishing up</h1>
<p>Now, recompile the marlin.ino (the checkmark in the top left) to check for errors and <a href="https://3dprinting.stackexchange.com/questions/6685/how-to-install-new-firmware-with-a-bootloader">flash the new firmware</a> it.</p>

CC BY-SA 4.0
2018-08-15T23:00:52.037Z
Thanks! The starting (x,y,z) values in my config were (-33, -12, 0) and it took me a bit of experimentation to figure out that to adjust the bounds of the bed 12mm right and 5mm back I needed to go to (-45,-17,0), but having sorted that out (and adjusted the max positions accordingly) everything seems to be working the way I'd expect.
AwesomeTown
CC BY-SA 4.0
2018-08-16T07:39:56.110Z
@AwesomeTown remember to adjust the ?_BED_SIZE correctly - I forgot to include their lines in the old version, fixed that.
Trish
CC BY-SA 4.0
2018-08-15T07:13:02.737Z
2018-08-16T08:29:28.630Z
2020-06-18T08:29:41.667Z
Trish
<p>I have an Anet A8 that I just flashed with the latest Marlin firmware (1.1.9). I'm sending prints to my printer with Ultimaker Cura via OctoPrint.</p>

<p>I have affixed a PEI surface to my bed that's about 10&nbsp;mm smaller in each direction than the full size of the bed (that is, I lose about 5&nbsp;mm on each side of the bed). This hasn't been a huge problem as usually I account for this myself and just make sure there's lots of room on each side of a print, but having upgraded my firmware, I'd like to take advantage of Marlin's bi-linear bed-levelling. Unfortunately, several of the points it chooses are outside the bounds of my PEI surface and so it's impossible to get a decent setting for those points.</p>

<p>What's the "correct" way to configure Marlin to know that my bed size is actually smaller than it thinks it is? Do I need to additionally adjust settings in Ultimaker Cura and/or OctoPrint?</p>

CC BY-SA 4.0
2019-07-28T08:13:30.277Z
The answer to the question can be found in [How to center my prints on the build platform? (Re-calibrate homing offset)](/q/6375). You need to set correct bed size dimensions and offsets from end stops. This question is a possible duplicate.
0scar
<marlin><anet-a8><firmware>
Setting custom x/y bed bounds for Anet A8/marlin
AwesomeTown
# Setting custom x/y bed bounds for Anet A8/marlin

(Asked by: username_0 on 2018-08-14)

I have an Anet A8 that I just flashed with the latest Marlin firmware (1.1.9). I'm sending prints to my printer with Ultimaker Cura via OctoPrint.

I have affixed a PEI surface to my bed that's about 10 mm smaller in each direction than the full size of the bed (that is, I lose about 5 mm on each side of the bed). This hasn't been a huge problem as usually I account for this myself and just make sure there's lots of room on each side of a print, but having upgraded my firmware, I'd like to take advantage of Marlin's bi-linear bed-levelling. Unfortunately, several of the points it chooses are outside the bounds of my PEI surface and so it's impossible to get a decent setting for those points.

What's the "correct" way to configure Marlin to know that my bed size is actually smaller than it thinks it is? Do I need to additionally adjust settings in Ultimaker Cura and/or OctoPrint?

**Tags:** marlin, anet-a8, firmware

> **Comments:**
> **username_1**: The answer to the question can be found in [How to center my prints on the build platform? (Re-calibrate homing offset)](/q/6375). You need to set correct bed size dimensions and offsets from end stops. This question is a possible duplicate.  

---

## 1 answers

### Answer by username_2 on 2018-08-15. Score: 6 | Accepted answer

As you just flashed your own Marlin, you probably have the `marlin.ino` and its associated files in the **Arduino IDE** set for your Processor and board and know how to work with them to some degree. This is *just the short version* **where** to find **what** you need to change the bed size, if the marlin.ino is based on the **[marlinfw-release](http://marlinfw.org/)**.

# Changing "home"

In `Configuration.h` there should be a set of lines that reads akin to this:

```
// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 200

```

Usually it is faster to use `Ctrl`+`F` and then typing in `X_MIN_POS` and adding the hook in front of *Search all Sketch Tabs* and then moving through all the finds till the right one pops up. This not only brings you right to the lines you want to alter, but also covers up the bases in case the distribution you work with did put the movement limits into a different location like `Configruration_adv.h`.

# Changing Bed Size

Alter these minimum positions and make sure that the Maximum positions (usually just after them) to fit the maximum of the bed.

If you reduced your bed size, you also might need to change `X_BED_SIZE` and `Y_BED_SIZE`, which (in the marlin.ino) is in the same `Configuration.h` - I found it to preceede the Travel limits:

```
// The size of the print bed
#define X_BED_SIZE 200
#define Y_BED_SIZE 200

```

Adjust these as needed to fit the new sizing.

# Hint: Getting the Values for Adjusting

For finding the adjusted values, I have had good experiences using Repetier Host on *Manual Control* to move the nozzle (lifted 1mm to prevent any accidents) into the correct XY-position and taking this position as adjustments for the minimum positions. Finding your personal settings is a bit of a trial and error still, *so take your time*.

# Finishing up

Now, recompile the marlin.ino (the checkmark in the top left) to check for errors and [flash the new firmware](https://3dprinting.stackexchange.com/questions/6685/how-to-install-new-firmware-with-a-bootloader) it.

> **Comments:**
> **username_0**: Thanks! The starting (x,y,z) values in my config were (-33, -12, 0) and it took me a bit of experimentation to figure out that to adjust the bounds of the bed 12mm right and 5mm back I needed to go to (-45,-17,0), but having sorted that out (and adjusted the max positions accordingly) everything seems to be working the way I'd expect.  
> **username_2**: @username_0 remember to adjust the ?_BED_SIZE correctly - I forgot to include their lines in the old version, fixed that.  

---

