From f3bf1c7e8f21c4d99bb378773ac92bf4a00851da Mon Sep 17 00:00:00 2001 From: will1742 Date: Thu, 24 Jun 2021 16:52:17 -0400 Subject: [PATCH 01/10] 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); } From 3eb266fc577b2165c7101c55af28f4c05a8ec170 Mon Sep 17 00:00:00 2001 From: will1742 Date: Fri, 25 Jun 2021 09:36:09 -0400 Subject: [PATCH 02/10] 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); } From f2dab7600c01c206362eb6d5625be998a5eb1bc9 Mon Sep 17 00:00:00 2001 From: will1742 Date: Fri, 25 Jun 2021 13:02:01 -0400 Subject: [PATCH 03/10] Added Radius Case --- Haas_Next_Generation/haas vf2.cps | 1 + 1 file changed, 1 insertion(+) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index e5edf9b..1af0ac8 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -661,6 +661,7 @@ function getHaasToolType(toolType) { return 5; // center drill case TOOL_MILLING_END_BALL: case TOOL_MILLING_LOLLIPOP: + case TOOL_MILLING_RADIUS: return 6; // ball nose case TOOL_PROBE: return 7; // probe From 65bfee78e3b51d26a9398a2e285265d44ad239c1 Mon Sep 17 00:00:00 2001 From: will1742 Date: Fri, 25 Jun 2021 13:11:28 -0400 Subject: [PATCH 04/10] new tool type and probing type functions --- Haas_Next_Generation/haas vf2.cps | 64 ++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 1af0ac8..5b4f7e4 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -661,7 +661,6 @@ function getHaasToolType(toolType) { return 5; // center drill case TOOL_MILLING_END_BALL: case TOOL_MILLING_LOLLIPOP: - case TOOL_MILLING_RADIUS: return 6; // ball nose case TOOL_PROBE: return 7; // probe @@ -671,11 +670,11 @@ function 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)) { @@ -708,6 +707,67 @@ function getHaasProbingType(tool, use9023) { } return probeType; +};*/ + +function getHaasProbingType(toolType, use9023) { + switch (getHaasToolType(toolType)) { + case 3: + case 4: + return (use9023 ? 23 : 1); // rotate + case 1: + case 2: + case 5: + case 6: + case 7: + return (use9023 ? 12 : 2); // non rotate + case 0: + return (use9023 ? 13 : 3); // rotate length and dia + default: + error(localize("Invalid HAAS tool type.")); + return -1; + } +} + +function getHaasToolTypeBIDC(toolType) { + switch (toolType) { + case TOOL_DRILL: + case TOOL_REAMER: + return 1; // drill + case TOOL_TAP_RIGHT_HAND: + case TOOL_TAP_LEFT_HAND: + return 2; // tap + case TOOL_MILLING_FACE: + case TOOL_MILLING_SLOT: + case TOOL_BORING_BAR: + return 3; // shell mill + case TOOL_MILLING_END_FLAT: + case TOOL_MILLING_END_BULLNOSE: + case TOOL_MILLING_TAPERED: + case TOOL_MILLING_DOVETAIL: + return 4; // end mill + case TOOL_DRILL_SPOT: + case TOOL_MILLING_CHAMFER: + case TOOL_DRILL_CENTER: + case TOOL_COUNTER_SINK: + case TOOL_COUNTER_BORE: + case TOOL_MILLING_THREAD: + case TOOL_MILLING_FORM: + return 5; // center drill + case TOOL_MILLING_END_BALL: + case TOOL_MILLING_LOLLIPOP: + case TOOL_MILLING_RADIUS: + return 6; // ball nose + case TOOL_PROBE: + return 7; // probe + default: + error(localize("Invalid HAAS tool type.")); + return -1; + } +} + +function getHaasProbingTypeBIDC(toolType) { + //TODO + return -1; } function writeToolCycleBlock(tool) { From 16e88e97010a9d10b79aead6e3f7a71789b76b11 Mon Sep 17 00:00:00 2001 From: will1742 Date: Fri, 25 Jun 2021 16:56:50 -0400 Subject: [PATCH 05/10] Added new ProbingType function --- Haas_Next_Generation/haas vf2.cps | 106 ++++++++++++++++++++++++++---- 1 file changed, 92 insertions(+), 14 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 5b4f7e4..097d4bf 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -444,6 +444,22 @@ staticProperties = { singleResultsFile: true }; + const HAAS_DRILL = 1; + const HAAS_TAP = 2; + const HAAS_SHELL = 3; + const HAAS_END_MILL = 4; + const HAAS_CENTER = 5; + const HAAS_BALL_NOSE = 6; + const HAAS_PROBE = 7; + + const NO_PROBING = 0; + const LEN_ROT = 1; + const LEN_NON_ROT = 2; + const LEN_DIA_ROT = 3; + + const DEFAULT_HAAS_K_FACTOR = 0.05; + const NULL_HAAS_K_FACTOR = 0; + var singleLineCoolant = false; // specifies to output multiple coolant codes in one line rather than in separate lines // samples: // {id: COOLANT_THROUGH_TOOL, on: 88, off: 89} @@ -634,6 +650,8 @@ function writeComment(text) { /** Returns the matching HAAS tool type for the tool. */ + +// TODO FIX TOOL TYPE function getHaasToolType(toolType) { switch (toolType) { case TOOL_DRILL: @@ -710,7 +728,7 @@ function getHaasProbingType(tool, use9023) { };*/ function getHaasProbingType(toolType, use9023) { - switch (getHaasToolType(toolType)) { + switch (getHaasToolType(toolType.type)) { case 3: case 4: return (use9023 ? 23 : 1); // rotate @@ -732,19 +750,19 @@ function getHaasToolTypeBIDC(toolType) { switch (toolType) { case TOOL_DRILL: case TOOL_REAMER: - return 1; // drill + return HAAS_DRILL; // drill case TOOL_TAP_RIGHT_HAND: case TOOL_TAP_LEFT_HAND: - return 2; // tap + return HAAS_TAP; // tap case TOOL_MILLING_FACE: case TOOL_MILLING_SLOT: case TOOL_BORING_BAR: - return 3; // shell mill + return HAAS_SHELL; // shell mill case TOOL_MILLING_END_FLAT: case TOOL_MILLING_END_BULLNOSE: case TOOL_MILLING_TAPERED: case TOOL_MILLING_DOVETAIL: - return 4; // end mill + return HAAS_END_MILL; // end mill case TOOL_DRILL_SPOT: case TOOL_MILLING_CHAMFER: case TOOL_DRILL_CENTER: @@ -752,22 +770,82 @@ function getHaasToolTypeBIDC(toolType) { case TOOL_COUNTER_BORE: case TOOL_MILLING_THREAD: case TOOL_MILLING_FORM: - return 5; // center drill + return HAAS_CENTER; // center drill case TOOL_MILLING_END_BALL: case TOOL_MILLING_LOLLIPOP: case TOOL_MILLING_RADIUS: - return 6; // ball nose + return HAAS_BALL_NOSE; // ball nose case TOOL_PROBE: - return 7; // probe + return HAAS_PROBE; // probe default: error(localize("Invalid HAAS tool type.")); return -1; } } -function getHaasProbingTypeBIDC(toolType) { - //TODO - return -1; +// 06/25/21 | Gavin Williams | will1742 +// 002 Probing +function formatCNumber(probeType, use9023){ + if (use9023) { + if (probeType == LEN_NON_ROT || probeType == LEN_DIA_ROT){ + return probeType + 10; + } + return 23; + } + return probeType; +} + +function getHaasProbingTypeBIDC(tool, use9023) { + switch (getHaasToolTypeBIDC(tool.type)) { + case HAAS_PROBE: + return formatCNumber(NO_PROBING, use9023); + case HAAS_TAP: + case HAAS_DRILL: + return formatCNumber(LEN_NON_ROT, use9023); + case HAAS_CENTER: + if (tool.type == TOOL_MILLING_THREAD) { + return formatCNumber(LEN_DIA_ROT, use9023); + } + if (tool.type == TOOL_MILLING_FORM) { + return formatCNumber(NO_PROBING, use9023); + } + formatCNumber(LEN_NON_ROT, use9023); + case HAAS_END_MILL: + return formatCNumber((tool.type == TOOL_MILLING_TAPERED ? LEN_ROT : LEN_DIA_ROT), use9023); + case HAAS_BALL_NOSE: + return formatCNumber((tool.type == TOOL_MILLING_RADIUS ? LEN_ROT : LEN_DIA_ROT), use9023); + case HAAS_SHELL: + if ((tool.type == TOOL_MILLING_FACE) && (tool.taperAngle !=0)) { + return formatCNumber(LEN_ROT, use9023); + } + return formatCNumber(LEN_DIA_ROT, use9023); + default: + return -1; + } +} + +function getHaasKFactorBIDC(tool) { + switch (getHaasToolTypeBIDC(tool.type)) { + case HAAS_SHELL: + case HAAS_END_MILL: + // TODO: Add cases + return DEFAULT_HAAS_K_FACTOR; + case HAAS_BALL_NOSE: + if (tool.type == TOOL_MILLING_RADIUS) { + return NULL_HAAS_K_FACTOR; + } + return tool.diameter + DEFAULT_HAAS_K_FACTOR; + case HAAS_CENTER: + case HAAS_PROBE: + case HAAS_DRILL: + case HAAS_TAP: + if (tool.type == TOOL_MILLING_THREAD) { + return tool.getThreadPitch() + DEFAULT_HAAS_K_FACTOR; + } + return NULL_HAAS_K_FACTOR; + default: + return -1; + } } function writeToolCycleBlock(tool) { @@ -815,12 +893,12 @@ function writeToolMeasureBlock(tool, preMeasure) { gFormat.format(65), "P9995", "A0.", - "B" + getHaasToolType(tool.type) + ".", - "C" + getHaasProbingType(tool, false) + ".", + "B" + getHaasToolTypeBIDC(tool.type) + ".", + "C" + getHaasProbingTypeBIDC(tool, false) + ".", "T" + toolFormat.format(tool.number), "E" + xyzFormat.format(tool.bodyLength + tool.holderLength), "D" + xyzFormat.format(tool.diameter), - "K" + xyzFormat.format(0.1), + "K" + xyzFormat.format(getHaasKFactorBIDC(tool)), "I0.", comment ); // probe tool From cd03fee84032071d09aba74970653bb42aa9b2ca Mon Sep 17 00:00:00 2001 From: will1742 Date: Mon, 28 Jun 2021 10:24:38 -0400 Subject: [PATCH 06/10] Added cases for K Factor --- Haas_Next_Generation/haas vf2.cps | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 097d4bf..d2eadbd 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -809,7 +809,7 @@ function getHaasProbingTypeBIDC(tool, use9023) { if (tool.type == TOOL_MILLING_FORM) { return formatCNumber(NO_PROBING, use9023); } - formatCNumber(LEN_NON_ROT, use9023); + return formatCNumber(LEN_NON_ROT, use9023); case HAAS_END_MILL: return formatCNumber((tool.type == TOOL_MILLING_TAPERED ? LEN_ROT : LEN_DIA_ROT), use9023); case HAAS_BALL_NOSE: @@ -828,19 +828,24 @@ function getHaasKFactorBIDC(tool) { switch (getHaasToolTypeBIDC(tool.type)) { case HAAS_SHELL: case HAAS_END_MILL: - // TODO: Add cases - return DEFAULT_HAAS_K_FACTOR; + if (tool.type == TOOL_BORING_BAR || tool.type == TOOL_MILLING_END_FLAT) { + return DEFAULT_HAAS_K_FACTOR; + } + if (tool.type == TOOL_MILLING_FACE && tool.taperAngle != 0) { + return NULL_HAAS_K_FACTOR; + } + return DEFAULT_HAAS_K_FACTOR + tool.cornerRadius; case HAAS_BALL_NOSE: if (tool.type == TOOL_MILLING_RADIUS) { return NULL_HAAS_K_FACTOR; } - return tool.diameter + DEFAULT_HAAS_K_FACTOR; + return DEFAULT_HAAS_K_FACTOR + tool.diameter; case HAAS_CENTER: case HAAS_PROBE: case HAAS_DRILL: case HAAS_TAP: if (tool.type == TOOL_MILLING_THREAD) { - return tool.getThreadPitch() + DEFAULT_HAAS_K_FACTOR; + return DEFAULT_HAAS_K_FACTOR + tool.getThreadPitch(); } return NULL_HAAS_K_FACTOR; default: From fbf1b39985d1b5e80788a5f4e92617b2f5e7c88e Mon Sep 17 00:00:00 2001 From: will1742 Date: Mon, 28 Jun 2021 13:45:03 -0400 Subject: [PATCH 07/10] Using radius for K case --- Haas_Next_Generation/README.txt | 1 + Haas_Next_Generation/haas vf2.cps | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Haas_Next_Generation/README.txt b/Haas_Next_Generation/README.txt index da050fb..8e31c78 100644 --- a/Haas_Next_Generation/README.txt +++ b/Haas_Next_Generation/README.txt @@ -3,6 +3,7 @@ Changelog 06/14/21 Added media and QA 06/15/21 Check tool distance from stock, finalized QA 06/21/21 Tool probing required, tool probing now uses P9995 +06/28/21 Tool specific probing added, with cases for type of probing and k factor Function List: diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index d2eadbd..db75ad2 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -839,7 +839,7 @@ function getHaasKFactorBIDC(tool) { if (tool.type == TOOL_MILLING_RADIUS) { return NULL_HAAS_K_FACTOR; } - return DEFAULT_HAAS_K_FACTOR + tool.diameter; + return DEFAULT_HAAS_K_FACTOR + (tool.diameter/2); case HAAS_CENTER: case HAAS_PROBE: case HAAS_DRILL: @@ -877,7 +877,6 @@ function writeToolMeasureBlock(tool, preMeasure) { // var writeFunction = measureTool ? writeBlock : writeOptionalBlock; var writeFunction = writeBlock; var comment = measureTool ? formatComment("MEASURE TOOL") : ""; - if (!preMeasure) { prepareForToolCheck(); } From 9fa2a50b7de5000f8e0115937878f985030b5101 Mon Sep 17 00:00:00 2001 From: "Williams, Gavin J" Date: Mon, 28 Jun 2021 16:10:11 -0400 Subject: [PATCH 08/10] Altered Thread Mill Classification --- Haas_Next_Generation/haas vf2.cps | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index db75ad2..77a0ef0 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -762,13 +762,13 @@ function getHaasToolTypeBIDC(toolType) { case TOOL_MILLING_END_BULLNOSE: case TOOL_MILLING_TAPERED: case TOOL_MILLING_DOVETAIL: + case TOOL_MILLING_THREAD: return HAAS_END_MILL; // end mill case TOOL_DRILL_SPOT: case TOOL_MILLING_CHAMFER: case TOOL_DRILL_CENTER: case TOOL_COUNTER_SINK: case TOOL_COUNTER_BORE: - case TOOL_MILLING_THREAD: case TOOL_MILLING_FORM: return HAAS_CENTER; // center drill case TOOL_MILLING_END_BALL: @@ -803,9 +803,6 @@ function getHaasProbingTypeBIDC(tool, use9023) { case HAAS_DRILL: return formatCNumber(LEN_NON_ROT, use9023); case HAAS_CENTER: - if (tool.type == TOOL_MILLING_THREAD) { - return formatCNumber(LEN_DIA_ROT, use9023); - } if (tool.type == TOOL_MILLING_FORM) { return formatCNumber(NO_PROBING, use9023); } @@ -834,6 +831,9 @@ function getHaasKFactorBIDC(tool) { if (tool.type == TOOL_MILLING_FACE && tool.taperAngle != 0) { return NULL_HAAS_K_FACTOR; } + if (tool.type == TOOL_MILLING_THREAD) { + return DEFAULT_HAAS_K_FACTOR + tool.getThreadPitch(); + } return DEFAULT_HAAS_K_FACTOR + tool.cornerRadius; case HAAS_BALL_NOSE: if (tool.type == TOOL_MILLING_RADIUS) { @@ -844,9 +844,7 @@ function getHaasKFactorBIDC(tool) { case HAAS_PROBE: case HAAS_DRILL: case HAAS_TAP: - if (tool.type == TOOL_MILLING_THREAD) { - return DEFAULT_HAAS_K_FACTOR + tool.getThreadPitch(); - } + return NULL_HAAS_K_FACTOR; default: return -1; @@ -893,6 +891,7 @@ function writeToolMeasureBlock(tool, preMeasure) { ); } else { // use Macro P9995 to measure tools // writeFunction("T" + toolFormat.format(tool.number), mFormat.format(6)); // get tool + // TODO: fix tool type writeFunction( gFormat.format(65), "P9995", @@ -1312,6 +1311,7 @@ function onOpen() { } comment += " - " + getToolTypeName(tool.type); writeComment(comment); + writeComment(tool.description); if (staticProperties.measureToolsAtStart) { writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool writeBlock(mFormat.format(0), formatComment("Load Tool")); //Pause until operator loads tool From f4e956c40a5ffb8d0928272de5159edc92bc659b Mon Sep 17 00:00:00 2001 From: will1742 Date: Mon, 28 Jun 2021 16:43:49 -0400 Subject: [PATCH 09/10] Set number of flutes per tool --- Haas_Next_Generation/README.txt | 5 +++++ Haas_Next_Generation/haas vf2.cps | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/Haas_Next_Generation/README.txt b/Haas_Next_Generation/README.txt index 8e31c78..6ac065f 100644 --- a/Haas_Next_Generation/README.txt +++ b/Haas_Next_Generation/README.txt @@ -26,6 +26,10 @@ takeInput(prompt, options) any number of options can be input, sequenceNumbers will be adjusted to compensate +setMacro(macro, value, comment) + sets specified macro, adds inline comment + + General notes: - staticProperties is a dictionary containing all properties previously allowed to be altered by the user. @@ -33,3 +37,4 @@ General notes: - Some optional portions were commented out, specifically those associated with safe start. +- Macro references can be found on page 189 of the milling manual \ No newline at end of file diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 77a0ef0..74219d0 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -892,6 +892,7 @@ function writeToolMeasureBlock(tool, preMeasure) { } else { // use Macro P9995 to measure tools // writeFunction("T" + toolFormat.format(tool.number), mFormat.format(6)); // get tool // TODO: fix tool type + setMacro(1600 + tool.number, tool.numberOfFlutes, "Number of Flutes"); writeFunction( gFormat.format(65), "P9995", @@ -909,6 +910,13 @@ function writeToolMeasureBlock(tool, preMeasure) { measureTool = false; } +// 6/28/21 | Gavin Williams | will1742 +// 002 Improved Probing +// sets specified macro number with value +function setMacro(macro, value, comment) { + writeWords("#" + macro + "=" + value, "(" + comment + ")"); +} + function defineMachineModel() { var useTCPC = staticProperties.useTCPC; switch (staticProperties.machineModel) { From 30f4c415733db497ba29b5dd868a3436211f9038 Mon Sep 17 00:00:00 2001 From: will1742 Date: Tue, 6 Jul 2021 13:11:00 -0400 Subject: [PATCH 10/10] Added WCS verification --- Haas_Next_Generation/haas vf2.cps | 48 ++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 74219d0..6bf4ca8 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -414,7 +414,7 @@ staticProperties = { useDWO: true, safeStartAllOperations: true, preloadTool: true, - chipTransport: true, + chipTransport: false, optionalStop: true, separateWordsWithSpace: true, useRadius: false, @@ -441,7 +441,8 @@ staticProperties = { useM130PartImages: false, useM130ToolImages: false, coolantPressure: "", - singleResultsFile: true + singleResultsFile: true, + pencilWCSVerif: true }; const HAAS_DRILL = 1; @@ -1874,6 +1875,10 @@ function onManualNC(command, value) { var probeOutputWorkOffset = 1; var stockTopZ = -1; +var stockUpperX; +var stockLowerX; +var stockUpperY; +var stockLowerY; function onParameter(name, value) { if (name == "probe-output-work-offset") { @@ -1885,6 +1890,18 @@ function onParameter(name, value) { if (name == "stock-upper-z") { stockTopZ = value; } + if (name == "stock-upper-x") { + stockUpperX = value; + } + if (name == "stock-lower-x") { + stockLowerX = value; + } + if (name == "stock-upper-y") { + stockUpperY = value; + } + if (name == "stock-lower-y") { + stockLowerY = value; + } } var seenPatternIds = {}; @@ -2173,6 +2190,27 @@ function setAbsoluteMode(xyz, abc) { } function onSection() { + if (isFirstSection() && staticProperties.pencilWCSVerif) { + var stockMidX = (stockUpperX + stockLowerX)/2; + var stockMidY = (stockUpperY + stockLowerY)/2; + writeln(""); + writeComment("Verify WCS"); + writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool + writeBlock(gFormat.format(0), xOutput.format(stockMidX), yOutput.format(stockMidY)); + displayMedia("Net Share/Media/xyWCSCheck.png"); + writeBlock(mFormat.format(0), formatComment("Open door")); + displayMedia("Net Share/Media/arrowDown.png"); + var gotoRef = takeInput("Is the graphite probing device in the middle of the stock?", ['Y']); + writeWords("N" + nFormat.format(gotoRef['Y']), mFormat.format(131), formatComment("End Multimedia")); + writeBlock(gFormat.format(55), gFormat.format(43), hFormat.format(19), zOutput.format(stockTopZ)); + displayMedia("Net Share/Media/zWCSCheck.png"); + writeBlock(mFormat.format(0), formatComment("Open door")); + displayMedia("Net Share/Media/arrowDown.png"); + gotoRef = takeInput("Is the graphite probing device touching the stock?", ['Y']); + writeWords("N" + nFormat.format(gotoRef['Y']), mFormat.format(131), formatComment("End Multimedia")); + } + + var forceToolAndRetract = optionalSection && !currentSection.isOptional(); optionalSection = currentSection.isOptional(); @@ -2606,8 +2644,10 @@ function onSection() { writeComment("END VALIDATION SECTION"); // initialize spindle and engage coolant if heights are correct - writeBlock(mFormat.format((tool.clockwise ? 3 : 4)), formatComment("Restart spindle")); - setCoolant(tool.coolant); + if (tool.type != TOOL_PROBE) { + writeBlock(mFormat.format((tool.clockwise ? 3 : 4)), formatComment("Restart spindle")); + setCoolant(tool.coolant); + } // define subprogram subprogramDefine(initialPosition, abc, retracted, zIsOutput);