GRBL post

This is the place for any plugins, posts or other useful tools you have created.
Post Reply
regpye
Posts: 56
Joined: Sat Nov 09, 2019 1:12 am
Location: South Australia

GRBL post

Post by regpye » Fri Jun 18, 2021 11:59 pm

I am running a post that is generic GRBL, and although it is working mostly, I am getting notifications that some G01 and G03 moves are not supported.
Is there a specific post written for GRBL 1.1h ?
The post I am using is shown below.

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

firstPierceTime = 0 --this is an extra delay added to the first pierce as needed by some machines




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




function OnInit()

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
bigArcs = 1 --stitch arc segments together
minArcSize = 0.05 --arcs smaller than this are converted to moves
firstPierce = firstPierceTime
end

function OnFinish()
post.Text (" M05 M9 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 M04 M8\n")
if (pierceDelay + firstPierce > 0.001) then
post.Text (" G04 P")
post.Number (pierceDelay + firstPierce,"0.###")
firstPierce = 0
post.Eol()
end
end


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


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

regpye
Posts: 56
Joined: Sat Nov 09, 2019 1:12 am
Location: South Australia

Re: GRBL post

Post by regpye » Thu Jun 24, 2021 3:48 am

I am also think about using a stand alone THC and not sure how this will effect the use of SheetCAM as the Z axis will no long be controlled by my motion software. I am still not sure about how the stand alone system works fully, but I am sure that there will need to be some changes to accommodate for the different behaviour of the machine.
Although I have been getting the messages appear about M01 and M03 not supported, the file seems to process correctly.

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

Re: GRBL post

Post by Les Newell » Thu Jun 24, 2021 2:12 pm

Could you give me the exact warning message.
Does the THC completely control the Z? If so you can probably still use this post. Simply don't connect anything to the Z axis.

regpye
Posts: 56
Joined: Sat Nov 09, 2019 1:12 am
Location: South Australia

Re: GRBL post

Post by regpye » Sat Jun 26, 2021 10:11 am

Thanks Les,
The warning is displayed in Universal Gcode Sender. It has small warning triangles against the lines that hold G01 and G03 code and when the cursor is placed over the line in question, a message shows that the code may not be supported.
The code seems to complete without any errors.

I was think about what you mentioned about the Z axis, I had the same idea. I am not sure yet about how the stand alone system works (it hasn't arrived yet) and I have not been able to get much information from the supplier. The unit I have purchased is SF-HC25G/25K with a lifter.

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

Re: GRBL post

Post by Les Newell » Mon Jun 28, 2021 1:06 pm

That's odd. GRBL supports both G01 and G03. Could you post a copy of your g-code here.

Post Reply