chiark / gitweb /
M206: always use homing ("homeing") offsets
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 1 Aug 2012 20:12:14 +0000 (21:12 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 9 Aug 2012 18:20:23 +0000 (19:20 +0100)
commit71f5d005126298c899d87701cbdd432c76dd4480
treead98c0229e8c7036d7c4e6d12cdf7a7e26176d84
parent33f9aa6d9952e7f643bb2f7eba39f7bd1a765f86
M206: always use homing ("homeing") offsets

Previously the parameters set in M206 would only be used if a G82
command was sent with specific axis home values.  This limits its
usefulness.

Really, we should have a way to adjust the XYZ homing of a machine in
the eeprom.  So as the first stage of this, make M206 affect every
home command.  The values set using M206 are now added to the
configuration variables [XYZ]_HOME_POS.

This is achieved by replacing all uses of [XYZ]_HOME_POS in the code
by [XYZ]_HOME_POS_A which is a macro which includes the adjustment.

A question arises: if the M206 offset is set, should this adjustment
to the home position shift or change the possible range of movement
permitted by the software endstops ?

The documentation in Configuration.h describes these limits as:
    // Travel limits after homing
Since this is a file containing physical limits, and actual suggested
values for these configuration parameters appear to include a certain
amount of slop, I've taken the view that these should be regarded as
nominal physical distances from the limit switches, and that the
permissible travel should be unaffected by M206.

So for example with the (rather unrealistic)
  #define X_HOME_DIR -1
  #define X_MIN_POS -20
  #define X_HOME_POS 0
  #define X_MAX_POS 100
no matter the setting of M206 X, the machine would be permitted
to move from 20mm "beyond" the limit switch trigger point in
the negative X direction and 100mm away from the limit switch in
the positive X direction, for a total travel of 120mm.

With M206 X-10 that would be considered to correspond to X coordinates
-30 to +90.  With M206 X+10 that would be considered to correspond to
X coordinates -10 to +110.

fixes #200 (in ErikZalm/Marlin).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Marlin/Marlin.h
Marlin/Marlin.pde
README.md