From 53052f386a405a67349158511d7a2a5c7d5db596 Mon Sep 17 00:00:00 2001 From: "Williams, Gavin J" Date: Mon, 6 Sep 2021 12:50:07 -0400 Subject: [PATCH] Updated mappings, added live tools --- Haas_Lathes_BIDC/Bechtel ST-20Y.cps | 47 +++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/Haas_Lathes_BIDC/Bechtel ST-20Y.cps b/Haas_Lathes_BIDC/Bechtel ST-20Y.cps index 351da16..8392f26 100644 --- a/Haas_Lathes_BIDC/Bechtel ST-20Y.cps +++ b/Haas_Lathes_BIDC/Bechtel ST-20Y.cps @@ -536,7 +536,7 @@ const NORTH = { const KM50A = { name: "KM50 Axial", x: -12.9819, - z: -8.8234, + z: -11.9723, sOffset: 0.0 }; @@ -550,7 +550,7 @@ const KM40A = { const WBLOCK = { name: "Wedge Block", x: -20.8443, - z: -12.5006, + z: -12.0006, sOffset: 0.0 }; @@ -664,28 +664,45 @@ function getCompleteTool(holder, tool) { this.offsetType = "General Turning"; this.probeX = defaultX; this.probeZ = defaultZ; + } else if (holder == KM40R) { - this.offsetType = "General Turning"; - this.probeX = function() { - return holder.x + (tool.getBodyLength() + tool.getHolderLength())*2 + var haasType = getHaasToolTypeBIDC(tool.type); + var millZ = function() { + return holder.z - (PROBE_CENTERING_OFFSET * 0.5) + (tool.diameter * 0.5); }; - this.probeZ = function() { - return holder.z - PROBE_CENTERING_OFFSET; + var drillZ = function() { + return holder.z - (PROBE_CENTERING_OFFSET * 0.5); }; + + this.offsetType = (haasType == HAAS_END_MILL) ? "Mill Probe" : "Drill Probe"; + this.probeZ = (haasType == HAAS_END_MILL) ? millZ : drillZ; this.machineZ = function() { return holder.z; }; + this.probeX = function() { + return holder.x + (tool.getBodyLength() + tool.getHolderLength())*2 + }; } else if (holder == KM40A) { this.offsetType = "General Turning"; - this.probeX = function() { - return holder.z - PROBE_CENTERING_OFFSET; - } + var haasType = getHaasToolTypeBIDC(tool.type); + var millX = function() { + return holder.x - PROBE_CENTERING_OFFSET + tool.diameter; + }; + var drillX = function() { + return holder.x - PROBE_CENTERING_OFFSET; + }; + + this.offsetType = (haasType == HAAS_END_MILL) ? "Mill Probe" : "Drill Probe"; + this.probeZ = (haasType == HAAS_END_MILL) ? millX : drillX; this.machineX = function() { return holder.x; } this.probeZ = function() { - return holder.z + (tool.getBodyLength() + tool.getHolderLength())*2 + return holder.z + tool.getBodyLength() + tool.getHolderLength() + } + if ((holder.z + tool.getBodyLength() + tool.getHolderLength()) >= 5.0){ + throw "TOOL LENGTH TOO LARGE" } } else { throw "TOOL: " + tool.number + ", INVALID HOLDER" @@ -1171,10 +1188,13 @@ var machineConfigurationSubSpindle; function getHaasToolTypeBIDC(toolType) { switch (toolType) { case TOOL_DRILL: + case TOOL_MILLING_END_BALL: return HAAS_DRILL; // drill case TOOL_MILLING_END_FLAT: case TOOL_MILLING_END_BULLNOSE: case TOOL_MILLING_TAPERED: + case TOOL_MILLING_FACE: + case TOOL_MILLING_SLOT: return HAAS_END_MILL; // end mill case TOOL_DRILL_SPOT: case TOOL_MILLING_CHAMFER: @@ -1263,6 +1283,9 @@ function writeToolMeasureBlockBIDC(tool) { writeMeasure("T" + toolFormat.format(tool.number * 100 + compensationOffset % 100)); writeComment("PROBE: " + measureTool.offsetType + ", " + probeType.name); writeMeasure(mFormat.format(104)); + if (measureTool.offsetType == "Mill Probe") { + writeMeasure(mFormat.format((tool.clockwise) ? 134 : 133), "P400"); + } writeMeasure(gFormat.format(212), "H" + probeType.num); writeMeasure(mFormat.format(105)); @@ -1270,7 +1293,7 @@ function writeToolMeasureBlockBIDC(tool) { writeMeasure(gFormat.format(10), "L10 P" + tool.number, xOffset.format(measureTool.machineX())); } if (typeof measureTool.machineZ == 'function') { - writeMeasure(gFormat.format(10), "L10 P" + tool.number, xOffset.format(measureTool.machineZ())); + writeMeasure(gFormat.format(10), "L10 P" + tool.number, zOffset.format(measureTool.machineZ())); } writeln("");