What's new
What's new

Okuma mill macro help

tay2daizzo8

Hot Rolled
Joined
Nov 8, 2013
Location
north of Bean town
I have read thru most of the sticky macro thread but im still completly lost.

What i want...to have a helical interpolation (like g13 for fanuc) for my okuma mill)

what i need...an idiots guide to macros with definitions and rules for writing, along with how to incorperate into my normal post

I understand macros have been talked about alot on here but i just dont seem to get where\how to start.

thanks all
 
hy :) my 1st procedure for a mill was a helix :) because i did not like how the machine igf behaves, more exactly it has auxiliar moves and instead of digging inside the igf for how & where to change, i started writing my own stuff

this is parametric coding :)

after that i did not assign it to a macro, because this will require for the file to still be in MD1, and will be loaded at each system startup inside the flash memory, reducing the memory of the control ( depends on program selection type, but still ... )

so actually i see no reason to have the hdd space busy and the memory busy, and always be sure to keep those resource-files inside the MD1, whenever i change the program ( you may simply delete the files from MD1 after they load inside the memory, but ... )

it is a mess ... if you dont have a file managament program, than this leads to downtime

other solutions is to keep the resource file in a folder <> MD1, and specify its location inside the PSELECT, but still, at this moment, you may hit the nesting levels problems, and etc etc

.... so i can help you with a procedure :) macros / libraries / etc, do them how you wish :)
 
I want to be able to position over a holw hit g113 or whatever and have it already defined to take the rough/finish cuts and depths if possible

right now im forced to either helical(g3) down starting from z0 or i have to plunge to depth then start my g1/g3 moves///
i would like to be able to set my definitions for a standard helix and adjust as necessary..

the okuma now runs a g116 for tool change..i would like somethnig like that
 
i have a procedure that takes a lot of inputs :
... cutting specs ( S F sense gear ) + coolant ( throw, near, air, etc )
... geometry pattern ( holes distribution )
... sequence names for fast in-cycle restart
... pitch / lead / start orientation
... going Z+ / Z-
... disengaging tangent / in arc / linear / etc ...

all you can imagine, so to cut helix / threads, etc

i may suggest starting simple, and creating a base code, and after that you may develop it

things with such procedures is that they are optimized + fast editable, near the machine panel :) thus they may be used for series or for particular jobs

that's all from me now :) kindly !
 
I want to be able to position over a holw hit g113 or whatever and have it already defined to take the rough/finish cuts and depths if possible

right now im forced to either helical(g3) down starting from z0 or i have to plunge to depth then start my g1/g3 moves///
i would like to be able to set my definitions for a standard helix and adjust as necessary..

the okuma now runs a g116 for tool change..i would like somethnig like that

hy / if you share a code sample, i can make it parametric for you

... and you may use those paramters so to define the macro variables and assing it to a macro ( i can not help here* )

also, you can wait for a macro guy to drop in, and do the full job for you :)

* the reason why i can not help, is that i dont like the flexibility of the control when i use macro, and i preffer CALL O*** V1= V2 instead of G*** P R T ... when i saw all this colaterals, i did not like them, and i simply formated my part of the brain that remembers that :)
 
yes i just need a basic start...im thinking for now

tool dia
finish dia
finish pass amount
rough step over
cutter comp

i will do a code for you ... pls be patient, because it will take a bit of time, so to make it simple and safe + test on the machine

meanwhile, maybe someone else drops in and shares stuff :)
 
I have an Okuma MA600 Machining Centre and developed a Helical milling macro many years ago.
This macro will machine a Helix from top down, any diameter, any depth, obviously restricted by your tooling tho
smile.gif

I have set up a G Code macro link on the machine to link the library subroutine to G103... refer your manuals if you do not know how to do this...
The library file contains the following code in a file called HELLIMILL.LIB (on the machine)

