Gcode Z start outside of limits after touch off

More
12 Mar 2023 17:53 #266504 by re_relentlessly
Gcode Z start outside of limits after touch off was created by re_relentlessly
Hello,

I am having a issue I don't understand with Linuxcnc and My Z axis.
I load a gcode program generated from fusion360. I home the machine, I set the g54 offsets. I then load a tool and set the tool offset.
but when I go to run the program I get an error about the Z axis being outside the minimum.
After investigate a little, I noticed that the origin point in the gcode (as seen in the attached image) is outside the machine volume. But I have no idea why. Can anyone help me understand why the gcode origin/start point is in a seemingly random spot?
 
Attachments:

Please Log in or Create an account to join the conversation.

More
13 Mar 2023 21:24 #266607 by re_relentlessly
Replied by re_relentlessly on topic Gcode Z start outside of limits after touch off
I Have done some more testing,

It appears the the gcode origin/start position being offset from the work envelop is order of operation dependant.
If I setup the tool length offset first (t1 m06 g43) and then load the program, and finally set the g54 work offset, the gcode origin stays fixed to the work envelope corner, instead of ending up beside it

So i still do not know what is causing this issue, but the order in which i:
1. set the work offset (g54)
2. set the tool offset (t1 m06 g43)
3. load the gcode

changes the outcome.

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
13 Mar 2023 21:33 #266609 by tommylight
Replied by tommylight on topic Gcode Z start outside of limits after touch off
Does the machine have home switch on Z axis?
How are the limits set in the ini file?
For mill:
Z home must be at the top of Z movement
In CAM everything under the material surface must be in negative direction
G54 and tool offsets must be from the top of the material
-
Migh double check the above as its been a while since i used mills.

Please Log in or Create an account to join the conversation.

More
13 Mar 2023 22:04 #266610 by re_relentlessly
Replied by re_relentlessly on topic Gcode Z start outside of limits after touch off
Yes the machine does have home switch on z axis (actually all axis have home, + limit switch and - limit switch)
ini configuration: I have attached my ini

z home is at Z 0, which is physically in the up direction (away from work surface), and all of the z travel is in the -z direction.
g54 is touched off from the top of the material
Tool offsets are set with a tool probe that is sitting on the work surface (bed of machine), and are calibrated with `m400 p2 r0`, using the spindle nose as the calibration length. Before a tool and collet are inserted into the spindle and then `t1 m6 g43` is called.
Attachments:

Please Log in or Create an account to join the conversation.

More
14 Mar 2023 05:42 #266633 by gitin
z0 is higher than the limits by 32.152. Limits 0 -123 is more than in INI (MAX_LIMIT = 0.0 MIN_LIMIT = -105.0).

Please Log in or Create an account to join the conversation.

More
18 Mar 2023 19:20 #267022 by re_relentlessly
Replied by re_relentlessly on topic Gcode Z start outside of limits after touch off
gitin: yes you are correct, and it just so happens that the offset is exactly the tool length offset

I tried a bunch of start up sequences today to try to find a working one.
There are 5 things i need to do during start up
1. home the machine
2. calibrate the tool offset (m400 p2 r0)
3. set the tool offset (m6 t1 g43 )
4. set the work offset (g54 touch off)
5. load the gcode

most of the possible orders results in the strange gcode origin offset.
So apart from the strange behaviour, I also don't know why it is so order dependant.

During my last test today, I noticed that the gcode origin offset appears to happen when loading the tool offset, but I do not understand why loading a tool and setting its offset would mess up the gcode origin.
I am using the following:  M6 Tool Change Remapping with Tool Length Measurement - LinuxCNC
to automatically probe and set tool length. So maybe that code does something weird, or I have it miss configured?
 

Please Log in or Create an account to join the conversation.

More
07 Apr 2023 19:34 #268541 by re_relentlessly
Replied by re_relentlessly on topic Gcode Z start outside of limits after touch off
More testing, still unsure 
It appears that the M6 remap ( M6 Tool Change Remapping with Tool Length Measurement - LinuxCNC ), that I am using, messing with the gcode start offset. I have read through the script but am struggling to identify exactly what is causing the weird offset. Does anyone have idea's on where in the script I should be looking?

Please Log in or Create an account to join the conversation.

More
08 Apr 2023 00:35 #268568 by re_relentlessly
Replied by re_relentlessly on topic Gcode Z start outside of limits after touch off
even more testing

I have now narrowed it down to g43/g49, turning off tool length compenstation "fixes" the problem.
So as soon as the g43 gets applied the gcode z position jumps upwards the tool length offset.
but then if via MDI I run g49, it snaps back into place at the machine top corner.

Why is tool length compensation moving the gcode start postion (0,0), outside the bounds of the machine limits?

Please Log in or Create an account to join the conversation.

More
08 Apr 2023 14:33 #268608 by re_relentlessly
Replied by re_relentlessly on topic Gcode Z start outside of limits after touch off
Out of curiosity I disabled the M6/M400 remap that I was using.
I then loaded a tool via t1 m06 g43. and the weird offset still shows up
running g49 in MDI, corrects the offset

Can anyone explain why the origin gizmo moves when tool offsets are loaded? is this normal?
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum