What's new
What's new

Learning Haas Mill Macros

rbrandes

Aluminum
Joined
Jan 5, 2009
Location
Panama City Beach, Florida
I finally have an application where a macro will be most effective.
The part I am making is 6061 1/2 x 1-1/4 extrusion.
It gets a hole, full radius on one end and a 45º angle on the other with 1/8 radii.
The hole gets counter bored from each side so that dictates two holds and I am using a pair of double vises.
The outside profile gets chamfered on both sides.
Where it gets sticky is that the 1-1/4" extrusion dimension is actually 1.242".
The old way I handled this was to re-model the part using that dimension and then adjusting my G code.
Since this is a repeat job, I just want to enter the width value and let the machine do the work.

Here is what I have and will test today;

The call -
G65 P6500 A1.242 (

The macro

O6500
(LENGTH IS 16.0)
B=#A/2 (RADIUS)
C=16.0-#A-.213
D=C-.088
G0 X-15. Y.2 (ENTRY POINT)
G0 Z-.110 (DEPTH)
G41 D8 G1 X#D F20.
G1 X-#B
G2 X-#B Y#A R#B
G1 X-15.875
G2 X-15.936 Y-(#A-.213) R.125
G1 X-#C Y-.037
G2 X-#D Y0 R.125
G40 G1 Y.2
M99

I'll let you know how I make out.

macro.jpg
 
Just some syntax to clean up. Here is the code that runs

The Call;
G65 P90005 Y1.242 X16.

The Macro;
%
O90005 (PC LEG CHAMFER MACRO)

(G65 P90005 X24 Y25 )
(LENGTH IS #24)
(WIDTH IS #25)

#1= #24 - #25 - 0.088 + 0.213
#2= #25 / 2 (RADIUS)

G00 X - [ #24 - 1. ] Y0.2
G41 D01 G01 X - #1 Y0 F20.
G01 X - #2
G02 X - #2 Y - #25 R#2
G01 X - [ #24 - 0.125 ]
G02 X - [ #24 - 0.037 ] Y - [ #25 - 0.213 ] R0.125
G01 X - [ #24 - #25 + 0.213 ] Y-0.037
G02 X - [ #24 - #25 + 0.213 - 0.088 ] Y0
G40 G01 Y0.2
M99
 
Another routine "macroized"

We all have something that brings the table front and center at then end of a job. I often need to go in to that program and change the X value depending where the work is on my table. I also change the Z value if it is a one tool job and I don't need the spindle to go all the way up.

The call;
G65 P90002 X-14. Y0 Z-13.5

The macro;
090002 (FRONT AND CENTER)
M9
M0
G0
S1500
G53 Z#26
G53 X#24 Y#25
M99

I am thinking of going the 9010 route and asigning the alias G06 to this macro.
 








 
Back
Top