Scribe Setup and Post with THC300

Having problems with or questions about SheetCam? Post them here.
Post Reply
Wolfes Metal Fab
Posts: 64
Joined: Wed Jan 14, 2009 6:08 am

Scribe Setup and Post with THC300

Post by Wolfes Metal Fab »

What all do i need to do to get a scribe up and going as far as in sheetcam? I have it hooked up to the Flood M8 Relay currently (may switch it to another output sometime) and can activate it in mach.

I see many say use the MP1000 scribe post, but i am currently using the THC300, do i need to do anything to "Merge" the 2, or copy and paste certain sections. I dont understand the post language very much.

The scribe is attached to my Plasma Z axis and when engaged, it will be 1/2" to 3/4"" lower than the plasma tip, and then I will use the z axis to raise it approx 1/4" - 1/2" between lines, leaving the scribe running, to make it faster, and instead of constantly turning the relay on and off, unless the engraving is far apart (any way to setup a distance for this automatically, like there is for floating head switch reference?), and the plan is when i need to scribe, it will go to the path start with the plasma torch at Z 1", and fire the relay and then lower the scribe to the plate, or .25" below, relying on the cylinder pressure. Which all may be fine tuned.

I need to add the scribe tool, 201 maybe?, and then figure out how to add it into the post, and make it fire the relay when that tool is selected and it needs to engage.

This may be a simple thing for you guys, and im hoping you can save me some grief.

Thanks,
Brian
Wolfes Metal Fab
Posts: 64
Joined: Wed Jan 14, 2009 6:08 am

THC300 Post

Post by Wolfes Metal Fab »

Here is the Current THC300 Post, I would like some help determining the important settings that I would need to use in a different post, or understanding some things more.


function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("plasma THC300 post processor\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")
ctrl:AppendText("The torch is referenced at cut start and every 500mm of movement thereafter\n")
ctrl:AppendText("Designed for use with Mach2 and Campbell Designs THC300\n")
ctrl:AppendText("Post variables:\n")
ctrl:AppendText("refdistance - set the distance between each reference\n")
end



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

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

-- created 27/10/04
-- Based on plasma1.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 G40\n F1\n S500\n")

dist = 9999999
refdistance = 500 * scale
switchoffset = .0511
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()
if(endZ < currentZ) then return end
dist = dist + math.hypot(endX-currentX , endY-currentY)
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()
dist = dist + math.hypot(endX-currentX , endY-currentY)
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.###")
post.Eol()
end

