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:

Call positions after offset change?


Recommended Posts

Hello again!

I'm trying to program some mill parts to run 1st/2nd op in the same program left vise/right vise, I'm doing this now with multiple offsets. I just noticed a problem though, if a coordinate has not changed between an offset change, mastercam will not reposition/recall the positions. The toolpath will run on the previous offset only because the absolute position hasn't changed as far as Mastercam knows, machine coordinates changed though. If only one value changes, only that axis will update in the code...

Is there a way to make the post recall last absolute positions after an offset change without calling all positions for all holes, I don't want to make programs more bloated than they need to be. While I can pay attention and call code manually to do what I want I just know the first one I forget is going to bite me good...

Thank you!!

 

Link to comment
Share on other sites
56 minutes ago, JParis said:

Sample code of what you're getting and sample of what you want would be most helpful

Here is a drill cycle 30 thou from center of the part in Y, on offset 1 I get positions, then the code switches to offset 2 and tries to drill a hole in X without actually moving to the X value. The reason it doesn't think it needs to  move is because the last hole it drilled was at the same absolute X value. Offset 1 is the top of the part, offset 2 is the bottom of the part. One part in, one part out per cycle is the goal. 

 

N3 G116 T2 (13/32 DRILL)
(MAX - Z2.)
(MIN - Z-2.122)
G15 H1
G00 G17 G90 X-.6875 Y-.03 S2182 M03
G56 H2 Z2. T3
M08
Z.1
G94
G71 Z.1
G83 Z-2.122 R.1 I.1218 J.1218 F13.96 M54
X.6875
G80
Z2.
G15 H2
Y.03
Z.1
G71 Z.1
G73 Z-1.622 R.1 Q.1218 F13.96 M54
X-.6875
G80
Z2.
M09
M05
G30 P1
M01

 

I have no experience in modding posts outside of editing single bits on or off, where would I start with adding all that?  If I call my VAR and more or less convey your post verbatim should it be an easy modification?

Thank you both! 

Link to comment
Share on other sites

The easiest way will be to force XYZ for every new operation and just not worry about the changing WCS. This will cover all WCS changes, it might add a few redundant position calls, but they will not do any harm.

in mpmaster, you can do it with the following steps, any other posts should be fairly similar:

1. go to "ptlchg0$"

2. find a condition for "if op_id$ <> last_op_id,"

3. add "result = force(xabs,zabs)"

EXAMPLE

ptlchg0$         #Call from NCI null tool change (tool number repeats)
      toolchng0 = one
      if op_id$ <> last_op_id,
        [
        rd_params$  # Read parameters - pparameter
        pmisccheck
        result = force(xabs,zabs)
        ]

Link to comment
Share on other sites

Hi Alex,

While your solution will work, it is unnecessary.

MPMaster already has a switch, to take care of this exact situation.

force_dpts

The Force Drill Points switch will do everything you need, and all you need to do is change the initialization from 'no$' to 'yes$'.

In your spare time I highly recommend going through the list of "variable switches", and familiarizing yourself with the functions that are already built into the MPMaster Post. There is a ton of very useful stuff that is already built-in...

Link to comment
Share on other sites

 

34 minutes ago, Colin Gilchrist said:

Hi Alex,

While your solution will work, it is unnecessary.

MPMaster already has a switch, to take care of this exact situation.


force_dpts

The Force Drill Points switch will do everything you need, and all you need to do is change the initialization from 'no$' to 'yes$'.

In your spare time I highly recommend going through the list of "variable switches", and familiarizing yourself with the functions that are already built into the MPMaster Post. There is a ton of very useful stuff that is already built-in...

Colin,

I was going to suggest that switch as an alternative, however I removed it before submitting for two reasons:

1. It applies to drilling canned cycles only. In this case it would work, but that does not cover a longhand cycle or any other operation types.

2. In the sample code the toolpath is moving to a reference height of Z0.1 before calling the drill cycle. Forcing the XY with the cycle will move the machine to the correct position, however, it will do so at the Z0.1 reference height. My solution will result in a safe approach, moving to the correct XY position before moving down to the Z reference height.

When I do post mods, I always error on the side of caution, and I try my best to advise others in the same direction. While force_dpts will work for this problem, I would not recommend it as the safest or most robust option.

Link to comment
Share on other sites

Thank you everyone for the advice, I added the snippet of code to force XYZ moves after each operation and got some code which will run a lot better. 

N3 G116 T2 (13/32 DRILL)
(MAX - Z2.)
(MIN - Z-2.122)
G15 H1
G00 G17 G90 X-.6875 Y-.03 S2182 M03
G56 H2 Z2. T3
M08
Z.1
G94
G71 Z.1
G83 Z-2.122 R.1 I.1218 J.1218 F13.96 M54
X.6875
G80
Z2.
G15 H2
X.6875 Y.03 Z2.
Z.1
G71 Z.1
G73 Z-1.622 R.1 Q.1218 F13.96 M54
X-.6875
G80
Z2.
M09
M05
G30 P1
M01

 

I'm pretty familiar with the easy to change section of the posts, plus what you can change from the machine definition. 

Mpmaster is the default post "mpfan" correct? My Okuma post is based on the generic, so I assume this is mpmaster?

 

Thanks again!

  • Like 1
Link to comment
Share on other sites
4 minutes ago, deezums said:

Thank you everyone for the advice, I added the snippet of code to force XYZ moves after each operation and got some code which will run a lot better. 

N3 G116 T2 (13/32 DRILL)
(MAX - Z2.)
(MIN - Z-2.122)
G15 H1
G00 G17 G90 X-.6875 Y-.03 S2182 M03
G56 H2 Z2. T3
M08
Z.1
G94
G71 Z.1
G83 Z-2.122 R.1 I.1218 J.1218 F13.96 M54
X.6875
G80
Z2.
G15 H2
X.6875 Y.03 Z2.
Z.1
G71 Z.1
G73 Z-1.622 R.1 Q.1218 F13.96 M54
X-.6875
G80
Z2.
M09
M05
G30 P1
M01

 

I'm pretty familiar with the easy to change section of the posts, plus what you can change from the machine definition. 

Mpmaster is the default post "mpfan" correct? My Okuma post is based on the generic, so I assume this is mpmaster?

 

Thanks again!

Glad to help!

mpfan is CNC Software's default fanuc post.

mpmaster is the generic fanuc post we have here at In-House Solutions.

If your post came with the software it was most likely written by CNC Software and would be based off of mpfan.

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...