Subroutine error
- Philip Lydin
- Offline
- Senior Member
-
Less
More
- Posts: 41
- Thank you received: 4
22 Oct 2025 20:29 #336890
by Philip Lydin
Subroutine error was created by Philip Lydin
Im setting up my cnc which has a toolchanger but i have some weird issues that if the tool prepared and tool changed iocontrol hal pins goes high i get an error that line 0 would exeed the z axis / joint 2 limit. I have 2 machines running linuxcnc but still cannot seem to figure out the problem. Im very lost so any info would help.
o<toolchange> sub
M73
G90
G53 G0 Z0
G0 X0 Y0
o100 if [EXISTS[#<_ini[traj]axes>]]
#<geometry> = #<_ini[traj]axes>
o100 endif
o110 if [#<geometry> EQ 4]
G0 A0
o110 else if [#<geometry> EQ 5]
G0 A0 C0
o110 endif
o<toolchange> endsub [1]
M2
this sub is just as a test.
o<toolchange> sub
M73
G90
G53 G0 Z0
G0 X0 Y0
o100 if [EXISTS[#<_ini[traj]axes>]]
#<geometry> = #<_ini[traj]axes>
o100 endif
o110 if [#<geometry> EQ 4]
G0 A0
o110 else if [#<geometry> EQ 5]
G0 A0 C0
o110 endif
o<toolchange> endsub [1]
M2
this sub is just as a test.
Attachments:
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19680
- Thank you received: 4560
26 Oct 2025 18:41 #337236
by andypugh
You could try setting max Z (or joint 2) to 0.01 (or whatever) then see if G53 Z0 still gives a fault.
Replied by andypugh on topic Subroutine error
Is Z=0 in machine coordinates inside the axis limits? If your soft-limit is at zero then possibly going to exactly zero triggers the error (I have a vague memory that this was a fixed bug, though).G53 G0 Z0
You could try setting max Z (or joint 2) to 0.01 (or whatever) then see if G53 Z0 still gives a fault.
Please Log in or Create an account to join the conversation.
- Philip Lydin
- Offline
- Senior Member
-
Less
More
- Posts: 41
- Thank you received: 4
08 Nov 2025 10:56 #338076
by Philip Lydin
Replied by Philip Lydin on topic Subroutine error
This line in the ini was the problem "TOOL_CHANGE_POSITION = 0 0 410". My z limit is 300....
Please Log in or Create an account to join the conversation.
Time to create page: 0.065 seconds