OHELI
(MILL HELICAL SUBROUTINE)
IF [PD EQ EMPTY ] NALM2
IF [PE EQ EMPTY ] NALM3
IF [PF EQ EMPTY ] NALM4
IF [PP EQ EMPTY ] NALM5
IF [PS EQ EMPTY ] NALM6
IF [PW EQ EMPTY ] NALM7
IF [PZ EQ EMPTY ] NALM8
IF [PR EQ EMPTY ] NALM9
N2 TODR=PD/2 (RADIUS OF MAJOR DIAMETER)
N4 RATE=PS*PE*PF (CALCULATE LINEAR FEEDRATE)
N8 DPTH=PW-PZ (ACTUAL DEPTH OF HOLE)
N10 QTYP=DPTH/PP (QUANTITY OF PASSES REQUIRED TO MILL THREAD)
N12 QTYP=ROUND[QTYP+0.5] (ROUNDUP THE NUMBER OF PASSES)
N14 PTCH=[DPTH/QTYP]*-1 (CALC ACTUAL PITCH REQ)
N16 PASS=0 (COUNTER FOR NUMBER OF PASSES MILLED)
N18 G0 Z=PR (RAPID TO "R" PLANE)
N20 G1 Z=PW F6000. (FEED TO "W" WORKING SURFACE)
N22 G91 G41 DA X=TODR Z0 F=RATE (MOVE FROM CENTRE OF HOLE TO DIAMETER, TURNING ON CUTTER RAD COMP)
NJP1 G3 X0 Y0 I-[TODR] J0 Z=PTCH F=RATE (FULL PITCH)
N24 PASS=PASS+1 (INCREMENT COUNTER)
N26 IF [PASS LT QTYP] NJP1 (JUMP BACK TO NEXT PASS CONDITION)
N28 G3 X0 Y0 I-[TODR] J0 (FULL CIRCLE CLEANUP)
N30 G1 G40 X-[TODR] Z0 F=RATE*5 (BACK TO CENTRE)
N32 G0 G90 Z=PR (CLEAR HOLE)
N34 GOTO NEND
NALM2
VNCOM[1]=1
MSG(MISSING DATA "D")
M00
NMSG
VNCOM[1]=0
GOTO NEND
NALM3
VNCOM[1]=1
MSG(MISSING DATA "E")
M00
NMSG
VNCOM[1]=0
GOTO NEND
NALM4
VNCOM[1]=1
MSG(MISSING DATA "F")
M00
NMSG
VNCOM[1]=0
GOTO NEND
NALM5
VNCOM[1]=1
MSG(MISSING DATA "P")
M00
NMSG
VNCOM[1]=0
GOTO NEND
NALM6
VNCOM[1]=1
MSG(MISSING DATA "S")
M00
NMSG
VNCOM[1]=0
GOTO NEND
NALM7
VNCOM[1]=1
MSG(MISSING DATA "W")
M00
NMSG
VNCOM[1]=0
GOTO NEND
NALM8
VNCOM[1]=1
MSG(MISSING DATA "Z")
M00
NMSG
VNCOM[1]=0
GOTO NEND
NALM9
VNCOM[1]=1
MSG(MISSING DATA "R")
M00
NMSG
VNCOM[1]=0
NEND G90
RTS
%

To use the program, follow the example below

Helical Milling Programming MA600
Definitions:
G103 G Code for the Helical program VIA G-Code Macro setting.
G100 Cancel Subprogram same as using G80 for std drilling cycles
D Hole Diameter
E Number of Flutes on the cutter
F Feed rate per Flute
P Z amount per rev. Pitch, in MM
R Reference Z Height
S RPM of tool
W Top surface of hole (Z).
Z Depth of hole.

Sample program:
Mill a hole 62mm diameter 70mm deep using a 4 flute 40mm diam tip tool.

N1 M3 S1432
N2 M8
N3 G0 Xstartpos Ystartpos
N4 G56 HA Z700
N5 Z20. (reference height)
N6 G103 D62 E4 F0.15 P4. R20. S1432 W0. Z-70.
N7 Xpos Ypos
N8 Xnext Ynext
or
N9 ARC or BHC or LAA...
N10 G100
N11 G0 Z20.
N12 M5
N13 M209
N14 Z700
N15 M6
N16 M1
...

As you might be able to see, the use of the helical milling routine is as simple as drilling a hole! The main tricks to remember when using the G103 command is to not just position at the first point and call the routine, as in like a drilling cycle, and then list the points for the next hole... but to list the first point and all other points on the line after the G103 line and make sure you cancel the cycle with a G100!
I have included comments for most lines to explain what they do... the bulk of the library file is actually taken up with alarm statements to help the user at the machine if any part of the G103 command is missing.
As the macro uses incremental mode for machining the hole, you can position the tool anywhere on the job and call this routine very easily.
I have found this macro to be VERY handy and a very fast way of programming helical milled holes.
Let me know if you find it useful.
Regards
Brian.
 
Fail on my part.
Long answer lost.

A/B/C
I/J/K
U/V/W
X/Y/Z

Feel free to macro, but I'm lazy, so anything complex is too involved for me to work with. (or trust others with)

G0X0Y0
Z25
G3G91X10I5F1000
Z-3I-10
Z-3I-10
Z-3I-10
Z-3I-10
Z-3I-10
Z-3I-10
Z-3I-10
Z-3I-10
X-10I-5
G090Z1000

OR:


G0X0Y0
Z25
G3G91X10I5F1000
N1Z-3I-10
IF[VWKAZ GT -100]N1
X-10I-5
G090Z1000
M2

Sure you can create something as a G code macro if you want or something to use in AOT-M where you can insert an NC program. Or if you're lazy, copy/paste.

I/J/K can be used for any sized radius. < or > 180, doesn't matter.

I see the benefit to a G code macro, I just don't find all that much value in it in this instance unless all you do is helix holes in parts all day.
I've also had issues with look ahead doing math before I wanted in macros causing me issues, so, there's that.

