Skip to content

Commit

Permalink
Shell Mill Probing Granularity
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Jun 24, 2021
1 parent 4023ab2 commit f3bf1c7
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions Haas_Next_Generation/haas vf2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit f3bf1c7

Please sign in to comment.