PDA

View Full Version : Looking for some code...


John Kugler
03-01-2006, 09:49 PM
Looking for some code. I'm trying to come up with a program to calibrate ring gages. Got everything I need but I would like to have the operator input the class and have the correct tolerances input into the report. Tech support helped, but I was not able to get right at it at the time and I seem to have forgotten most of it. :confused:

Thanks in advance.

John

kmcmm
03-01-2006, 11:41 PM
This may be a little cumbersom, but you could use an input comment along with the Select/End Select and Case/Case End flow control commands

TRD_racing
03-03-2006, 09:20 AM
John,

I have a program that will measure any size ring gage. We wrote it during our CAD++ training class. It requires some knowlege of variables but it works great. Sorry it took me so long to answer, this is my 1st time on the board. If you will send me your email address I will get back w/ you in a couple of days. I need to look for the program to email to you.

rjreyob@yahoo.com

Dale

Matthew D. Hoedeman
03-03-2006, 09:53 AM
Here is some code I have for measuring different sizes of a "tooling ball holding key", you enter the width of the key, it does the rest. You would need to put the variables in different places and different features, but it should help you get the idea:
C1 =COMMENT/INPUT,What size key, please, in METRIC
ASSIGN/V1 = C1.INPUT
ASSIGN/V2 = V1/2
ASSIGN/V3 = V2+3

AA1 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/0,0-V3,-15.7,1,0,0
ACTL/0,-8,-15.7,1,0,0
TARG/0,0-V3,-15.7,1,0,0
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 5


KEY01 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/2.5,0-V2,-15.7,0,-1,0
ACTL/2.5,-5,-15.7,0,-1,0
TARG/2.5,0-V2,-15.7,0,-1,0
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 5


I have heard that if you don't include the math operation in some versions it will give you incorrect nominals.

CORKSCREW
01-17-2008, 10:21 PM
Here's a code I wrote to check your rings. (it will work with pins also with the ID switched to OD) It assumes you have CAD++. (I'm sure you can make something similar work if you don't have auto features) It also assumes the ring will be relatively close to the same x,y and z each time you put a new ring down. (I'd do a manual on the 1st ring, then just put all the rest close to the same place, the initial prehit is very large to accomodate for different ring thicknesses and not placing it on zero. The program will automatically find then level the part regardless of dia., then enter the correct tolerance according to class. I only used x, y and z tolerances and only went to rings up to 2.51 dia, but you should be able to fill in the rest now that you have an example and by using the same code logic. You can also add more levels or use math functions to convert english to metric


