4691
G-Code, CAD, and CAM discussions / Re: Tube coping subroutien wont repeat properly
« on: December 25, 2011, 11:17:55 AM »
WOW you were really close right out of the box. BUT the Sub formula is based on XY=0.000 (;-).
The best way would be to shift the X coord base to account for the length of the tube.
(CNC A axis Plasma TUBE Coping routine)
(Math derivative by Dan Hopper Copyright 2006)
#100= 1.250 (CutTube Diameter)
#101= 1.250 (Uncut Tube Diameter)
#103= .095 ( Tube Thickness )
#104= 45 (Joint ANGLE)
#200 = [#100 / 2] (RO)
#201 = [#101 / 2] (RU)
#202 = [#200 - #103] (RI)
#203 = #104 (AF)
#204 = 0 (ID)
#300= 2 (A step in deg)
G0 G40 G54 G90 G49 G17 G50 G64 G91.1 G94
G0 A0.000 x0.000 Z1.000 F500
Z0.000
M98 P01 L180
#104= -45 (Joint ANGLE)
#200 = [#100 / 2] (RO)
#201 = [#101 / 2] (RU)
#202 = [#200 - #103] (RI)
#203 = #104 (AF)
#204 = 0 (ID)
#300= 2 (A step in deg)
G0 A0.000 x5.000 Z1.000 F500 (you shifted the Tube length here)
G92 X0.000 (NOW reset the X coord to zero)
Z0.000
M98 P01 L180
G0 A0.000 X0.000 Z1.000
M30
o01
G1 A#300 X [sqrt [#201 **2 - [ [#202 * sin [#204]] **2]] / sin[#203] - tan [90-#203] * #202 * cos[#204]]
#204=[#204+2]
#300=[#300+2]
m99
%
Give that a try, (;-) TP
The best way would be to shift the X coord base to account for the length of the tube.
(CNC A axis Plasma TUBE Coping routine)
(Math derivative by Dan Hopper Copyright 2006)
#100= 1.250 (CutTube Diameter)
#101= 1.250 (Uncut Tube Diameter)
#103= .095 ( Tube Thickness )
#104= 45 (Joint ANGLE)
#200 = [#100 / 2] (RO)
#201 = [#101 / 2] (RU)
#202 = [#200 - #103] (RI)
#203 = #104 (AF)
#204 = 0 (ID)
#300= 2 (A step in deg)
G0 G40 G54 G90 G49 G17 G50 G64 G91.1 G94
G0 A0.000 x0.000 Z1.000 F500
Z0.000
M98 P01 L180
#104= -45 (Joint ANGLE)
#200 = [#100 / 2] (RO)
#201 = [#101 / 2] (RU)
#202 = [#200 - #103] (RI)
#203 = #104 (AF)
#204 = 0 (ID)
#300= 2 (A step in deg)
G0 A0.000 x5.000 Z1.000 F500 (you shifted the Tube length here)
G92 X0.000 (NOW reset the X coord to zero)
Z0.000
M98 P01 L180
G0 A0.000 X0.000 Z1.000
M30
o01
G1 A#300 X [sqrt [#201 **2 - [ [#202 * sin [#204]] **2]] / sin[#203] - tan [90-#203] * #202 * cos[#204]]
#204=[#204+2]
#300=[#300+2]
m99
%
Give that a try, (;-) TP