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:

B0 Safety Move After Work Offset Change


Jake L
 Share

Recommended Posts

I just finished programming a part and we want to run two parts at a time on the same machine with two separate work offsets (G54, G55). Because of the large number of toolpaths, I ended up using a transform toolpath for each tool to duplicating the toolpaths, and I just incremented the offset number by 1. This seemed to work great except for one thing, my parts are running in a 4 axis horizontal machine, and the two parts are setup on opposite sides of a tower. I posted the g-code, and when the program switched to G55 there was no B0 safety move like there usually is at the start of each tool. Because of this, all I have done is make a program that will ghost pass every toolpath at the same position on the same part.

I'm hoping there is an easy fix here I but have yet to find it. One thing that did work was putting a position point at the end of each group of toolpaths, and giving that a rotation move. This caused there to be a rotation move right before calling up G55 (to B5. or any specified number) which, in turn, caused the machine to reorient to G55 B0 when it called G55. This will work it just seems like a very large work around for a problem that I'm hoping has a simple solution.

I'm running Mastercam 2021. The machine is a horizontal 4-axis Smart SX4000 with a Fanuc 31i control. The post is an in house post but I tried a stock post and encountered the same problem so I don't think that's the issue. Attached is the original G-code as well as the G-code for the work around.

Any help is much appreciated, I've been stuck on this one for a few days now. I ended up just putting in B moves by hand so at least the machine can be running while I figure this out, but I hate editing the G-code by hand. Hopefully I have included everything needed.

Original_G-Code.png

Work_Around_G-Code.png

Link to comment
Share on other sites

Without a file I am only guessing here...

It seems like your Planes are not properly set up...

Your WCS will be Top...your T&C planes should the a plane that aligns to the Z direction of your machining...

Mastercam sees the difference between the WCS and C&T planes and calculates and outputs that as rotational value.

I program multiple parts on out 20+ HMC's day in day out

Link to comment
Share on other sites

Thanks for the quick response.

I feel as though I may be misunderstanding how translate works. When I told translate to automatically increment the work offset number I figured it would define a new T&C plane for me behind the scenes and I wouldn't have to touch my planes. I was also under the impression that when a new work offset was called up there would automatically be a safety B0 move.

Secondly, the two parts I'm trying to machine have separate pickups (the face of each part will be B0 in the program). I could be miscommunicating that information, or misunderstanding that. Another solution for my problem is; if I posted the code for a single part, then changed all the G54's to G55's then I would be able to use those two programs to run the two parts. However, doing so would waste a lot of cycle time because all my tool changes would have to happen twice.

I attached a mock program of a very simplified version of what I'm trying to accomplish.

Saftey_Move_After_Work_Offset_Change.mcam

Link to comment
Share on other sites

Check out how I set this up..I used a default post

jp_Saftey_Move_After_Work_Offset_Change.mcam

 

O0000(T)
(DATE=DD-MM-YY - 31-01-22 TIME=HH:MM - 10:41)
(MCAM FILE - C:\USERS\JOHNP\DESKTOP\SAFTEY_MOVE_AFTER_WORK_OFFSET_CHANGE.MCAM)
(NC FILE - C:\USERS\JOHNP\DOCUMENTS\MY MASTERCAM 2021\MASTERCAM\MILL\NC\T.NC)
(MATERIAL - ALUMINUM INCH - 2024)
( T1 | 0.5 FLAT ENDMILL | H1 | D1 | WEAR COMP | TOOL DIA. - .5 )
N100 G20
N110 G0 G17 G40 G49 G80 G90
( T1 )
( T1 )
N120 T1 M6
N130 G0 G90 G54 X-2.3 Y-1. A-270. S1000 M3
N140 G43 H1 Z1.
N150 Z.1
N160 G1 Z0. F25.
N170 G41 D1 X-2.25 F5.
N180 Y1.
N190 G2 X-2. Y1.25 I.25 J0.
N200 G1 X2.
N210 G2 X2.25 Y1. I0. J-.25
N220 G1 Y-1.
N230 G2 X2. Y-1.25 I-.25 J0.
N240 G1 X-2.
N250 G2 X-2.25 Y-1. I0. J.25
N260 G1 G40 X-2.3
N270 G0 Z1.
N280 Z4.
N290 X0. Y0.
( T1 )
N300 G55 X-2.3 Y-1. Z1. A270.
N310 Z.1
N320 G1 Z0. F25.
N330 G41 D1 X-2.25 F5.
N340 Y1.
N350 G2 X-2. Y1.25 I.25 J0.
N360 G1 X2.
N370 G2 X2.25 Y1. I0. J-.25
N380 G1 Y-1.
N390 G2 X2. Y-1.25 I-.25 J0.
N400 G1 X-2.
N410 G2 X-2.25 Y-1. I0. J.25
N420 G1 G40 X-2.3
N430 G0 Z1.
N440 Z4.
N450 X0. Y0.
N460 M5
N470 G91 G28 Z0.
N480 G28 X0. Y0. A0.
N490 M30
%