function OnArc()
dist = dist + math.hypot(endX-currentX , endY-currentY)
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(dist >= (refdistance/scale)) then
dist = 0
post.ModalText(" G28.1 Z")
post.Number(3 * scale, "0.00")
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.ModalText (" G00")
post.ModalNumber(" Z", switchoffset, "0.0000")
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.CancelModalNumbers()
end
post.ModalText (" G00")
post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
post.Eol()
if (preheat > 0) then
post.Text ("\n G04 P")
post.Number (preheat,"0.###")
post.Eol()
end
post.Text ("\n M03\n")
if (pierceDelay > 0) 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 (" (Process: ", processname, ")\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 OnComment()
post.Text(" (",commentText,")\n")
end

function OnToolChange()
post.Text (" M06 T")
post.Number (tool, "0")
post.Text (" (", toolName, ")\n")
end

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

function OnDrill()
OnRapid()
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end
Wolfes Metal Fab
Posts: 64
Joined: Wed Jan 14, 2009 6:08 am

Mp1000 Scriber Post

Post by Wolfes Metal Fab »

Here is the scriber post to compare to the THC300


--************************************************
--*** 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
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

--If this value is set to true then use G28 (home) for the Z reference
--Set it to false for G31 probe
refHome = true

--The cutter will slow down for corners and turn off THC below this radius
slowRadius = 10

--Minimum slow down speed.
--This is a scale factor. For instance 0.5 = 50% of the current feed rate
slowPercent = 0.4

--THC on and off codes. Use nil if you don't want THC control e.g:
-- thcOnCode = nil
-- thcOffCode = nil

--here is another example that use M667 and M666
--thcOnCode = " M667"
--thcOffCode = " M666"

thcOnCode = nil
thcOffCode = nil

--************************************************
--*** 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")
ctrl:AppendText("slowRadius - slow down below this radius\n")
ctrl:AppendText("slowPercent - minimum percentage to slow down\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)
post.DefineVariable("slowRadius",sc.unitLINEAR,-1e17,1e17)
post.DefineVariable("slowPercent",sc.unitPERCENT,-1e17,1e17)

function OnInit()

offX = 0
offY = 0
offZ = 0

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 (" 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
ThcOff()
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
if(len > slowRadius) then
ThcOn()
end
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 (radius < slowRadius) and (math.abs(arcAngle) > 0.5) then
feed = (radius / slowRadius)
if(feed < slowPercent) then
feed = slowPercent
end
feed = feed * feedRate
ThcOff()
else
feed = feedRate
ThcOn()
end
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", feed * scale, "0.0###")
post.Eol()
end


function ThcOff()
if(not thcOffCode) then return end
if(thcstate ==1) then
thcstate = 0
post.Text(thcOffCode)
post.Text(" (THC off)\n");
end
end

function ThcOn()
if(not thcOnCode) then return end
if(toolClass == "MarkerTool") or tool > 99 then return end
if(thcstate ==0) then
thcstate = 1
post.Text(thcOnCode)
post.Text(" (THC on)\n");
return
end
if(thcstate == 2) then
thcstate = 0
end
end


function OnPenDown()
if(toolClass == "MarkerTool") or tool > 99 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.###")
post.Eol()
end
post.Text ("\n M03\n")
end
if (pierceDelay > 0) then
post.Text (" G04 P")
post.Number (pierceDelay,"0.###")
post.Eol()
end
-- thcstate = 2 --leave THC off for plunge move
end


function Reference()
firstRef = false
if (refHome) then
post.ModalText(" G28.1 Z")
post.Number(3 * scale, "0.00")
else
post.ModalText(" G31 Z -100")
end
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(tool > 99) then
post.Text(" M09\n")
else
post.Text (" M05\n")
end
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 OnToolChange()
if (toolClass == "MarkerTool" or tool > 99 ) then
ThcOff()
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 OnNewPart()
post.Text(" (Part: ",partName,")\n");
end

function OnDrill()
OnRapid()
currentX = endX
currentY = endY
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Post by Les Newell »

Just use the MP1000 post. It should work with your MP300.

Define a scriber tool rather than messing around with tool numbers. There is a specific tool type for scribers.
Wolfes Metal Fab
Posts: 64
Joined: Wed Jan 14, 2009 6:08 am

Post by Wolfes Metal Fab »

Ok, i will try that. Is the MP1000 newly updated to use the new rules and settings that are in sheetcam now instead of being in the post (like on small arcs, do etc or will any of them contradict each other? Also, can the MP1000 Scriber post be changed to mm were it says mm only, by adding the * scale code, and any other corresponding areas?

I will probably have a few more questions, but I will try it and google what i can before posting more. I wondered if i could just switch, but i was unsure if there was something important in the THC300 post for the THC301d that i am using that i needed to be sure to merge into it.

Thanks Les, much appreciated.

Brian
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Post by Les Newell »

Wolfes Metal Fab wrote:Ok, i will try that. Is the MP1000 newly updated to use the new rules and settings that are in sheetcam now instead of being in the post (like on small arcs, do etc or will any of them contradict each other?
Just leave the THC on and off codes set to nil and set slowRadus to 0. That will disable the post's slowdown stuff.

Also, can the MP1000 Scriber post be changed to mm were it says mm only, by adding the * scale code, and any other corresponding areas?
All posts use mm internally. The g-code units are set in Options->machine->post processor.
Wolfes Metal Fab
Posts: 64
Joined: Wed Jan 14, 2009 6:08 am

Post by Wolfes Metal Fab »

Les Newell wrote:All posts use mm internally. The g-code units are set in Options->machine->post processor.
Yes, i am aware of the g-code inch settings, my THC300 post actually used the *scale feature to use inch input for switch offsets, etc. Its not a big deal, as i can convert them, but its nice to look at a sheet of information and be able to change it quickly and easily notice any errors, say if you wanted to change the z reference distance to every cut just for a certain sheet, and then every 12" for another and so on. I was debating trying to copy the THC300 posts *scale part of the post to add inch input for the mp1000, but i will probably just try to make sure everything is working first, if i attempt that. But if its a pain, like I said, no big deal.

Thanks,
Brian
Post Reply