Hello Guest it is July 07, 2020, 12:16:14 AM

Author Topic: Coding error in M6End.m1s  (Read 994 times)

0 Members and 1 Guest are viewing this topic.

Coding error in M6End.m1s
« on: July 07, 2015, 06:08:45 PM »
I was getting an unexpected Z move after a tool change.
The file M6ENd.m1s that come with the Mach3 download contains this:


REM The default script here moves the tool back to m6start if any movement has occured during the tool change..

x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
if(IsSafeZ() = 1) Then
   SafeZ = GetSafeZ()
   if  SafeZ  > z then StraightTraverse x, y,SafeZ, a, b, c
      StraightFeed  x, y,  z  , a, b, c
else
Code"G00 X" & x & "Y" & y
end if


Should it not really be THIS:

REM The default script here moves the tool back to m6start if any movement has occured during the tool change..

x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
if(IsSafeZ() = 1) Then
   SafeZ = GetSafeZ()
   if  SafeZ  > z then StraightTraverse x, y,SafeZ, a, b, c
   else   StraightFeed  x, y,  z  , a, b, c
else
Code"G00 X" & x & "Y" & y
end if
_______________
My safeZ was higher than z.....so it was doing a rapid move to safeZ and then ALSO an unexpected feed move to z (i'm ignoring other axis for this discussion)

The else needs to be included otherwise it performs both moves (when  SafeZ  > z)  ...?
« Last Edit: July 07, 2015, 06:13:45 PM by damo green »
Re: Coding error in M6End.m1s
« Reply #1 on: July 07, 2015, 07:09:25 PM »
I retract the above post, perhaps it IS meant to both  rapid to safe Z (up) and then feed down to z-start .