What's new
What's new

OiMD post help please

rb1

Cast Iron
Joined
Nov 10, 2008
Location
AB, Canada
Hey Gang,

Need some guidance.

Long story short, lost shop in a fire 3 years ago... Healed up now and getting rolling again. Last VMC was a Fagor, new one is a Fanuc Oi-MD. I went this route so that I not off on an island like I felt I was with Fagor. Nothing against them, just more experience on the forums with Fanuc.

I have OneCNC-XR4 Mill 3D Advantage, and luckily the Dongle survived, so that is what I am using, and this week the CNC tech is supposed to come by for some training general Fanuc training. Back when XR4 was purchased, I had the OneCNC reps help to tweak their Fagor Post, but I'm hoping because Fanuc is more mainstream, I'll be able to use it without too many patches.

Below, is the NC file OneCNC spit out, when I selected "FANUC" as the post (there are 23 different ones to choose from, but none are OiMD). It is a simple drill (with pecking), and tap with G84. If anyone has direct knowledge of if I am on the right path, any input is valued,

thanks!

%
O005000(PART - TEST DRILL TAP JUNE2020)
N10 (NOTES - DRILL OP .500 DEEP)
N15 (NOTES - TAP .400 DEEP)
N20 M05 G40 G49 G80
N25 M09
N30 (.2874 SPOT DRILL COBALT MARI)
N35 T9 M06
N40 G00 G90 G54 X0.25 Y-0.25 S5236 M03
N45 G43 H9 Z0.4
N50 M08
N55 G00 X0.25 Y-0.25 Z0.4
N60 Z0.05
N65 G01 Z-0.0417 F16.0 S5236
N70 G00 Z0.0083
N75 G01 Z-0.1333
N80 G00 Z-0.0833
N85 G01 Z-0.225
N90 G00 Z-0.175
N95 G01 Z-0.3167
N100 G00 Z-0.2667
N105 G01 Z-0.4083
N110 G00 Z-0.3583
N115 G01 Z-0.5
N120 G00 Z0.05
N125 G00 Z0.4
N130 M01
N135 M05 G40 G49 G80
N140 M09
N145 (5/16 X 18 FORM TAP)
N150 T7 M06
N155 G00 G90 G54 X0.25 Y-0.25 S600 M03
N160 G43 H7 Z0.4
N165 M08
N170 G00 X0.25 Y-0.25 Z0.4
N175 G98 G84 Z-0.4 R0.05 F33.3333
N180 G80
N185 G00 Z0.4
N190 M01
N195 M30
%
 
%
O005000(PART - TEST DRILL TAP JUNE2020)
N10 (NOTES - DRILL OP .500 DEEP)
N15 (NOTES - TAP .400 DEEP)
N20 M05 G40 G49 G80
N25 M09
N30 (.2874 SPOT DRILL COBALT MARI)
N35 T9 M06
N40 G00 G90 G54 X0.25 Y-0.25 S5236 M03
N45 G43 H9 Z0.4
N50 M08
N55 G00 X0.25 Y-0.25 Z0.4
N60 Z0.05
N65 G01 Z-0.0417 F16.0 S5236
N70 G00 Z0.0083
N75 G01 Z-0.1333
N80 G00 Z-0.0833
N85 G01 Z-0.225
N90 G00 Z-0.175
N95 G01 Z-0.3167
N100 G00 Z-0.2667
N105 G01 Z-0.4083
N110 G00 Z-0.3583
N115 G01 Z-0.5
N120 G00 Z0.05

N125 G00 Z0.4
N130 M01
N135 M05 G40 G49 G80
N140 M09
N145 (5/16 X 18 FORM TAP)
N150 T7 M06
N155 G00 G90 G54 X0.25 Y-0.25 S600 M03
N160 G43 H7 Z0.4
N165 M08
N170 G00 X0.25 Y-0.25 Z0.4
N175 G98 G84 Z-0.4 R0.05 F33.3333
N180 G80
N185 G00 Z0.4
N190 M01
N195 M30
%

Hello rb1,
The Tool Change may use a Macro Program to position the Z axis in the Zero Return position, but I wouldn't end a program by leaving the last tool at Z0.4 above the workpiece, as shown in Block N185 above.

