lathe tool sensor setup , who's done it ?

More
2 years 9 months ago #292061 by endian
hello,

Ive already create dry program for my manual toolchange 4 direction tool probe... but not yet tested because I am out off the shop.. should it be working from you point of view?
Code:
o<m275> sub (master tool number) #<_toolNumberMaster> = 0 (axis reference number) #<_xAxisNumber> = 1 (#<_yAxisNumber> = 2) #<_zAxisNumber> = 3 (etc...) (tool orientation for probing directions) #<_toolOrientation1> = 1 #<_toolOrientation2> = 2 #<_toolOrientation3> = 3 #<_toolOrientation4> = 4 #<_toolOrientation5> = 5 #<_toolOrientation6> = 6 #<_toolOrientation7> = 7 #<_toolOrientation8> = 8 #<_toolOrientation9> = 9 (default probing stroke) #<_probingStrokeDefault> = 50.0 (calibration move off stroke) <_calibrationMoveOffStroke> = 0.5 (move off probe stroke) #<_moveOffProbeStroke> = 5.0 (reference value of axis - for lathe 1/2 of wanted value - X10 == D20) #<_xReference> =  24.0 (#<_yReference> = number here) #<_zReference> = 0.0 (tool orientation low limit) #<_toolOrientationLowLimit> = 1 (feed of probing) #<_roughtProbingSpeed> = 500.0 #<_finalProbingSpeed> = 10.0 (tool number) #<_toolNumber> = #5400 (tool orientation 1 - 9) #<_toolOrientation> = #5413 (axis in which probing) #<_probingAxis> = #<P> (aproximation lenght of probing stroke in UU) #<_probingStroke> = #<Q> (actual coordination system) #<_actualCoordSystem> = #5220 (probing order M275 P1 - Xprobing in default lenght uu) (probing order M275 P1 Q150 - Xprobing in 150uu) (probing order M275 P3 q80 - Zprobing in 80uu)          o108 if[#<_probingStroke> LE 0]         #<_probingStroke> = #<_probingStrokeDefault>     o108 endif              o110 if[#<_probingAxis> EQ #<_xAxisNumber> OR #<_probingAxis> EQ #<_zAxisNumber>]    (check if your probing order is right)         o120 if[#<_toolOrientation> GE #<_toolOrientationLowLimit>]    (check right configuration of tool table)                      G94             G91             G49             #<_actualCoordSystem> = #5220                           o130 if[#<_toolOrientation> EQ #<_toolOrientation1> OR #<_toolOrientation> EQ #<_toolOrientation2> OR #<_toolOrientation> EQ #<_toolOrientation6> OR #<_toolOrientation> EQ #<_toolOrientation5]                 #<_probingStroke> = #<_probingStroke>                 <_calibrationMoveOffStroke> = <_calibrationMoveOffStroke>             o130 elseif[#<_toolOrientation> EQ #<_toolOrientation3> OR #<_toolOrientation> EQ #<_toolOrientation4> OR #<_toolOrientation> EQ #<_toolOrientation8> OR #<_toolOrientation> EQ #<_toolOrientation7]                 #<_probingStroke> = -#<_probingStroke>                 <_calibrationMoveOffStroke> = -<_calibrationMoveOffStroke>             o130 else                 (#########################################call error for the lathe setup)                 #<P>=0                  #<Q>=0                  M2             o130 endif                                       o200 if[#<_toolNumber> GT #<_toolNumberMaster>] (check which number of tool are already inserted)                 o300 if[#<_probingAxis> EQ #<_xAxisNumber>](other tools then master)                     G38.2 X-#<_probingStroke> F#<_roughtProbingSpeed>                     G1 X<_calibrationMoveOffStroke>                     G38.2 X-#<_probingStroke> F#<_finalProbingSpeed>                     G0 X#<_moveOffProbeStroke>                     #<probingSuccesfull> = #5070                     o350 if[#<probingSuccesfull> EQ 1]                         #<axisActualProbeOffset> = #5061                         #<axisOffet> = [[#<axisActualProbeOffset> + #<_xReference>] * 2]                         G90                         G49 $                        G10 L1 P#<_toolNumber> X#<axisOffet>                     o350 else                         (#########################################call an error of probing )                                             (MSG,Probing in X direction error.)                         #<P>=0                          #<Q>=0                          M2                     o350 endif                 o300 elseif[#<_probingAxis> EQ #<_zAxisNumber>]                     G38.2 Z-#<_probingStroke> F#<_roughtProbingSpeed>                     G1 Z<_calibrationMoveOffStroke>                     G38.2 Z-#<_probingStroke> F#<_finalProbingSpeed>                     G0 Z#<_moveOffProbeStroke>                     #<probingSuccesfull> = #5070                     o360 if[#<probingSuccesfull> EQ 1]                                             #<axisActualProbeOffset> = #5063                         #<axisOffet> = [#<axisActualProbeOffset> + #<_zReference>]                         G90                         G49 $                        G10 L1 P#<_toolNumber> Z#<axisOffet>                     o360 else                         (#########################################call an error of probing )                                             (MSG,Probing in Z direction error.)                         #<P>=0                          #<Q>=0                          M2                     o360 endif                 o300 endif                                              o200 else                 o400 if[#<_probingAxis> EQ #<_xAxisNumber>]                (master tool reference setup for T0 - find to where probe is located)                     G38.2 X-#<_probingStroke> F#<_roughtProbingSpeed>                     G1 X<_calibrationMoveOffStroke>                     G38.2 X-#<_probingStroke> F#<_finalProbingSpeed>                     G0 X#<_moveOffProbeStroke>                     #<probingSuccesfull> = #5070                     o450 if[#<probingSuccesfull> EQ 1]                             G90                         G49                         G4 P0.5                         #<axisOffet> = [#<_xReference> * 2] $                        G10 L2 P#<_actualCoordSystem> X#<axisOffet>                     o450 else                         (#########################################call an error of probing )                                             (MSG,Probing in X direction error.)                         #<P>=0                          #<Q>=0                          M2                     o450 endif                                      o400 elseif[#<_probingAxis> EQ #<_zAxisNumber>]                     G38.2 Z-#<_probingStroke> F#<_roughtProbingSpeed>                     G1 Z<_calibrationMoveOffStroke>                     G38.2 Z-#<_probingStroke> F#<_finalProbingSpeed>                     G0 X#<_moveOffProbeStroke>                     #<probingSuccesfull> = #5070                     o460 if[#<probingSuccesfull> EQ 1]                                                 G90                         G49                         G4 P0.5                         #<axisOffet> = #<_zReference> $                        G10 L2 P#<_actualCoordSystem> Z#<axisOffet>                     o460 else                         (#########################################call an error of probing )                                             (MSG,Probing in Z direction error.)                         #<P>=0                          #<Q>=0                          M2                     o460 endif                                      o400 endif                 o200 endif         o120 else             (#########################################call an error of wrong configuration of tool table)             (MSG,Probing error. Wrong tool setup in the tooltable.)             #<P>=0              #<Q>=0              M2         o120 endif     o110 else         (#########################################call an error of wrong configuration of #<P> parameter in the macro MDI call)         (MSG,Probing error. Wrong macro call configuration.)         #<P>=0          #<Q>=0          M2     o110 endif #<P>=0  #<Q>=0  o<m275> endsub M30

I do no know have many conditions should be in the row or in the single expresion ... do you know it please?

regards

Please Log in to join the conversation.

Time to create page: 0.029 seconds
Powered by Kunena Forum