Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

custom 5 axis drill toolpath


Recommended Posts

I am trying to write a custom drill cycle to do some 3+2 moves and probe points on a surface. I am using a 5 axis drill tool path with a custom drill cycle.

I have it working mostly how i want to but the Z values are coming out wrong. Any advice would be appreciated machine is a Mazak Variaxis.    

first hole
          pdrlcommonb
	  #customer probing cycle #EJL
	  svar = drl_prm1$
	  zrefhgt = drl_ref_z$ + drl_sel_ref$
	  ztoshgt = drl_ref_z$ + drl_sel_tos$ 
	  #pbld, n$, "G43", *tlngno$,e$ 
	  pbld, n$, "M01", "M09",e$
	  pbld, n$, "M05",e$ 
	  pbld, n$, "M19",e$    
	  pbld, n$, "G00", *drl_init_z$,"G43", *tlngno$,e$
	  pbld, n$, *zrefhgt,e$
	  pbld, n$, "G31", *drl_depth_z$, "F500.", "(fast probe touch)",e$
	  pbld, n$, *ztoshgt,e$
          pbld, n$, "G31" *drl_depth_z$, "F50.", "(slow probe touch)",e$
	  P_varplusone,!svar "#",*svar, "=", "#5023",e$
	  pbld, n$, "G00", *drl_init_z$,e$
	  pcom_movea

additional holes

                    

          pdrlcommonb 
	  zrefhgt = drl_ref_z$ + drl_sel_ref$
	  ztoshgt = drl_ref_z$ + drl_sel_tos$
	  #pbld, n$, "G00", drl_init_x$, drl_init_y$,e$
	  pbld, n$, "M01",e$
	  pbld, n$, "G00", *drl_init_z$, "G43", *tlngno$,e$
	  pbld, n$, *zrefhgt,e$
	  pbld, n$, "G31", *drl_depth_z$, "F500.", "(fast probe touch)",e$
	  pbld, n$, *ztoshgt,e$
	  pbld, n$, "G31" *drl_depth_z$, "F50.", "(slow probe touch)",e$
	  P_varplusone,!svar "#",*svar, "=", "#5023",e$
	  pbld, n$, "G00", *drl_init_z$,e$
          pcom_movea

output from my custom drill cycle

X-15.26 Y16.386 S1000 M3
Z90.14 M8
M01 M09
M05
M19
G00 Z23.244 G43 H1
Z14.226
G31 Z-.845 F500. (fast probe touch)
Z9.226
G31 Z-.845 F50. (slow probe touch)
#1 = #5023
G00 Z23.244

output from normal drill cycle

X-15.26 Y16.386 S1000 M3
Z90.14 M8
G81 G98 X-15.26 Y16.386 Z33.14 R45.14 F120.
G80
M9
G69
G49
G0 G90 G53 Z0.

 

Link to comment
Share on other sites

Why did you go through the trouble of defining variables with math in them and then not use them for the process? Where are you defining drill_depth_z as a variable? Where are you telling it to take the zabs and use it for the probing operation? When I defined my probe variables I did them outside of the operation. I don't see them defined to understand how you plan to use them. If I did any math in the routine it was to use that variable not to do math and then not use it and that has my puzzled.

Link to comment
Share on other sites
5 hours ago, crazy^millman said:

Why did you go through the trouble of defining variables with math in them and then not use them for the process? Where are you defining drill_depth_z as a variable? Where are you telling it to take the zabs and use it for the probing operation? When I defined my probe variables I did them outside of the operation. I don't see them defined to understand how you plan to use them. If I did any math in the routine it was to use that variable not to do math and then not use it and that has my puzzled.

It has a $.  By definition it's a predefined variable.   Not sure if that one exists.... I'm guessing he should possibly be using depth$, but given it's a 5ax post, it's likely not that simple due to mapping....

Link to comment
Share on other sites
8 minutes ago, huskermcdoogle said:

It has a $.  By definition it's a predefined variable.   Not sure if that one exists.... I'm guessing he should possibly be using depth$, but given it's a 5ax post, it's likely not that simple due to mapping....

I haven't seen them before so all I can do it throw out ideas and see if something sticks.

Link to comment
Share on other sites
 drl_init_z$   (clearance height)                          Mapped value
 drl_sel_ref$  (retract height)                            not mapped
 drl_sel_tos$  (top of stock)                              not mapped
 drl_ref_z$    (referance point in space for top of hole)  Mapped value  
 drl_depth_z$  (hole depth)                                Mapped value

drl_sel_ref$ & drl_sel_tos$ get output from mastercam as inc values.
I am using the calc's below to calculate these variables based on a mapped value
 
zrefhgt = drl_ref_z$ + drl_sel_ref$
ztoshgt = drl_ref_z$ + drl_sel_tos$

FYI I'm new to post writing and open to advises if I'm doing it wrong. 
 
Link to comment
Share on other sites
16 hours ago, mustardcam said:

 drl_init_z$   (clearance height)                          Mapped value
 drl_sel_ref$  (retract height)                            not mapped
 drl_sel_tos$  (top of stock)                              not mapped
 drl_ref_z$    (referance point in space for top of hole)  Mapped value  
 drl_depth_z$  (hole depth)                                Mapped value

drl_sel_ref$ & drl_sel_tos$ get output from mastercam as inc values.
I am using the calc's below to calculate these variables based on a mapped value
 
zrefhgt = drl_ref_z$ + drl_sel_ref$
ztoshgt = drl_ref_z$ + drl_sel_tos$

