Hello Guest it is March 28, 2024, 08:16:14 PM

Author Topic: Need Help With Floating Head in SheetCAM  (Read 3094 times)

0 Members and 1 Guest are viewing this topic.

Need Help With Floating Head in SheetCAM
« on: October 15, 2017, 03:37:08 PM »
Hi Everyone:

Just completed a plasma build and have been testing/tuning/setting up.  I am using a Gecko G540 controller, MACH3 (licensed), has a floating head and torch height control, using SheetCAM (also licensed) and MACH3 Plasma post processor.  I designed/built the machine myself so tech support is only me, myself, and I.

After the usual bugs and initial headaches I have everything working perfectly both mechanically and with the G-code.  For testing the machine, I set up a couple of manual switches so I could simulate the torch on signal and the torch height control up-down signal.  The machine responds correctly to these inputs, and, although I have not even turned on the Hypertherm 45XP yet, the THC appears to be working in MACH at least.

So, to test with, I made a drawing of two 10" squares stacked on top of each other and imported into SheetCAM.  Set everything up and post-processed then tested in the machine but quickly realized that the floating head needed some custom programming.  I spent most of today getting that worked out manually in the G-code starting with the file that SheetCAM generated.  After about 6 hours of trying different things (AND learning G-code), the floating head now works perfectly.  The squares in the test code cut exactly as expected, with the float head finding the surface before each pierce, rising to the pierce height, then going to the cut height after the torch-on signal makes.  When I work the test switch for the torch up-down, the torch responds.  PROGRESS!!

Now, I need some help finding a way to get SheetCAM to insert the pre-pierce code automatically before each cut (lines N0110 through N0160 below and then again at the next G28.1 at N0290).  If I can get this done, I will be ready to start burning parts!

Thanks in advance for any help anyone has to offer!!

Here is the G-code:

