MACRO HACKS! Automate Your Tool Offsets and Data - Haas Automation Tip of the Day

preview_player
Показать описание
Mark gets back out into the deep water on this one. Check out how you can automate the proper entry of tool offsets and other important tool data using one of Mark's favorite macro variables; #3026. It's easy to understand and use, and it'll make your programs more efficient.

Link to bonus "Cheat Sheet":

Links to the plethora of other "Macro" related TOD videos:

If you enjoyed this video, please hit the like button and share it with a friend who’ll find it helpful . . . and thanks!

Follow Haas:
Рекомендации по теме
Комментарии
Автор

Here is a macro I wrote to pickup a part from one side, jog to the other side and pick the opposing side up and store the mid-point in the selected work offset. It will also store the edge locations and the overall sizes in the G154P01, G154P03 and G14P3 offsets. Where is this useful? Anytime you need to pickup the mid-point of a machined or odd size part that would be difficult or time consuming to use the canned cycles. Now, I am by no means an expert in macros, but learning all the time. And, there are always many ways of writing a macro to do the same thing so, I would appreciate any constructive criticism or helpful information that would help me, and others out.
-Mark, and Haas, HUGE Thank you for continuing to share and help your users out! It is very appreciated!

#100= 1 (X=1, Y=2 AXIS TO PICKUP)
#101= 54 (WORK OFFSET, 54-59)

(MAKE SURE BLOCK DELETE IS OFF FOR FIRST PICKUP)

(FIRST PICKUP PROBE MOVES + POSITIVE)
(SECOND PICKUP PROBE MOVES - NEGATIVE)

(1-JOG PROBE TO WITHIN .5 OF FIRST SURFACE)
(2-RUN PROGRAM)
(3-JOG PROBE TO WITHIN .5 OF OPPOSITE SECOND SURFACE)
(4-RUN PROGRAM)

(MID POINT OF BOTH PICKUPS = OFFSET SELECTED)
(INDIVIDUAL SURFACE PICKUPS ARE STORED IN G154P01 & G154P02)
(OVERALL DISTANCE BETWEEN THE PICKUP ARE ON G154P03)

(FIRST X PICKUP=G154P01)
(SECOND X PICKUP-G154P02)
(OVERALL DISTANCE BETWEEN X PICKUP-G154P03)

(FIRST Y PICKUP=G154P01)
(SECOND Y PICKUP-G154P02)
(OVERALL DISTANCE BETWEEN Y PICKUP-G154P03)



