Skip to content

Commit

Permalink
Fixed Probing Air Cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Aug 6, 2021
1 parent ddbab91 commit 0308758
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions Haas_Gantry_BIDC/Bechtel SR.cps
Original file line number Diff line number Diff line change
Expand Up @@ -681,19 +681,24 @@ function BIDCWriteToolMeasureBlock(tool, rotating) {
writeBlock(gFormat.format(43), hFormat.format(tool.number));
if (rotating) {
writeBlock(gFormat.format(59), gFormat.format(0), xOutput.format(-tool.diameter/2), yOutput.format(0));
writeBlock(sOutput.format(400), mFormat.format(!tool.clockwise ? 3 : 4));
} else {
writeBlock(gFormat.format(59), gFormat.format(0), xOutput.format(0), yOutput.format(0));
}
writeBlock(mFormat.format(83))
writeBlock(mFormat.format(0));
writeComment("TOOL PROBING");
writeBlock(gFormat.format(83));
writeBlock(gFormat.format(4), "P1.");
writeBlock(mFormat.format(84));
if (rotating) {
writeBlock(sOutput.format(400), mFormat.format(!tool.clockwise ? 3 : 4));
}
writeBlock(gFormat.format(37), hFormat.format(tool.number), zOutput.format(0), feedOutput.format(15));
writeBlock(gAbsIncModal.format(91), gFormat.format(0), zOutput.format(.1), feedOutput.format(100));
if (rotating) {
writeBlock(sOutput.format(800));
}
writeBlock(gFormat.format(37), hFormat.format(tool.number), zOutput.format(0), feedOutput.format(3));
writeBlock(gAbsIncModal.format(91), gFormat.format(0), zOutput.format(.1), feedOutput.format(100));
writeBlock(mFormat.format(84));
onCommand(COMMAND_STOP_SPINDLE);
writeRetract(Z);
}
Expand Down Expand Up @@ -910,11 +915,13 @@ function onOpen() {
writeRetract(Z);
}
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
writeComment("SET LENGTH AND RADIUS");
writeBlock(gFormat.format(10), "L" + 10, "P" + tool.number, "R" + (tool.holderLength + tool.bodyLength).toFixed(4));
writeBlock(gFormat.format(10), "L" + 12, "P" + tool.number, "R" + (tool.diameter).toFixed(4));
writeComment("POSITION SPINDLE");
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
// 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);
// writeToolMeasureBlock(tool, true);
writeln("")
Expand Down Expand Up @@ -1701,11 +1708,11 @@ function onSection() {
writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool
writeBlock(gFormat.format(55), gFormat.format(0), xOutput.format(stockMidX), yOutput.format(stockMidY));
writeBlock(mFormat.format(0), formatComment("Open door"));
writeBlock(mFormat.format(0));
writeComment("Is the pencil centered above your stock?");
writeBlock(gFormat.format(55), gFormat.format(43), hFormat.format(19), zOutput.format(stockTopZ));
writeBlock(mFormat.format(0), formatComment("Open door"));
writeBlock(mFormat.format(0));
writeComment("Is the pencil touching your stock?");
}
var forceToolAndRetract = optionalSection && !currentSection.isOptional();
Expand Down Expand Up @@ -2055,7 +2062,6 @@ function onSection() {
}

if (getProperty("toolHeightValidation")) {
writeComment("BEGIN VALIDATION SECTION");
// Added 06/15/21 | Gavin Williams | will1742
// Verifies tool-stock distance. Post fails if tool fails clearance standards
if (toolDistance < CLEARANCE_HEIGHT) {
Expand All @@ -2068,15 +2074,11 @@ function onSection() {
var toolDistance = initialPosition.z - stockTopZ;

// Prompt user to check stock-tool distance
writeBlock(mFormat.format(0), formatComment("Halt Program"));
writeBlock(mFormat.format(0));
writeComment("Is your tool " + toolDistance.toPrecision(2).toString() + "in from your stock?");


writeComment("END VALIDATION SECTION");

// initialize spindle and engage coolant if heights are correct
if (tool.type != TOOL_PROBE) {
writeBlock(mFormat.format((tool.clockwise ? 3 : 4)), formatComment("Restart spindle"));
writeBlock(mFormat.format((tool.clockwise ? 3 : 4)));
}
}

Expand Down

0 comments on commit 0308758

Please sign in to comment.