Good afternoon all. I'm a complete "newby" when it comes to probing and macro programming but have been given the task as a CNC programmer to adjust the taper and gage-point for a single part using off the shelf probe cycles from Renishaw and macro statements. More parts are to follow once I get the logic and format down.
I did receive some help from the Renishaw installation engineer which I greatly appreciate, but I am still have issues with the probe making the necessary adjustments. The gage point tolerance for the part is +/- .001" and the taper tolerance is +/- .040 (2 minutes 24 seconds).
The code shown below is after the CNC has made a preliminary cut and is now probing the taper to make the necessary adjustments.
I would appreciate it if someone with more experience than I review the attached code and critique the logic and math used and point me in the right direction.
Thanks.
%
O8004(3811 MID-CYCLE CHECK)
T01000
M06T01001
T11000
G0G28U0V0
G28W0
M35(C AXIS ON)
G28H0(REF C AXIS)
G28B0
G400B0J0.
G54X5.Y0Z5.
M74(PROBE ON)
G4X1.
(BEGIN RENISHAW MACROS)
(G65 P9314=PROTECTIVE MOVE CYCLE)
G65P9314X3.Y0Z1.F250.
G65P9314Z-.13188
G65P9311X1.6904Q.5
#800=#140
#810=#144
#810=[#810/2]
G65P9314Z-.3858
G65P9311X1.64165Q.5
#801=#140
G65P9314X5.Z5.
(TAPER CALC)
#802=.25392(SIDE B)
#803=[#800-#801](SIDE A)
#803=#803/2
#804=#803/#802
#804=[#804*1.004]
#805=ATAN[#804]
#805=#805*2(TAPER)
IF[#805GT18.104]GOTO100
(CALC TO INCREASE TAPER)
#806=[18.104-#805]
#806=[#806*.005]
#806=[#806*[-1]]
GOTO200
(CALC TO DECREASE TAPER)
N100
#806=[#805-18.104]
#806=[#806*.006]
N200
G0G28V0
G28U0
G28W0
M73(PROBE OFF)
/M00
#15011=[#15011+#810]
M99
%