IF [#100 LT 1] #3000=15 (#100 MUST BE 1 OR 2)
IF [#100 GT 2] #3000=15 (#100 MUST BE 1 OR 2)
IF [#101 LT 54] #3000=20 (WORK OFFSET MUST BE 54-59)
IF [#101 GT 59] #3000=21 (WORK OFFSET MUST BE 54-59)


IF [#100EQ1] GOTO 100
IF [#100EQ2] GOTO 200

(BEGINNING OF X PICKUP)
N100
/(1ST X PICKUP IN + DIRECTION)
/G65 P9995 W154.01 A20. D.5
/#110=#14001
/GOTO 110

(2ND X PICKUP IN DIRECTION)
G65 P9995 W154.02 A20. D-.5
#111=#14021

(AVERAGE FOR BOTH PICKUPS IN X)
#115=[[#110+#111]/2]
#7041=#7021-#7001

(SETTING WORK OFFSET FOR X)
IF[#101EQ54] #5221=#115
IF[#101EQ55] #5241=#115
IF[#101EQ56] #5261=#115
IF[#101EQ57] #5281=#115
IF[#101EQ58] #5301=#115
IF[#101EQ59] #5321=#115
GOTO 120

N110
#3032=1(TURN BLOCK DEL ON)
M30

N120
#3032=0(TURN BLOCK DEL OFF)
M30
(END OF X PICKUP)




(BEGINNING OF Y PICKUP)
N200
/(1ST Y PICKUP IN + DIRECTION)
/G65 P9995 W154.01 A20. E.5
/#112=#14002
/GOTO 210

(2ND Y PICKUP IN -DIRECTION)
G65 P9995 W154.02 A20. E-.5
#113=#14022


(AVERAGE FOR BOTH PICKUPS IN Y)
#115=[[#112+#113]/2]
#7042=#7022-#7002


(SETTING WORK OFFSET FOR Y)
IF[#101EQ54] #5222=#115
IF[#101EQ55] #5242=#115
IF[#101EQ56] #5262=#115
IF[#101EQ57] #5282=#115
IF[#101EQ58] #5302=#115
IF[#101EQ59] #5322=#115
GOTO 220

N210
#3032=1(TURN BLOCK DEL ON)
M30

N220
#3032=0(TURN BLOCK DEL OFF)
M30
(END OF Y PICKUP)

Tpreb
Автор

Still not to the macro level. But LOL on the ...pause...Daniel Machado :-) Brilliant. I will come back to this later as my reference library...Thanks, Mark, excellent presentation as usual.

BrilliantDesignOnline
Автор

My personal favorite is this one:


O9000 (Automatic Tool Breakage Detection)
G65 P9023 A24. T#3026 H0.01
M99


Aliased as an M-Code.
This is an automatic tool breakage detection using the current tool macro variable. This makes it a lot easier when using tool breakage detection in my CAM system. It allows for an M-code rather than having to manually type in all of the information after each tool I want checked.

DdgeluvinHic
Автор

Please make more videos on macro programming

imranpathan
Автор

Here is perhaps one of my most used macro programs.

Rectangular Pocket MACRO

G65 P4040 Z(depth) I(X dimension) J(Y dimension) Q(Step) R(Finish Corner Radius)

Note It picks up the tooling variable and uses the InSpindle variable to set the diameter offset.
2nd Note, since it uses absolute positioning, the center of the pocket must be at the work coordinance X0 Y0. I usually give the pocket location its own coordinance location.

O04040
(UNIVERSAL POCKET MACRO)
(ie. G65 P4040 Z-.5625 I25.5 J4.5 Q0.125 R0.75)
(#4 I LENGTH)
(#5 J WIDTH)
(#17 Q STEP)
(#18 R)
(#26 Z DEPTH)
(#2401-2600 TOOL DIAMETERS)
(#3026 TOOL IN SPINDLE)
#1= #[ 2400 + #3026 ] (CURRENT TOOL DIA)
#3= [ [ #1 / 2 ] - #17 ]
#6= #17
#7= [ #18 - [ #1 / 2 ] ] (R CORNERS - 1/2 D)
(N100= CASE X GT Y)
(N200= CASE Y GT X)
N10 G01 G91 Z#26
IF [ #4 LT #5 ] GOTO200
N100 G90 G01
X0 Y#6, R#3
X - [ [ [ [ #4 - #1 ] / 2 ] - [ [ #5 - #1 ] / 2 ] ] + #6 ], R#3
Y - #6, R#3
X [ [ [ [ #4 - #1 ] / 2 ] - [ [ #5 - #1 ] / 2 ] ] + #6 ], R#3
Y#6, R#3
X#6
#6= #6 + #17
IF [ [ #3 + #6 ] LT #18 ] #3= [ #3 + #6 ]
IF [ #6 LT [ [ #5 - #1 ] / 2 ] ] GOTO100
G01 G90 X0 Y [ [ #5 - #1 ] / 2 ]
X - [ [ #4 - #1 ] / 2 ], R#7
Y - [ [ #5 - #1 ] / 2 ], R#7
X [ [ #4 - #1 ] / 2 ], R#7
Y [ [ #5 - #1 ] / 2 ], R#7
X0
Y0
M99
N200 G90 G01
X#6 Y0, R#3
Y [ [ [ [ #4 - #1 ] / 2 ] - [ [ #5 - #1 ] / 2 ] ] + #6 ], R#3
X - #6, R#3
Y - [ [ [ [ #4 - #1 ] / 2 ] - [ [ #5 - #1 ] / 2 ] ] + #6 ], R#3
X#6, R#3
Y - #6
#6= #6 + #17
IF [ [ #3 + #6 ] LT #18 ] #3= [ #3 + #6 ]
IF [ #6 LT [ [ #5 - #1 ] / 2 ] ] GOTO200
G01 G90 X [ [ #5 - #1 ] / 2 ] Y0
Y - [ [ #4 - #1 ] / 2 ], R#18
X - [ [ #5 - #1 ] / 2 ], R#18
Y [ [ #4 - #1 ] / 2 ], R#18
X [ [ #5 - #1 ] / 2 ], R#18
Y0
X0
M99

andrew_the_machinist
Автор

Thanks for getting into macro programming. We just got WIPS installed on one machine, and we don't know how we ran without it. Our local HFO helped me out with this exact macro a few weeks ago so we can probe tooling groups. This machine is also robotically tended. My next hurdle is how to get the robot to load a new blank if a tool in a tooling group breaks.

mechmotion
Автор

Once my classmate showed me that Auto probing macro, I’ve been flying through with tool setups. It makes setting tools up so, so much faster and enjoyable.

_Ptat_
Автор

For anyone wondering i
#4120 on fanuc is simular to #3206 on haas #4120 is last commanded T value

Thefreakyfreek
Автор

For lathes, has to be ran after recalibrating the probe. (Not sure why our lathe doesn't do this automatically)
%
O90007 (UPDATE PROBING MACRO VARS)

(PREVENTS ALARM 1085 FROM OCCURING)

(THIS PROGRAM IS INTENDED TO BE RAN...)
(...AFTER UPDATING PROBE DISTANCE..)
(...SETTINGS)
(UPDATES MACROS FOR SETTING 59, 60, 334)


G103 P1.


(SETTING 59 )
#101= #6059
#101= #101 / 5000
#10582= #101

(SETTING 60)
#101= #6060
#101= #101 / 5000
#10583= #101


(SETTING 334)
(NO DIV BY 5000)
#10585= #20334
M30

%

TheSouper
Автор

Full video on broken tool detection next, Please!

andrew_the_machinist
Автор

Hey Mark, do a video if the C-Axis on the CL-1 and just a little more in depth video on the CL-1, PLEASE!! My CL-1 delivers later this month and would love to see more of it in action!

vitalcarry
Автор

OK, you showed the procedure on setting your tool lengths using a macro variable #3026 but you did not explain the tool measure offset read out.
So how about explaining on the older machines like a 2001 VF4B, how that the tool length measurement does not
show the actual Z length from home position to the part like you would on Fanuc where you have to add the tool length measurement to your Z measurement, per example - your work coordinate G54 Z0 is the locating surface of your part in the vise. (the bottom of your part)
You set your first tool off the Z0 location then you set all your other tools using Tool Measure Offset, all your other tools is shown as the difference from between your first tool length and all the other tools length that you touch off.
Am I correct as Haas uses this feature as to how other machine operating systems don't use a feature like this?
And am I correct that I understand how this Tool Measure Offset button system works?

warrenradcliff
Автор

This is a relatively simple Macro I made to line bolts in a plate on the 5th axis of a Haas EC-1600, the oles are put in in the first operation and then it's flipped over and the top and bottom holes are located and then the B axis is adjusted to line up the holes accurately so they can be conterbored from the front. It also finds the 3" centre bore and sets X and Y as well as Z being set to .085" below the measured surface. It's for a large T-slot plate.


(SET G54 FROM G58)
IF [#611 EQ 68] GOTO999

#5221=#5301
#5222=#5302
#5223=#5303
#5225=#5305

T50 M6
G20 G40 G54 G90 G0 X0 Y0 B0.
G43 H50 G0 Z10.
G65 P9832(ON)
G65 P9810 Z2. F100.
G65 P9810 Z-0.5 F60.
G65 P9814 D3.0 S1(SET G54 X AND Y)
G65 P9810 Z6. F100.
G65 P9810 X3. Y0.
G65 P9810 Z.75 F60.
G65 P9811 Z0 Q1. S1
G65 P9810 Z6.0 F100.
#5223=[#5223-.085]


G90
G54 G0 X0 B15.
B0.
G00 X0. Y-9.6565
G43 H50 Z6. G01 F100.
G65 P9832
G65 P9810 Z1. F100.
G65 P9814 D0.75 Z.15
G65 P9834
G65 P9810 Z4.
G65 P9810 X0. Y9.6565
G65 P9810 Z1. F100.
G65 P9814 D0.75 Z.15
G65 P9834 A90. D19.313.

G65 P9810 Z1.
G91 G28 Z0. G01 F100.
G65 P9833
#5225= [ #5225 + #194 ]
G90 G54 G0 B15.
B0.

#611=68
N999
M99

matthewwood
Автор

Please do a video on G 141 3D cutter compensation. Thanks

jenniferriggins
Автор

Use it in graphics mode carefully. #3026 equals to the tool in spindle right now. Not tool that you've choosen in your program.

maxmorozov
Автор

Talking about tool offsets I would love to see a video on diameter offsets tool comp. All your videos are amazing and great teaching tools. Thank you!

RafaelSoldan
Автор

A very simple program to use instead of G10 L13, especially it won't stay when you hit reset.

O09xxx
for example G300 R+-
G300 R0 or only G300 will reset the offset changes

#3003=1
G103 P1
IF [#18 EQ #0 OR 0] GOTO 1

#2700=0
D100
GOTO2
N1 D#4111
N2 G103
#3003=0
M99

TheTaishogun
Автор

Do you have a similar video for the lathe? Or are the Macro Variables the same?

robforster
Автор

any plans on doing a video about the new way to touch of tools in the lathe? you know when you go to edit/vps/probe to do that?

hemligagosta
Автор

I wrote Marcos for milling a keyway an boring a hole with a endmill an also enlarging a hole from a diameter I use them all the time but I use Fanuc so I hope I can also use #3202 which would be amazing for me so radius compensation would be automatically used instead of puting a g41 d10 ; g40 in front of them

Thefreakyfreek