PREHIT/ 0.5
RETRACT/ 0.5
MODE/DCC
C1 =COMMENT/INPUT,Enter diameter
ASSIGN/DIA = C1.INPUT
ASSIGN/RAD = C1.INPUT/2
RING_LOC =AUTO/CIRCLE, SHOWALLPARAMS=YES, SHOWHITS=NO
THEO/0,0,0,0,0,1,DIA
ACTL/0,0,0,0,0,1,2.5
TARG/0,0,0,0,0,1
THEO_THICKNESS = 0, RECT, IN, CIRCULAR, LEAST_SQR, ONERROR =
AUTO MOVE = NO, DISTANCE = 1, RMEAS = None, READ POS = NO, FIND HOLE = NO, REMEASURE = NO ,$
NUMHITS = 3, INIT = 0, PERM = 0, SPACER = 0, PITCH = 0 ,$
START ANG = 0, END ANG = 360, DEPTH = 0.25 ,$
ANGLE VEC = 1,0,0
A2 =ALIGNMENT/START,RECALL:A1, LIST= YES
ALIGNMENT/TRANS,XAXIS,RING_LOC
ALIGNMENT/TRANS,YAXIS,RING_LOC
ALIGNMENT/END
PNT1 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/RAD+.05,0,0,0,0,1
ACTL/1.3,0,0,0,0,1
TARG/RAD+.05,0,0,0,0,1
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 1
PNT2 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/-RAD-.05,0,0,0,0,1
ACTL/-1.3,0,0,0,0,1
TARG/-RAD-.05,0,0,0,0,1
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 1
PNT3 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/0,RAD+.05,0,0,0,1
ACTL/0,1.3,0,0,0,1
TARG/0,RAD+.05,0,0,0,1
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 1
PLN2 =FEAT/PLANE,RECT
THEO/0.03333,0.18333,0,0,0,1
ACTL/0,0.43333,0,0,0,1
CONSTR/PLANE,BF,PNT1,PNT2,PNT3,,
A3 =ALIGNMENT/START,RECALL:A2, LIST= YES
ALIGNMENT/LEVEL,ZPLUS,PLN2
ALIGNMENT/TRANS,ZAXIS,PLN2
ALIGNMENT/END
C2 =COMMENT/INPUT,Enter Tolerance
,1=X
,2=Y
,3=Z
IF/C1.INPUT<=.825
GOTO/SIZE1
END_IF/
IF/C1.INPUT<=1.51
GOTO/SIZE2
END_IF/
IF/C1.INPUT<=2.51
GOTO/SIZE3
END_IF/
SIZE1 =LABEL/
IF/C2.INPUT==1
ASSIGN/T = .00004
END_IF/
IF/C2.INPUT==2
ASSIGN/T = .00007
END_IF/
IF/C2.INPUT==3
ASSIGN/T = .0001
END_IF/
GOTO/SIZEFINAL
SIZE2 =LABEL/
IF/C2.INPUT==1
ASSIGN/T = .00006
END_IF/
IF/C2.INPUT==2
ASSIGN/T = .00009
END_IF/
IF/C2.INPUT==3
ASSIGN/T = .00012
END_IF/
GOTO/SIZEFINAL
SIZE3 =LABEL/
IF/C2.INPUT==1
ASSIGN/T = .00008
END_IF/
IF/C2.INPUT==2
ASSIGN/T = .00012
END_IF/
IF/C2.INPUT==3
ASSIGN/T = .00016
END_IF/
GOTO/SIZEFINAL
SIZEFINAL =LABEL/
PREHIT/ 0.05
RETRACT/ 0.05
RING =AUTO/CIRCLE, SHOWALLPARAMS=YES, SHOWHITS=NO
THEO/0,0,0,0,0,1,DIA
ACTL/0,0,0,0,0,1,2.5
TARG/0,0,0,0,0,1
THEO_THICKNESS = 0, RECT, IN, CIRCULAR, LEAST_SQR, ONERROR = NO ,$
AUTO MOVE = NO, DISTANCE = 1, RMEAS = None, READ POS = NO, FIND HOLE = NO, REMEASURE = NO ,$
NUMHITS = 25, INIT = 0, PERM = 0, SPACER = 0, PITCH = 0 ,$
START ANG = 0, END ANG = 360, DEPTH = 0.25 ,$
ANGLE VEC = 1,0,0
DIM LOC1= LOCATION OF CIRCLE RING UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=1.00 OUTPUT=BOTH
AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
D 2.50000 DIA T T 0.00000 0.00000 -#--
END OF DIMENSION LOC1

Good luck, hope it helps, let me know if you need further help. Some people post more questions to your questions than answers. It never ceases to amaze me how smart they want us to think they are and how unable others are when all most people need is a place to start and an example. I'm sure you can figure more out from this such as depths etc. If not, post again and maybe some will add something besides a question. If not, I will.

Vertman
01-18-2008, 04:29 AM
Are you saying you calibrate your setting rings on your CMM ??

What accuracy do you expect to get?

I use my setting rings to validate the CMM, not the other way round.

John Kugler
01-18-2008, 09:36 AM
Are you saying you calibrate your setting rings on your CMM ??

What accuracy do you expect to get?

I use my setting rings to validate the CMM, not the other way round.

At the time I was using a B&S PMC 1000. Most accurate machine out there. I was capable to .000008 inches. Man I miss that machine..:(

We weren't really calibrating them, we were just double checking our lab that did the calibrating for us.

Vertman
01-18-2008, 12:07 PM
At the time I was using a B&S PMC 1000. Most accurate machine out there. I was capable to .000008 inches. Man I miss that machine..:(

We weren't really calibrating them, we were just double checking our lab that did the calibrating for us.


Is that a contact cmm??

Thats two tenths of a micron.............

John Kugler
01-18-2008, 12:13 PM
Is that a contact cmm??

Thats two tenths of a micron.............

Yeah, it was really a Leitz machine, B&S bought them out and slapped a B&S sticker on the Leitz machines.

Machine is also different than anything else. Different head, probes, etc.
Had continuous scan capability, and ran Quindos, and PC-DMIS. Great for gears, worms, etc. Machine had it's own climate-controlled room, I could tell when too many people were too close to the machine...