From f3bf1c7e8f21c4d99bb378773ac92bf4a00851da Mon Sep 17 00:00:00 2001 From: will1742 Date: Thu, 24 Jun 2021 16:52:17 -0400 Subject: [PATCH] Shell Mill Probing Granularity --- Haas_Next_Generation/haas vf2.cps | 36 +++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 65f8421..e5edf9b 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -8,6 +8,9 @@ $Date: 2021-06-01 08:35:38 $ FORKID {DBD402DA-DE90-4634-A6A3-0AE5CC97DEC7} + + Modified by BIDC of Purdue University + Authors: Gavin Williams (will1742@purdue.edu) */ // >>>>> INCLUDED FROM ../../../haas next generation.cps @@ -667,23 +670,43 @@ function getHaasToolType(toolType) { } } -function getHaasProbingType(toolType, use9023) { - switch (getHaasToolType(toolType)) { + +// 06/24/21 | Gavin Williams | will1742 +// 002 Improved Probing +// Added case for shell mills +// Added improved 9023 compatibility +function getHaasProbingType(tool, use9023) { + var probeType; + switch (getHaasToolType(tool.type)) { case 3: + probeType = ((tool.taperAngle > 0) ? 1 : 3); + break; case 4: - return (use9023 ? 23 : 1); // rotate + probeType = 1; // rotate + break; case 1: case 2: case 5: case 6: case 7: - return (use9023 ? 12 : 2); // non rotate + probeType = 2; // non rotate + break; case 0: - return (use9023 ? 13 : 3); // rotate length and dia + probeType = 3; // rotate length and dia + break; default: error(localize("Invalid HAAS tool type.")); return -1; } + + if (use9023) { + if (probeType == 2 || probeType == 3){ + return probeType + 10; + } + return 23; + } + + return probeType; } function writeToolCycleBlock(tool) { @@ -732,7 +755,7 @@ function writeToolMeasureBlock(tool, preMeasure) { "P9995", "A0.", "B" + getHaasToolType(tool.type) + ".", - "C" + getHaasProbingType(tool.type, false) + ".", + "C" + getHaasProbingType(tool, false) + ".", "T" + toolFormat.format(tool.number), "E" + xyzFormat.format(tool.bodyLength + tool.holderLength), "D" + xyzFormat.format(tool.diameter), @@ -1150,6 +1173,7 @@ function onOpen() { writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool writeBlock(mFormat.format(0), formatComment("Load Tool")); //Pause until operator loads tool writeToolMeasureBlock(tool, true); + // TODO WHATISBOOL } else { writeToolCycleBlock(tool); }