Community
Looking for assistance in editing a Generic WinCNC 3-axis router PP.
Currently, my G-Code ends with the following:
X-0.7911 Y-1.2131 Z-1.5024
X-0.7921 Y-1.2124 Z-1.4947
Z0.5906
M5
G53
I need this corrected to:
X-0.7911 Y-1.2131 Z-1.5024
X-0.7921 Y-1.2124 Z-1.4947
Z0.5906
M5
G53 G00 Z0
G53 X0 Y0
Solved! Go to Solution.
Solved by aju_augustine. Go to Solution.
Hi @rlengert ,
You will have to first enable home retract in X, Y by modifying the lines in the post as shown below:
Original:
homeXY: { onIndexing: false, onToolChange: false, onProgramEnd: false } // Specifies when the machine should be homed in X/Y. Sample: onIndexing:{axes:[X, Y], singleLine:false}
Modified:
homeXY: { onIndexing: false, onToolChange: false, onProgramEnd: { axes: [X, Y] } } // Specifies when the machine should be homed in X/Y. Sample: onIndexing:{axes:[X, Y], singleLine:false}
Then search for function writeRetract() and replace it with the codes given below:
Original:
function writeRetract() {
var retract = getRetractParameters.apply(this, arguments);
if (retract && retract.words.length > 0) {
if (typeof gRotationModal != "undefined" && gRotationModal.getCurrent() == 68 && settings.retract.cancelRotationOnRetracting) { // cancel rotation before retracting
cancelWorkPlane(true);
}
for (var i in retract.words) {
var words = retract.singleLine ? retract.words : retract.words[i];
if (retract.retractAxes[2]) {
writeBlock(gFormat.format(53)); // retract
} else {
gMotionModal.reset();
writeBlock(gAbsIncModal.format(90), gMotionModal.format(0), words); // retract
}
if (retract.singleLine) {
break;
}
}
}
}
Modified:
function writeRetract() {
var retract = getRetractParameters.apply(this, arguments);
if (retract && retract.words.length > 0) {
if (typeof gRotationModal != "undefined" && gRotationModal.getCurrent() == 68 && settings.retract.cancelRotationOnRetracting) { // cancel rotation before retracting
cancelWorkPlane(true);
}
for (var i in retract.words) {
var words = retract.singleLine ? retract.words : retract.words[i];
if (retract.retractAxes[2]) {
forceModals(gMotionModal);
writeBlock(gAbsIncModal.format(90), gFormat.format(53), gMotionModal.format(0), words);
} else {
gMotionModal.reset();
writeBlock(gAbsIncModal.format(90), gFormat.format(53), gMotionModal.format(0), words); // retract
}
if (retract.singleLine) {
break;
}
}
}
}
Output should look like the screenshot below:
Can't find what you're looking for? Ask the community or share your knowledge.