Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: tomi on November 25, 2011, 04:48:25 PM

Title: Tool compensation xz or zy plane (G41 G42 G18)
Post by: tomi on November 25, 2011, 04:48:25 PM
Hi!

Is there any method/trick to use tool radius compensation to different plane than xy?

Thanks. tomi
Title: Re: Tool compensation xz or zy plane (G41 G42 G18)
Post by: BR549 on November 25, 2011, 06:20:56 PM
You may want to give the manual a try it covers the subject nicely.

(;-) TP
Title: Re: Tool compensation xz or zy plane (G41 G42 G18)
Post by: ger21 on November 25, 2011, 08:54:00 PM
You may want to give the manual a try it covers the subject nicely.

(;-) TP
From the manual:
"Cutter radius compensation may be performed only if the XY-plane is active. "
Title: Re: Tool compensation xz or zy plane (G41 G42 G18)
Post by: tomi on November 26, 2011, 01:06:05 AM
Thank's TP your answer. I found one trick is use the axis scale if I drive symmetrical shapes. Not using G41 or G42 just putting some calculations to script.
Title: Re: Tool compensation xz or zy plane (G41 G42 G18)
Post by: BR549 on November 26, 2011, 10:47:51 AM
YOu may want to look into G43 dealing with the Z (;-).

(;-) TP
Title: Re: Tool compensation xz or zy plane (G41 G42 G18)
Post by: tomi on November 30, 2011, 08:26:26 AM
I answer my self  ;)

If you have machine with same parameters in Y and Z axis then you can do that.

use VB Script SwapAxis( 1,2 ) and after that swap current coordinates (Y and Z) macro 800.m1s attached.

after using remember to ResetAxisSwap() and swap coordinates back.

M218 (Macro to swap axis to simulate xz plane SwapAxis(1,2))
M800

( run your code here )

M800
M217 (Macro to reset axis to back xy plane ResetAxisSwap())

Note! Movements is made XY axis where Y is realy Z and vise versa.

DISCLAIMER: Your own risk!

M800.m1s
Code: [Select]
REM SwapAxis macro
REM Macro swaps Y and Z axis coordinates

X = GetDRO( 0 )
Y = GetDRO( 1 )
Z = GetDRO( 2 )

XMachine = GetOEMDRO( 83 )
YMachine = GetOEMDRO( 84 )
ZMachine = GetOEMDRO( 85 )

XOffset = GetDRO( 30 )
YOffset = GetDRO( 31 )
ZOffset = GetDRO( 32 )

XG92 = GetOEMDRO( 16 )
YG92 = GetOEMDRO( 17 )
ZG92 = GetOEMDRO( 18 )

XTool = GetOEMDRO( 204 )
ZTool = GetOEMDRO( 32 )

g92valueToY = ( YMachine - YOffset ) - ( ZMachine - ZOffset - ZG92 - ZTool )
g92valueToZ = ( ZMachine - ZOffset - ZTool ) - ( YMachine - YOffset - YG92 )

Code "G92 X" & X & "Y" & g92ValueToY & "Z" & g92valueToZ

REM Wait For data update
sleep(500)

REM Move current To g92
y = ( GetOEMDRO( 84 ) - GetDRO( 31 ) - GetDRO( 1 ) )
z = ( GetOEMDRO( 85 ) - GetDRO( 32 ) - GetOEMDRO( 32 ) - GetDRO( 2 ) ) 
Code "G92X" & x & "Y" & y & "Z" & z