G-Code Numbered and Named Parameters

testyourdesign

testyourdesign
@masso-support

I am working on a probing routine to find the center of a part or hole. I need a way to set parameters for the parts overall geometry and basic math to calculate the part center once the G38.2 positions are found. Does the Masso support Numbered Parameters and Basic Arithmetic Operations through G-Code?

Cheers, Stephen Brown
 

masso-support

MASSO Support
Staff member
there are no Numbered Parameters and Basic Arithmetic Operations and we plan to take care of this with our probing cycle additions.
 

testyourdesign

testyourdesign
Well that's a shame @masso-support. Those parameters are pretty standard on other CNC controls. I have some G-Code that made use of G38.2 with parameters #1001 thru #1005 and simple math to establish the center of a pocket or hole. Maybe you can make use of this G-Code for your additions.

N010 G90 G94 G17
N020 G20
N030 M05
N040 M09
N050 T0 M06
N060 G91
N070 G0 Z
N080 #1001=
N090 #1002=
N100 #1003=
N110 #1004=

N120 #1005=[/2.0 - #1004]
N130 G0 X#1001 Y#1002 (move above nominal hole center)
N140 G0 Z#1003 (move into hole - to be cautious, substitute G1 for G0 here)
N150 G38.2 X[#1001 + #1005] (probe +X side of hole)
N160 #1011=#5061 (save results)
N170 G0 X#1001 Y#1002 (back to center of hole)
N180 G38.2 X[#1001 - #1005] (probe -X side of hole)
N190 #1021=[[#1011 + #5061] / 2.0] (find pretty good X-value of hole center)
N200 G0 X#1021 Y#1002 (back to center of hole)
N210 G38.2 Y[#1002 + #1005] (probe +Y side of hole)
N220 #1012=#5062 (save results) N210 G0 X#1021 Y#1002 (back to center of hole)
N230 G38.2 Y[#1002 - #1005] (probe -Y side of hole)
N240 #1022=[[#1012 + #5062] / 2.0] (find very good Y-value of hole center)
N250 #1014=[#1012 - #5062 + [2 * #1004]] (find hole diameter in Y-direction)
N260 G0 X#1021 Y#1022 (back to center of hole)
N270 G38.2 X[#1021 + #1005] (probe +X side of hole)
N280 #1031=#5061 (save results)
N290 G0 X#1021 Y#1022 (back to center of hole)
N300 G38.2 X[#1021 - #1005] (probe -X side of hole)
N310 #1041=[[#1031 + #5061] / 2.0] (find very good X-value of hole center)
N320 #1024=[#1031 - #5061 + [2 * #1004]] (find hole diameter in X-direction)
N330 #1034=[[#1014 + #1024] / 2.0] (find average hole diameter)
N340 #1035=[#1024 - #1014] (find difference in hole diameters)
N350 G0 X#1041 Y#1022 (back to center of hole)
N360 M30
 
Top