-- Edited 14/June/2018 -- Robertspark - edited for simple oxyacetylene --************************************************************************** --*** USER SETTINGS --************************************************************************** -- UCCNC settings within Sheetcam, set OTIONS >> APPLICATION OPTIONS >> -- >> UNITS >> TIME to mS (miliseconds) as used for G04 -- within UCCNC -- USER SETTINGS within Sheetcam, set OPTIONS >> APPLICATION OPTIONS >> -- >> UNITS >> -- LINEAR UNITS to: mm (milimeters) or inches -- FEEDRATE to: mm/min or inch/min -- -- >>>> all below units MUST be entered in METRIC {mm}!!!! safeRetract = 50 -- insert the safe retract height (presumed to be 50mm = ~2") touchOffset = 1.5 -- presumed floating head offset, presumed to be 1.5mm = ~0.06") -- test / set with a piece of paper + G31 and backoff to find switch offset probeDepth = 100 -- enter probing depth (greater than Z travel), 100 = ~4" probeFeedRate = 200 -- enter probe (G31) touchoff feedrate --************************************************************************** --*** END OF USER SETTINGS --************************************************************************** g31initialFLAG = "201" -- do not change!!! function OnAbout(event) ctrl = event:GetTextCtrl() ctrl:AppendText("Simple OxyAcet Post Processor\n") ctrl:AppendText("\n") ctrl:AppendText("Generic post for machines without THC\n") ctrl:AppendText("\n") ctrl:AppendText("Uses G31 with a floating head to zero Z\n") ctrl:AppendText("before start of torch and manual ignition\n") ctrl:AppendText("\n") ctrl:AppendText("No Z-axis motion during cut\n") ctrl:AppendText("\n") ctrl:AppendText("Modal G-codes and coordinates\n") ctrl:AppendText("Comments enclosed with ( and )\n") ctrl:AppendText("Incremental IJ\n") ctrl:AppendText("Set G68 in MDI if you require part rotation\n") end 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 (" G64 (Set Machine in Constant Velocity Mode)\n") -- post.Text (" G61 (Set Machine in Exact Stop Velocity Mode)\n") post.Text (" G17 G40 G49 G50 G53 G64 G80 G90\n F1\n") bigArcs = 1 --stitch arc segments together minArcSize = 0.05 --arcs smaller than this are converted to moves end --************************************************************************** --*** End of settings --*** DO NOT CHANGE ANYTHING BELOW THIS LINE --************************************************************************** post.DefineCustomToolParam("FlameTool", "PreHeat Height", "preHeatHeight", sc.unitLINEAR, 2, 0, 200) function OnNewLine() post.Text ("N") post.Number (lineNumber, "0000") lineNumber = lineNumber + 10 end function OnFinish() post.ModalText (" G00" ) -- retract torch to safe Z position post.ModalNumber (" Z", safeRetract * scale, "0.0000") post.Eol() post.Text (" M30 (Programme Ended)\n") -- End + Rewind end function OnRapid() if(math.hypot(currentX - endX, currentY - endY) < 0.001) then return end 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() if(math.hypot(currentX - endX, currentY - endY) < 0.001) then return end 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 (g31initialFLAG == "1") then post.Text (" ( G31 skipped )") post.Eol() end if (g31initialFLAG == "201") then g31initialFLAG = "1" post.ModalText (" G31") -- probe post.ModalNumber (" Z", probeDepth * scale, "0.0000") post.ModalNumber (" F", probeFeedRate * scale, "0.0###") post.Eol() post.ModalText (" G92") -- set temporary machine co-ordinate post.ModalNumber (" Z -", touchOffset * scale, "0.0000") post.Eol() post.ModalText (" G00" ) -- retract torch to safe Z position post.ModalNumber (" Z", safeRetract * scale, "0.0000") post.Eol() post.ModalText (" M0 (press Cycle Start to Resume)") -- pause to ignite the torch post.Eol() end if (preheat > 0.001) then post.ModalText (" G00") post.ModalNumber (" Z", preHeatHeight * scale, "0.0000") post.Eol() post.Text (" G04 P") post.Number (preheat,"0.###") post.Text (" (Preheat Delay)") post.Eol() end if (pierceDelay > 0.001) then if(preheat > 0.001) then post.ModalText (" G01") post.ModalNumber (" Z", pierceHeight * scale, "0.0000") post.ModalNumber (" F", plungeRate * scale, "0.0###") post.Eol() else post.ModalText (" G00") post.ModalNumber (" Z", pierceHeight * scale, "0.0000") post.Eol() end post.Text (" G04 P") post.Number ( pierceDelay,"0.###") post.Text (" (Pierce Delay)") post.Eol() end post.ModalText (" G01") post.ModalNumber (" Z", pierceHeight * scale, "0.0000") post.ModalNumber (" F", plungeRate * scale, "0.0###") post.Eol() end function OnPenUp() post.ModalText (" G00" ) -- retract torch to safe Z position post.ModalNumber (" Z", safeRetract * scale, "0.0000") post.Eol() end function OnNewOperation() post.Text (" (Operation: ", operationName, ")\n") end function OnComment() post.Text(" (",commentText,")\n") end function OnToolChange() end function OnNewPart() post.Text(" (Part: ",partName,")\n"); end