Hello Guest it is April 18, 2024, 10:31:09 AM

Author Topic: Tube coping subroutien wont repeat properly  (Read 4452 times)

0 Members and 2 Guests are viewing this topic.

Tube coping subroutien wont repeat properly
« on: December 22, 2011, 05:06:50 PM »
Below is a working subroutine for tube coping, with lines I added (separated by space) to repeat the cut 5" away.
It doesn't work properly, cutting from 0,0 rather than the 5" offset.
Can someone please point out the error in this code?
I've tried absolute vs incremental mode.... and nothing seems to work.


(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
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
%

Offline Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: Tube coping subroutien wont repeat properly
« Reply #1 on: December 25, 2011, 07:30:02 AM »
You will need to add the 5" to the formula in the sub routine, add another #nnn to do this.

Graham
Without engineers the world stops

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tube coping subroutien wont repeat properly
« Reply #2 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
Re: Tube coping subroutien wont repeat properly
« Reply #3 on: December 25, 2011, 05:48:41 PM »
Thanks soooo much TP for both the fix & encouragement!
Can I ask a few more questions please?
The scale looks off including the angle. Attached is a picture.
Ive set the DRO to the radius with Gcode & different settings of steps without success.
1) Why is the plotted scale not true?
2) What motor setting make the feedrate work out in this example?
3) How would alter the subroutine to cut a smaller hole thru a larger tube.
    The code stops in the subroutine when I try this.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tube coping subroutien wont repeat properly
« Reply #4 on: December 25, 2011, 06:15:17 PM »
Set the A axis diam on the settings page this will correct the toolpath scaling and make it look much better. Also turn on USE DIAM for feedrate on the toolpath config page. This will help setting the feedrate to the proper speed based on tube diameter.

Cutting a hole in a tube takes another math routine I think I have a copy coded out I will look.

(;-) TP
Re: Tube coping subroutien wont repeat properly
« Reply #5 on: December 26, 2011, 08:39:01 AM »
Thanks for the quick reply TK.
I had the A axis radius = .625 on the settings page and the use Radius for feedrate box was checked in toolpath. So, I tried unrealistic big & small values of the A axis radius just to see what affect it has on the scaling. Smaller values didn't change it much, & larger values made it worse.
I must have some other setting messed up.
When I installed Mach3 I found that the Plasma configuration created during install did not have A axis capability. So I am using the Mach3Mill configuration with motor/config/toolpath...
 settings copied from the Plasma config. Is it something to do with this?
Re: Tube coping subroutien wont repeat properly
« Reply #6 on: January 05, 2012, 04:18:52 PM »
Ok, so I have it pretty well working now except the G92 command isn't working on the A axis.

G0 A180.000 x5.000 Z1.000 F500     (Move to next cut)
G92 x0.000 A0                              (Zero coordinate system, X works but A doesn't)        

Anyone know why the coordinate system don't shift to zero on a rotary axis?

I also tried G52 without success

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tube coping subroutien wont repeat properly
« Reply #7 on: January 05, 2012, 04:50:12 PM »
Just tested the G92 on A here and it works ok.
Post your code and lets see what is happening.

(;-) TP
Re: Tube coping subroutien wont repeat properly
« Reply #8 on: January 06, 2012, 12:59:53 PM »
Thanks allot TP.
I got it working by using the ID parameter, rather than G92 on the A axis.
I also included a few other useful lines of code. (see below)
Did you ever find the routine for a hole thru the side of a pipe?
I really could use it.... ;)

(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
G0 A#300 X  [sqrt [#201 **2 - [ [#202 * sin [#204]] **2]] /  sin[#203] -  tan [90-#203] * #202 * cos[#204]] z0.0
M98 P01 L180
#104 = -45             (Joint ANGLE)
#200 = [#100 / 2]         (RO)
#201 = [#101 / 2]         (RU)
#202 = [#200 - #103]      (RI)
#203 = #104               (AF)
#204 = 180                  (ID)
#300 = 2              (A step in deg)
G0 x5.000 Z1.000 F500
G92 x0.00
G0 A#300 X  [sqrt [#201 **2 - [ [#202 * sin [#204]] **2]] /  sin[#203] -  tan [90-#203] * #202 * cos[#204]] z0.0
M98 P01 L180
G92.1
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
%

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Tube coping subroutien wont repeat properly
« Reply #9 on: January 06, 2012, 07:36:59 PM »
I am still looking as I clean off all the older computers around here. I know it is here somewhere(;-) But I don't use Mach3 much anymore so the docs have been cleaned out of the files and put in the bin.

(;-) TP