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:

Averages


Recommended Posts

Ok Guys,

Here's a stumper for me.

I have this post I am working on for our Toshiba Tue VTL's. I am trying to create custom probe routines. One routine we do is take probe points along the face of a part and average out the stock. We do this with Cast Iron Parts that have surfaces that don't get machined. This way we are not too heavy on one side than another.

Anyways,

This is a sample of the Routine:

 

N12 G0G59X41.C30.

N13 Z.875

N14 G65P9831K2

N15 G65P9810Z-.735F100.

N16 G65P9811Z-1.235

N17 #596=#138<-------- this is the "count up". The #596 start number is specified in the custom parameters box in custom drill cycle. Then the post counts up the number by the points selected

N18 G65P9810Z.875

N19 G0C90.

N20 G65P9810Z-.735

N21 G65P9811Z-1.235

N22 #597=#138<-------this is the "count up". #597

N23 G65P9810Z.875

N24 G0C150.

N25 G65P9810Z-.735

N26 G65P9811Z-1.235

N27 #598=#138<--------this is the "count up".#598

N28 G65P9810Z.875

N29 G0C210.

N30 G65P9810Z-.735

N31 G65P9811Z-1.235

N32 #599=#138<---------this is the "count up".#599

N33 G65P9810Z.875

N34 G0C270.

N35 G65P9810Z-.735

N36 G65P9811Z-1.235

N37 #600=#138<---------this is the "count up".#600

N38 G65P9810Z.875

N39 G0C330.

N40 G65P9810Z-.735

N41 G65P9811Z-1.235

N42 #601=#138<---------this is the "count up".#601

N43 G65P9810Z.875

N44 #602=ABS[[#596+#597+#598+#599+#600+#601]/6]<------this is where it adds the variables then divides by the number of points(which I input in the custom para. area)

N45 IF[#602GT1.235]GOTO5000

N46 IF[#602LT1.235]GOTO5100

N47 IF[#602EQ1.235]GOTO5200

N5000 #700=[#602-1.235]

N49 #5322=[#5322-#700]

N50 GOTO5200

N5100 #700=[1.235-#602]

N52 #5322=[#5322+#700]

N53 GOTO5200

N5200

N55 #5222=#5322

N56 #5242=#5322

N57 #5262=#5322

N58 #5302=#5322

N59 #500=0

N60 G0Z5.

 

I was able to get the count up feature to work but now I have to use those values in determining the Average.

I can't make it permanent because the number of probe points is going to change from job to job.

Soo my question is, how do I create a formula for the line above which I will highlight in yellow.

Any help would be greatly appreciated guys.

Thanks,

Todd

Link to comment
Share on other sites

Set your number of probe points to be a variable, keep it away from your variable inputs

 

I might in the program have

 

#560=equal number of probe point

 

Then edit it to #560 = 6

 

#602=ABS[[#596+#597+#598+#599+#600+#601]/#560]<

 

I "think" that was what you were asking

Link to comment
Share on other sites

This way won't care what the count is;

 

#597=0

#598=0

.

.

#597 = #597 + #138

#598 = #598 + 1

.

.

.

#597 = #597 + #138

#598 = #598 + 1

.

.

.

#597 = #597 + #138

#598 = #598 + 1

.

.

.

#597 = #597 + #138

#598 = #598 + 1

.

.

.

#597 = #597 + #138

#598 = #598 + 1

.

.

.

#597 = #597 + #138

#598 = #598 + 1

.

.

.

#599 = ABS[#597/#598]

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