modifying a post processor

Having problems with or questions about SheetCam? Post them here.
Post Reply
cruz
Posts: 19
Joined: Mon Apr 09, 2018 11:45 am

modifying a post processor

Post by cruz »

hi everyone,

a few days ago i changed from post processor to be able to use my floating head (long story not relevant now :lol: ).
now i'm using the MP1000-THC processor, which works fine except for one thing.
when going to reference the plate height it did this weird thing.
it would touch the plate go up to the pierce height and then go further up...

after some searching and trying (with help from a other forum) i found the issue.
here is the old part of the code that has that problem:
N0100 G00 Z15.0000
N0110 X30.5425 Y26.4336
N0120 Z3.8000
N0130 G28.1 Z3.00
N0140 G92 Z0.0
N0150 G00 Z0.3500
N0160 G92 Z0.0
N0170 G00 Z3.8000
N0180 M03

and here is the new part of that code with the problem fixed:
N0100 G00 Z15.0000
N0110 X13.2256 Y1.0187
N0120 Z3.8000
N0130 G28.1 Z3.00
N0150 G00 Z0.3500
N0160 G92 Z0.0
N0170 G00 Z3.8000
N0180 M03

if possible i would like some help from you guys to change the post processor in sheetcam, so that is make the code directly like the second example.
so that i don't need to do it manually in mach3, which would be crazy for a long cutting job.

tanks everyone.
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: modifying a post processor

Post by robertspark »

Post the actual post processor you are using, I'll modify it and repost it back.

The fix is easy, but takes longer to explain than do
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: modifying a post processor

Post by robertspark »

This modified code should do it:

(commented out 1 line)

Code: Select all

function OnPenDown()
   if(dist >= (refdistance/scale)) then
      dist = 0
--      modaltext (" G00")
--      text(" Z")
--      number (pierceheight  * scale, "0.0000")
--      eol()
      post.ModalText(" G28.1 Z")
      post.Number(3 * scale, "0.00")
      post.Eol()
--      post.ModalText(" G92 Z0.0\n")
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (switchoffset, "0.0000")
      post.Eol()
      post.ModalText(" G92 Z0.0\n")
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (pierceHeight  * scale, "0.0000")
      post.Eol()
   else
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (pierceHeight  * scale, "0.0000")
      post.Eol()
   end
   if (preheat > 0) then
      post.Text ("\n G04 P")
      post.Number (preheat,"0.###")
      post.Eol()
   end
   post.Text ("\n M03\n")
   if (pierceDelay > 0) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
end
cruz
Posts: 19
Joined: Mon Apr 09, 2018 11:45 am

Re: modifying a post processor

Post by cruz »

robertspark wrote: Fri Jan 25, 2019 2:49 pm This modified code should do it:

(commented out 1 line)

Code: Select all

function OnPenDown()
   if(dist >= (refdistance/scale)) then
      dist = 0
--      modaltext (" G00")
--      text(" Z")
--      number (pierceheight  * scale, "0.0000")
--      eol()
      post.ModalText(" G28.1 Z")
      post.Number(3 * scale, "0.00")
      post.Eol()
--      post.ModalText(" G92 Z0.0\n")
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (switchoffset, "0.0000")
      post.Eol()
      post.ModalText(" G92 Z0.0\n")
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (pierceHeight  * scale, "0.0000")
      post.Eol()
   else
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (pierceHeight  * scale, "0.0000")
      post.Eol()
   end
   if (preheat > 0) then
      post.Text ("\n G04 P")
      post.Number (preheat,"0.###")
      post.Eol()
   end
   post.Text ("\n M03\n")
   if (pierceDelay > 0) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
end
thanks i'll give it a try tomorrow.
cruz
Posts: 19
Joined: Mon Apr 09, 2018 11:45 am

Re: modifying a post processor

Post by cruz »

robertspark wrote: Fri Jan 25, 2019 2:49 pm This modified code should do it:

(commented out 1 line)

Code: Select all

function OnPenDown()
   if(dist >= (refdistance/scale)) then
      dist = 0
