Hello Guest it is October 03, 2024, 09:48:35 PM

Author Topic: New program for pipe coping  (Read 20955 times)

0 Members and 1 Guest are viewing this topic.

Offline DaOne

*
  •  236 236
Re: New program for pipe coping
« Reply #20 on: January 08, 2011, 07:37:00 PM »
ok.. think I got it

Offline DaOne

*
  •  236 236
Re: New program for pipe coping
« Reply #21 on: January 08, 2011, 07:54:17 PM »
Ok it dosnt look like its working right for me.. The code outputs point to point so maybe someone could look at it and see where I screwed up..

Offline BR549

*
  •  6,965 6,965
Re: New program for pipe coping
« Reply #22 on: January 08, 2011, 08:00:05 PM »
This is what a 2" x2" at 45 deg should look like in the toolpath

Offline BR549

*
  •  6,965 6,965
Re: New program for pipe coping
« Reply #23 on: January 08, 2011, 08:03:49 PM »
From your earlier code it looke like you were trying to solve the equations from the VB side (;-) You need to let the Gcode side solve the equation as part of the evolution of the SUBprogram or all you will get is a straight line(;-)

Offline DaOne

*
  •  236 236
Re: New program for pipe coping
« Reply #24 on: January 08, 2011, 08:10:31 PM »
Sounds like you got a good understanding of what wrong. Care to take a crack at fixing it? I have yet to play with G-code macros in mach so that is a shot in the dark for me.

Offline DaOne

*
  •  236 236
Re: New program for pipe coping
« Reply #25 on: January 08, 2011, 08:19:58 PM »
I can make it loop and pull the math out of the gcode but I need to define when to exit the loop and I dont know what I am looking for.

Offline BR549

*
  •  6,965 6,965
Re: New program for pipe coping
« Reply #26 on: January 08, 2011, 08:22:43 PM »
OK I will take a crack at it. "You" are real close just set up the Sub like it is in the example then let VB plug in the VARS. Let VB convert YOUR variables into Gcode #vars  The Gcode will pull the # vars over internally(;-)

Want to take one more crack at it??

(;-) TP

Offline DaOne

*
  •  236 236
Re: New program for pipe coping
« Reply #27 on: January 08, 2011, 08:35:49 PM »
Naw man go for it and I will look at how you got there... My brain hurts from cad all day. One of the perks of owning your own biz... on weekends.. U get to work.

Offline BR549

*
  •  6,965 6,965
Re: New program for pipe coping
« Reply #28 on: January 08, 2011, 08:40:43 PM »
YEP that is where the term 24/7 came from . Don't believe it ? Start your own business (;-)

(;-) TP

Offline BR549

*
  •  6,965 6,965
Re: New program for pipe coping
« Reply #29 on: January 08, 2011, 09:07:36 PM »
Here ya go give this a whirl. This is your post code button code.


Sub Main()

'(CNC A axis Plasma TUBE Coping routine)
'(Math derivative by Dan Hopper Copyright 2006)

'WIZARD BY WES TREIHAFT

CutTubeD = GetOEMDRO (1366)
UncutTubeD = GetOEMDRO (1367)
TubeThickness = GetOEMDRO (1368)
JointANGLE = GetOEMDRO (1369)
'ASTEPDEG = GetOEMDRO (1370)

RO = (CutTubeD / 2)        '  (RO)
RU = (UncutTubeD / 2)        '  (RU)
RI = (RO - TubeThickness)    '  (RI)
AF = JointANGLE              '  (AF)
ID = 0                     '  (ID)
ASTEPDEG = 2 '  (A step in deg)


SetTicker 20, ""

Setvar(200, RO)
Setvar(201,RU)
SetVar(202, RI)
SeTvAR(203, AF)
SetVar(204, AstepDeg)



OpenTeachFile "PIPENOTCHER.tap"
 
Code "%"
Code "G0 G40 G54 G90 G49 G17 G50 G64 G91.1 G94"
Code "G0 A0.000 x0.000 Z1.000 F500"
Code "Z0.0"
Code "M98 P01 L180"
Code "G0  A0.0 X0.0 Z1.0"
Code "M30"
Code "o01"
Code"G1  A#300 X  [sqrt [#201 **2 - [ [#202 * sin [#204]] **2]] /  sin[#203] -  tan [90-#203] * #202 * cos[#204]]"
Code"#204=[#204+2]"
Code"#300=[#300+2]"
Code "M99"
Code "%"

Setdro(25,RU)

CloseTeachFile
Call LoadTeachFile()
End Sub

Main