Canned drilling cycle
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Indicate the post processor used.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Indicate the post processor used.
Attach drawing files and screenshots.
Post one question per topic.
Canned drilling cycle
I have been playing with a custom post for our Mazak nexus machines, which so far is working pretty good. We frequently drill hole patterns, and as the machines are equipped with canned cycles, G73, G81, G82, G83, I prefer to use the canned cycles. I have come up with a work around. Attached is the post and 2 programs that drill the same hole pattern. The first is the straight G code and the second is canned cycles. To get this output, I enter a zero value for Safe Z (a) and Cut Depth (c), then add the canned line. Due to the edited post, I also have to add the initial Z start move. This might help someone else out.
- Attachments
-
- Mazak.js
- (2.16 KiB) Downloaded 302 times
-
- DRILL_TEST_2.nc
- (422 Bytes) Downloaded 323 times
-
- DRILL_TEST.nc
- (538 Bytes) Downloaded 329 times
Re: Canned drilling cycle
Hi,
I read that this.firstPointMoveZ and this.pointMoveZ are meant for drilling.
In GCodeBase.js they fall back on common Z moves.
It should then be possible to add the canned cycles as 'PointMoves'
Regards,
CVH
I read that this.firstPointMoveZ and this.pointMoveZ are meant for drilling.
In GCodeBase.js they fall back on common Z moves.
It should then be possible to add the canned cycles as 'PointMoves'
Regards,
CVH
Re: Canned drilling cycle
Not sure how to go about that, but that would be awesome. Will play with it.
Thanks.
Thanks.
Re: Canned drilling cycle
Where do I look for these examples? I have the tutorial page on making postprocessors, can't say that I understand it but I am working on it.
Re: Canned drilling cycle
GCodeBase already adds one extra field to the postprocessor dialog.
See the GCodeBase.prototype.initConfigDialog function.
It is the "Always write G1" option.
Your postprocessor may overwrite this function with a specific one.
We also need to register the extra parameters so that we may include them by placeholders in the export.
With a textual search I find more than 10 occurencies of '.initConfigDialog'.
Regards,
CVH
Re: Canned drilling cycle
Thanks for the feedback. I've never done any java programming so it's a bit of a learning curve. I did add this section to my custom post and have a G73 check box. Which is pretty cool. Now trying to figure out how to get the output I want. One step at a time.
GCodeBase.prototype.initConfigDialog = function(dialog) {
// add options for laser on / off:
var group = dialog.findChild("GroupCustom");
group.title = qsTr("G-Code");
// get QVBoxLayout:
var vBoxLayout = group.layout();
// add checkbox to force G1:
var hBoxLayout = new QHBoxLayout(null);
vBoxLayout.addLayout(hBoxLayout, 0);
var cbAlwaysWriteG1 = new QCheckBox(qsTr("Always write G1"));
cbAlwaysWriteG1.objectName = "AlwaysWriteG1";
hBoxLayout.addWidget(cbAlwaysWriteG1, 0,0);
var cbG73 = new QCheckBox(qsTr("G73"))
cbG73.checked - true;
cbG73.objectName = "G73";
vBoxLayout.addWidget(cbG73, 0,0);
};
GCodeBase.prototype.initConfigDialog = function(dialog) {
// add options for laser on / off:
var group = dialog.findChild("GroupCustom");
group.title = qsTr("G-Code");
// get QVBoxLayout:
var vBoxLayout = group.layout();
// add checkbox to force G1:
var hBoxLayout = new QHBoxLayout(null);
vBoxLayout.addLayout(hBoxLayout, 0);
var cbAlwaysWriteG1 = new QCheckBox(qsTr("Always write G1"));
cbAlwaysWriteG1.objectName = "AlwaysWriteG1";
hBoxLayout.addWidget(cbAlwaysWriteG1, 0,0);
var cbG73 = new QCheckBox(qsTr("G73"))
cbG73.checked - true;
cbG73.objectName = "G73";
vBoxLayout.addWidget(cbG73, 0,0);
};
Re: Canned drilling cycle
Been trying to understand the processes involved here. In order to get this to export a G73 code, I believe there should be a change in the CamExporterV2. And while this file is referenced, I can't seem to locate it. Possibly something embedded in the software?
Re: Canned drilling cycle
No, CamExporterV2 does not define any G-Code output at all. This is the code that iterates through toolpaths and calls into your post processor to export to G-Code. CamExporterV2.js is indeed embedded into QCAD/CAM.
To replace the whole drill cycle, you'd have to filter out the toolpath part that is the Z move for the drilling and ignore all other drill toolpath entities:
Code: Select all
Mazak.prototype.writeEntity = function() {
var drillToolPath = this.getToolpathOption("CamDrillToolpathFlag", "0")==="1";
var toolDown = this.currentEntity.getCustomProperty("QCAD", "CamToolDown", "0")==="1";
var rapidMove = this.currentEntity.getCustomProperty("QCAD", "CamRapidMove", "0")==="1";
var zMove = this.currentEntity.getCustomProperty("QCAD", "CamZMove", "0")==="1";
if (drillToolPath) {
if (toolDown) {
// write canned cycle for entity that represents the Z move down:
this.writeBlockFromString("[N] G73 [Z!] R0.25 Q0.11 F5.1 (CANNED CYCLE LINE ADDED)");
}
else if (rapidMove && !zMove) {
// write X/Y rapid move to drill position:
GCodeBase.prototype.writeEntity.call(this);
}
// ignore all other drill path entities
}
else {
// anything else is handled as usual:
GCodeBase.prototype.writeEntity.call(this);
}
};