Torch Retract Height After Cuts

How do I change the torch retract height after machine is finished cutting? After cutting when homing the torch just barely clears the material and some times drags across. Is there a way to change it? Is it in fire control or sheet cam?

That is a good question. I used to β€œhome” the machine after installing limit switches and it would raise the torch automatically as it went to the left, back corner of the PRO table. Then it stopped doing that. It seems to me that the last time I performed the β€œhome” feature, it was raising the torch again. But I cannot say that positively.

I don’t know of a short cut command but I am sure there is a g-code command that could add manually just before the end of the gcode file. You need to allow the last two lines to read something similar to this:
M30
(PS18)

The (PS18) tells FireControl the cut speed, which in this case is 18. If FireControl does not find that line at the end, it will run.

Sorry. I am not much help: Just commiserating with you. :upside_down_face:

The standard retract height is 1". That is built into the post processor and can’t be changed unless you edit the post processor.

Post the last 5 lines of your g code.

There should be a line with G0 Z1

Sorry for taking so long to post. Life gets in the way at times. Here is the g code file from sheet cam. Please let me know what you think and any changes that should be made.
Thanks
firstPierceTime = 0 --this is an extra delay added to the first pierce as needed by some machines
version = 1.6

local function isEmpty(s)
return s == nil or s == β€˜β€™
end

function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText(β€œPost for CrossFire PRO and CrossFire using FireControl Software\n”)
ctrl:AppendText(β€œ\n”)
ctrl:AppendText(β€œFor CrossFire PRO and CrossFire w/powered z-axis add-on, be sure to set Pierce Height, Plunge Rate, and Cut Height values in order to activate IHS sequence. There is a 1 inch rapid retract move after each cut loop by default.\n”)
ctrl:AppendText(β€œ\nFor CrossFire without powered Z-axis, Pierce Height and Cut Height must be both set to 0 to disable IHS.\n”)
end

function OnInit()
programSpeed = 0 – variable overridden with fastest cut speed
post.SetOptions(post.ARC_SEGMENTS)
post.SetCommentChars (β€œ()”, β€œβ€) --make sure ( and ) characters do not appear in system text
post.Text (β€œ(v”… version β€¦β€œ-sc)\n”)
post.Text (β€œG90 G94\n”)
post.Text (β€œG17\n”)
if(scale == metric) then
post.Text (β€œG21 (Units: Metric)\n”) --metric mode
else
post.Text (β€œG20 (Units: Inches)\n”) --inch mode
end
post.TextDirect (β€œH0\n”) – thc OFF, Machine in control of Z

bigArcs = 1 --stitch arc segments together
minArcSize = 0.05 --arcs smaller than this are converted to moves
firstPierce = firstPierceTime
end

function OnFinish()

post.Text (β€œM5 M30\n”)
post.Text (β€œ(PS” … programSpeed … β€œ)\n”)
end

