z axis reference slow down

Having problems with or questions about SheetCam? Post them here.
Post Reply
rikduk
Posts: 47
Joined: Fri Oct 25, 2013 11:48 pm

z axis reference slow down

Post by rikduk »

When my torch goes down to sense the plate, it slows down when it gets to pierce height, if im not mistaken.
How can i always have it slow down at 1/4" from the plate, regardless of the pierce height?
I think its in the post-proc., but im not sure...
using MP3000-DTHCII-DCC-Hyt-scriber8
Thank you

Richard
cbhammer
Posts: 9
Joined: Thu Jan 08, 2015 4:12 pm

Post by cbhammer »

Hi Richard,

I don't use that post processor, but I looked at it and learned that this is not an easy thing to do. I edited the "OnPedDown" and "Reference" functions to output text in the gCode to show when they are called in relation to the coordinate that you want to change, and below is what I got.

Code: Select all

N0590 X44.5658 Y41.0695
N0600 Z2.0320
N0610 (________ Beginning of OnPenDown ________)
N0620 (________ Beginning of Reference ________)
N0630 G28.1 Z3.00 F500.0
N0640 G92 Z0.0
N0650 G00 Z1.5000
N0660 G92 Z0.0
N0670 G00 Z2.0320
You can see from this code that the torch moves to the (x,y) coordinate above the pierce, then to the pierce height BEFORE calling the OnPenDown function which calls the Reference function. My hope was that I could modify the OnPenDown function to achieve what you want, but since it is called after the torch is moved to pierce height this is not an option.

With that being said, there are a couple ways we could still achieve what you want. Here I edited the OnRapid function by forcing a 0.25 in for the Z if the torch is making a rapid move to pierce hieght:

Code: Select all

function OnRapid()
   if&#40;endX < 1e17 and endY < 1e17&#41; then --don't update the distance moved if X or Y are unknown
      local len = math.hypot&#40;&#40;endX + offX&#41;-currentX , &#40;endY + offY&#41;-currentY&#41;
      dist = dist + len
   end
   post.ModalText &#40;" G00"&#41;
   post.ModalNumber &#40;" X", &#40;endX + offX&#41; * scale, "0.0000"&#41;
   post.ModalNumber &#40;" Y", &#40;endY + offY&#41; * scale, "0.0000"&#41;
   if&#40;toolClass == "MarkerTool"&#41;  then
      if&#40;firstRef == true&#41; or &#40;finalCut == true&#41; or &#40;markerZ == true&#41; then
         post.ModalNumber &#40;" Z", safeZ * scale, "0.0000"&#41;
      end
      finalCut = false
   else --this is not a marker tool
      if&#40;endZ == pierceHeight&#41; then
         post.ModalNumber &#40;" Z", 0.25, "0.0000"&#41; --THIS FORCES 0.25 IF WE ARE MOVING TO PIERCE HEIGHT
      else   
         post.ModalNumber &#40;" Z", endZ * scale, "0.0000"&#41;
      end
   end
   post.Eol&#40;&#41;
 end
However, if you want to avoid having to hard code this value, you can create a custom variable that will allow you to change it without having to edit the post. Here is an example of the code to do that:

Code: Select all

post.DefineCustomToolParam&#40;"PlasmaTool", "Reference Height", "refHeight", sc.unit3DECPLACE, 0.25, 0, 999&#41;
If you use this approach, you just need to replace the hard-coded "0.25" in the OnRapid function with the variable refHeight. Again, I dont have a machine like yours and dont use this post so please keep one hand on the e-stop when you are testing any modifications like this!

Let me know if you have more questions.

Thanks,
Clay
Vmax549
Posts: 641
Joined: Mon Nov 09, 2009 5:55 pm

Post by Vmax549 »

all yoou should have to do is add in a piece of code to Rapid to Z0.250 before the REFHOME call. Here is a sample of the old code and new code to replace it with.

SHould WORK (;-)

function Reference()
firstRef = false
if (refHome) then
post.ModalText(" G28.1 Z")
post.Number(3 * scale, "0.00")
else
post.ModalText(" G31 Z -100")
end
post.ModalNumber (" F", refFeed * scale, "0.0###")
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.ModalText (" G00")
post.Text(" Z")
post.Number (switchOffset * scale, "0.0000")
post.Eol()
post.ModalText(" G92 Z0.0\n")
end


NEW section********************************

function Reference()
firstRef = false
if (refHome) then
post.ModalText("G00 Z0.250") ' Rapid to Z0.250" before Ref
post.ModalText(" G28.1 Z")
post.Number(3 * scale, "0.00")
else
post.ModalText("G00 Z0.250") ' Rapid to Z0.250" before Ref
post.ModalText(" G31 Z -100")
end
post.ModalNumber (" F", refFeed * scale, "0.0###")
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.ModalText (" G00")
post.Text(" Z")
post.Number (switchOffset * scale, "0.0000")
post.Eol()
post.ModalText(" G92 Z0.0\n")
end
cbhammer
Posts: 9
Joined: Thu Jan 08, 2015 4:12 pm

Post by cbhammer »

Vmax549,

I copied and pasted your code and this was the output after I removed the comment to get it to compile:

Code: Select all

N0200 X3.3970 Y0.4879
N0210 Z0.0800
N0220G00 Z0.250 G28.1 Z0.12 F19.685
N0230 G92 Z0.0
N0240 G00 Z0.0591
N0250 G92 Z0.0
N0260 G00 Z0.0800
after adding the end of lines and spaces the function looks like this:

