Site Navigation

Your Account

Choose Language

Centering the bed or setting the bed origin

With most printer geometries you can choose where on the bed the origin (the X=0 Y=0 point) will be. There are two common choices;

  1. X=0 Y=0 is at the centre of the printable area. This has a number of advantages, in particular GCode files are more portable between different printers.
  2. X=0 Y=0 is one corner of the printable area, typically the front left corner. Some users of Cartesian and CoreXY printers prefer this scheme.

The M208 S0 command defines the upper position limits of each axis, and the M208 S1 command defines the lower position limits. When an axis is homed to a low end (minimum) homing switch, the axis is assumed to be at the lower position limit. When it is homed to a high end (maximum) homing switch, it is assumed to be at the upper position limit. Therefore, changing the position limits in the M208 command will move the origin.

Example: a Cartesian printer uses a low end X homing switch, which triggers when the head reference point (i.e. the nozzle in a single tool printer) is 8mm off the low-X edge of the bed. It uses a high-end Y homing switch, which triggers when the head reference point is 2mm off the high-Y edge of the bed. The bed is 200mm square.

1. Suppose we want to make X0 Y0 the centre of the bed. Then the Xmin edge of the bed is at X=-100 and the homing switch triggers at X=(-100-8) = -108mm. Similarly, the Ymax edge of the bed is at Y=100 and the Y homing switch triggers at Y=(100+2) = 102mm. So we can use the following commands in config.g:

M208 S0 X-108 Y-100  ; set axis lower limits
M208 S1 X100 Y102    ; set axis upper limits

2. If instead we want to make X0 Y0 the corner of the bed then we would use:

M208 S0 X-8 Y0     ; set axis lower limits
M208 S1 X200 Y202  ; set axis upper limits

Notes:

1. You would normally have Z parameters in the M208 commands too.

2. The M208 limits set the position immediately after the corresponding G1 S1 command completes by triggering the homing switch. However, if your homing file has a G92 command after the G1 S1 command (as is typically the case when homing to a Z-min switch), then the G92 command will override that position.

The origin is always the centre of the bed and there is no facility to change it. If you really want an offset, use either a tool offset (G10) or workplace coordinates (G10 in conjunction with G54..G59.3).

In the M669 command, use the X and Y parameters to specify the offset where you want X=0 Y=0 to be relative to the centre of the proximal joint.

To be completed.

4 Comments

Z offset when using corexy with the M208 command doesn’t seem to work, it allows me to do g1 z-1 and it would move into the limit switch while x and y are correct at -60 and -90 respectively. When I do G1 x0 y0 it moves correctly to the corner of the heated bed.

imqqmi - Reply

If you are homing using a Z-min endstop switch, then you probably have a G92 Z command after the G1 S1 command. That G92 command will override the Z min homing position set by M208.

David Crocker - Reply

Thanks David, you're right. I used the generated configuration files. Maybe an option can be added if m208 z is non zero?

imqqmi - Reply

its much easier for us to track requests and provide help if you use the forum (https://forum.duet3d.com) rather than Dozuki comments.

Tony -

View Statistics:

Past 24 Hours: 1

Past 7 Days: 33

Past 30 Days: 112

All Time: 524