Skip to content

Commit

Permalink
KM40 Mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Aug 23, 2021
1 parent d60d17c commit 0b3d508
Showing 1 changed file with 70 additions and 20 deletions.
90 changes: 70 additions & 20 deletions Haas_Lathes_BIDC/Bechtel ST-20Y.cps
Original file line number Diff line number Diff line change
Expand Up @@ -578,41 +578,91 @@ function getCompleteTool(holder, tool) {
tool.threadPitch = toolSection.getParameter("operation:tool_threadPitch")

if (holder == KM50R || holder == WBLOCK) {
switch (tool.type) {
case TOOL_TURNING_GROOVING:
var kmZ = function() {
return holder.z + tool.shankWidth;
}
var wbZ = function() {
return holder.z + (.5*tool.shankWidth);
}
// Defaults
this.probeX = function() {
return holder.x = tool.holderOverallLength*2;
}

this.probeX = function() {
return holder.x = tool.holderOverallLength*2;
}
if (tool.type == TOOL_TURNING_GROOVING) {
var kmZ = function() {
return holder.z + tool.shankWidth;
}
var wbZ = function() {
return holder.z + (.5*tool.shankWidth);
}

this.probeZ = holder == KM50R ? kmZ : wbZ;
return;
default:
this.probeZ = (holder == KM50R) ? kmZ : wbZ;
return;
} else {
var leftHandZ = function() {
return holder.z - tool.cuttingWidth + (.5*tool.shankWidth);
};
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;
this.probeZ = (tool.hand == 'L') ? leftHandZ : rightHandZ;
}

} else if (holder == KM50A || holder == RBLOCKY) {
var defaultX = function() {
return holder.x - (tool.cuttingWidth*2);
}

var defaultZ = function() {
return holder.z + tool.holderOverallLength;
}

if (getHaasToolTypeBIDC(tool.type) == HAAS_DRILL) {
var stanProbeX = function() {
return holder.z - PROBE_CENTERING_OFFSET;
}
var indexProbeX = function() {
return holder.x + (.3*tool.diameter) - PROBE_CENTERING_OFFSET;
}
var stanProbeZ = function() {
return holder.z + (tool.getBodyLength() + tool.getHolderLength());
}
var indexProbeZ = function() {
return holder.z + tool.getBodyLength() + tool.getHolderLength() + holder.sOffset;
}

this.offsetType = (tool.numberOfFlutes != 1) ? "General Drill" : "Indexable Drill";
this.probeZ = (tool.numberOfFlutes != 1) ? stanProbeZ : indexProbeZ;
this.probeX = (tool.numberOfFlutes != 1) ? stanProbeX : indexProbeX;
this.machineX = function() {
return holder.z;
}
return;
}

if (tool.type == TOOL_TURNING_THREADING) {
this.probeX = function() {
return holder.x - (tool.cuttingWidth - (.5*tool.shankWidth));
}
}

} else if (holder == KM40R) {
this.probeX = function() {
return holder.x + (tool.getBodyLength() + tool.getHolderLength())*2
}
this.probeZ = function() {
return holder.z - PROBE_CENTERING_OFFSET;
}
this.machineZ = function() {
return holder.z;
}

} else if (holder == KM40A) {
this.probeX = function() {
return holder.z - PROBE_CENTERING_OFFSET;
}
this.machineX = function() {
return holder.z;
}
this.probeZ = function() {
return holder.z + (tool.getBodyLength() + tool.getHolderLength())*2
}
} else {
throw "TOOL: " + tool.number + ", INVALID HOLDER"
}
Expand Down

0 comments on commit 0b3d508

Please sign in to comment.