MIRL POST PROCESSOR ISSUE
Posted: Tue Nov 21, 2023 9:24 am
HI i have a Extron MIRL CONTROL Mill I'm trying to control with Sheetcam, I've been using it for years with mach3 no issues and only just started with this new macine.
although with this machine i get INT 132 faults (illegal Radius) fault
Code descriptioon
(1) End point on G02, G03 for arc cutting is not on the arc
(2)Check the vectors of center and endpoint
(3) Press Reset to Clear the error.
Ive tried making adjustments and still get this fault every now and then.
Any advice would help, the Post processor I"ve been working on making it work so there may be issues with it.
function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("EXTRON E216 MIRL M2000 POST PROCESSOR\n")
ctrl:AppendText("Non modal G-codes\n")
ctrl:AppendText("Modal coordinates\n")
ctrl:AppendText("All Comments preceeded by semicolon\n")
ctrl:AppendText("Incremental IJ\n")
ctrl:AppendText("uses G43 tool length offsets and H values from machine tool table\n")
end
-- revision 3/2/07
-- Removed final safety move. This is now done in SheetCam
-- revision 25/5/06
-- Revised rigid tapping spindle on/off sequencing
-- revision 11/5/06
-- Revised rigid tapping
-- revision 4/5/06
-- Revised tapping cycles
-- revision 2/5/06
-- Added tapping cycle
-- revision 14/11/05
-- Fixed circles for Mach2/earlier versions of Mach3
-- revision 20/10/04
-- added tool length offsets
-- revision 25/10/04
-- added G90.1 incremental IJ mode
-- revision 28/7/04
-- Added drill start depth
-- revision 19/7/04
-- added drill cycle
-- revision 28/6/04
-- Replaced startx,y,z with currentx,y,z
-- Revision 28/5/04
-- Unbodged first rapid move - main app is fixed now
-- Added plunge,feed,spindle speed warnings
-- Revision 25/5/04
-- fixed feed rate problem and bodged first rapid move
-- Revision 18/5/04
-- Added Metric + Inch variables and easy inch/metric swapping
-- changed to fixed number of trailing zeros
-- Created 11/5/2004
function OnInit()
post.TextDirect("%\n")
post.SetCommentChars ("()abcdefghijklmnopqrstuvwxyz", "[]ABCDEFGHIJKLMNOPQRSTUVWXYZ") --make sure ( and ) characters do not appear in system text
post.Text(" /*DATE: ",date," TIME:",time," */ \n")
post.Text (" /*POST PROCESSOR: EXTRON E216 SHEETCAM */ \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 (" G17")
post.Eol ()
post.Text (" G94")
post.Eol ()
post.Text (" G90")
post.Eol ()
post.Text (" G49")
post.Eol ()
post.Text (" G54")
post.Eol ()
post.Text (" M45")
post.Eol ()
bigArcs = 1 --stitch arc segments together
minArcSize = 0.05 --arcs smaller than this are converted to moves
end
function OnFinish()
post.Text (" M30\n")
post.TextDirect("%\n")
end
function OnRapid()
post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.00")
post.ModalNumber (" Y", endY * scale, "0.00")
post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.00")
post.Eol()
end
function OnMove()
post.ModalText (" G01")
post.ModalNumber (" X", endX * scale, "0.00")
post.ModalNumber (" Y", endY * scale, "0.00")
post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.00")
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.0###")
post.NonModalNumber (" Y", endY * scale, "0.0###")
post.ModalNumber (" Z", (endZ + toolOffset) * 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()
end
function OnSpindleCW()
post.ModalNumber (" S", spindleSpeed, "0.##")
post.Text (" M03")
post.Eol()
end
function OnSpindleCCW()
post.ModalNumber (" S", spindleSpeed, "0.##")
post.Text (" M04")
post.Eol()
end
function OnSpindleOff()
post.Text (" M05\n")
end
function OnNewOperation()
post.Text (" /*OPERATION ", operationName, " */ \n")
end
function OnComment()
post.Text(" /*",commentText," */ \n")
end
function OnToolChange()
post.Text (" /*", toolName, " */ \n")
post.Text (" M06")
post.Text (" T")
post.Number (tool, "0")
post.Eol()
post.Text (" G43 H")
post.Number (tool, "0")
post.Eol()
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 OnFloodOn()
post.Text(" M08 /*FLOOD COOLANT ON */ \n")
end
function OnMistOn()
post.Text(" M07 /*MIST COOLANT ON */ \n")
end
function OnCoolantOff()
post.Text(" M09 /*COOLANT OFF */ \n")
end
function OnDrill()
post.ModalText (" G83")
OnRapid()
depth = drillStart
buffer = plungeSafety
endZ = depth + buffer
OnRapid()
if(drillRetract < buffer) then
buffer = drillRetract
end
while depth > drillZ do
OnRapid()
depth = depth - drillPeck
if (depth < drillZ) then
depth = drillZ
end
endZ = depth
OnMove()
if (depth > drillZ) then --retract if we need to take another bite
endZ = endZ + drillRetract
if (endZ > safeZ) then
endZ = safeZ
end
OnRapid()
endZ = depth + buffer
end
end
if (endZ < safeZ) then
endZ = safeZ
OnRapid()
end
end
function OnSetFeed()
end
function OnTapStart()
post.Text(" M49\n") --disable FRO
post.Text(" G95\n") --feed per rev
end
function OnAutoTap()
clearance = 1 --tapping clearance height
--move to hole X,Y coordinates
OnRapid()
--move to tapping clearance height
clearance = clearance + drillStart
endZ = clearance
OnRapid()
--feed to depth
feedRate = tapPitch * underFeed
OnSetFeed()
endZ = drillZ
OnMove()
--retract to engage reverse clutch
endZ = drillZ + tapTravel
feedRate = 10000
OnMove()
--feed out
feedRate = tapPitch * reverseMult * underFeed
endZ = tapTravel + clearance
OnMove()
--retract to clearance plane
endZ = safeZ
OnRapid()
end
function OnRigidTap()
clearance = 1 --tapping clearance height
--spindle forwards
if (spindleDir == 1) then
OnSpindleCW()
else
OnSpindleCCW()
end
spindlecache = spindleSpeed
--move to hole X,Y coordinates
OnRapid()
--move to tapping clearance height
endZ = clearance + drillStart
OnRapid()
--tap to depth, correcting for underfeed
feedRate = tapPitch * underFeed
OnSetFeed()
depthfix = (drillStart - drillZ) * (1 - underFeed)
endZ = drillZ + depthfix
OnMove()
--reverse spindle
OnSpindleOff()
spindleSpeed = spindlecache * reverseMult
if(spindleDir == -1) then
OnSpindleCW()
else
OnSpindleCCW()
end
--feed out
feedRate = tapPitch * reverseMult * underFeed
OnSetFeed()
endZ = clearance + drillStart
OnMove()
--stop spindle and restore speed to tapping speed
OnSpindleOff()
spindleSpeed = spindlecache
--retract to clearance plane
endZ = safeZ
OnRapid() --retract to clearance plane
end
function OnTapEnd()
post.Text(" M48\n") --enable FRO
post.Text(" G94\n") --feed per min
end
although with this machine i get INT 132 faults (illegal Radius) fault
Code descriptioon
(1) End point on G02, G03 for arc cutting is not on the arc
(2)Check the vectors of center and endpoint
(3) Press Reset to Clear the error.
Ive tried making adjustments and still get this fault every now and then.
Any advice would help, the Post processor I"ve been working on making it work so there may be issues with it.
function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("EXTRON E216 MIRL M2000 POST PROCESSOR\n")
ctrl:AppendText("Non modal G-codes\n")
ctrl:AppendText("Modal coordinates\n")
ctrl:AppendText("All Comments preceeded by semicolon\n")
ctrl:AppendText("Incremental IJ\n")
ctrl:AppendText("uses G43 tool length offsets and H values from machine tool table\n")
end
-- revision 3/2/07
-- Removed final safety move. This is now done in SheetCam
-- revision 25/5/06
-- Revised rigid tapping spindle on/off sequencing
-- revision 11/5/06
-- Revised rigid tapping
-- revision 4/5/06
-- Revised tapping cycles
-- revision 2/5/06
-- Added tapping cycle
-- revision 14/11/05
-- Fixed circles for Mach2/earlier versions of Mach3
-- revision 20/10/04
-- added tool length offsets
-- revision 25/10/04
-- added G90.1 incremental IJ mode
-- revision 28/7/04
-- Added drill start depth
-- revision 19/7/04
-- added drill cycle
-- revision 28/6/04
-- Replaced startx,y,z with currentx,y,z
-- Revision 28/5/04
-- Unbodged first rapid move - main app is fixed now
-- Added plunge,feed,spindle speed warnings
-- Revision 25/5/04
-- fixed feed rate problem and bodged first rapid move
-- Revision 18/5/04
-- Added Metric + Inch variables and easy inch/metric swapping
-- changed to fixed number of trailing zeros
-- Created 11/5/2004
function OnInit()
post.TextDirect("%\n")
post.SetCommentChars ("()abcdefghijklmnopqrstuvwxyz", "[]ABCDEFGHIJKLMNOPQRSTUVWXYZ") --make sure ( and ) characters do not appear in system text
post.Text(" /*DATE: ",date," TIME:",time," */ \n")
post.Text (" /*POST PROCESSOR: EXTRON E216 SHEETCAM */ \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 (" G17")
post.Eol ()
post.Text (" G94")
post.Eol ()
post.Text (" G90")
post.Eol ()
post.Text (" G49")
post.Eol ()
post.Text (" G54")
post.Eol ()
post.Text (" M45")
post.Eol ()
bigArcs = 1 --stitch arc segments together
minArcSize = 0.05 --arcs smaller than this are converted to moves
end
function OnFinish()
post.Text (" M30\n")
post.TextDirect("%\n")
end
function OnRapid()
post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.00")
post.ModalNumber (" Y", endY * scale, "0.00")
post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.00")
post.Eol()
end
function OnMove()
post.ModalText (" G01")
post.ModalNumber (" X", endX * scale, "0.00")
post.ModalNumber (" Y", endY * scale, "0.00")
post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.00")
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.0###")
post.NonModalNumber (" Y", endY * scale, "0.0###")
post.ModalNumber (" Z", (endZ + toolOffset) * 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()
end
function OnSpindleCW()
post.ModalNumber (" S", spindleSpeed, "0.##")
post.Text (" M03")
post.Eol()
end
function OnSpindleCCW()
post.ModalNumber (" S", spindleSpeed, "0.##")
post.Text (" M04")
post.Eol()
end
function OnSpindleOff()
post.Text (" M05\n")
end
function OnNewOperation()
post.Text (" /*OPERATION ", operationName, " */ \n")
end
function OnComment()
post.Text(" /*",commentText," */ \n")
end
function OnToolChange()
post.Text (" /*", toolName, " */ \n")
post.Text (" M06")
post.Text (" T")
post.Number (tool, "0")
post.Eol()
post.Text (" G43 H")
post.Number (tool, "0")
post.Eol()
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 OnFloodOn()
post.Text(" M08 /*FLOOD COOLANT ON */ \n")
end
function OnMistOn()
post.Text(" M07 /*MIST COOLANT ON */ \n")
end
function OnCoolantOff()
post.Text(" M09 /*COOLANT OFF */ \n")
end
function OnDrill()
post.ModalText (" G83")
OnRapid()
depth = drillStart
buffer = plungeSafety
endZ = depth + buffer
OnRapid()
if(drillRetract < buffer) then
buffer = drillRetract
end
while depth > drillZ do
OnRapid()
depth = depth - drillPeck
if (depth < drillZ) then
depth = drillZ
end
endZ = depth
OnMove()
if (depth > drillZ) then --retract if we need to take another bite
endZ = endZ + drillRetract
if (endZ > safeZ) then
endZ = safeZ
end
OnRapid()
endZ = depth + buffer
end
end
if (endZ < safeZ) then
endZ = safeZ
OnRapid()
end
end
function OnSetFeed()
end
function OnTapStart()
post.Text(" M49\n") --disable FRO
post.Text(" G95\n") --feed per rev
end
function OnAutoTap()
clearance = 1 --tapping clearance height
--move to hole X,Y coordinates
OnRapid()
--move to tapping clearance height
clearance = clearance + drillStart
endZ = clearance
OnRapid()
--feed to depth
feedRate = tapPitch * underFeed
OnSetFeed()
endZ = drillZ
OnMove()
--retract to engage reverse clutch
endZ = drillZ + tapTravel
feedRate = 10000
OnMove()
--feed out
feedRate = tapPitch * reverseMult * underFeed
endZ = tapTravel + clearance
OnMove()
--retract to clearance plane
endZ = safeZ
OnRapid()
end
function OnRigidTap()
clearance = 1 --tapping clearance height
--spindle forwards
if (spindleDir == 1) then
OnSpindleCW()
else
OnSpindleCCW()
end
spindlecache = spindleSpeed
--move to hole X,Y coordinates
OnRapid()
--move to tapping clearance height
endZ = clearance + drillStart
OnRapid()
--tap to depth, correcting for underfeed
feedRate = tapPitch * underFeed
OnSetFeed()
depthfix = (drillStart - drillZ) * (1 - underFeed)
endZ = drillZ + depthfix
OnMove()
--reverse spindle
OnSpindleOff()
spindleSpeed = spindlecache * reverseMult
if(spindleDir == -1) then
OnSpindleCW()
else
OnSpindleCCW()
end
--feed out
feedRate = tapPitch * reverseMult * underFeed
OnSetFeed()
endZ = clearance + drillStart
OnMove()
--stop spindle and restore speed to tapping speed
OnSpindleOff()
spindleSpeed = spindlecache
--retract to clearance plane
endZ = safeZ
OnRapid() --retract to clearance plane
end
function OnTapEnd()
post.Text(" M48\n") --enable FRO
post.Text(" G94\n") --feed per min
end