# Bed size and nozzle homing offset in Marlin 1.1.9 firmware

This is driving me up the wall, hope somebody can give me some advice...

I have an Anet A8 (metal frame, so 'AM8'). Bed is the original 220x220 mm. When the nozzle is at the X/Y end stops it is positioned 16 mm 'west' away from the bed (in free space) in the x-axis, and 5 mm 'north'.

The problem I'm having is with the X_BED_SIZE (surely 220) and X_MIN_POS settings. I keep falling into either the nozzle home a long way from the center (should be 110,110), or getting a message about end stops being too narrow for the bed. Given my sizings above, what should the following be?:

// @section machine

// 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 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 240

• Welcome to 3DPrinting.SE! – 0scar Jan 4 '20 at 22:21

The original Anet A8 has:

// 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 -33
#define Y_MIN_POS -10
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 240


So in your case it would be:

// 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 -16
#define Y_MIN_POS -5
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 240


Tuning the bed to print exactly in the middle so that large prints fit on the build plate is described in question: "How to center my prints on the build platform? (Re-calibrate homing offset)".

• Thanks a lot Oscar. I was able to make that change, compile and upload, but it hasn't made a lot of difference. The homing nozzle position is about 20mm north and 28mm west of the actual bed center. This was what got me down this road in the first place... So I downloaded your calibration diagram from thingiverse, and it won't really print because the center is so off. The weird thing is, when I home the printer is heads off to X80 Y110. Why not X110 Y110 since that's clearly the center of 220x220? – AndyDove Jan 5 '20 at 2:32
• Looks like I got there, bed centered and compiled as it should: // 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 -16 #define Y_MIN_POS 15 #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS 235 #define Z_MAX_POS 240 – AndyDove Jan 5 '20 at 3:01
• @AndyDove Are the endstop locations the same as on the Anet A8 (X on the left and Y on the back when facing the machine)? Note the (0, 0), the origin is the left front. So when the printer homes Y, the nozzle is in front of the bed, so a negative Y value should be used (in front of the bed is the negative Y). Maybe you can add a link to your config and I'll inspect it for you. I also have an AM8, modified to my needs. – 0scar Jan 5 '20 at 10:09
• Hello Oscar, thanks much and sorry for the stunted replies. Just in the lounge heading over to Austria (from Detroit) for a week of business so it's been a day of packing. The printer is working much better. Stops are exactly as you describe, x on the left gantry and y on the rear right frame. Works well. What was throwing me is that when the printer homes, it actually centers the bltouch on bed center rather than the nozzle, but when I print it's now printing dead center so all's good. I would send you my config, but I left it on my other laptop - some other time! Thanks again!! /Andy – AndyDove Jan 5 '20 at 23:44