FYI I'm new to post writing and open to advises if I'm doing it wrong. 
 

Do you have the post documentation?  The docs the cover drl_ series of variables very well, though in my experience none of them are mapped automatically.

Also the formulas don't make much sense to me; seeing as... 

  • drl_sel_ref$ is the distance from the selected point to the ref point
  • drl_sel_tos$ is the distance from the selected point to the top of stock
  • drl_ref_z$ is the absolute Z position of the ref point

I'm not sure what you are trying to accomplish by adding them together. 

Also, as this is a 3+2/5-axis application you'll likely have to rotate/map the values depending on how your machine handles tilted work planes.     

You should contact your reseller or post developer; they will be able to get you sorted out.     

  • Like 1
Link to comment
Share on other sites
On 8/18/2020 at 1:03 AM, mustardcam said:

I have it working mostly how i want to but the Z values are coming out wrong.

I think you are making it more complicated than necessary. There are variables (pre defined) available to do what you want without calculation. Pay attention to incremental and absolute.

As Zaffin_D suggested the documentation is indispensable here. Especially the newer (after 2017 or 18) portfolio has a dedicated drill cycle section. You need to see what pre defined variables are available on the custom drill NCI line

  • Like 1
Link to comment
Share on other sites
18 hours ago, nickbe10 said:

I think you are making it more complicated than necessary. There are variables (pre defined) available to do what you want without calculation. Pay attention to incremental and absolute.

As Zaffin_D suggested the documentation is indispensable here. Especially the newer (after 2017 or 18) portfolio has a dedicated drill cycle section. You need to see what pre defined variables are available on the custom drill NCI line

The predefined variables are not mapped correctly. Some are absolute and some are incremental adding the incremental values to known absolute reference values make them absolute as well. turns out this was a mapping issue and my calculations are working. 

  • Like 1
Link to comment
Share on other sites
2 hours ago, mustardcam said:

The predefined variables are not mapped correctly. Some are absolute and some are incremental adding the incremental values to known absolute reference values make them absolute as well. turns out this was a mapping issue and my calculations are working. 

I'm glad you got this working, but you've lost me.  Adding the values as you show shouldn't generate a useful position.

Consider the below hole; Yellow is the ref point, green is the selected point and top of stock, and red is the depth 

 image.png.29aad014e649345ac74d17267a36438b.png   

I setup a drilling postblock to mimic your math

pdrill$
	"Ref. Z position (Abs.)             : ", *drl_ref_z$, e$
	"Selected Z position (Abs.)         : ", *drl_zdrl_z$, e$ 
	"TOS Z position (Abs.)              : ", *drl_tos_z$, e$
	"Depth Z position (Abs.)            : ", *drl_depth_z$, e$ 
	*e$
	"Ref. Z position (Inc.)             : ", *drl_sel_ref$, e$
	
	zrefhgt = drl_ref_z$ + drl_sel_ref$
	*e$
	"Sum of drl_ref_z$ and drl_sel_ref$ : ", *zrefhgt, e$

And that resulted in the following output.

Ref. Z position (Abs.)             : 60.
Selected Z position (Abs.)         : 50.
TOS Z position (Abs.)              : 50.
Depth Z position (Abs.)            : 20.

Ref. Z position (Inc.)             : 10.

Sum of drl_ref_z$ and drl_sel_ref$ : 70.

 

I don't understand how a value of 70mm is useful.   

Link to comment
Share on other sites
13 hours ago, Zaffin_D said:

I'm glad you got this working, but you've lost me.  Adding the values as you show shouldn't generate a useful position.

Consider the below hole; Yellow is the ref point, green is the selected point and top of stock, and red is the depth 

 image.png.29aad014e649345ac74d17267a36438b.png   

I setup a drilling postblock to mimic your math


pdrill$
	"Ref. Z position (Abs.)             : ", *drl_ref_z$, e$
	"Selected Z position (Abs.)         : ", *drl_zdrl_z$, e$ 
	"TOS Z position (Abs.)              : ", *drl_tos_z$, e$
	"Depth Z position (Abs.)            : ", *drl_depth_z$, e$ 
	*e$
	"Ref. Z position (Inc.)             : ", *drl_sel_ref$, e$
	
	zrefhgt = drl_ref_z$ + drl_sel_ref$
	*e$
	"Sum of drl_ref_z$ and drl_sel_ref$ : ", *zrefhgt, e$

And that resulted in the following output.


Ref. Z position (Abs.)             : 60.
Selected Z position (Abs.)         : 50.
TOS Z position (Abs.)              : 50.
Depth Z position (Abs.)            : 20.

Ref. Z position (Inc.)             : 10.

Sum of drl_ref_z$ and drl_sel_ref$ : 70.

 

I don't understand how a value of 70mm is useful.   

Are you using a 5 axis drilling toolpath?

Link to comment
Share on other sites
1 hour ago, mustardcam said:

Are you using a 5 axis drilling toolpath?

My tool axis control is set to 5-axis.  I tipped the part 25 degrees and still got numbers I would except. 

 image.png.fc54da153a95d8193da10e8e9d64f52d.png

Ref. Z position (Abs.)             : 54.378467
Selected Z position (Abs.)         : 45.315389
TOS Z position (Abs.)              : 45.315389
Depth Z position (Abs.)            : 18.126156

Ref. Z position (Inc.)             : 10.

Sum of drl_ref_z$ and drl_sel_ref$ : 64.378467

I don't remember this changing, but what version of Mastercam are you using?  Could you share a part file?  I'm curious why this is working for you. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...