CGiovannani
-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Posts posted by CGiovannani
-
-
Or rather, how do I do math with the points before they are printed with pfxout and pfyout?
guess I'm struggling to even ask the question haha
-
I guess what I'm asking is what the variables are called for points 1 and 2. I know what the math should look like.
-
Hello All,
This post is for an Okuma MV460-VE with a OSP-P300MA Controller.
I'm trying to write a custom probing cycle using one of the custom drill cycles in Mastercam 2021. I constantly have to write out by hand a program that probes the location of two dowel holes where one of them is 0,0 and the other is at some angle. The program then compares the actual measured angle to the nominal and makes a correction with work coordinate rotation.
I have written custom drilling cycles to use probing before, but I have never needed the points to make a calculation.
Where I'm stuck is how do I "get" the points inside of my custom drill cycle so that the post can calculate the angle between the points so that it can be posted out with the rest of the code?
Here is my hand written code:
(PROBE DATUM B - SET P1 WORK OFFSET)
(PROBE DATUM C - FIND ACTUAL ANGLE )(T32 - PROBE)
G116 T32
(STAGE NEXT TOOL HERE)M201 (LOOK AHEAD OFF)
(PROBE DATUM B - DIA 0.2502 - SET P1)
(POSITION PROBE)
G15 H1
G90 G00 X0.0 Y0.0
G56 HA G00 Z2.0
CALL O9832 (PROBE ON)
CALL O9810 PZ=-0.5 (PROTECTED MOVE INSIDE DATUM A HOLE)
CALL O9814 PD=0.2502 PS=1 (MEASURE DATUM A AND SET P1)
CALL O9810 PZ=0.25 (PROTECTED MOVE OUT OF HOLE)
CALL O9810 PX=9.0720 PY=3.7335 (PROTECTED MOVE TO DATUM C)(PROBE DATUM C - DIA 0.2502 - FIND ANGLE)
CALL O9810 PZ=-0.5 (PROTECTED MOVE INSIDE DATUM C HOLE)
CALL O9814 PD=0.2502 (MEASURE DATUM C POSTION)
CALL O9810 PZ=0.25 (PROTECTED MOVE OUT OF HOLE)
CALL O9833 (PROBE OFF)
VS120 = VS75 (STORE DATUM C X POSITION)
VS121 = VS76 (STORE DATUM C Y POSITION)(CALCULATE ACTUAL ANGLE)
VS122 = ATAN[VS76/VS75](CALCULATE CORRECTION AMOUNT)
VS123 = 22.369 - VS122IF[VS123 LT 0]NSKIP
VS124 = VS123(NEGATIVE ANGLE MATH)
NSKIP
VS124 = [VS123 + 360]
(ROTATE ENTIRE WORK COORDINATE SYSTEM)
G17 G11 X0.0 Y0.0 P=VS124M202 (LOOK AHEAD ON)
G30 P1
REST OF PROGRAM......
Here is the custom probe cycle I wrote that works ( it's probably sloppy but it works):
if drillcyc$ = 8, [ pcom_moveb probe_Dia = peck1$ tool_wear = peck2$ probe_zvalDepth = depth$ probe_Feed = feed probe_zvalRetract = refht$ noform_probeDia = peck1$ noform_Tool = peck2$ pbld, n$, "M201 (LOOK AHEAD OFF)", e$ pbld, n$,"(POSTION PROBE)", e$ pbld, n$, pxout, pyout, e$ pbld, n$, "CALL O9832 (Probe On)", e$ pbld, n$, "CALL O9810", *probe_zvalDepth, *probe_Feed, "(Protected Move to Bore Measurement Height)" e$ pbld, n$, "CALL O9814", *probe_Dia, "(Measure Diameter)", e$ pbld, n$, "VC120 = VS78", e$ pbld, n$, "CALL O9810", *probe_zvalRetract, *probe_Feed, "(Protected Move out)" e$ pbld, n$, "CALL O9833 (Probe Off)", e$ pbld, n$, *sg00, initht$, e$ pbld, n$, "(CALCULATE DIAMETER OFFSET ADJUST T",*noform_Tool,")", e$ pbld, n$, "VC121 = VC120 - ", *noform_probeDia, e$ pbld, n$, *tool_wear, "= [VC121/2] +", *tool_wear, e$ pbld, e$ pbld, n$, "M202 (LOOK AHEAD ON)", e$ #pcom_movea ] pcom_movea
Basically I just need to figure out how I can have the post calculate the "22.369 deg" in my hand written code and then I can figure out the rest.
Thanks for any help, I'm really scratching my head because I'm not a computer programmer by any means!!
How do I calculate an angle created by two points in a custom drill cycle?
in Post Processor Development Forum
Posted
But I need the nominal angle to be able to make a correction and I want the post to calculate it using the two points I select in MC.
(CALCULATE ACTUAL ANGLE)
VS122 = ATAN[VS76/VS75] <-------- Here I'm calculating the actual measured angle
(CALCULATE CORRECTION AMOUNT)
VS123 = 22.369 - VS122 <--------- Here I'm comparing it to the nominal angle - I want the post to come up with the 22.369 (using the two points selected in MC) on its own, but I don't know how to call the points without printing them (something other than pxout, pfout, pyout, pfyout, etc.
IF[VS123 LT 0]NSKIP
VS124 = VS123
(NEGATIVE ANGLE MATH)
NSKIP
VS124 = [VS123 + 360]
Is there a matrix or string or something of all the points that are selected for a particle drill cycle that you can pull from in the post?
Also a side note that this is an Okuma controller and G11 is the coordinate rotation G-code. It only works with a positive angle and can only rotate in the counter clockwise direction. The dowel holes could be in a negative or positive position in relation to the nominal angle.