Skip to content

impossible to get absolute machine coordinates from G38.n without erasing TLO #4159

Description

@wucke13

I have a use-case where I want to get the touch-off from a G38 in absolute machine coordinates. The problem that I have is the following: G38 only stores the machine coordinates in the relative current working coordinate system. This might, or might not include the tool offset (TLO), depending i.e. on whether G43 was called after the last Tn M6.

The G38.2 example (https://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g38) cleverly avoids this pitfall by issuing a G49 before the G38.2, which however erases the current TLO. At first I tried to just incorporate the TLO in the formula found in that example, to this extent:

(                   G53+n Z  n             G92 Z   G92?    TLO Z)
#<z_work_offset> = [#[5203 + #5220 * 20] + #5213 * #5210 - #5403]

However, this formula is only correct half the times, depending on whether the TLO Z is also applied (via a G43) or not. For other optional coordinate system offsets, there is a status property (i.e. #5210 for G92/G52, https://linuxcnc.org/docs/html/gcode/overview.html#sub:numbered-parameters) that tell us whether this offset is actually applied.

Unfortunately, as far as I can see, none such parameter is available to announce whether TLO is applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions