I can use MDI and an M6 Txx command to swap tools all day long and it always correctly keeps the part Z0 where it should be regardless of tool used as the macro does the maths. I seem to have a problem when using multiple tools in Intercon postprocessed programmes though and I can't understand the reason.
When intercon posts a CAM file I've put together it seems to apply a G49 before the tool change, homes Z with M25, calls the M6 macro for the new tool, that runs through the macro and I can see the WCS #54 Z value change to the correct value when the touch off is touched the second (slow) time. The spindle then retracts, starts spinning, turns coolant on, waits 3 seconds, then before anything moves the WCS #54 Z value jumps/is reconfigured and is now wrong. Here below is a sample of code from intercon.
I don't understand what is causing this reference in the Z to change, or why the G43 is written with a Dxx value by intercon. G43 is supposed to be a height offset, not a diameter function, and in the above its a drill cycle so it shouldn't care about diameters anyway? If I go through the G-code file and change all the G43 Dxx lines to G43 Hxx, with all my library H values set to zero, it works fine. The H7 in the above example does get written by Intercon on the next movement line, N0033 in the above example but the Z ref is already changed to a wrong value by then so I have to stop the cycle before it drives the tool into the job. Why is the H7 automatically written after movements are called, or why is it called at all if it wasn't chosen in the toolchange line?; ; --- Drill ---
N0030 X-68.0 Y-68.0 Z2.54
G81 X-68.0 Y-68.0 Z-12.0 R2.5 F30.0
G80
; --- Tool #7 ---
;Tool Diameter = 10.0000 Spindle Speed = 700
;dia 10mm drill
G49 H0 M25
G0 X0.0 Y0.0
N0031 T7 M6
F30.0 S700 M3
M8
G4 P3.00 ; pause for dwell
G43 D7
; --- Comment ---
N0032 ; dia 10mm holes
; --- Drill ---
N0033 X-128.0 Y-90.0 Z2.54 H7
G81 X-128.0 Y-90.0 Z-26.0 R2.5 F30.0
G80
Could someone explain the logic of what is going on here with the intercon and post processor?
Here is the icn file:
and here is the full cnc file created by CNC12:
Report is attached if it is any use