I advise my clients to arrange the various tool operations to be Stand Alone programs within the overall program. Accordingly, although some code is repeated, each Tool Operation in the following example is a Stand Alone program making for easy repeat of an operation, or restart from a particular tool quite easy. Including an Optional Stop (M01) at the end of each Tool Operation is good practice, in my opinion, as it allows for an orderly halt to the program if require for measuring of the part, or some other aspect.

The code shown in Blue above for the Peck Drilling, could be replaced with the following one Block:

G98 G83 Z-0.5 Q0.092 R0.05 F16.0


%
O005000(PART - TEST DRILL TAP JUNE2020)
(NOTES - DRILL OP .500 DEEP)
(NOTES - TAP .400 DEEP)
(.2874 SPOT DRILL COBALT MARI)
(DRILL 0.5 DEEP FOR 5/16 X 18 FORM TAP)
N1 G17 G20 G40 G49 G80 G94
G91 G28 Z0.0
G28 X0.0 Y0.0
T09 M06
S5236 M03
G00 G90 G54 X0.25 Y-0.25
G43 H09 Z0.4 M08
G98 G83 Z-0.5 Q0.092 R0.05 F16.0
G80
G91 G28 Z0.0 M09
G28 X0.0 Y0.0 M05
M01
(5/16 X 18 FORM TAP - 0.4 DEEP)
N2 G91 G28 Z0.0
G28 X0.0 Y0.0
T07 M06
S600 M03
G00 G90 G54 X0.25 Y-0.25
G43 H07 Z0.4 M08
G98 G84 Z-0.4 R0.05 F33.3333
N180 G80
G91 G28 Z0.0 M09
G28 X0.0 Y0.0 M05
M01
M30
%

Sequence numbers included in each Block is unnecessary. I only use a sequence number at the start of each Tool Operation and number the operations sequentially. Its seldom that each successive Tool Operation in a program will have Tool numbers that increment by one in unison with the operations. Therefore, for me at least, it easier to remember the operation sequence (1st, 2nd, 3rd operation, etc) than it is to remember the Tool Number used in each operation. Accordingly, if the 4th Tool operation has to be repeated, or the program started with the 4th operation, then its a simple task of having the control seach for N4, if only the Start of each Tool Operation has a Sequence Number.

Regards,

Bill
 
Last edited:
In addition to the things Bill mentioned wrt the peck drilling.

You probably need an M29 S600 right before N175.

I would remove the S500 M3 in N155, it's not needed.

N55 and N170 are redundant.

Add a G91 G28 Z0 between the tools and at the end.

I usually include a G17 in my cancel codes, but not necessary.
 
You may need to change the Txx M06 line. The machine tool builder's ladder logic program determines how the magazine and toolchanger work. Many machines are fine as shown in your program, but some do not allow the Txx command and M06 to be on the same line. In the case of a machine using a toolchange macro program, the Txx may need to after the M06 so that the Txx is passed as a variable to the macro.

In angelw's example above there is a small typo in the code. The M08 commands highlighted in red should read M09. Some machine builders ladder logic will automatically temporarily turn off the coolant during a toolchange, while others do not. In general, it is poor practice to leave coolant running during toolchanging if the coolant will get on the tool holder taper.

%
O005000(PART - TEST DRILL TAP JUNE2020)
(NOTES - DRILL OP .500 DEEP)
(NOTES - TAP .400 DEEP)
(.2874 SPOT DRILL COBALT MARI)
(DRILL 0.5 DEEP FOR 5/16 X 18 FORM TAP)
N1 G17 G20 G40 G49 G80 G94
G91 G28 Z0.0
G28 X0.0 Y0.0
T09 M06
S5236 M03
G00 G90 G54 X0.25 Y-0.25
G43 H09 Z0.4 M08
G98 G83 Z-0.5 Q0.092 R0.05 F16.0
G80
G91 G28 Z0.0 M08
G28 X0.0 Y0.0 M05
M01
(5/16 X 18 FORM TAP - 0.4 DEEP)
N2 G91 G28 Z0.0
G28 X0.0 Y0.0
T07 M06
S600 M03
G00 G90 G54 X0.25 Y-0.25
G43 H07 Z0.4 M08
G98 G84 Z-0.4 R0.05 F33.3333
N180 G80
G91 G28 Z0.0 M08
G28 X0.0 Y0.0 M05
M01
M30
%

