MIRL POST PROCESSOR ISSUE

Having problems with or questions about SheetCam? Post them here.
Post Reply
80gus
Posts: 28
Joined: Sun Nov 30, 2014 1:14 pm

MIRL POST PROCESSOR ISSUE

Post by 80gus »

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
80gus
Posts: 28
Joined: Sun Nov 30, 2014 1:14 pm

Re: MIRL POST PROCESSOR ISSUE

Post by 80gus »

example this post always crashes at line 20

%
/*DATE: 21/11/2023 TIME:12:37:50 */
/*POST PROCESSOR: EXTRON E216 SHEETCAM */
G21 /*UNITS METRIC */
G17
G94
G90
G49
G54
/*PART: HOLDING JIG2 */
/*OPERATION INSIDE OFFSET, HOLE, T4: MILL/ROUTER, 10 MM DIAMETER, 23 MM DEEP */
/*MILL/ROUTER, 10 MM DIAMETER */
M06 T4
G43 H4
G00 Z50.00
S4000 M03
X134.10 Y129.10
Z5.00
G01 Z0.00 F500.0
X132.69 Y127.69 Z-0.07
G03 X132.6863 Y127.6863 Z-3.5805 I11.3137 J11.3137
X141.4447 Y123.2054 I11.3137 J11.3137 F2000.0
G01 X141.76 Y125.18 Z-3.58
X141.44 Y123.21
G02 X132.6863 Y127.6863 Z-3.5805 I2.5554 J15.7946
X132.6863 Y127.6863 Z-7.0911 I11.3137 J11.3137 F500.0
G01 X134.10 Y129.10 Z-7.09 F2000.0
X132.69 Y127.69 Z-7.16 F500.0
G03 X129.3679 Y145.473 Z-10.0 I11.3137 J11.3137
G02 X132.6863 Y127.6863 I14.6322 J-6.473 F2000.0
G01 X134.10 Y129.10 Z-10.00
X132.69 Y127.69
G03 X132.6863 Y127.6863 Z-10.0 I11.3137 J11.3137
X141.4447 Y123.2054 I11.3137 J11.3137
G01 X141.76 Y125.18 Z-10.00
G00 Z50.00
X134.10 Y129.10
Z-5.00
G01 Z-10.00 F500.0
X132.69 Y127.69 Z-10.07
G03 X132.6863 Y127.6863 Z-13.5805 I11.3137 J11.3137
X141.4447 Y123.2054 I11.3137 J11.3137 F2000.0
G01 X141.76 Y125.18 Z-13.58
X141.44 Y123.21
G02 X132.6863 Y127.6863 Z-13.5805 I2.5554 J15.7946
X132.6863 Y127.6863 Z-17.0911 I11.3137 J11.3137 F500.0
G01 X134.10 Y129.10 Z-17.09 F2000.0
X132.69 Y127.69 Z-17.16 F500.0
G03 X129.3679 Y145.473 Z-20.0 I11.3137 J11.3137
G02 X132.6863 Y127.6863 I14.6322 J-6.473 F2000.0
G01 X134.10 Y129.10 Z-20.00
X132.69 Y127.69
G03 X132.6863 Y127.6863 Z-20.0 I11.3137 J11.3137
X141.4447 Y123.2054 I11.3137 J11.3137
G01 X141.76 Y125.18 Z-20.00
G00 Z50.00
X134.10 Y129.10
Z-15.00
G01 Z-20.00 F500.0
X132.69 Y127.69 Z-20.07
G03 X128.5113 Y143.0126 Z-23.0 I11.3137 J11.3137
G02 X132.6863 Y127.6863 I15.4887 J-4.0125 F2000.0
G01 X134.10 Y129.10 Z-23.00
X132.69 Y127.69
G03 X132.6863 Y127.6863 Z-23.0 I11.3137 J11.3137
X141.4447 Y123.2054 I11.3137 J11.3137
G01 X141.76 Y125.18 Z-23.00
/*OPERATION OUTSIDE OFFSET, OUT, T4: MILL/ROUTER, 10 MM DIAMETER, 3 MM DEEP */
G00 Z50.00
X179.88 Y250.00
Z3.00
G01 Z-3.00 F500.0
G02 X182.8908 Y248.9882 Z-3.0 I0.0 J-5.0 F1500.0
X184.8665 Y247.268 I-11.4593 J-15.1553
G01 X186.67 Y245.47 Z-3.00
G03 X193.0295 Y242.8329 Z-3.0 I6.364 J6.364
G01 X207.97 Y242.83 Z-3.00
G02 X223.6858 Y234.5116 Z-3.0 I0.0 J-19.0
G01 X256.68 Y185.96 Z-3.00
G02 X261.0 Y171.9085 Z-3.0 I-20.6778 J-14.0509
G01 X261.00 Y74.85 Z-3.00
G03 X262.2525 Y70.2673 Z-3.0 I9.0 J0.0
G01 X289.06 Y24.91 Z-3.00
G02 X280.5946 Y-4.4459 Z-3.0 I-18.0776 J-10.6865
X278.3068 Y-5.0 I-2.2878 J4.4459
G01 X45.33 Y-5.00 Z-3.00
G02 X42.7186 Y-4.2612 Z-3.0 I0.0 J5.0
X34.6326 Y9.397 I8.8937 J14.488
G01 X29.11 Y122.50 Z-3.00
G03 X27.2837 Y126.8823 Z-3.0 I-6.9917 J-0.3417
G02 X22.3169 Y139.6913 I14.0332 J12.8089
G01 X22.32 Y147.27 Z-3.00
G02 X22.914 Y150.6739 Z-3.0 I10.0 J0.0
G01 X36.61 Y188.52 Z-3.00
G02 X40.1715 Y195.0755 Z-3.0 I23.5072 J-8.5095
G01 X70.54 Y235.28 Z-3.00
G02 X85.7043 Y242.8329 Z-3.0 I15.161 J-11.4518
G01 X95.31 Y242.83 Z-3.00
G03 X101.6755 Y245.469 Z-3.0 I0.0 J9.0
G01 X103.47 Y247.27 Z-3.00
G02 X105.4502 Y248.9882 Z-3.0 I13.435 J-13.435
X108.4658 Y250.0 I3.0156 J-3.9882
G01 X179.88 Y250.00 Z-3.00
G00 Z50.00
M05
M30
%
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: MIRL POST PROCESSOR ISSUE