N0020 (Post processor: Mach3 plasma.scpost)
N0030 (Date: 15/10/2017)
N0040 G20 (Units: Inches)
N0050 G53 G90 G91.1 G40
N0060 F1
N0070 S500
N0080 (Part: 10x10 Square Test)
N0090 (Operation: Outside Offset, 0, T1: 0.125" Mild Steel)
N0100 M06 T1 F200.0  (0.125" Mild Steel)
N0110 G00 Z2.0000
N0120 X12.9086 Y11.8948
N0110 G28.1 Z0.12
N0120 G92 Z0.0
N0130 G00 Z0.1700
N0140 G92 Z0.0
N0150 G00 Z0.1000
N0160 M03
N0150 G04 P1200
N0160 G01 Z0.1250 F3.937
N0170 G03 X12.5886 Y11.5748 I0.0000 J-0.3200 F200.0
N0180 G01 Y1.5748
N0190 G02 X12.5591 Y1.5453 I-0.0295 J0.0000
N0200 G01 X2.5591
N0210 G02 X2.5295 Y1.5748 I0.0000 J0.0295
N0220 G01 Y11.5748
N0230 G02 X2.5591 Y11.6044 I0.0295 J0.0000
N0240 G01 X12.5591
N0250 G03 X12.8791 Y11.9244 I0.0000 J0.3200
N0260 M05
N0270 G04 P1500
N0280 G00 Z2.0000
N0290 X12.9086 Y22.8948
N0291 G28.1 Z0.12
N0292 G92 Z0.0
N0293 G00 Z0.1700
N0294 G92 Z0.0
N0295 G00 Z0.1000
N0296 M03
N0320 G04 P1500
N0330 G01 Z0.1250 F3.937
N0340 G03 X12.5886 Y22.5748 I0.0000 J-0.3200 F200.0
N0350 G01 Y12.5748
N0360 G02 X12.5591 Y12.5453 I-0.0295 J0.0000
N0370 G01 X2.5591
N0380 G02 X2.5295 Y12.5748 I0.0000 J0.0295
N0390 G01 Y22.5748
N0400 G02 X2.5591 Y22.6044 I0.0295 J0.0000
N0410 G01 X12.5591
N0420 G03 X12.8791 Y22.9244 I0.0000 J0.3200
N0430 M05
N0440 G04 P1500
N0450 G00 Z2.0000
N0460 M05 M30


Here is the post script:

function OnAbout(event)
   ctrl = event:GetTextCtrl()
   ctrl:AppendText("Mach3 plasma post processor\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("Generic plasma post for machines without THC\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("Modal G-codes and coordinates\n")
   ctrl:AppendText("Comments enclosed with ( and )\n")
   ctrl:AppendText("M03/M05 turn the torch on/off\n")
   ctrl:AppendText("Incremental IJ\n")
end


--  revision 3/2/07
--  Removed final safety move. This is now done in SheetCam

--   revision 7/10/05
--   Added new arc handling

--   revision 11/7/05
--   Moved torch to cut height when preheating
--   Added dummy spindle speed to prevent Mach2 throwing a zero spindle speed error

--   revision 9/10/04
--   Added preheat

--   revision 28/6/04
--   Replaced startx,y,z with currentx,y,z

--   created 28/5/04
--   Based on Mach2 metric.post



function OnInit()

   post.SetCommentChars ("()", "[]")  --make sure ( and ) characters do not appear in system text
   post.Text (" (Filename: ", fileName, ")\n")
   post.Text (" (Post processor: ", postName, ")\n")
   post.Text (" (Date: ", date, ")\n")
   if(scale == metric) then
      post.Text (" G21 (Units: Metric)\n") --metric mode
   else
      post.Text (" G20 (Units: Inches)\n") --inch mode
   end
   post.Text (" G53 G90 G91.1 G40\n F1\n S500\n")
   bigArcs = 1 --stitch arc segments together
   minArcSize = 0.05 --arcs smaller than this are converted to moves
end

function OnNewLine()
   post.Text ("N")
   post.Number (lineNumber, "0000")
   lineNumber = lineNumber + 10
end


function OnFinish()
   post.Text (" M05 M30\n")
end

function OnRapid()
   post.ModalText (" G00")
   post.ModalNumber (" X", endX * scale, "0.0000")
   post.ModalNumber (" Y", endY * scale, "0.0000")
   post.ModalNumber (" Z", endZ * scale, "0.0000")
   post.Eol()
end

function OnMove()
   post.ModalText (" G01")
   post.ModalNumber (" X", endX * scale, "0.0000")
   post.ModalNumber (" Y", endY * scale, "0.0000")
   post.ModalNumber (" Z", endZ * scale, "0.0000")
   post.ModalNumber (" F", feedRate * scale, "0.0###")
   post.Eol()
end

function OnArc()
   if(arcAngle <0) then
      post.ModalText (" G03")
   else
      post.ModalText (" G02")
   end
   post.NonModalNumber (" X", endX * scale, "0.0000")
   post.NonModalNumber (" Y", endY * scale, "0.0000")
   post.ModalNumber (" Z", endZ * scale, "0.0000")
   post.Text (" I")
   post.Number ((arcCentreX - currentX) * scale, "0.0000")
   post.Text (" J")
   post.Number ((arcCentreY - currentY) * scale, "0.0000")
   post.ModalNumber (" F", feedRate * scale, "0.0###")
   post.Eol()
end


function OnPenDown()
   if (preheat > 0.001) then
      post.ModalText (" G00")
      post.ModalNumber (" Z", cutHeight * scale, "0.0000")
      post.Text ("\n G04 P")
      post.Number (preheat,"0.###")
      post.Eol()
   end
   post.ModalText (" G00")
   post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
   post.Text ("\n M03\n")
   if (pierceDelay > 0.001) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
end


function OnPenUp()
   post.Text (" M05\n")
   if (endDelay > 0) then
      post.Text (" G04 P")
      post.Number (endDelay,"0.###")
      post.Eol()
   end
end


function OnNewOperation()
   post.Text (" (Operation: ", operationName, ")\n")
end

function OnComment()
  post.Text(" (",commentText,")\n")
end

function OnToolChange()
   post.Text (" M06 T")
   post.Number (tool, "0")
   post.ModalNumber(" F",feedRate * scale,"0.0###")
   post.Text ("  (", toolName, ")\n")
   if (plungeRate <= 0) then
      post.Warning("WARNING: Plunge rate is zero")
   end
   if (feedRate <= 0) then
      post.Warning("WARNING: Feed rate is zero")
   end
end

function OnNewPart()
   post.Text(" (Part: ",partName,")\n");
end

function OnDrill()
   OnRapid()
   OnPenDown()
   endZ = drillZ
   OnMove()
   OnPenUp()
   endZ = safeZ
   OnRapid()
end


If you made it this far down
BIG THANKS!!

Dale


   
Re: Need Help With Floating Head in SheetCAM
« Reply #1 on: October 17, 2017, 05:12:05 AM »
Really?  Nobody?

Offline beefy

*
  •  138 138
    • View Profile
Re: Need Help With Floating Head in SheetCAM
« Reply #2 on: October 17, 2017, 03:45:54 PM »
Dale,

I'd ask this question on the Sheetcam forum itself. Les (author of Sheetcam) should fix you up pretty quick there.

Keith.
Re: Need Help With Floating Head in SheetCAM
« Reply #3 on: October 18, 2017, 07:58:04 PM »
Hey, thanks for the tip.  I only had to spend a little time reading and found exactly what I needed without bothering Les for it.  My machine is working awesome!

Dale