There are a couple other tweaks you might need to do depending on how your machine performs. For an example, you may find it better to move the M08 up one line. On small, fast machines, turning on the coolant as the Z is rapiding to the part may not allow the coolant enough time to get flowing before the tool begins cutting.
 
The great thing about One Cnc is the ease of modifying your posts.

I think your mistake with the peck drilling section is your selected "Automatic Drilling" instead of "Machine cycle (I think)" when you were doing the drilling cycle. I have set up a few Fanuc posts for One Cnc including a Oi control. Mine look more like my normal style of programming which would read at the start...

O4000 (WHATEVER THE PROGRAM WAS SAVED AS)
P8003 M98
(T9 SPOT DRILL COBALT MARI)
(T7 5/16 X 18 FORM TAP)
(HERE IT WOULD GIVE A WARNING IF YOU HAD A DUPLICATE TOOLS STATION IF YOU DID)
N1 T9 M6 (SPOT DRILL COBALT MARI)
G00 G90 G54 X0.25 Y-0.25 S5236 M03
G43 H9 Z0.4 M8
G98 G83 Z-0.5 Q0.092 R0.05 F16.0
G80
(END TOOL)
P8002 M98
N2 T7 M6 (
5/16 X 18 FORM TAP)
G00 G54 X0.25 Y-0.25 S600 M3
G43 H7 Z0.4 M8
M29 S600
G84 G98 Z-0.4 R0.05 F33.3333
G80
(END TOOL)
P8003 M98
M30

So programs 8003 and 8002 are stored in your control. They pretty much have all of the cancel offsets. 8003 home's Y and Z. 8002 homes only Z or if in the toolchange macro Z home is not needed it only cancels offsets.

I send you a post for One Cnc that you can import via email for you to try if you would like PM me. I have been busy lately so it might take a bit to respond but I will try my best.


 
In an effort to understand what your new machine will do for you in the event of wanting a tool change, turn on the spindle at any speed, and bring your Z axis down about half way, and your table roughly centered under the spindle. Then MDI a tool change as in T5M6; or T05M06; if you prefer, and see what the machine does. If it goes up and stops the spindle and does a tool change you're in luck. You can spare yourself all the G91 G28 M5 stuff your post outputs. They're not needed. If the tool change also sends the X and Y axis home after Z, that's not as lucky but still worthwhile in certain machine-table-is-crowded conditions. If the machine throws some kind of alarm as in "Axis Not Home" or something to that effect, then you'll probably have to include the G91 G28 Z0 and maybe M5, followed in the next line by G90 at the end of every tool before calling the next. Hopefully that's not the case. Neither of my Fanuc milling machines needs any kind of preliminary help to pull off a tool change with a live spindle and starting from anywhere within the work envelope. If the MTB has good sense, neither will yours.

BTW - re-do the above using a small program held in memory with the only things in it being another tool change using a different tool number followed with M30. This is to make sure that you get exactly the same result under Memory/Auto conditions as you did in MDI.

Personally I stay away from using G28 at all and use G53 to position the machine axis to the places you prefer, whether for a safe tool change or part reloading. Simpler, safer, and leaves no chance for the machine to run to the intermediate position it will run to should G91 be forgotten before calling G28. Nothing worse then a machine moving in unexpected ways. I've written hundreds if not thousands of programs without a single G28 with no problems that might relate to machine movement between tools or end of program. Meaning it can easily be done with G53. The other good thing about it is you're not, for the very basic act of moving to home, part loading or safe positions, jumping back and forth between G91 and G90, which has it's own set of hazards if something be forgotten.

Note on some machines, G53Z0 won't technically satisfy the needs of the tool changer. It will put the axis at the home position but not light the Home Position Indicator, which is significant as far as the tool change goes. Hopefully the machine's built in tool change functionality will satisfy the rest of the needs as I explained above, so no matter of concern.
 
You are right about using automatic drilling, nice catch.

Studying the rest of your info.

I guess I'm just used to having to number all the lines for the Fagor. Seems strange (to me, lol) not having that.

I just PM'd you, thanks!!
 








 
Back
Top