Post by bLouChip »

Those arc errors can be caused by insufficient decimal accuracy in motion stmts. The OnRapid() and OnMove() functions are using only 2 decimal (0.00) of accuracy, so when they immediately precede an arc stmt (G2 or G3), that can be the problem since the motion just prior to the arc stmt is used by the controller in the circle point validation math. Try changing the decimal accuracy to 0.0000 in OnRapid() and OnMove() functions. In metric mode, at least 3 decimal accuracy is necessary for the arc point validation math to work well. In inch mode, at least 4 decimal accuracy is necessary.
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
80gus
Posts: 28
Joined: Sun Nov 30, 2014 1:14 pm

Re: MIRL POST PROCESSOR ISSUE

Post by 80gus »

Thanks Bluechip that worked perfectly
80gus
Posts: 28
Joined: Sun Nov 30, 2014 1:14 pm

Re: MIRL POST PROCESSOR ISSUE

Post by 80gus »

Working on getting rigid taping to work
I found the M48 and M49 don’t work with MIRL
I found a Mcode M150 = Spindle override, feed hold, singal block functions is disable

Although it doesn’t seem to work.


The Mirl manuals only have a small number of
M codes listed
M01
M02
моЗ
MO4
M05
M06
M08
MO9
M10
M11
M19
M30
M40
M41
M98
M99
M150
M151

Program stop
Program option stop
Program end
Spindle CW.rotation
Spindle CCW rotation
Spindle stop
Auto tool change
Coolant on
Coolant off
Spindle tool clamp
Spindle tool unclamp
Spindle orientation
Program end and rewind
Tool magazine go out
Tool magazine go back
Call subprogram
Subprogram return
Spindle override, feed hold, singal block functions is disable
Cancel M150



I did find these codes the machine also accepted without crashing


M25
M26
M28
M29
M35
M36
M45
M46
M90
M91
M95
M96
M100


Any suggestions on disabling the feed and spindle adjustment?
Post Reply