I attached a sample job file.
Here is the current post processor:
–************************************************
–*** Set these values up to suit your machine ***
–************************************************
–this is the distance between each torch reference in MILLIMETRES
refDistance = 250
–this is the reference feed rate in mm/min
refFeed = 500
–Put your switch offset value here in MILLIMETRES
–Put a sheet of metal on your machine and place a sheet of paper on top.
–Slowly jog the torch down onto the paper until the touch-off switch just operates.
–Zero the Z axis then pull gently on the paper and slowly jog up until the paper slides out.
–The Z axis position is your switch offset.
switchOffset = 1.5
–Scriber X,Y,Z offsets in MILLIMETRES. Do not use inches here even if you want inch code
–Use the special code ‘nil’ on the Z axis to disable it.
–In that case no Z values will be output at all while scribing.
–e.g scriberZ = nil
scriberX = 110
scriberY = 220
scriberZ = 0
–scriber axis. Leave this as nil if the scriber is fixed to the same axis as the torch
–scriberAxis = “A”
scriberAxis = nil
–this is an extra delay added to the first pierce as needed by some machines
firstPierceTime = 0
–************************************************
–*** End of settings ***
–************************************************
function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText(“plasma MP1000-THC post processor with engraver\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(“M08/M09 turn the engraver on/off\n”)
ctrl:AppendText(“Incremental IJ - set in mach2\n”)
ctrl:AppendText(“The torch is referenced at cut start and every 500mm of movement thereafter\n”)
ctrl:AppendText(“Designed for use with Mach3 and CandCNC MP1000-THC and Floating head Touch-n-Go\n”)
ctrl:AppendText(“Post variables:\n”)
ctrl:AppendText(“refDistance - set the distance between each reference\n”)
ctrl:AppendText(“refFeed - set the feed rate when referencing\n”)
ctrl:AppendText(“switchOffset - set your net switch offset amount \n”)
ctrl:AppendText(“Scriber uses any tool number\n”)
end
– created 1/1/06
– Based on plasma1.post
– Modified 21/6/2010
– added option for ‘nil’ plate marker z
– Added support for plate marker tool type as well as tool number based plate marker
– Modified 4/11/2010
– Added: Reference the torch on the first pen down if the plate marker is the first tool used.
post.DefineVariable(“refDistance”,sc.unitLINEAR,0,1e17)
post.DefineVariable(“refFeed”,sc.unitFEED,0,1e17)
post.DefineVariable(“switchOffset”,sc.unitLINEAR,-1e17,1e17)
function OnInit()
offX = 0
offY = 0
offZ = 0
post.SetCommentChars (“()”, “”) --make sure ( and ) characters do not appear in system text
if(scale == metric) then
post.Text (" G21\n") --metric mode
else
post.Text (" G20\n") --inch mode
end
post.Text (" F1\n G53 G90 G40\n")
minArcSize = 0.2 --arcs smaller than this are converted to moves
firstRef = true
currentZAxis = “Z”
dist = 9999999
lastz = 0
thcstate = 1
firstPierce = firstPierceTime;
end
function OnNewLine()
post.Text (“N”)
post.Number (lineNumber, “0000”)
lineNumber = lineNumber + 10
end
function OnFinish()
endZ = safeZ
OnRapid()
endX = 0
endY = 0
offX = 0
offY = 0
offZ = 0
OnRapid()
post.Text (" M05 M30\n")
end
function OnRapid()
if(endX > 1e17 and endY > 1e17) then return end
local len = math.hypot((endX + offX)-currentX , (endY + offY)-currentY)
dist = dist + len
post.ModalText (" G00")
post.ModalNumber (" X", (endX + offX) * scale, “0.0000”)
post.ModalNumber (" Y", (endY + offY) * scale, “0.0000”)
if(offZ and firstRef == false and currentZ ~= safeZ) then
post.ModalNumber (" " … currentZAxis, (endZ + offZ) * scale, “0.0000”)
end
post.Eol()
end
function OnMove()
local len = math.hypot(endX - currentX , endY - currentY)
dist = dist + len
post.ModalText (" G01")
post.ModalNumber (" X", (endX + offX) * scale, “0.0000”)
post.ModalNumber (" Y", (endY + offY) * scale, “0.0000”)
if(offZ) then
post.ModalNumber (" " … currentZAxis, (endZ + offZ) * scale, “0.0000”)
end
post.ModalNumber (" F", feedRate * scale, “0.0###”)
post.Eol()
end
function OnArc()
local radius = math.hypot(currentX - arcCentreX, currentY - arcCentreY)
dist = dist + radius * math.abs(arcAngle)
if(arcAngle <0) then
post.ModalText (" G03")
else
post.ModalText (" G02")
end
post.ModalNumber (" X", (endX + offX) * scale, “0.0000”)
post.ModalNumber (" Y", (endY + offY) * scale, “0.0000”)
if(offZ) then
post.ModalNumber (" " … currentZAxis, (endZ + offZ) * scale, “0.0000”)
end
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(toolClass == “MarkerTool”) then
if (firstRef) then
Reference()
post.ModalText (" G00")
post.Text(" Z")
post.Number (safeZ * scale, “0.0000”)
post.Eol()
offX = scriberX
offY = scriberY
offZ = scriberZ
post.ModalNumber (" X", (currentX + offX) * scale, “0.0000”)
post.ModalNumber (" Y", (currentY + offY) * scale, “0.0000”)
post.Eol()
end
if (offZ) then
post.ModalNumber (" " … currentZAxis, (currentZ + offZ) * scale, “0.0000”)
post.Eol()
end
post.Text(" M08\n")
else
if(dist >= refDistance) then
dist = 0
Reference();
end
post.ModalText (" G00")
post.Text(" Z")
post.Number (pierceHeight * scale, “0.0000”)
post.Eol()
if (preheat > 0) then
post.Text (“\n G04 P”)
post.Number (preheat,“0.0##”)
post.Eol()
end
post.Text (“\n M03\n”)
end
if (pierceDelay + firstPierce > 0.001) then
post.Text (" G04 P")
post.Number (pierceDelay + firstPierce,“0.0##”)
firstPierce = 0
post.Eol()
end
end
function Reference()
firstRef = false
post.ModalText(" G38.2 z")
post.Number(-50 * scale, “0.0##”)
post.ModalNumber (" F", refFeed * scale, “0.0###”)
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.ModalText (" G00")
post.Text(" Z")
post.Number (switchOffset * scale, “0.0000”)
post.Eol()
post.ModalText(" G92 Z0.0\n")
end
function OnPenUp()
if(toolClass == “MarkerTool”) then
if (firstRef) then
Reference()
end
post.Text(" M09\n")
else
post.Text (" M05\n")
end
if(dist >= refDistance) then
dist = 0
Reference();
end
if (endDelay > 0) then
post.Text (" G04 P")
post.Number (endDelay,“0.###”)
post.Eol()
end
end
function OnToolChange()
if (toolClass == “MarkerTool”) then
if(scriberAxis and scriberAxis ~= currentZAxis) then
endZ = safeZ
OnRapid()
currentZAxis = scriberAxis
end
if(firstRef ~= true) then
offX = scriberX
offY = scriberY
offZ = scriberZ
end
else
if(scriberAxis and scriberAxis == currentZAxis) then
endZ = safeZ
OnRapid()
currentZAxis = “Z”
end
offX = 0
offY = 0
offZ = 0
end
end
function OnDrill()
OnRapid()
currentX = endX
currentY = endY
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end
function OnComment()
post.Text(" (“,commentText,”)\n")
end
Here is the code it produces, which won’t work because it doesn’t add the M08/M09 commands to turn the THC on and off and it also fails because it’s losing the X and Y location before the probe cycles. It’s also calling for probes after some cuts, based on distances traveled, rather than putting the probes right before the start of each cut, where they need to be. :
N0010 G20
N0020 F1
N0030 G53 G90 G40
N0040 (arc voltage 123v 30A)
N0050 G00 X5.4596 Y18.7662
N0060 G38.2 z-1.969 F19.685
N0070 G92 Z0.0
N0080 G00 Z0.0591
N0090 G92 Z0.0
N0100 G00 Z0.0600
N0110 M03
N0120 G04 P0.5
N0130 G01 Z0.0300 F3.937
N0140 X5.8519 Y18.8442 F35.0
N0150 G03 I0.0000 J2.0938
N0160 G01 Y18.4442
N0170 M05
N0180 G38.2 z-1.969 F19.685
N0190 G92 Z0.0
N0200 G00 Z0.0591
N0210 G92 Z0.0
N0220 G00 Z0.3937
N0230 X5.3269 Y13.6976
N0240 Z0.0600
N0250 M03
N0260 G04 P0.5
N0270 G01 Z0.0300 F3.937
N0280 X5.7192 Y13.7756 F35.0
N0290 G03 I0.0000 J2.0937
N0300 G01 Y13.3756
N0310 M05
N0320 G38.2 z-1.969 F19.685
N0330 G92 Z0.0
N0340 G00 Z0.0591
N0350 G92 Z0.0
N0360 G00 Z0.3937
N0370 X5.3119 Y8.3140
N0380 Z0.0600
N0390 M03
N0400 G04 P0.5
N0410 G01 Z0.0300 F3.937
N0420 X5.7043 Y8.3920 F35.0
N0430 G03 I0.0000 J2.0937
N0440 G01 Y7.9920
N0450 M05
N0460 G38.2 z-1.969 F19.685
N0470 G92 Z0.0
N0480 G00 Z0.0591
N0490 G92 Z0.0
N0500 G00 Z0.3937
N0510 X5.3539 Y2.8194
N0520 Z0.0600
N0530 M03
N0540 G04 P0.5
N0550 G01 Z0.0300 F3.937
N0560 X5.7462 Y2.8975 F35.0
N0570 G03 I0.0000 J2.0937
N0580 G01 Y2.4975
N0590 M05
N0600 G38.2 z-1.969 F19.685
N0610 G92 Z0.0
N0620 G00 Z0.0591
N0630 G92 Z0.0
N0640 G00 Z0.3937
N0650 X2.5613 Y4.4349
N0660 Z0.0600
N0670 M03
N0680 G04 P0.5
N0690 G01 Z0.0300 F3.937
N0700 X2.1722 Y4.3423 F35.0
N0710 G03 I0.0778 J-2.0923
N0720 G01 X2.1573 Y4.7420
N0730 M05
N0740 G38.2 z-1.969 F19.685
N0750 G92 Z0.0
N0760 G00 Z0.0591
N0770 G92 Z0.0
N0780 G00 Z0.3937
N0790 X2.4372 Y9.8338
N0800 Z0.0600
N0810 M03
N0820 G04 P0.5
N0830 G01 Z0.0300 F3.937
N0840 X2.0547 Y9.7168 F35.0
N0850 G03 I0.2102 J-2.0832
N0860 G01 X2.0145 Y10.1148
N0870 M05
N0880 G38.2 z-1.969 F19.685
N0890 G92 Z0.0
N0900 G00 Z0.0591
N0910 G92 Z0.0
N0920 G00 Z0.3937
N0930 X2.5068 Y15.3587
N0940 Z0.0600
N0950 M03
N0960 G04 P0.5
N0970 G01 Z0.0300 F3.937
N0980 X2.1189 Y15.2613 F35.0
N0990 G03 I0.1041 J-2.0912
N1000 G01 X2.0990 Y15.6608
N1010 M05
N1020 G38.2 z-1.969 F19.685
N1030 G92 Z0.0
N1040 G00 Z0.0591
N1050 G92 Z0.0
N1060 G00 Z0.3937
N1070 X2.2740 Y20.7604
N1080 Z0.0600
N1090 M03
N1100 G04 P0.5
N1110 G01 Z0.0300 F3.937
N1120 X1.8995 Y20.6200 F35.0
N1130 G03 I0.3384 J-2.0662
N1140 G01 X1.8348 Y21.0147
N1150 M05
N1160 G38.2 z-1.969 F19.685
N1170 G92 Z0.0
N1180 G00 Z0.0591
N1190 G92 Z0.0
N1200 G00 Z2.5000
N1210 X0.0000 Y0.0000
N1220 Z0.3937
N1230 M05 M30
Here is the code I cobbled up using sheetcam’s output and modifying it: (not sure if it’s right yet as I’m not near the machine until next week. I manually added the M08/09’s at the correct spots and moved the XY start position of each cut into a line before the probe cycle)
N0010 G20
N0020 F1
N0030 G53 G90 G40
N0040 (arc voltage 123v 30A)
N0045 G00 Z .5
N0050 G00 X5.4596 Y18.7662
N0060 G38.2 z-1 F5
N0070 G92 Z0.0
N0080 G00 Z0.0591
N0090 G92 Z0.0
N0100 G00 Z0.0600
N0110 M03
N0120 G04 P0.5
N0130 G01 Z0.0300 F5
N0135 M08
N0140 G01 X5.8519 Y18.8442 F35.0
N0150 G03 I0.0000 J2.0938
N0160 G01 Y18.4442
N0165 M09
N0170 M05
N0175 G00 Z0.25
N0177 G00 X5.3629 Y13.6976
N0180 G38.2 z-1 F5
N0190 G92 Z0.0
N0200 G00 Z0.0591
N0210 G92 Z0.0
N0240 G00 Z0.0600
N0250 M03
N0260 G04 P0.5
N0270 G01 Z0.0300 F5
N0275 M08
N0280 G01 X5.7192 Y13.7756 F35.0
N0290 G03 I0.0000 J2.0937
N0300 G01 Y13.3756
N0305 M09
N0310 M05
N0315 G00 Z0.25
N0317 G00 X5.3119 Y8.3140
N0320 G38.2 z-1 F5
N0330 G92 Z0.0
N0340 G00 Z0.0591
N0350 G92 Z0.0
N0360 G00 Z0.0600
N0390 M03
N0400 G04 P0.5
N0405 G01 Z0.0300 F5
N0407 M08
N0420 G01 X5.7043 Y8.3920 F35.0
N0430 G03 I0.0000 J2.0937
N0440 G01 Y7.9920
N0445 M09
N0450 M05
N0455 G00 Z0.25
N0457 G00 X5.3539 Y2.8194
N0460 G38.2 z-1 F5
N0470 G92 Z0.0
N0480 G00 Z0.0591
N0490 G92 Z0.0
N0520 G00 Z0.0600
N0530 M03
N0540 G04 P0.5
N0550 G01 Z0.0300 F5
N0555 M08
N0560 G01 X5.7462 Y2.8975 F35.0
N0570 G03 I0.0000 J2.0937
N0580 G01 Y2.4975
N0585 M09
N0590 M05
N0595 G00 Z0.25
N0597 G00 X2.5613 Y4.4349
N0600 G38.2 z-1 F5
N0610 G92 Z0.0
N0620 G00 Z0.0591
N0630 G92 Z0.0
N0660 G00 Z0.0600
N0670 M03
N0680 G04 P0.5
N0690 G01 Z0.0300 F5
N0695 M08
N0700 G01 X2.1722 Y4.3423 F35.0
N0710 G03 I0.0778 J-2.0923
N0720 G01 X2.1573 Y4.7420
N0725 M09
N0730 M05
N0735 G00 Z0.25
N0737 G00 X2.4372 Y9.8338
N0740 G38.2 z-1 F5
N0750 G92 Z0.0
N0760 G00 Z0.0591
N0770 G92 Z0.0
N0800 G00 Z0.0600
N0810 M03
N0820 G04 P0.5
N0830 G01 Z0.0300 F5
N0835 M08
N0840 G01 X2.0547 Y9.7168 F35.0
N0850 G03 I0.2102 J-2.0832
N0860 G01 X2.0145 Y10.1148
N0865 M09
N0870 M05
M0875 G00 Z0.25
N0877 G00 X2.5068 Y15.3587
N0880 G38.2 z-1 F5
N0890 G92 Z0.0
N0900 G00 Z0.0591
N0910 G92 Z0.0
N0940 G00 Z0.0600
N0950 M03
N0960 G04 P0.5
N0970 G01 Z0.0300 F5
N0975 M08
N0980 G01 X2.1189 Y15.2613 F35.0
N0990 G03 I0.1041 J-2.0912
N1000 G01 X2.0990 Y15.6608
M1005 M09
N1010 M05
N1015 G00 Z0.25
N1017 G00 X2.2740 Y20.7604
N1020 G38.2 z-1 F5
N1030 G92 Z0.0
N1040 G00 Z0.0591
N1050 G92 Z0.0
N1080 Z0.0600
N1090 M03
N1100 G04 P0.5
N1110 G01 Z0.0300 F5
N1115 M08
N1120 G01 X1.8995 Y20.6200 F35.0
N1130 G03 I0.3384 J-2.0662
N1140 G01 X1.8348 Y21.0147
N1145 M09
N1150 M05
N1200 G00 Z2.5000
N1201 GOO X0
M1202 G00 Y0
N1230 M05 M30
valley circles.job (13 KB)