Post problem? Feed slow after first cut

Having problems with or questions about SheetCam? Post them here.
Post Reply
Tristar500
Posts: 10
Joined: Sun May 14, 2023 1:28 pm

Post problem? Feed slow after first cut

Post by Tristar500 »

I'm trying to figure out how to fix this post. The initial cut starts out great then moves to subsequent cuts and stays at federate 30 instead of 100 as I defined in my sheetcam tool.

Any help greatly appreciated!!!!

______________________________________________________________________________

function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("Mach3 CNC4pc Plasma no Z\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("M03/M05 turn the torch on/off\n")
ctrl:AppendText("Incremental IJ\n")
end



-- created 26/5/23
-- 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 G91.1 G40\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 (" M05\n M30\n")
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 (preheat > 0.001) then
-- post.ModalText (" G00")
-- post.ModalNumber (" Z", cutHeight * scale, "0.0000")
-- post.Text (" G04 P")
-- post.Number (preheat,"0.###")
post.Eol()
end
-- post.ModalText (" G00")
-- post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
post.Text (" M03\n")
post.Text (" F", feedRate * scale)
if (pierceDelay > 0.001) 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 (" (Operation: ", operationName, ")\n")
end

function OnComment()
post.Text(" (",commentText,")\n")
end

function OnToolChange()
end

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

function OnDrill()
OnRapid()
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Post problem? Feed slow after first cut

Post by djreiswig »

Not exactly sure, but I did notice that several places refer to federate as a number, but one place it is text. I would change the text line to match the number lines and give that a try. Otherwise, post a sample of your gcode and note where it works and where it doesn't.
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: Post problem? Feed slow after first cut

Post by bLouChip »

I'm guessing here, but the if(math.hypot... stmt in OnMove() appears to mean "do nothing" if X and Y coords have not changed. However, that is exactly the condition when the machine is about to pierce, so by immediately returning the plungeRate is not posted for the pierce motion. So by removing this stmt, sheetcam will post the pierce plunge motion and that should include a "feedrate" change for the value of plungeRate, at least it does so in my scpost.

And then as @ djreiswig has mentioned, you're mixing post.ModalNumber(" F"... with post.Text(" F"... to manage feedrate, where as post.ModalNumber should exclusively manage it so that when feedrate changes, it will know to post it. So remove the post.Text(" F"... since I suspect you are intending it to use the plungeRate as feedrate, but that's shouldn't be necessary based on sheetcam handling the feedrate through OnMove().


try changing these functions...

function OnMove()
-- comment out this stmt-- 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

unction OnPenDown()
if (preheat > 0.001) then
-- post.ModalText (" G00")
-- post.ModalNumber (" Z", cutHeight * scale, "0.0000")
-- post.Text (" G04 P")
-- post.Number (preheat,"0.###")
post.Eol()
end
-- post.ModalText (" G00")
-- post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
post.Text (" M03\n")
-- comment out this stmt-- post.Text (" F", feedRate * scale)
if (pierceDelay > 0.001) then
-- post.Text (" G04 P")
-- post.Number (pierceDelay,"0.###")
post.Eol()
end
end
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Post problem? Feed slow after first cut

Post by djreiswig »

The if is there to prevent the code from being inserted if the move is too tiny to happen. It prevents moves from appearing that are 0 when chopped to 4 decimal places.
Tristar500
Posts: 10
Joined: Sun May 14, 2023 1:28 pm

Re: Post problem? Feed slow after first cut

Post by Tristar500 »

Here's the G code generated with this post to cut 3 6 inch parallel lines.

Thanks again.
I'm trying to make sense of this but new to editing posts beyond basic parameters.

N0010 (Filename: 6inch.NC)
N0020 (Post processor: Mach3 CNC4pc plasma no Z.scpost)
N0030 (Date: 10/12/2023)
N0040 G20 (Units: Inches)
N0050 G53 G90 G91.1 G40
N0060 (Part: 6inch)
N0070 (Operation: No Offset, Colour 7, T2: Plasma, 0.08 in kerf 20 100 IPM)
N0080 G00 X0.3965 Y0.2398
N0090 M03
N0100 F30
N0110 G01 Y6.7398 F100.0
N0120 (Part: 6inch Duplicate 1)
N0130 (Operation: No Offset, Colour 7, T2: Plasma, 0.08 in kerf 20 100 IPM)
N0140 M05
N0150 G00 X0.8391 Y0.2490
N0160 M03
N0170 F30
N0180 G01 Y6.7490
N0190 (Part: 6inch Duplicate 2)
N0200 (Operation: No Offset, Colour 7, T2: Plasma, 0.08 in kerf 20 100 IPM)
N0210 M05
N0220 G00 X1.2725 Y0.2490
N0230 M03
N0240 F30
N0250 G01 Y6.7490
N0260 M05
N0270 M05
N0280 M30
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Post problem? Feed slow after first cut

Post by djreiswig »

Where is the 30 feedrate coming from? Plunge rate?
For sure you need to fix the text feedrate line in the post and change it to modelnumber instead of text. Just copy one of the other lines and paste it over the text one.

Edit: it says the post is for no Z so you shouldn't have a plunge speed. I'll have a closer look in a bit and see if I can figure out what is happening.
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Post problem? Feed slow after first cut

Post by djreiswig »

I'd say just comment out the feedrate line in onpendown. You don't need any other feedrates since you're not moving a Z axis. I'm guessing it's coming from the plunge rate setting in your tool. You didn't show your tool settings, so I can't verify.
Tristar500
Posts: 10
Joined: Sun May 14, 2023 1:28 pm

Re: Post problem? Feed slow after first cut

Post by Tristar500 »

djreiswig wrote: Mon Dec 11, 2023 12:03 am Where is the 30 feedrate coming from? Plunge rate?
For sure you need to fix the text feedrate line in the post and change it to modelnumber instead of text. Just copy one of the other lines and paste it over the text one.

Edit: it says the post is for no Z so you shouldn't have a plunge speed. I'll have a closer look in a bit and see if I can figure out what is happening.
This post is supposed to work with this Mach screen. probe federate and other variables are adjusted on the screen.
cnc4pcMach3Screen.jpg
cnc4pcMach3Screen.jpg (263.23 KiB) Viewed 6858 times
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Post problem? Feed slow after first cut

Post by djreiswig »

Your post has the z moves commented out, but still has a feedrate change (programmed incorrectly as text). The screen is made for the unedited post with a Z axis.

Comment out the feedrate in the onpendown and it should stay at the normal feedrate instead of the probing feedrate (which I assume you had set to 30 when you made your gcode). Whomever modified the post you are using made some mistakes.
Make this change and rerun the post and see what the code looks like.
Post Reply