Skip to content

Conversation

@zz912
Copy link
Contributor

@zz912 zz912 commented Feb 7, 2026

LinuxCNC core behavior:
Activating G43 with zero offsets deactivates tool compensation.
In this situation, G43 behaves like G49.
If the CNC operator is not aware of this, it can have dangerous consequences.

@hansu was not aware of this in the past. See:
#3706 (comment)
I struggled with this as well.

Therefore, I made exiting the Tool Table in Gmoccapy more verbose and added the option to activate G43 when the active offset changes from zero to non-zero.

I would like to ask @Sigma1912 for their opinion on whether this is OK.

@Sigma1912
Copy link
Contributor

I have no problem with this addition.

Comment on lines +4749 to +4750
new_offset_is_zero = all(v == 0.0 for v in new_offset)
old_offset_is_zero = all(v == 0.0 for v in self.stat.tool_offset)
Copy link
Member

@hansu hansu Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea to compare float with "==" ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fine in this case, float 0 is exact 0 and if somebody sets offset of 10nm you don't want to treat it as zero.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah true, that should be fine.

But new_offset != self.stat.tool_offset could give an unwanted message, but maybe that's not very likely....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants