Hello, I use Mach 4 on two machines. I have a problem with tool diameter compensation. In mach4, tool diameter correction can be entered in two ways:
Format 1: G00 / G01 G41 / G42 D__ X__ Y__ F__
Format 2: G00 / G01 G41 / G42 P__ X__ Y__ F__
Format 1 uses D to determine the tool diameter from the tool table.
Format 2 uses P to specify the tool radius (P5, P8, ...)
The point is that the Postprocessor for Mach 4 generates P, and I need to generate D with the appropriate tool number. When there is P in the program, I cannot edit tool corrections in the machine.
Can you help me ? Thank you in advance.
Solved! Go to Solution.
Solved by seth.madore. Go to Solution.
So you want it to post out:
T1M6
G43H1
G1G41X__Y__D1
Is the above correct?
So, it's going to take a couple small edits. The changes that I've listed below are from a STOCK Mach4 post, so it may differ slightly if you are running any changes
At line 118, we are going to change this:
var pFormat = createFormat({prefix:"P", decimals:(unit == MM ? 3 : 4), scale:0.5});
to this:
var pFormat = createFormat({prefix:"D", decimals:0});
And then we are going to scroll all the way down to line 1234 and 1238
and change the cutter comp sections from:
writeBlock(gMotionModal.format(1), gFormat.format(41), x, y, z, f, pOutput.format(tool.diameter));
to:
writeBlock(gMotionModal.format(1), gFormat.format(41), x, y, z, f, pOutput.format(tool.number));
@seth.madore wrote:
So, it's going to take a couple small edits. The changes that I've listed below are from a STOCK Mach4 post, so it may differ slightly if you are running any changes
At line 118, we are going to change this:
var pFormat = createFormat({prefix:"P", decimals:(unit == MM ? 3 : 4), scale:0.5});to this:
var pFormat = createFormat({prefix:"D", decimals:0});And then we are going to scroll all the way down to line 1234 and 1238
and change the cutter comp sections from:
writeBlock(gMotionModal.format(1), gFormat.format(41), x, y, z, f, pOutput.format(tool.diameter));to:
writeBlock(gMotionModal.format(1), gFormat.format(41), x, y, z, f, pOutput.format(tool.number));
Seth. don't forget the other bit
case RADIUS_COMPENSATION_RIGHT:
dOutput.reset();
writeBlock(gMotionModal.format(1), gFormat.format(42), x, y, z, dOutput.format(d), f );
break;
default:
writeBlock(gMotionModal.format(1), gFormat.format(40), x, y, z, f);
Taken from my PP for Mach 4