Post processor "how to" problem.

Having problems with or questions about SheetCam? Post them here.
Post Reply
mancavedweller
Posts: 161
Joined: Tue Feb 25, 2014 6:53 am

Post processor "how to" problem.

Post by mancavedweller »

Hi Les (or anyone else who can help),

I've been modifying an old Mach3 plasma post processor but cannot for the life of me find out how to get it to stop putting the Z pierce height at an unwanted location in the code.

I basically need:

1. Go to Safe Z
2. Rapid to pierce location
3. Touch off
4. Raise to pierce height

However what I am getting is:

1. Go to Safe Z
2. Rapid to pierce location
3. Z rapid to pierce height (this is the bit I want to get rid off)
4. Touch off
5. Raise to pierce height

This is the generated gcode:

Code: Select all

N0010 (Filename: SINGLE OPEN LINE.tap)
N0020 (Post processor: MACH3 PLASMA PP ( BEEFY modified).scpost)
N0030 (Date: 09/05/2019)
N0040 G21 (Units: Metric)
N0050 G90
N0060 F1
N0070 (Part: 100mm HORIZ OPEN LINE)
N0080 (Operation: Outside Offset, 0, T1: Plasma, 1.5 mm kerf)
N0090 M06 T1 F1100.0  (Plasma, 1.5 mm kerf)

N0100 G00 Z70.0000
N0110 X0.0000 Y10.0000

N0120 Z3.8000     ************* HOW TO STOP PIERCE HEIGHT BEING PUT HERE *****************

N0130 G28.1 Z15
N0140 G92 Z0.0
N0150 G00 Z0.4000
N0160 G92 Z0.0

N0170 G00 Z3.8000       ****** GOOD - PIERCE HEIGHT HERE ***********

N0180 M03
N0190 G04 P0.7

N0200 G01 Z1.5000 F3000.0

N0210 Y0.0000 F1100.0
N0220 X100.0000
N0230 Y10.0000

N0240 M05
N0250 G00 Z70.0000
N0260 M05 M30
It appears the pierce height is entered "behind the scenes" in the post processing and I can't figure out how to stop it being entered at the unwanted location.

Job file and post processor attached.

Keith
MACH3 PLASMA PP ( BEEFY modified).scpost
(4.26 KiB) Downloaded 72 times
SINGLE OPEN LINE.job
(3.35 KiB) Downloaded 63 times
User avatar
djreiswig
Posts: 471
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Post processor "how to" problem.

Post by djreiswig »

I stepped through the post with your job file, and it appears that SheetCam is calling OnRapid twice at the beginning. The first time the Z value is unknown, so that's why there is an X & Y move first. Then the next time through the Z has a value so it is outputted. It does appear to be something internal to SheetCam. You could assign a variable to determine if the Z should be outputted.

Maybe something like this.

Code: Select all

function OnRapid()
   post.ModalText (" G00")
   post.ModalNumber (" X", endX * scale, "0.0000")
   post.ModalNumber (" Y", endY * scale, "0.0000")
   if (endZ == pierceHeight) then
      if (SkipPierce == "False") then 
         post.ModalNumber (" Z", endZ * scale, "0.0000")
         SkipPierce = "True"
      else
         SkipPierce = "False"
      end
   else
      post.ModalNumber (" Z", endZ * scale, "0.0000")
   end
   post.Eol()
end
And then init the variable in the OnInit section.

Code: Select all

   SkipPierce = "True"
This will get rid of every other pierce height Z move. I'm not sure if that is exactly what you want, or if for some reason it is just happening once after the tool change, or the new operation. If either one of these is the case, I can try and modify the code.
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Re: Post processor "how to" problem.

Post by Les Newell »

I am guessing that Keith wants to just remove the pierce height move entirely. In that case this part:

Code: Select all

   if (endZ == pierceHeight) then
      if (SkipPierce == "False") then 
         post.ModalNumber (" Z", endZ * scale, "0.0000")
         SkipPierce = "True"
      else
         SkipPierce = "False"
      end
   else
      post.ModalNumber (" Z", endZ * scale, "0.0000")
   end
could be simplified to:

Code: Select all

   if (endZ ~= pierceHeight) then
      post.ModalNumber (" Z", endZ * scale, "0.0000")
   end
   
User avatar
djreiswig
Posts: 471
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Post processor "how to" problem.

Post by djreiswig »

He said he just wants to remove one of the pierce height moves. He wants to keep the one after the reference.
mancavedweller
Posts: 161
Joined: Tue Feb 25, 2014 6:53 am

Re: Post processor "how to" problem.

Post by mancavedweller »

A big thanks to both of you.

After I first posted I actually did find an old Candcnc post processor that did what I wanted BUT knowledge is always something I'm hungry for.

I used the short piece of code in Les post and that did the trick. Up until your replies I did not really understand the Onrapid() function but now have at least a bit more understanding of how it's applied. That's just as important to me as the cure.

Cheers,

Keith.
User avatar
djreiswig
Posts: 471
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Post processor "how to" problem.

Post by djreiswig »

Great to hear. Happy to help.
Post Reply