Link to comment
Share on other sites

I'm going to sound like a complete beginner here but what's HMC? My pickup for the part is; X0 / Y0 centerline of part, Z0 / B0 face of stock. Because the single part program has no rotations, my zeros don't have to be point of rotation. Because I have two separate work offsets I thought I didn't need to define and use a second T&C plane in Mastercam because the 180 rotation will be put in the offsets at the machine.

Just to make sure I'm understanding what you did let me put it in my own words. You moved the wireframe off the origin and gave it a new T&C plane. This allows Mastercam to recognize the rotation you called in the transform toolpath, and update the B0 when G55 is called. My question is this, in this scenario, would the zeros that you have to input into the machine be the point of rotation (Mastercam origin) or would the zeros be the T&C plane origin?

My head is starting to spin a little but I think I'm on the verge of understanding all of this.

Link to comment
Share on other sites

HMC = Horizontal Machining Center.

You can set your part origin as you please, I typically work from the center of the part and the top face...though if I have angles and tough pickup points, I'll use a tooling ball

I create my setups complete...I moved your part so as to "simulate" where it would be in position in the real world on a tombstone..

 

 

O2rYjMT.png

 

When you mentioned setting origins in the control...my post is set up to output them..

(**************************************)
(*************B0 FACE******************)
(**************************************)
(G54.1P1 - B0. - OP1 - UPPER LEFT PART - OP1 MASTER)
(X0 -1.75 FROM CENTER OF LOCATING PIN)
(Y0 -2.50 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P1X-1.75Y-6.2879Z-20.6665


(G54.1P2 - B0. - OP1 - UPPER RIGHT PART)
(X0 +1.75 FROM CENTER OF LOCATING PIN)
(Y0 -2.50 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P2X[#70001+3.500]Y#70002Z#70003


(G54.1P3 - B0. - OP1 - LOWER LEFT PART)
(X0 -1.75 FROM CENTER OF LOCATING PIN)
(Y0 -5.000 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P3X#70001Y[#70002-2.50]Z#70003


(G54.1P4 - B0. - OP1 - LOWER RIGHT PART)
(X0 +1.75 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P4X[#70001+3.500]Y[#70002-2.50]Z#70003


(G54.1P21 - B0. - OP2 - UPPER LEFT PART - OP2 MASTER)
(X0 -2.560 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P21X-.9803Y-15.7621Z-20.7243


(G54.1P22 - B0. - OP2 - UPPER RIGHT PART)
(X0 +1.020 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P22X[#70401+2.00]Y#70402Z#70403


(G54.1P23 - B0. - OP2 - LOWER LEFT PART)
(X0 -2.560 FROM CENTER OF LOCATING PIN)
(Y0 -14.214 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P23X#70401Y[#70402-2.42]Z#70403


(G54.1P24 - B0. - OP2 - LOWER RIGHT PART)
(X0 +1.020 FROM CENTER OF LOCATING PIN)
(Y0 -14.214 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P24X[#70401+2.00]Y[#70402-2.42]Z#70403


(**************************************)
(*************B90 FACE*****************)
(**************************************)
(G54.1P5 - B90. - OP1 - UPPER LEFT PART - OP1 MASTER)
(X0 -1.75 FROM CENTER OF LOCATING PIN)
(Y0 -2.50 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P5X-1.75Y-6.2879Z-20.6665


(G54.1P6 - B90. - OP1 - UPPER RIGHT PART)
(X0 +1.75 FROM CENTER OF LOCATING PIN)
(Y0 -2.50 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P6X[#70081+3.50]Y#70082Z#70083


(G54.1P7 - B90. - OP1 - LOWER LEFT PART)
(X0 -1.75 FROM CENTER OF LOCATING PIN)
(Y0 -5.000 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P7X#70081Y[#70082-2.500]Z#70083


(G54.1P8 - B90. - OP1 - LOWER RIGHT PART)
(X0 +1.75 FROM CENTER OF LOCATING PIN)
(Y0 -5.000 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P8X[#70081+3.50]Y[#70082-2.500]Z#70083

(G54.1P25 - B90. - OP2 - UPPER LEFT PART - OP2 MASTER)
(X0 -2.560 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P25X-.9803Y-15.7621Z-20.7243


(G54.1P26 - B90. - OP2 - UPPER RIGHT PART)
(X0 +1.020 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P26X[#70481+2.00]Y#70482Z#70483


(G54.1P27 - B90. - OP2 - LOWER LEFT PART)
(X0 -2.560 FROM CENTER OF LOCATING PIN)
(Y0 -14.214 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P27X#70481Y[#70482-2.42]Z#70483


(G54.1P28 - B90. - OP2 - LOWER RIGHT PART)
(X0 +1.020 FROM CENTER OF LOCATING PIN)
(Y0 -14.214 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P28X[#70481+2.00]Y[#70482-2.42]Z#70483


(**************************************)
(*************B180 FACE****************)
(**************************************)
(G54.1P9 - B180. - OP1 - UPPER LEFT PART - OP1 MASTER)
(X0 -1.75 FROM CENTER OF LOCATING PIN)
(Y0 -2.50 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P9X-1.75Y-6.2879Z-20.6665


(G54.1P10 - B180. - OP1 - UPPER RIGHT PART)
(X0 +1.75 FROM CENTER OF LOCATING PIN)
(Y0 -2.50 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P10X[#70161+3.50]Y#70162Z#70163


(G54.1P11 - B180. - OP1 - LOWER LEFT PART)
(X0 -1.75 FROM CENTER OF LOCATING PIN)
(Y0 -5.000 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P11X#70161Y[#70162-2.50]Z#70163


(G54.1P12 - B180. - OP1 - LOWER RIGHT PART)
(X0 +1.75 FROM CENTER OF LOCATING PIN)
(Y0 -5.000 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P12X[#70161+3.50]Y[#70162-2.50]Z#70163


(G54.1P29 - B180. - OP2 - UPPER LEFT PART - OP2 MASTER)
(X0 -2.560 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P29X-.9803Y-15.7621Z-20.7243


(G54.1P30 - B180. - OP2 - UPPER RIGHT PART)
(X0 +1.020 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P30X[#70561+2.00]Y#70562Z#70563


(G54.1P31 - B180. - OP2 - LOWER LEFT PART)
(X0 -2.560 FROM CENTER OF LOCATING PIN)
(Y0 -14.214 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P31X#70561Y[#70562-2.42]Z#70563


(G54.1P32 - B180. - OP2 - LOWER RIGHT PART)
(X0 +1.020 FROM CENTER OF LOCATING PIN)
(Y0 -14.214 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P32X[#70561+2.00]Y[#70562-2.42]Z#70563

(**************************************)
(*************B270 FACE****************)
(**************************************)
(G54.1P13 - B270. - OP1 - UPPER LEFT PART - OP1 MASTER)
(X0 -1.75 FROM CENTER OF LOCATING PIN)
(Y0 -2.50 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P13X-1.75Y-6.2879Z-20.6665


(G54.1P14 - B270. - OP1 - UPPER RIGHT PART)
(X0 +1.75 FROM CENTER OF LOCATING PIN)
(Y0 -2.50 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P14X[#70241+3.50]Y#70242Z#70243


(G54.1P15 - B270. - OP1 - LOWER LEFT PART)
(X0 -1.75 FROM CENTER OF LOCATING PIN)
(Y0 -5.000 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P15X#70241Y[#70242-2.50]Z#70243


(G54.1P16 - B270. - OP1 - LOWER RIGHT PART)
(X0 +1.75 FROM CENTER OF LOCATING PIN)
(Y0 -5.000 FROM CENTER OF LOCATING PIN)
(Z0 +.915 FROM FACE OF PLATE)
G90G10L20P16X[#70241+3.50]Y[#70242-2.50]Z#70243


(G54.1P33 - B270. - OP2 - UPPER LEFT PART - OP2 MASTER)
(X0 -2.560 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P33X-.9803Y-15.7621Z-20.7243


(G54.1P34 - B270. - OP2 - UPPER RIGHT PART)
(X0 +1.020 FROM CENTER OF LOCATING PIN)
(Y0 -11.974 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P34X[#70641+2.00]Y#70642Z#70643


(G54.1P35 - B270. - OP2 - LOWER LEFT PART)
(X0 -2.560 FROM CENTER OF LOCATING PIN)
(Y0 -14.214 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P35X#70641Y[#70642-2.42]Z#70463


(G54.1P36 - B270. - OP2 - LOWER RIGHT PART)
(X0 +1.020 FROM CENTER OF LOCATING PIN)
(Y0 -14.214 FROM CENTER OF LOCATING PIN)
(Z0 +.857 FROM FACE OF PLATE)
G90G10L20P36X[#70641+2.00]Y[#70642-2.42]Z#70463

  • Like 1
Link to comment
Share on other sites

Thank you so much. Apparently I was limited to 3 posts a day because I just signed up, but this was figured out yesterday morning. 

It was mostly me not fully understanding what I was trying to do and also not fully understanding how Mastercam worked. I ended up copying, at least for the most part, the mcam file JParis posted. The biggest mistake was not drawing in the whole tower. I thought that was an unnecessary step and that I could just skip it to save time. Turns out, while it is technically unnecessary, it makes understanding this concept much more difficult. Oh well, live and learn I guess.

Thank you again for the quick and helpful responses. I'm sure this won't be my last post here. I'll be back the next time I can't solve a problem.

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