Skip to content

Commit

Permalink
Ball Nose Fix + Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Aug 19, 2021
1 parent c27d266 commit 9a31954
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Haas_Gantry_BIDC/Bechtel SR.cps
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ const LEN_DIA_ROT = 3;
const DEFAULT_HAAS_K_FACTOR = 0.05;
const NULL_HAAS_K_FACTOR = 0;

const CLEARANCE_HEIGHT = 1;
const CLEARANCE_HEIGHT = .1;
const LENGTH_TOLERANCE = .25;
const DIAM_TOLERANCE = .01;

Expand Down Expand Up @@ -679,14 +679,14 @@ function prepareForToolCheck() {

function BIDCWriteToolMeasureBlock(tool, rotating) {
writeBlock(gFormat.format(43), hFormat.format(tool.number));
if (rotating) {
if (rotating && tool.type != HAAS_BALL_NOSE) {
writeBlock(gFormat.format(59), gFormat.format(0), xOutput.format(-tool.diameter/2), yOutput.format(0));
} else {
writeBlock(gFormat.format(59), gFormat.format(0), xOutput.format(0), yOutput.format(0));
}
writeBlock(mFormat.format(0));
writeComment("TOOL PROBING");
writeBlock(gFormat.format(83));
writeBlock(mFormat.format(83));
writeBlock(gFormat.format(4), "P1.");
writeBlock(mFormat.format(84));
if (rotating) {
Expand All @@ -701,6 +701,7 @@ function BIDCWriteToolMeasureBlock(tool, rotating) {
writeBlock(gAbsIncModal.format(91), gFormat.format(0), zOutput.format(.1), feedOutput.format(100));
onCommand(COMMAND_STOP_SPINDLE);
writeRetract(Z);
writeRetract(X, Y);
}

function writeToolMeasureBlock(tool, preMeasure) {
Expand Down Expand Up @@ -922,7 +923,7 @@ function onOpen() {
writeRetract(Z);
// writeBlock(gFormat.format(53), gFormat.format(0), xOutput.format(TOOL_CHANGE_X), yOutput.format(TOOL_CHANGE_Y));
// writeBlock(mFormat.format(0), formatComment("Load Tool " + tool.number)); //Pause until operator loads tool
BIDCWriteToolMeasureBlock(tool, probeType != 2);
BIDCWriteToolMeasureBlock(tool, probeType != LEN_NON_ROT);
// writeToolMeasureBlock(tool, true);
writeln("")
} else {
Expand Down Expand Up @@ -1754,6 +1755,7 @@ function onSection() {

// retract to safe plane
writeRetract(Z);
writeRetract(X, Y);
writeBlock(gAbsIncModal.format(90));
zOutput.reset();

Expand Down

0 comments on commit 9a31954

Please sign in to comment.