0 BEGIN PGM 8245_EN MM 1 ;NC program for ascertaining compensation 2 ;values for the 3D-ToolComp option 3 ;(Option 92) with the touch probe, and 4 ;writing them in the 3DTC table. 5 ;You need to create the table and insert 6 ;the number of required lines before 7 ;running the program. In the Angle column 8 ;you define the angular values where the 9 ;control measures the radius. 10 ;Define the path of the table in 11 ;the FN 26 function. 12 ;At the beginning of the program, the 13 ;control calls a NC program which mills 14 ;a 5 mm radius on a workpiece edge. 15 ;Subsequently, the control measures points 16 ;on the radius with Cycle 444. 17 ;To do this, the control first reads the 18 ;defined angle in the table, and then 19 ;calculates the coordinates and the normal 20 ;vectors for the measuring points from this. 21 ;Note that before measuring with Cycle 444, 22 ;the touch probe needs to be calibrated 23 ;in 3-D with Cycle 460! 24 ;The control writes the measured 25 ;compensation value into the table. 26 ;The control skips the program section for 27 ;measuring and writing during Block Scan 28 ;and Test Run in order to avoid writing 29 ;incorrect values. 30 ;When all points have been measured and the 31 ;values have been written into the table, 32 ;the control jumps to the end of the 33 ;program. In the example program, two other 34 ;NC programs are called now. In the first 35 ;program, the control finishes another piece 36 ;of the 5 mm radius on the workpiece edge. 37 ;Please note that the compensation value 38 ;table is assigned to the finishing tool. 39 ;In the subsequent NC program the control 40 ;measures points on the radius again so you 41 ;can check if the compensation is effective 42 ;based on the measuring log. 43 ; 44 BLK FORM 0.1 Z X-50 Y+0 Z-50 45 BLK FORM 0.2 X+0 Y+50 Z+0 46 ; 47 ;Program call to mill the radius 48 CALL PGM 82451_en.h 49 ; 50 ;Open the table into which the measurement 51 ;results are written 52 FN 26: TABOPEN TNC:\system\3D-ToolComp\TAB_8245.3DTC 53 ; 54 ;Input parameters QL20 = 0 ;FIRST LINE OF THE TABLE QL21 = 8 ;NUMBER OF LINES IN THE TABLE QL22 = 5 ;RADIUS TO BE MEASURED QL2 = 3 ;MEASURING POINTS IN THE Y AXIS 55 ;End of parameter input 56 ; 57 ;Calculations QL23 = QL21 - 1 ;Number of repeats 58 ;End of calculations 59 ; 60 ;Reset the tilting of the working plane 61 PLANE RESET STAY 62 ;Retract tool 63 M140 MB MAX 64 ; 65 ;Tool call for touch probe 66 TOOL CALL "TOUCH_PROBE" Z S11 67 ; 68 ;Tilt the working plane into position 69 PLANE SPATIAL SPA+0 SPB+0 SPC+0 TURN MB MAX FMAX SEQ- 70 ; 71 ;Pre-position 72 L X+0 Y+0 R0 FMAX 73 L Z+25 R0 FMAX 74 ; 75 ;Repetition 76 LBL "REPETITION" 77 ;Subprogram call: CALC 78 CALL LBL "CALC" 79 ;Subprogram call: PROBE 80 CALL LBL "PROBE" 81 ;Call: repeat 82 CALL LBL "REPETITION" REPQL23 83 ; 84 ;Go to end of program 85 FN 9: IF +0 EQU +0 GOTO LBL "End" 86 ; 87 ;Subprogram: measuring 88 LBL "PROBE" 89 FN 18: SYSREAD QL40 = ID992 NR10 ;Check if block scan is active 90 FN 9: IF +QL40 EQU +1 GOTO LBL "JUMP" ;Perform jump if block scan is active 91 FN 18: SYSREAD QL41 = ID992 NR16 ;Check if simulation is active 92 FN 9: IF +QL41 EQU +0 GOTO LBL "JUMP" ;Perform jump if simulation is active 93 TCH PROBE 444 PROBING IN 3-D ~ Q263=+QL1 ;1ST POINT 1ST AXIS ~ Q264=+QL2 ;1ST POINT 2ND AXIS ~ Q294=+QL3 ;1ST POINT 3RD AXIS ~ Q581=+QL11 ;NORMAL IN REF. AXIS ~ Q582=+QL12 ;NORMAL IN MINOR AXIS ~ Q583=+QL13 ;NORMAL IN TOOL AXIS ~ Q320=+2 ;SET-UP CLEARANCE ~ Q260=+25 ;CLEARANCE HEIGHT ~ QS400="0.015-0.015" ;TOLERANCE ~ Q309=+0 ;ERROR REACTION QL50 = - Q164 ;Convert a measurement result into a compensation value 94 FN 27: TABWRITE QL20 /"DR2" = QL50 ;Write compensation value into table QL20 = QL20 + 1 ;Increment the number of the line 95 ;Label for skipping the measurement 96 LBL "JUMP" 97 LBL 0 98 ;Calculate subprogram 99 LBL "CALC" 100 FN 28: TABREAD QL60 =QL20 /"ANGLE" ;Read angle from table QL61 = ( SIN QL60 ) * QL22 ;Calculate X coordinate of point QL1 = - QL22 + QL61 ;Calculate X coordinate of point QL62 = COS QL60 * QL22 ;Calculate Z coordinate of point QL3 = - QL22 + QL62 ;Calculate Z coordinate of point QL11 = SIN QL60 * 1 ;Calculate normal in reference axis QL12 = 0 ;Define normal in minor axis QL13 = COS QL60 * 1 ;Calculate normal in tool axis 101 LBL 0 102 ; 103 ;End of program 104 LBL "End" 105 ;Call NC program for compensated surface 106 CALL PGM 82452_en.h 107 ;Call NC program for measuring 108 CALL PGM 82453_en.h 109 M129 M9 110 M30 111 END PGM 8245_EN MM