Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gmoccapy - G43 is disabled after selecting tool with zero z compensation #2613

Open
zz912 opened this issue Aug 23, 2023 · 11 comments
Open

Gmoccapy - G43 is disabled after selecting tool with zero z compensation #2613

zz912 opened this issue Aug 23, 2023 · 11 comments

Comments

@zz912
Copy link
Contributor

zz912 commented Aug 23, 2023

RIP 2.9 Branche
Debian Bookworm
Oracle VM VirtualBox
Test sim Gmoccapy.

If any tool other than 0 is selected at the start, the z offset is displayed correctly.
If I choose tool 0, the z offset is displayed incorrectly.
Bug-tool-offset

@rmu75
Copy link
Contributor

rmu75 commented Aug 23, 2023

Before selecting tool 0, G43 is active, after you select tool 0, G49 is active, i.e. tool compensation is off.

@zz912
Copy link
Contributor Author

zz912 commented Aug 23, 2023

So the question is why is G43 automatically disabled when tool 0 is selected?

@zz912 zz912 changed the title Gmoccapy - offset Z - wrong after tool 0 Gmoccapy - G43 is disabled after selecting tool 0 Aug 23, 2023
@zz912
Copy link
Contributor Author

zz912 commented Aug 23, 2023

If a tool with Z=0 compensation is selected, G43 is deactivated.
g43-is_disabled
Is this a bug or a feature? This behavior is not described here:
http://linuxcnc.org/docs/2.9/html/gcode/g-code.html#gcode:g43

@zz912 zz912 changed the title Gmoccapy - G43 is disabled after selecting tool 0 Gmoccapy - G43 is disabled after selecting tool with zero z compensation Aug 23, 2023
@zz912
Copy link
Contributor Author

zz912 commented Aug 23, 2023

Axis dont kill G43 never.
AXIS-G43_is_not_killed

@zz912
Copy link
Contributor Author

zz912 commented Aug 30, 2023

I did some research on this issue and found out that it is again a problem with the G43 auto-starting after a tool change.

if "G43" in self.active_gcodes and self.stat.task_mode != linuxcnc.MODE_AUTO:
self.command.mode(linuxcnc.MODE_MDI)
self.command.wait_complete()
self.command.mdi("G43")
self.command.wait_complete()

Norbert knows about this problem and plans to solve it. However, I will leave this Issue open so that we don't forget to check if his solution removes this consequence as well.

My solution is:

  1. Remove lines auto-starting g43
  2. Add the lines here:
    self.command.mode(linuxcnc.MODE_MDI)
    self.command.wait_complete()
            self.command.wait_complete()
            self.command.mdi("G43")
            self.command.wait_complete()

@rmu75
Copy link
Contributor

rmu75 commented Aug 30, 2023

I don't see how "tool offset == 0" can influence the code you cited.

@zz912
Copy link
Contributor Author

zz912 commented Aug 30, 2023

The cited code makes random problems. It makes race conditions. I have been dealing with this for a long time.

lookt at:
#2489

lookt at:
#2552

lookt at:
https://forum.linuxcnc.org/38-general-linuxcnc-questions/49445-python-command-wait-complete-does-not-wait-for-c-halui-commands

lookt at:
#2453 (comment)

I would like ask you. Could you try reproduce this bug? I wouldn't be surprised if I was the only one with the problem.

@rmu75
Copy link
Contributor

rmu75 commented Aug 30, 2023

This issue may be related but I don't think this is caused by a race condition.

@zz912
Copy link
Contributor Author

zz912 commented Aug 30, 2023

Feel free to find source of problem. I am mechanical designer. Programing is only my hobby.

This is video with my code modifications:
g43-g49
It is interesting that G43 and G49 switch when selecting tool offset == 0. Axis does not do this.

For now, I will not look into this issue further until the previous issues are resolved.

@gmoccapy
Copy link
Collaborator

In Axis you are changing the tools by MDI commands like T1 M6 and T2M6, but in gmoccapy you use M61 Q1 and M61 Q2.

So that is one difference. I checked gmoccapy code and did not find any place, where M49 is commanded. So the problem may be deeper.

Norbert

@zz912
Copy link
Contributor Author

zz912 commented Aug 31, 2023

In Axis you are changing the tools by MDI commands like T1 M6 and T2M6, but in gmoccapy you use M61 Q1 and M61 Q2.

Thank you for notice. Here is AXIS with the M61 QX:
Axis-g43
G49 does not appear

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

No branches or pull requests

5 participants