function OnRapid()
if (math.hypot(endX - currentX, endY - currentY) < 0.001) then return end
if(endX > 1e30) then return end
post.Text (β€œG0”)
post.ModalNumber (" X", endX * scale, β€œ0.0###”)
post.ModalNumber (" Y", endY * scale, β€œ0.0###”)
– post.ModalNumber (" Z", endZ * scale, β€œ0.0###”)
post.Eol()
end

function OnMove()

if(currentX ~= endX or currentY ~= endY) then
post.Text (β€œG1”)
post.ModalNumber (" X", endX * scale, β€œ0.0###”)
post.ModalNumber (" Y", endY * scale, β€œ0.0###”)
–post.ModalNumber (" Z", endZ * scale, β€œ0.0###”)
post.ModalNumber (" F", feedRate * scale, β€œ0.0###”)
post.Eol()
if(feedRate * scale > programSpeed and leadinType == 0) then
programSpeed = feedRate * scale
end
end
end

function OnArc()
if(arcAngle <0) then
post.Text (β€œG3”)
else
post.Text (β€œG2”)
end
post.NonModalNumber (" X", endX * scale, β€œ0.0###”)
post.NonModalNumber (" Y", endY * scale, β€œ0.0###”)
– post.ModalNumber (" Z", endZ * scale, β€œ0.0###”)
post.Text (" I")
post.Number ((arcCentreX - currentX) * scale, β€œ0.0###”)
post.Text (" J")
post.Number ((arcCentreY - currentY) * scale, β€œ0.0###”)
post.ModalNumber (" F", feedRate * scale, β€œ0.0###”)
post.Eol()

if(feedRate * scale > programSpeed and leadinType == 0) then
programSpeed = feedRate * scale
end
end

function OnPenDown()
post.TextDirect (β€œ\n”)
ihs = pierceHeight ~= 0 and cutHeight ~= 0 --enable IHS if both pierce and cut are non-zero
if (ihs) then
post.TextDirect (β€œG92 Z0.\n”) – reset Z to 0
post.TextDirect (β€œG38.2 Z”… post.FormatNumber(-5 * 25.4 * scale, β€œ0.0##”) …" F"… post.FormatNumber(100 * 25.4 * scale, β€œ0.0##”) β€¦β€œ\n”) – IIHS Fast Down
post.TextDirect (β€œG38.4 Z”… post.FormatNumber(0.5 * 25.4 * scale, β€œ0.0##”) …" F"… post.FormatNumber(20 * 25.4 * scale, β€œ0.0##”) β€¦β€œ\n”) – IIHS Slow Up
post.TextDirect (β€œG92 Z”…post.FormatNumber(0, β€œ0.0##”) β€¦β€œ\n”) – reset Z to IHS 0
post.TextDirect (β€œG0 Z”…post.FormatNumber(0.02 * 25.4 * scale, β€œ0.0##”) …" (IHS Backlash)\n") – reset Z to IHS 0
post.TextDirect (β€œG92 Z”…post.FormatNumber(0, β€œ0.0##”) β€¦β€œ\n”) – reset Z to IHS 0

  post.TextDirect ("G0 Z"..post.FormatNumber(pierceHeight * scale, "0.0##") .." (Pierce Height)\n") -- Z to Pierce

end
post.Text (β€œM3\n”) – fire torch

if (pierceDelay + firstPierce > 0.001) then – pierce delay
post.Text (β€œG4 P”)
post.Number (pierceDelay + firstPierce,β€œ0.###”)
firstPierce = 0
post.Eol()
end

if (ihs) then
post.TextDirect (β€œG1 Z”…post.FormatNumber(cutHeight * scale, β€œ0.0##”) …" F"… post.FormatNumber(plungeRate * scale, β€œ0.0##”) …" (Cut Height)\n") – Z to Cut
end
post.TextDirect (β€œH1\n”) – thc ON, THC in control of Z
end

function OnPenUp()
ihs = pierceHeight ~= 0 and cutHeight ~= 0 --enable IHS if both pierce and cut are non-zero
post.Text (β€œH0\n”) – thc OFF, Machine in control of Z
post.Text (β€œM5\n”)
if (endDelay > 0) then
post.Text (β€œG4 P”)
post.Number (endDelay,β€œ0.###”)
post.Eol()
end
if (ihs) then
post.TextDirect (β€œG0 Z” … post.FormatNumber(25.4 * scale, β€œ0.0##”) … β€œ\n”) – Z to rapid height
end
post.CancelModalNumbers()
end

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

If the built in 1 inch retract isn’t enough to let you home the torch, it seems like something is wrong.

Is your material warping so much or you have so many tip ups you can’t home?

Why not manually jog it up?

3 Likes

That is the post processor, not a G-code file.

3 Likes

The retract is defined in the following:

The post.TextDirect line references the Z axis move. The 25.4 * scale defines the distance. (For scale = metric, 25.4 * 1 = 25.4mm, for scale = inches, 25.4 * .03937 = 1")

If you need more travel, adjust the 25.4 (in mm) to your required height.

5 Likes

Thank you for the information. I’m glad someone has an answer. I don’t know why or how my post processor got changed and stopped raising the torch. I will change the post processor code and hope it works again. Thanks again.

1 Like

You still didn’t post any code, so we don’t really know if the code calls for a 1" retract or not. The code could be fine and your Z axis coupler is slipping.

1 Like

But I did. Just look above in the posts

That’s not G code. It’s the post processor that the CAM program uses to make the code.

The line that writes the retract is calling for a 1" retract height on the post processor that you posted.

1 Like

Plugged the code in sheet cam you posted. Now works perfectly. Thank you for the help.

1 Like