diff --git a/Haas_Lathes_BIDC/Bechtel ST-20Y.cps b/Haas_Lathes_BIDC/Bechtel ST-20Y.cps index 81d9ec0..1ef6de3 100644 --- a/Haas_Lathes_BIDC/Bechtel ST-20Y.cps +++ b/Haas_Lathes_BIDC/Bechtel ST-20Y.cps @@ -517,26 +517,47 @@ const NORTH = { name: "NORTH" }; -const WHOLD = { - name: "Wedge Holder", - x: -24.8094, - z: -13.2233, +const KM50A = { + name: "KM50 Axial", + x: -12.9819, + z: -8.8234, sOffset: 0.0 }; -const SRBLOCK = { - name: "Small Round Block", - x: -15.5690, - z: -12.4896, - sOffset: 0.5 -} +const KM40A = { + name: "KM40 Axial", + x: -15.1809, + z: -10.8315, + sOffset: 0.0 +}; -const LRBLOCK = { - name: "Large Round Block", - x: -15.5690, - z: -12.4896, +const WBLOCK = { + name: "Wedge Block", + x: -20.8443, + z: -12.5006, + sOffset: 0.0 +}; + +const KM50R = { + name: "KM50 Radial", + x: -15.3367, + z: -11.9843, + sOffset: 0.0 +}; + +const KM40R = { + name: "KM40 Radial", + x: -16.4433, + z: -14.7289, + sOffset: 0.0 +}; + +const RBLOCKY = { + name: "Round Block", + x: -15.1838, + z: -11.7061, sOffset: 0.74 -} +}; function getCompleteTool(holder, tool) { var toolSection; @@ -556,85 +577,44 @@ function getCompleteTool(holder, tool) { tool.holderOverallLength = toolSection.getParameter("operation:tool_holderOverallLength"); tool.threadPitch = toolSection.getParameter("operation:tool_threadPitch") - if (holder == WHOLD) { + if (holder == KM50R || holder == WBLOCK) { switch (tool.type) { case TOOL_TURNING_GROOVING: - this.offsetType = "Grooving"; - this.probeX = function() { - return holder.x + (tool.holderOverallLength*2); - }; - this.probeZ = function() { - return holder.z + (tool.shankWidth*.5); - }; - - return; - default: - this.offsetType = "General Turning"; - this.probeX = function() { - return holder.x + (tool.holderOverallLength*2); - }; - if (tool.hand == 'L') { - this.probeZ = function() { - return holder.z - tool.cuttingWidth + (tool.shankWidth*.5); - }; - } else { - this.probeZ = function() { - return holder.z + tool.cuttingWidth - (tool.shankWidth*.5); - }; + var kmZ = function() { + return holder.z + tool.shankWidth; } - } - } else { - switch (tool.type) { - case TOOL_DRILL: - case TOOL_DRILL_CENTER: - case TOOL_DRILL_SPOT: - case TOOL_COUNTER_BORE: - case TOOL_COUNTER_SINK: - case TOOL_MILLING_CHAMFER: - if (tool.numberOfFlutes != 1) { - this.offsetType = "General Drilling"; - this.probeX = function() { - return holder.x - PROBE_CENTERING_OFFSET; - }; - this.machineX = function() { - return holder.x; - } - this.probeZ = function() { - return holder.z + (tool.getBodyLength() + tool.getHolderLength()); - }; - return; + var wbZ = function() { + return holder.z + (.5*tool.shankWidth); } - this.offsetType = "Indexible Drill"; - this.probeX = function() { - return holder.x + tool.diameter*.3 - PROBE_CENTERING_OFFSET; - }; - this.machineX = function() { - return holder.x; - }; - this.probeZ = function() { - return holder.z + (tool.getBodyLength() + tool.getHolderLength() + holder.sOffset); - }; - return; - case TOOL_TURNING_THREADING: - this.offsetType = "Threading"; this.probeX = function() { - return holder.x - (2*(tool.cuttingWidth) - tool.shankWidth); - }; - this.probeZ = function() { - return holder.z + tool.holderOverallLength + holder.sOffset; - }; + return holder.x = tool.holderOverallLength*2; + } + + this.probeZ = holder == KM50R ? kmZ : wbZ; return; - default: - this.offsetType = "General Turning" - this.probeX = function() { - return holder.x - (tool.cuttingWidth*2); + var leftHandZ = function() { + return holder.z - tool.cuttingWidth + (.5*tool.shankWidth); }; - this.probeZ = function() { - return holder.z + tool.holderOverallLength + holder.sOffset; + var rightHandZ = function() { + return holder.z + tool.cuttingWidth - (.5*tool.shankWidth); }; + + this.probeX = function() { + return holder.x = tool.holderOverallLength*2; + } + + this.probeZ = tool.hand == 'L' ? leftHandZ : rightHandZ; } + } else if (holder == KM50A || holder == RBLOCKY) { + + } else if (holder == KM40R) { + + } else if (holder == KM40A) { + + } else { + throw "TOOL: " + tool.number + ", INVALID HOLDER" } } @@ -1150,21 +1130,22 @@ function getToolHolderBIDCST20(toolNum) { switch (toolNum) { case 1: case 2: + return KM50A; case 3: case 4: - case 5: + return WBLOCK; case 6: case 7: + return KM50R; case 8: - return WHOLD; case 9: - case 12: - return SRBLOCK; + return RBLOCKY; case 10: - case 11: - return LRBLOCK; + return KM40R; + case 12: + return KM40A; default: - throw "INVALID ST20 TOOL NUMBER. RANGE 1-12" + throw "INVALID ST20Y TOOL NUMBER: " + tool.number; } }