Code: Select all

function Reference&#40;&#41; 
   firstRef = false 
   if &#40;refHome&#41; then 
      post.ModalText&#40;" G00 Z0.250"&#41;  
      post.Eol&#40;&#41; 
      post.ModalText&#40;" G28.1 Z"&#41; 
      post.Number&#40;3 * scale, "0.00"&#41; 
   else 
      post.ModalText&#40;" G00 Z0.250"&#41;
      post.Eol&#40;&#41; 
      post.ModalText&#40;" G31 Z -100"&#41; 
   end 
   post.ModalNumber &#40;" F", refFeed * scale, "0.0###"&#41; 
   post.Eol&#40;&#41; 
   post.ModalText&#40;" G92 Z0.0\n"&#41; 
   post.ModalText &#40;" G00"&#41; 
   post.Text&#40;" Z"&#41; 
   post.Number &#40;switchOffset * scale, "0.0000"&#41; 
   post.Eol&#40;&#41; 
   post.ModalText&#40;" G92 Z0.0\n"&#41; 
end
the output is now this:

Code: Select all

N0200 X3.3970 Y0.4879
N0210 Z0.0800
N0220 G00 Z0.250
N0230 G28.1 Z0.12 F19.685
N0240 G92 Z0.0
N0250 G00 Z0.0591
N0260 G92 Z0.0
N0270 G00 Z0.0800
So, does this move to 0.25 prior to reference? Yes, but only after it moves to pierce height. So if pierce height is less than 0.25" (which it likely is on anything less than 3/4" plate) the torch is going to go down to pierce height (0.08" in this case), then up to 0.25", then down to reference the Z. Whether this extra time, movement, and proximity to material for a rapid is acceptable is up to you Richard. Perhaps can you explain why you initially wanted this?

Thanks,
Clay
Vmax549
Posts: 641
Joined: Mon Nov 09, 2009 5:55 pm

Post by Vmax549 »

That Zpierce move is done by another component of Scam post.

My mod had nothing to do with it. There is a great deal about that post that should be corrected.

Just a thought, (;-) TP
Vmax549
Posts: 641
Joined: Mon Nov 09, 2009 5:55 pm

Post by Vmax549 »

I see where it puts in the Pierce height. It is at the end of the Rapid move ???.

I corrected what I thought would do it BUT it is doubling some of the posted Gcode when it should NOT. It is making some loops back through through the code that I do not understand or follow (;-)

We will have to ask LES on this one.

(;-) TP
WyoGreen
Posts: 257
Joined: Wed May 07, 2014 10:02 pm

Post by WyoGreen »

I'm not sure, but I think what you are talking about is Plunge safety clearance, which is set in Sheetcam under Options/Job options/Material, at the bottom of the Job options box.
User avatar
Les Newell
Site Admin
Posts: 3683
Joined: Thu May 11, 2006 8:12 pm

Post by Les Newell »

The move to pierce height comes from within SheetCam. The sequence of events for a pierce is as follows:
Rapid to cut start X,Y
Rapid to pierce height
call OnPenDown() where the reference is performed

To stop above pierce height we need to modify the post so it intercepts the move to pierce height. This is fairly easy to do. Edit your post and look for function OnRapid(). This function runs every time a rapid move is needed. Now look for this line:

Code: Select all

   post.ModalNumber &#40;" Z", endZ * scale, "0.0000"&#41;
Now we add a check for the Z move to pierce height:

Code: Select all

   if endZ == pierceHeight then
      endZ = 6
   end
   post.ModalNumber &#40;" Z", endZ * scale, "0.0000"&#41;
The post always uses metric even if it is outputting inches so I used 6mm in this example. Of course you can use any value here.
User avatar
Les Newell
Site Admin
Posts: 3683
Joined: Thu May 11, 2006 8:12 pm

Post by Les Newell »

WyoGreen wrote:I'm not sure, but I think what you are talking about is Plunge safety clearance, which is set in Sheetcam under Options/Job options/Material, at the bottom of the Job options box.
Plunge safety is only used when milling, routing or drilling. Instead of moving directly to the top of the work at rapid speed it stops just short and moves the rest of the way at feed rate. This prevents damage to the cutter if the work isn't perfectly positioned or there are some chips in the way.

However the post has access to this value so it could be re purposed for plasma cutting. Here is a modified version of my previous code:

Code: Select all

   if endZ == pierceHeight then
      endZ = plungeSafety
   end
   post.ModalNumber &#40;" Z", endZ * scale, "0.0000"&#41; 
Now you can tweak your reference slowdown position in Options->Job options->material->plunge safety clearance.

This is a nice solution but it has one major pitfall. Plunge safety is saved with your job and the default is 0.5mm. If you modify your post like this then load an old job and forget to change the plunge safety clearance you may get an unpleasant surprise when you run the job.
rikduk
Posts: 47
Joined: Fri Oct 25, 2013 11:48 pm

Post by rikduk »

Thanks guys for the help, and thanks Les, ill try that.
I asked this, because on thick plate, i slow down to ref. speed too high,
it just takes more time.
On thin, if the plate is warped a little, sometimes the torch hits the plate while coming down to pierce height.
That's why i thought to always start ref. at around 1/4".

Richard
Post Reply