--      modaltext (" G00")
--      text(" Z")
--      number (pierceheight  * scale, "0.0000")
--      eol()
      post.ModalText(" G28.1 Z")
      post.Number(3 * scale, "0.00")
      post.Eol()
--      post.ModalText(" G92 Z0.0\n")
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (switchoffset, "0.0000")
      post.Eol()
      post.ModalText(" G92 Z0.0\n")
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (pierceHeight  * scale, "0.0000")
      post.Eol()
   else
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (pierceHeight  * scale, "0.0000")
      post.Eol()
   end
   if (preheat > 0) then
      post.Text ("\n G04 P")
      post.Number (preheat,"0.###")
      post.Eol()
   end
   post.Text ("\n M03\n")
   if (pierceDelay > 0) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
end
okay, i'm stupid...
i gave you the wrong post processor... sorry :oops:
here is the right one:
Mach3 plasma snippet Mod .035.scpost
(4.23 KiB) Downloaded 104 times
this is the unchanged code with the problem:
N0010 (Filename: bijna.tap)
N0020 (Post processor: Mach3 plasma snippet Mod .035.scpost)
N0030 (Date: 26/01/2019)
N0040 G21 (Units: Metric)
N0050 G53 G90 G91.1 G40
N0060 F1
N0070 S500
N0080 (Part: New part)
N0090 (Operation: Outside Offset, Shape, T1: staal 45A finecut 2mm THC58 0,5 kerf)
N0100 M06 T1 F4800.0 (staal 45A finecut 2mm THC58 0,5 kerf)
N0110 G00 Z15.0000
N0120 X74.7709 Y50.9964
N0130 Z2.2500
N0140 G90F30
N0150 G28.1 Z0.50
N0160 G92 Z0
N0170 G0 z0.3500
N0180 G92 Z0
N0190 Z2.2500
N0200 M03
N0210 G01 X75.5209 Z1.5000 F80.0
N0220 X76.7709 F3840.0
N0230 G03 X76.7507 Y51.9962 I-24.7500 J0.0000
N0240 X76.2676 Y46.0304 I-24.7298 J-0.9997 F4800.0
N0250 X76.7507 Y51.9962 I-24.2467 J4.9661 F3120.0
N0260 X76.0854 Y52.6098 I-0.6395 J-0.0259
N0270 M05
N0280 G00 Z15.0000
N0290 X104.2709 Y50.9964
N0300 Z2.2500
N0310 G90F30
N0320 G28.1 Z0.50
N0330 G92 Z0
N0340 G0 z0.3500
N0350 G92 Z0
N0360 Z2.2500
N0370 M03
N0380 G01 X103.5209 Z1.5000 F80.0
N0390 X102.2709 F3840.0
N0400 G02 X102.2610 Y49.9965 I-50.2500 J0.0000
N0410 X102.0224 Y55.9882 I-50.2401 J0.9999 F4800.0
N0420 X102.2610 Y49.9965 I-50.0014 J-4.9918 F3120.0
N0430 G03 X102.8881 Y49.3439 I0.6399 J-0.0127
N0440 M05
N0450 G00 Z15.0000
N0460 G0x0y0 M05 M30