That said, what kind of 5 axis machine are you programming in using AOT-M?
That's one expensive mill to use conversational programming to run.
I mean it works just fine, sure, but damn.
 
if you wish, pls check those samples ... just to get you a taste of what other people do :)

each one has its own approach and perspective

i will reply later with my code ... all the best :)
 
yes that is very helpfull..

What do the if statements mean at the beginning of your program..also NALM ?? what is that

:) those are not my programs

you are looking at them exactly how i was looking at the 1st time

if you wanna get experience, try understanding :) i will also do a variant for you, and you should try to built your own

... be patient :)

i wont answer your questions now about those samples, because you have to struggle yourself to get experience

i will answer in a few days :) please, is this ok for you ?

print those posts, take a seat, relax, enjoy, and conect with the Matrix :) learing programing by reading from paper is better than in front of the pc, where you will get your eyes burned

there is no reason to lose your eyes sight, so to get G code experience :)
 
You use the word Macro. G12-13 on a Fanuc control are fixed Canned Cyces, like G83 for peck drilling IE-G83 Z-1. X0 R.1 Q.1 F25. Each value represents a set command in that line of code, same goes for G12-start positions-radius of arc-increment of step down-radial DOC-Feedrate. Same thing. For the sake of clarification lets separate the term Macro and Canned Cycle. I think we get what a Canned Cycle is, most of us use them all day. Macro on the other hand is different. And that's why Tony's post is up top for definitions and arguments.

Point is Okuma doesn't use G12-13 Canned Cycle for spiral out roughing/finish milling, your just going to have to create the geometry and toolpath from there. If I were doing it freehand, I would not spiral out, just cut the periphery.

R
 
Point is Okuma doesn't use G12-13 Canned Cycle for spiral out roughing/finish milling, your just going to have to create the geometry and toolpath from there. If I were doing it freehand, I would not spiral out, just cut the periphery.

hy :) helical cutting is available as an option ...
 
.....What do the if statements mean at the beginning of your program..also NALM ?? what is that

The if statements are a conditional test. If false the program proceeds to the next block. If true then the program jumps the the block labeled NALM_ and processes the blocks following it. This is the program creator's method to determine if a required argument has been omitted.
 
yes i just need a basic start...im thinking for now

tool dia
finish dia
finish pass amount
rough step over
cutter comp

hy :) i would like to use this inputs :

... rpm
... feed G95
... desired inner cilinder diameter
... Z start
... Z end
... Z revolution height
... tool diameter
... normal or climb milling
... full circle at bottom or not
...... arch overlap in case that a full circle is desired
... polar start position ( angle )

also, i may use this simpler set :

... rpm
... feed G95
... desired inner cilinder diameter
... Z start
... Z revolution height
... number of revolutions
... tool diameter

this last set will be linked with a simpler code, that you may understand easier

please notice that i did not included these parameters that you mentioned :
... finish pass amount
... rough step over

i did not include them, because i wish to build the helix procedure as a single toolpath

this approach will allow the following cases to be build over it :
... finish : direct call
... rough : direct call from within a loop
... threading : requires 1st set + direct call with particular depths specified, that generaly can not be generated within a loop, because threading depths are not equal; even if a cnc cycle asks for a desired cutting depth, than this depth is not always respected and it is only used as an input for some calculations, etc

what do you think ? please feel free to ask whatever you wish :) kindly !
 
go up : G00 Zmax
activate main offset : G56 HA
activate main coords :G15 H1
call helix : CALL OHLX
LV**=...
go up :G00 Zmax
stop :M02

OHLX

get in position : G00 X... Y... Z...
ignition S... M3 M8
repeat this [ cut a revolution with diameter = desired_diameter - tool_diameter and desired_height ] for a desired_number_of times
cut a revolution with diameter = desired_diameter - tool_diameter and height=0 ( thus, a full circle )
move to hole center
move to clearance
RTS

so far, does this makes sense to you ?

now lets rough :

go up : G00 Zmax
activate main offset : G56 HA
activate main coords :G15 H1
repeat this :
... i = i + 1
... cilinder diameter = initial_diameter + i*cutting_detph_cross_diameter
... repeat until i=100
go up :G00 Zmax
stop :M02

that is a combination of Gcode and pseudocode; is it ok ?

i can write Gcode directly if you wish ...



if you have a code sample, put it here, and i will tune it up for you :)

i may begin with simple examples, as you consider ...

i may continue with the codes that i just write and deliver you a program

did you tried to do something ? anything ?

if you are looking for a simple code, there is this one allready shared :

G0X0Y0
Z25
G3G91X10I5F1000
N1Z-3I-10
IF[VWKAZ GT -100]N1
X-10I-5
G090Z1000
M2

do you wish to continue from it ?

whatever you wish, i am here :) kindly !
 








 
Back
Top