Hi,
I'm using the trail version and I'm thinking of buying it.
But first, I have some problems that I want to fix.
I use usbcnc from EdingCNC for my homemade plasma table.
I use the Mach3-plasma post processor which I have modified a little, because my tool-out is broken, and I'm now using flood-out to light up the torch.
I don't have a THC and I'm not planning on buying / making one.
The easy fix for this, is that I zero the torch before every cut.
The zeroing go's automatically. There is a switch in the torch and when it touches the plate it zero's.
Calling a simple subroutine triggers the zero action.
Currently, I put in the code line for zeroing in the G-code by hand but I prefer it to go automatically.
Code looks like this:
N0100 M06 T1 F850.0 (Plasma) // toolchange and speed
N0110 G00 Z10.0000 // go rapid to Z-height 10
N0120 X50.0000 Y50.0000 // go rapid to coordinate
N0130 Z3.0000 // Set Z to pierce height
N0140 M08 // ignite torch (using the flood to ignite)
N0150 G04 P0.5 // wait 0,5 second - pierce delay
N0160 G01 Z2.0000 F100.0 // go to cut height
N0170 .... // start cutting
Code should be like this:
N0100 M06 T1 F850.0 (Plasma) // toolchange and speed
N0110 G00 Z10.0000 // go rapid to Z-height 10
N0120 X50.0000 Y50.0000 // go rapid to coordinate
N0130 GOSUB TN // this line calls the zeroing subrouting
N0140 Z3.0000 // Set Z to pierce height
N0150 M08 // ignite torch (using the flood to ignite)
N0160 G04 P0.5 // wait 0,5 second - pierce delay
anyone an idea
Follow the link and seit in action
http://www.youtube.com/watch?v=7ihHJ668 ... YCMfmnW96g
Thanks Sjuul CNC
Modifying a postprocessor
- Les Newell
- Site Admin
- Posts: 3668
- Joined: Thu May 11, 2006 8:12 pm
Thanks Les.
http://www.edingcnc.com/index.php?pagin ... e&taalid=2
maby you mean usbcnc from planet cnc
http://www.planet-cnc.com/
unfortunately it didn't work, i think i placed the code at the wrong place i think
I'm not a great programmer, this is my complete post processor code:
No, I'm using USBCNC from EdingCNCBy the way, are you using the USBCNC plugin for SheetCam?"
http://www.edingcnc.com/index.php?pagin ... e&taalid=2
maby you mean usbcnc from planet cnc
http://www.planet-cnc.com/
unfortunately it didn't work, i think i placed the code at the wrong place i think
I'm not a great programmer, this is my complete post processor code:
Code: Select all
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("M08/M09 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 G0 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 (" M09 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 M08\n")
if (pierceDelay > 0.001) then
post.Text (" G04 P")
post.Number (pierceDelay,"0.###")
post.Eol()
end
end
function OnPenUp()
post.Text (" M09\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
- Les Newell
- Site Admin
- Posts: 3668
- Joined: Thu May 11, 2006 8:12 pm
This should do the trick:
In SheetCam if you go to the plugins menu you should see an option 'Enable USBCNC'. If you turn that on you should get a window that allows you to control your machine from within SheetCam. It will also automatically load the G-code into USBCNC when you run the post processor. Note that when the code is loaded into USBCNC it is not shown in the USBCNC main program. However it will run correctly.
Code: Select all
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("M08/M09 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 G0 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 (" M09 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.Text(" GOSUB TN\n")
post.ModalText (" G00")
post.NonModalNumber (" Z", pierceHeight * scale, "0.0000")
post.Text ("\n M08\n")
if (pierceDelay > 0.001) then
post.Text (" G04 P")
post.Number (pierceDelay,"0.###")
post.Eol()
end
end
function OnPenUp()
post.Text (" M09\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