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:

What macros do you use ?


brandon b
 Share

Recommended Posts

This is a warm up one that we use on our VMC.

 

%

O0003(WARMUP MACRO)

(FEEDRATES + COUNTER)

#619=60.(REPETITION COUNT)

#615=400.(FEED PER MINUTE)

#616=1000.

()

N10G53Z0G49G80G90G0M5G69

#618=0

#5201=0(X EXT OFFSET)

#5202=0(Y EXT OFFSET)

#5203=0(Z EXT OFFSET)

#5321=0(G59 X)

#5322=0(G59 Y)

#5323=0(G59 Z)

N10G53Z0G49G80G90G0M5G69

G59

M6T25

(M8)

M3S#616

N11

G4

IF[#618LT[#619*.33]]GOTO20

#616=2000

IF[#618LT[#619*.66]]GOTO20

#616=3000

N20S#616M3

X-30.Y-16.F#615(Y- LIMIT)

Z-8.G1F#615(Z LIMIT -8)

Z0(Z LIMIT)

X0Y0.(X LIMIT)

#618=#618+1.

IF[#618LT#619]GOTO11

G53Z0G49G80G90G0M05

G53X0.Y0.

G200

M06T22

G200

M30

%

Link to comment
Share on other sites

I use a few and they are very handy. Here is a short list:

 

1. Pallet verify - detects if the pallet in the machine corresponds to the pallet assigned to the program and initiates a pallet change if need be.

2. Tool length check - Checks to see if the tool length in the spindle is less than 2", equal to 10.0", or equal to 15.0". If the tool length is either 10.0" or less than 2.0" it alarms the machine because the operator forgot to set the tool length to 15.0". If the tool length is 15.0" it sets the tool length with the tool setter. When tools are removed from the machine the pocket is zeroed and the length is set to 10.0" by the operator.

3. God spot - Probing routine that tracks a reference position on the machine table throughout the day and adjusts G52 in X, Y, and Z to account for any thermal drift that is detected. G52 is set back to zero in my spindle warm up program using a G10 command (G10 L2 P0 X0.0 Y0.0 Z0.0) and this is run every morning when the machine is powered on and warmed up.

4. DFO input - Allows the operator to input the part zero location in X Y and Z and it automatically populates all offset values using G10 commands to get DFO working correctly. This is in the program header.

5. M198 tramsform - Allows an operator to quickly set up multiple parts in the machine. It is a looping program that moves the work offset around using G10 commands.

Link to comment
Share on other sites

Here's some of mine:

 

1. Engraving - contains logic to increment the dates in different formats as well as part # serialising

2. Angled Plane - cuts an angled plane with a Y-Z stepover, operator positions the tool and tells the macro what angle, ball/bull endmill size, stepover, X cut length, rotation...etc Also, can do a fillet radius blend at top or bottom of the plane.

3. Threadmilling - ID or OD threads, full form or single point cutter, RH/LH threads

4. Trochoidal slot roughing - slot width, stepover, length, rotation, cut depth increments

5. Mazak WPC update - one-touch execution after operator sweeps in a feature

6. 2D digitizing - probe is positioned to X+ side of flat 2d contour, start position is saved, then the probe finds its way around the part back to the start. Every touch sends XY data to text file using DPRNT function

7. Probe center - probes four points to find XY center without all the extra movement in the original Renishaw macro, half the cycle time, updates WPC, saves X and Y length to variables

 

These are all running on Mazak VCNs in a shop with no mastercam

Link to comment
Share on other sites
  • 4 weeks later...

Here is one of my very first macros. It can machinine a cone of any size or angle. You can also pick any tool size you want. I also added a feature that speeds up the cutter as it travels down the cone. We have used this on tooling and roughed out larger parts before turning. Let me know what you think.

 

O6777(OD CONE MACRO)

(ABSOLUTE SURFACING MACRO)

(WORKS)

(FORMAT G65/G66 AQDTMSRZEF)

(A = #1 - INCLUDED ANGLE OF PART FROM TOP)

(Q = #17 - STEPOVER IN Z/ CUSP HEIGHT)

(D = #7 - TOOL DIAMETER)

(T = #20 - TOOL RADIUS/ BALL OR BULL)

(M = #13 - MATERIAL SIZE/ SQUARE OR ROUND)

(S = #19 - PART DIAMETER/ TOP)

(R = #18 - R PLANE)

(Z = #26 - Z START ZERO)

(E = #8 - END OF TAPER IN Z)

(F = #9 - FEEDRATE)

(***********************************)

#100=ABS[#26]-ABS[#8]

#100=ABS[#100]

IF[[#26*#8]GE0]GOTO1

#100=ABS[#26]+ABS[#8]

N1#101=ROUND[#100/#17]

#102=#100/#101

IF[#102GT[#100/2]]GOTO1000

#103=#5001

#104=[#103-.1]-[[#7/2]+[#13/2]]

#105=#5002

#113=#105

#115=[#105+.1]+[[#7/2]+[#13/2]]

#155=0

IF[#7EQ[#20*2]]GOTO10

#105=#105+[[#7/2]-#20]

#155=#155+[[#7/2]-#20]

N10#105=#105+[#19/2]

#155=#155+[#19/2]

#125=90.+[#1/2]

#105=#105+[#20/TAN[#125/2]]

#155=#155+[#20/TAN[#125/2]]

G0G90X#104Y#115

Z[#26+.1]

G1Z#26F#9

#106=#5003

#109=#9

#135=[#155*2]*3.14

WHILE[#101GE0]DO1

IF[#101LT0]GOTO100

#101=#101-1.

G1Z#106F#109

G41Y#105

X#103

G02J-#155

G03X[#103+.1]Y[#105+.1]J.1F[#9/2]

G0Z[#106+.1]

G40X#104

#105=#105+[TAN[#1/2]*#102]

#155=#155+[TAN[#1/2]*#102]

#145=[#155*2]*3.14

#109=#9*[#145/#135]

#106=#106-#102

END1

N100G0G90Z#18

X#103Y#113

M99

N1000#3000= 1( Q VALUE TOO BIG )

Link to comment
Share on other sites

Here's one I made the other day. It uses two Mcodes (M209, M210) for tracking and reporting time. M209 starts the timer, M210 ends and then reports to a text file in the MD1 directory. The macro uses the VQDAT variable to get the date and put that in the report.

 

 

OM209
IF [VDIN[1001] GT 99999999] NALM1
VC199=VDIN[1001]
RTS

OM210
VC198=VDIN[1001]
TIM3=VC198-VC199
TIM4=FIX[TIM3/60]
TIM5=[TIM3/60-FIX[TIM3/60]]*60
VC200=TIM4+TIM5/100
AY=4716
AJ=1401
AM=2
AN=12
AR=4
AP=1461
AV=3
AU=5
AS=153
AW=2
AB=274277
AC=-38
JUL=VQDAT + 2444238
AF = JUL + AJ
AF = AF + [[[4 * JUL + AB]/146097] * 3]/4 + AC
AE = AR * AF + AV
AG1 = MOD[AE,AP]/AR
AH = AU * AG1 + AW
DAY = FIX[[MOD[AH,AS]]/AU + 1]
MNTH = FIX[MOD[AH/AS + AM,AN] + 1]
YEAR = FIX[AE/AP - AY + [AN + AM - MNTH]/AN]

CLOSE C
FWRITC MD1:TOOL-TIME.TXT;A
PUT' '
WRITE C
PUT 'YEAR/MM/DD'
WRITE C
PUT YEAR,4
PUT '/'
PUT MNTH,2
PUT '/'
PUT DAY,2
WRITE C
WRITE C
PUT'TOOL NUMBER '
PUT VATOL,1
WRITE C
PUT'TIME='
PUT TIM4,2
PUT':'
PUT TIM5,2
WRITE C
CLOSE C
GOTO NEND
NALM1 VUACM[1]='CYCLE POWER'
VDOUT[992]=1234
NEND
RTS

  • Like 1
Link to comment
Share on other sites

Yo Doug. Do you ever use VTIME? Also a handy date and time tracker for OSP.

 

VTIME is very new in terms of OSP controls. Older P200M do not have the VTIME variable. Only very new lathes have it. The VQDAT variable is old and is in E, U, and P controls. I did find two different P200 controls the other day at a customer that the VQDAT resets on power up vs being a cumulative count. We ended up having to use a common variable to set the date in the output.

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...