Cut Direction

Discussions around the CAM Add-On of QCAD version 3

Moderator: andrew

Cut Direction

Postby jthornton » Sat Oct 26, 2013 2:32 pm

When I select Forced Orientation: Clockwise or Counterclockwise it does not change the cut direction for my profile. Both G codes cut in the Clockwise direction as viewed from the Z axis.

Thanks
JT
jthornton
Full Member
 
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm

Re: Cut Direction

Postby andrew » Sat Oct 26, 2013 5:10 pm

I cannot reproduce that problem here at the moment. Could you please attach or mail the DXF file?
Is the contour closed (i.e. each element connects to exactly one end point of another element)?
User avatar
andrew
Site Admin
 
Posts: 2370
Joined: Fri Mar 30, 2007 6:07 am

Re: Cut Direction

Postby jthornton » Sun Oct 27, 2013 1:29 pm

It is just a square drawn with the rectangle tool.

JT
Attachments
test.dxf
(80.07 KiB) Downloaded 20 times
jthornton
Full Member
 
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm

Re: Cut Direction

Postby andrew » Sun Oct 27, 2013 1:41 pm

Thanks. I still cannot reproduce though.
Could you attach your latest version of your machine configuration file?
Attachments
test_ccw.ngc
test.dxf converted with 'JThornton', counter-clockwise.
(108 Bytes) Downloaded 22 times
test_cw.ngc
test.dxf converted with 'JThornton', clockwise.
(108 Bytes) Downloaded 19 times
User avatar
andrew
Site Admin
 
Posts: 2370
Joined: Fri Mar 30, 2007 6:07 am

Re: Cut Direction

Postby jthornton » Sun Oct 27, 2013 1:48 pm

Here is what I have so far for a LinuxCNC mill.

Code: Select all
include("GCode.js");

// Machine Configuration for LinuxCNC Mill type machines in Inch

function Lcnc_Mill(documentInterface, newDocumentInterface) {
    GCode.call(this, documentInterface, newDocumentInterface);

    // set output unit:
    this.unit = RS.Inch;
}

Lcnc_Mill.prototype = new GCode();

// change file extension from nc to ngc
Lcnc_Mill.prototype.getFileExtensions = function() {
    // set output file extension:
    return ["ngc"];
};

// change default to inch
Lcnc_Mill.prototype.initGlobalOptionWidget = function(w) {
    switch (w.objectName) {
    case "ZSafety":
        w.addItems(["2", "1", "0.5"]);         // available options in combo box
        w.setEditText("0.5");                    // preselected default option
        break;
    case "ZClear":
        w.addItems(["0.25", "0.5", "1"]);
        w.setEditText("0.25");
        break;
    case "ZCutting":
        w.addItems(["-0.125", "-0.25", "-0.5"]);
        w.setEditText("-0.125");
        break;
    }
};

// change default to inch
Lcnc_Mill.prototype.initLayerOptionWidget = function(w) {
    switch (w.objectName) {
    case "ZCutting":
        w.addItems(["default", "-0.125", "-0.250", "-0.375"]);
        w.currentText = "default";
        break;
    }
};

// change G00 to G0
Lcnc_Mill.prototype.getRapidMoveCode = function() {
    return "G0";
};

// change G01 to G1
Lcnc_Mill.prototype.getLinearMoveCode = function() {
    return "G1";
};

// change G02 to G2
Lcnc_Mill.prototype.getCircularCWMoveCode = function() {
    return "G2";
};

// change G03 to G3
Lcnc_Mill.prototype.getCircularCCWMoveCode = function() {
    return "G3";
};

// add preamble
GCode.prototype.writeHeader = function() {
    this.writeLine("G20 G17 G40 G49 G54 G64 P0.005 G80 G90 G94");
    this.writeRapidZMove(this.getSafetyZLevel());
    this.toolPosition = GCode.ToolPosition.Clear;
};

// change M30 to M2
Lcnc_Mill.prototype.writeFooter = function() {
    this.writeToolUp();
    this.writeRapidZMove(this.getSafetyZLevel());
    this.toolPosition = GCode.ToolPosition.Clear;
    this.writeLine("M2");
};

// turn off line numbers
Lcnc_Mill.prototype.getLineNumberCode = function() {
    return "";
};
Attachments
Lcnc_Mill.js.zip
(897 Bytes) Downloaded 24 times
jthornton
Full Member
 
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm

Re: Cut Direction

Postby jthornton » Sun Oct 27, 2013 2:09 pm

Here is a test circle with both outputs using G3 even though I selected CW for one the CCW for the second one. I also attached the log files for each one if that helps.

JT
Attachments
circle test CW.log
(23.52 KiB) Downloaded 22 times
circle test CCW.log
(23.52 KiB) Downloaded 22 times
circle test CW.ngc
(112 Bytes) Downloaded 23 times
circle test CCW.ngc
(112 Bytes) Downloaded 23 times
circle test.dxf
(79.68 KiB) Downloaded 22 times
jthornton
Full Member
 
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm

Re: Cut Direction

Postby jthornton » Sun Oct 27, 2013 2:32 pm

Is it possible my hack to remove the line numbers caused the direction not to work? Changing from my hack to your fix and now the direction is correct in a test with a square object. The circle still uses G3 for both CW and CCW.

JT
jthornton
Full Member
 
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm

Re: Cut Direction

Postby jthornton » Sun Oct 27, 2013 2:53 pm

I just tested a rectangle object with radius corners and the CW CCW works fine. Seems like a circle is the only one that does not work.

JT
jthornton
Full Member
 
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm


Return to QCAD 3 CAM Add-On

Who is online

Users browsing this forum: cmcgrath5035, Yahoo [Bot] and 0 guests