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:

Mplmaster not exporting Plane selection code


Recommended Posts

Hey guys

 

Hopefully a relatively easy question- Im running MPLMASTER. It is not outputting any plane selection code in the file (no G17/18/19 anywhere). It is a simple Lathe Rough/Finish sequence on a spherical test part, so lots of arc moves are output.

My controller defaults to G17, and it seems my current post settings default to G18 (but implied, not as posted). Is there a way via MC to force a G18 output at beginning of file, or do I need to edit the post? Any guidance on how to get this implemented is appreciated.

 

Regards

  • Like 1
Link to comment
Share on other sites

I just checked in MPLMaster. By default, it will only force the Plane to be output if there is a "Y Axis" detected on the machine (as a Component inside the Machine Definition), or when "mill canned cycle" is active, and "cuttype = 4" is also true.

MPLMaster is a great starting point for many machines, but by necessity, it can't be all things to all people, in its OOTB (out-of-the-box) state.

Fortunately, through the magic of code, you can make it do whatever you want.

First, go to the top of the Post and initialize a new variable:

force_plane : yes$

Then, search for 'pfsgplane' post block:

pfsgplane       #Force machining plane
      if (gcode$ = 2 | gcode$ = 3) & plane$ <> prv_plane$, result = force(gcode$,gcode$)
      if y_axis_mch | (millcc & cuttype = 4), *sgplane    #force plane output before G07 whether Y-axis or not, never allow plane output during G07.1 or G12.1
      !plane$

Since it is always a good idea to "remember where you started", make a copy of the original Post Block, and paste it underneath. Then "Pound out" the original block, with "#" pound signs (or *sigh* a "Hash tag"), so you can see the original. Then make some changes as I show below:


#pfsgplane       #Force machining plane
#      if (gcode$ = 2 | gcode$ = 3) & plane$ <> prv_plane$, result = force(gcode$,gcode$)
#      if y_axis_mch | (millcc & cuttype = 4), *sgplane    #force plane output before G07 whether Y-axis or not, never allow plane output during G07.1 or G12.1
#      !plane$

pfsgplane       #Force machining plane
      if (gcode$ = 2 | gcode$ = 3) & plane$ <> prv_plane$, result = force(gcode$,gcode$)
      if force_plane | y_axis_mch | (millcc & cuttype = 4), *sgplane    #force plane output before G07 whether Y-axis or not, never allow plane output during G07.1 or G12.1
      !plane$

 

Try that and see if you get the output you want.

Note: by default, the "Lathe Tool Change" and "Mill Tool Change" post blocks call "pfsgplane". There is also "Null" tool change blocks for both Lathe and Mill. A "Null Tool Change" is an event where the same Tool Number is used in a subsequent operation in Mastercam.

The "null" tool change blocks call 'psgplane', which is a different Post Block for outputting 'sgplane'. It is "Modal" and is not "forced output".

The 'psgplane' Post Block has similar code to 'pfsgplane'. You may find that you also need to modify that block as well. If so, here is how you can do that one:


#psgplane        #Machining plane
#      if (gcode$ = 2 | gcode$ = 3) & plane$ <> prv_plane$, result = force(gcode$,gcode$)
#      if y_axis_mch & not(millcc) & posttype$ <> 2, sgplane   #plane changes between 0 and 2 for turning, only allow output at toolchange, never allow plane output during G07.1 or G12.1
#      !plane$

psgplane        #Machining plane
      if (gcode$ = 2 | gcode$ = 3) & plane$ <> prv_plane$, result = force(gcode$,gcode$)
      if force_plane, pfsgplane
      else,
        [
        if y_axis_mch & not(millcc) & posttype$ <> 2, sgplane   #plane changes between 0 and 2 for turning, only allow output at toolchange, never allow plane output during G07.1 or G12.1
        ]
      !plane$

 

 

  • Like 2
Link to comment
Share on other sites

Well, first just wanted to thank you for this help- the level of detail in the response made the approach very easy to apply.

On first glance, it seems to do what is needed. Ill have to run a few different toolpath types at it (seems my controller has weird requirements on G17/G18 for peck drill vs arc motion, even though it can only move in X/Z).

I didn’t apply the code change elsewhere, just in the case it might end up spitting out a G17 or G18 at some tool change, or a null change, etc.

I understand that the Post is generic, and that edits are required. Because Im using a strange controller which is based in LinuxCNC, there are some unconventional approaches and some limitations especially as regards canned cycles. And that has required a lot of minor changes, and just simple stuff via the Machine Control config. But some of the stuff (like the plane change thing) is just a little outside of my comfort level, given the potential unintended consequences.

If I see anything weird, Ill post to this thread the operation data and related code output.

Thanks again- have a great weekend

CW

  • Like 1
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...