# G28 is not homing to center of bed

I've got a heavily modified CR-10s Pro, and I'm compiling my firmware. I have my own x-carriage with the probe changed to the right of the nozzle. The bed size is 300x300. Oddly, when I do a G28 the printer homes to (177, 0). I can't understand where it's getting the number 177 from.

In Configuration.h I have:

// The size of the print bed
#define X_BED_SIZE 300
#define Y_BED_SIZE 300

// 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 310
#define Y_MAX_POS 315
#define Z_MAX_POS 395


And

#define Z_SAFE_HOMING

#if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT X_CENTER  // X point for Z homing
#define Z_SAFE_HOMING_Y_POINT Y_CENTER  // Y point for Z homing
#endif

• In order to solve where the 177 is coming from you might need to mention the offset of the sensor to the nozzle. I've got a feeling that it can be explained by that. Also, are you sure The print head can reach beyond both the bed sizes? What are the offsets from endstops to the origin? – 0scar Apr 28 at 21:40
• What happens with G28 X0 Y0? – Davo Apr 29 at 11:52
• @Davo Please note: The X, Y, and Z parameters act only as flags. Any coordinates given are ignored. For example, G28 Z10 results in the same behavior as G28 Z. But that is indeed an interesting comment, this will test endstop positions, movement to the "middle of the plate" would be caused by G28 Z. So all that is needed to home X and Y is to use G28 X Y, digits are ignored. – 0scar Apr 29 at 21:16
• @0scar That's interesting. On my machines, G28 does nothing; G28 X0 homes only the X; G28 Y0 homes only the Y, and G28 X0 Y0 homes both X and Y. – Davo Apr 30 at 13:07