here is the code with the change:
N0010 (Filename: bijna.tap)
N0020 (Post processor: Mach3 plasma snippet Mod .035.scpost)
N0030 (Date: 26/01/2019)
N0040 G21 (Units: Metric)
N0050 G53 G90 G91.1 G40
N0060 F1
N0070 S500
N0080 (Part: New part)
N0090 (Operation: Outside Offset, Shape, T1: staal 45A finecut 2mm THC58 0,5 kerf)
N0100 M06 T1 F4800.0 (staal 45A finecut 2mm THC58 0,5 kerf)
N0110 G00 Z15.0000
N0120 X74.7709 Y50.9964
N0130 Z2.2500
N0140 G90F30
N0150 G28.1 Z3.00
N0170 G0 z0.3500
N0190 Z2.2500
N0200 M03
N0210 G01 X75.5209 Z1.5000 F80.0
N0220 X76.7709 F3840.0
N0230 G03 X76.7507 Y51.9962 I-24.7500 J0.0000
N0240 X76.2676 Y46.0304 I-24.7298 J-0.9997 F4800.0
N0250 X76.7507 Y51.9962 I-24.2467 J4.9661 F3120.0
N0260 X76.0854 Y52.6098 I-0.6395 J-0.0259
N0270 M05
N0280 G00 Z15.0000
N0290 X104.2709 Y50.9964
N0300 Z2.2500
N0310 G90F30
N0320 G28.1 Z3.00
N0340 G0 z0.3500
N0360 Z2.2500
N0370 M03
N0380 G01 X103.5209 Z1.5000 F80.0
N0390 X102.2709 F3840.0
N0400 G02 X102.2610 Y49.9965 I-50.2500 J0.0000
N0410 X102.0224 Y55.9882 I-50.2401 J0.9999 F4800.0
N0420 X102.2610 Y49.9965 I-50.0014 J-4.9918 F3120.0
N0430 G03 X102.8881 Y49.3439 I0.6399 J-0.0127
N0440 M05
N0450 G00 Z15.0000
N0460 G0x0y0 M05 M30

the problem lies in the lines 160 and 180.
if you could do the same to the post processor as you did to the other one,
that would be great.
sorry again.
User avatar
djreiswig
Posts: 471
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: modifying a post processor

Post by djreiswig »

Did you try replacing the code in the new post with what he posted? The posts are probably pretty similar so it might still work.
cruz
Posts: 19
Joined: Mon Apr 09, 2018 11:45 am

Re: modifying a post processor

Post by cruz »

djreiswig wrote: Sun Jan 27, 2019 1:31 am Did you try replacing the code in the new post with what he posted? The posts are probably pretty similar so it might still work.
No I haven't tried that, when I'm the workshop again I
i'll try it.
Tough I don't think it will work, the posts are quite different.
Would be great if he could do it again with the right post.
User avatar
djreiswig
Posts: 471
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: modifying a post processor

Post by djreiswig »

Try this. Just edited out the same line.

Code: Select all

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.ModalText ("\n G90F30\n")
      post.ModalText (" G28.1 Z0.50\n")
--      post.ModalText (" G92 Z0\n")
      post.ModalText (" G0 z0.040\n")
      post.ModalText (" G92 Z0\n")
      post.Text (" Z")
      post.Number (pierceHeight * scale, "0.0000")
      post.Text ("\n M03\n")
   if (pierceDelay > 0.001) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
end
I also noticed that this post has G0 z0.040, but your code has z0.3500. Maybe this is the original post, and the post your are using has actually been edited already.
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: modifying a post processor

Post by robertspark »

Oops.... sorry .... forgot I'd tried to help here..... :lol: :lol: :roll: :oops:

Old age....? Also I didn't get any notifications....

anyway.... here goes.

Current post processor code {unmodified}

Code: Select all

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.ModalText ("\n G90F30\n")
      post.ModalText (" G28.1 Z0.50\n")
      post.ModalText (" G92 Z0\n")
      post.ModalText (" G0 z0.040\n")
      post.ModalText (" G92 Z0\n")
      post.Text (" Z")
      post.Number (pierceHeight * scale, "0.0000")
      post.Text ("\n M03\n")
   if (pierceDelay > 0.001) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
end
And the modified code:

Code: Select all

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.ModalText ("\n G90F30\n")
      post.ModalText (" G28.1 Z3.0\n")
      post.ModalText (" G92 -Z0.35\n")
      post.Text ("G0 Z")
      post.Number (pierceHeight * scale, "0.0000")
      post.Text ("\n M03\n")
   if (pierceDelay > 0.001) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
end
[code]
cruz
Posts: 19
Joined: Mon Apr 09, 2018 11:45 am

Re: modifying a post processor

Post by cruz »

no problem, the post from djreiswig also worked.
do i need to mark this as solved or something?
thanks guys.
User avatar
djreiswig
Posts: 471
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: modifying a post processor

Post by djreiswig »

You just did. :lol: Always nice to hear back.
Post Reply