Skip to content

Commit

Permalink
Updated mappings, added live tools
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Sep 6, 2021
1 parent 9ed4d6e commit 53052f3
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions Haas_Lathes_BIDC/Bechtel ST-20Y.cps
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ const NORTH = {
const KM50A = {
name: "KM50 Axial",
x: -12.9819,
z: -8.8234,
z: -11.9723,
sOffset: 0.0
};

Expand All @@ -550,7 +550,7 @@ const KM40A = {
const WBLOCK = {
name: "Wedge Block",
x: -20.8443,
z: -12.5006,
z: -12.0006,
sOffset: 0.0
};

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1263,14 +1283,17 @@ 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));

if (typeof measureTool.machineX == 'function') {
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("");
Expand Down

0 comments on commit 53052f3

Please sign in to comment.