Inkscape & PCB engraving



  • I have been working on a personal project and I required a PCB.
    After printing a few and getting decent result but the same height made it hard for me to weld properly… I am new to welding on PCB...
    I decided to try engraving.
    At first I tried Eagle but their G-Codes isn't compatible... with duet ( what I was told by Autodesk...) I then tried Inkscape with the gcodetools...
    It seems to work really well, no need to have it modified.

    However, there are a few thing that I do not know and I thought that I would ask for help here.
    so here is the Procedure that I used.

    I downloaded Inkscape here https://inkscape.org/en/release/0.92.2/
    Apparently there are some issues with some hardcoding proportion. I had to download this patch https://www.dropbox.com/s/yqkdrqnfhkgx8s0/gcodetools.py?dl=0 from the inkscape forum and replace the file in the installation folder (for me C:\Program Files\Inkscape\share\extensions) after get into Inkscape and the proportion were fixed.

    I imported the image of the PCB, resized it to the size that I wanted.
    I inverted the color but doesn't seem to work (if the path is black, doesn't seem to work, requires to be white with black or gray (the color will decide the depth of engraving (0%= white, 100% being black of the Z depth in Orientation points).

    Selected the PCB Image
    Tool bar: Extension -> Gcodetools -> Orientation points
    Orientation points window:

    • select 2-points mode

    • Z depth -0,5

    • unit in mm

    • Apply

    • Close

    You should now see 2 Orientation points
    Reselect the PCB image
    Tool bar: Extension -> Gcodetools -> Path to Gcode
    Path to Gcode window:

    • Select the Preferences tab

    • File: Test.ngc

    • directory…

    • Z safe height: 1,0mm

    • Select the Path to Gcode

    • Cutting order: pass by pass

    • Sort paths to reduse rapid distance

    • Apply (you MUST ne in the Path to Gcode tab for it to work

    After a few minutes you should have the gcode file in the selected folder under the chosen name.
    You will see a green section with info and here is what I need help with… I grave the path... I seem to obliterate the trace where I wanted to save it.
    Green section:

    • Diameter 0.5 (to the size of my mill)

    • Feed 100 (engraving speed)

    • Depth step 0.5 (allows multiple pass)

    IMO, the size of my cutter might be too large or I might need to find other settings

    If anyone have knowledge with this tool, I welcome any suggestion, assistance or help.



  • If you use eagle + pcb-gcode you can select a post processor for generating the gcode. I'm not sure why they would say this was not compatible with Duet unless they just didnt know what the duet supported however, the gcode post processor script is easy to update.

    For example at the top of the gerneric post processor, it defines the commands for types of move -

    [c]// G codes
    //
    string RAPID = "G00 ";
    string FEED = "G01 ";
    string ARC_CW = "G02 ";
    string ARC_CCW = "G03 ";
    string DWELL = "G04 " + PARAM + "%f" + EOL;

    //
    // M codes
    //
    string SPINDLE_ON = "M03" + EOL + DWELL;
    string SPINDLE_OFF = "M05" + EOL;
    string END_PROGRAM = "M02" + EOL;
    string OPERATOR_PAUSE = "M06 ";[/c]

    Looking at the Duet gcode wiki all the commands except G4,M02 and M06 are supported (although you might need to remove the 0 - not sure if Duet interprets M03 as M3.) M02 & M06 can probably be subsitited with M1.

    G4 could probably be updated in the post process to "string DWELL = "G4 P" + PARAM + EOL;"



  • I will try it tonight.
    Thank you



  • I tried it,
    I changed the :

    • G00 for G0

    • G01 for G1

    • G02 for G2

    • G03 for G3

    • G04 for G4

    • M02 for M2

    • M03 for M3

    • M05 for M5

    • M06 for M6

    I unlocked the Z-Axis movment to -1mm and run the file…
    The result was strange, the move was solely on the Y & Z-Axis. I checked the file and I see some G1 X & Y in the G-Codes.
    With the version with inkjet, My mill was moving on the X & Y. I do not understand the issue, I tested and I can move X, Y & Z.
    Any idea?


  • administrators

    RepRapFirmware doesn't care whether the commands it receives have leading zeros or not; but any post-processing scripts you use might.



  • I can't seem to make it work properly so I am taking a look at their .pp (Gcode source)

    It's too complex for me ATM but I was hoping to get it done and save it after once it works properly.

    Manuel to help https://www.dropbox.com/s/0waup3t9fxkgiza/pcbgcode.pdf?dl=0

    //
    // Options for pcb-gcode.ulp.
    // Often used options are at the top of the file.
    // Copied to gcode-defaults.h by the setup program.
    //
    // author=John Johnson
    // description=Tries to be very compatible
    //

    int FILENAMES_8_CHARACTERS = NO;

    //
    // Comments.
    //
    string COMMENT_BEGIN = ";";
    string COMMENT_END = "";

    //
    // Format strings for coordinates, etc.
    //
    string EOL = ""; /* standard line ending /
    string PARAM = "P"; /
    some use P, some # for parameters /
    string FORMAT = "%-6.4f "; /
    coordinate format /
    string FR_FORMAT = "F%-5.0f "; /
    feedrate format */
    string IJ_FORMAT = "I" + FORMAT + "J" + FORMAT;
    string R_FORMAT = "R" + FORMAT;

    //
    // Modes
    //
    string INCH_MODE = "G20" + EOL;
    string INCH_MODE_COMMENT = COMMENT_BEGIN + "Inch Mode" + COMMENT_END + EOL;
    string METRIC_MODE = "G21" + EOL;
    string METRIC_MODE_COMMENT = COMMENT_BEGIN + "Metric Mode" + COMMENT_END + EOL;
    string MIL_MODE = "M2 (Please setup MIL_MODE in gcode-defaults.h)" + EOL;
    string MICRON_MODE = "M2 (Please setup MICRON_MODE in gcode-defaults.h)" + EOL;
    string ABSOLUTE_MODE = COMMENT_BEGIN + "Absolute Coordinates" + COMMENT_END + EOL + "G90" + EOL;

    //
    // G codes
    //
    string RAPID = "G0 ";
    string FEED = "G1 ";
    string ARC_CW = "G2 ";
    string ARC_CCW = "G3 ";
    string DWELL = "G4 " + PARAM + "%f" + EOL;

    //
    // M codes
    //
    string SPINDLE_ON = "M3" + EOL + DWELL;
    string SPINDLE_OFF = "M5" + EOL;
    string END_PROGRAM = "M2" + EOL;
    string OPERATOR_PAUSE = "M6 ";

    //
    // Spindle speed
    //
    string SPINDLE_SPEED = "S%.0f" + EOL;

    //
    // Coordinates
    //
    string MOVE_X = "X" + FORMAT;
    string MOVE_Y = "Y" + FORMAT;
    string MOVE_XY = "X" + FORMAT + "Y" + FORMAT;
    string MOVE_Z = "Z" + FORMAT;
    string MOVE_XYZ = MOVE_XY + MOVE_Z;

    //
    // Rapids
    //
    string RAPID_MOVE_X = RAPID + MOVE_X;
    string RAPID_MOVE_Y = RAPID + MOVE_Y;
    string RAPID_MOVE_XY = RAPID + MOVE_XY;
    string RAPID_MOVE_XY_HOME = RAPID + "X0 Y0";
    string RAPID_MOVE_Z = RAPID + MOVE_Z;
    string RAPID_MOVE_XYZ = RAPID + MOVE_XYZ;

    //
    // Feeds
    //
    string FEED_MOVE_X = FEED + MOVE_X;
    string FEED_MOVE_Y = FEED + MOVE_Y;
    string FEED_MOVE_XY = FEED + MOVE_XY;
    string FEED_MOVE_XY_WITH_RATE = FEED + MOVE_XY + FR_FORMAT;
    string FEED_MOVE_Z = FEED + MOVE_Z;
    string FEED_MOVE_Z_WITH_RATE = FEED + MOVE_Z + FR_FORMAT;
    string FEED_MOVE_XYZ = FEED + MOVE_XYZ;

    //
    // Drilling holes
    //
    // Not using G82 so it will be very generic.
    //
    string DRILL_CODE = ";( G82 not used )";
    string RELEASE_PLANE = "R" + FORMAT;
    string DWELL_TIME = PARAM + "%f";

    string DRILL_FIRST_HOLE = RAPID + "Z" + real_to_string(DEFAULT_Z_UP) + EOL

    • RAPID + MOVE_XY + EOL
    • FEED + MOVE_Z + FR_FORMAT + EOL
    • FEED + "Z" + real_to_string(DEFAULT_Z_UP) + EOL
    • COMMENT_BEGIN + RELEASE_PLANE + " " + DWELL_TIME + COMMENT_END + EOL;

    string DRILL_HOLE = RAPID + MOVE_XY + EOL

    • FEED + "Z" + real_to_string(DRILL_DEPTH) + EOL
    • FEED + "Z" + real_to_string(DEFAULT_Z_UP) + EOL;

    //
    // Tool change
    //
    string TOOL_CODE = "T%02d ";
    string TOOL_MM_FORMAT = "%1.3fmm";
    string TOOL_INCH_FORMAT = "%1.4fin";
    string TOOL_CHANGE = OPERATOR_PAUSE + TOOL_CODE + " ; " + FORMAT + EOL;

    string TOOL_CHANGE_TABLE_HEADER = COMMENT_BEGIN +
    " Tool| Size | Min Sub | Max Sub | Count " + COMMENT_END + EOL;

    string TOOL_CHANGE_TABLE_FORMAT(int tool_number, real size_mm, real size_inch, real min_drill, real max_drill, int count)
    {
    string formatted;

    sprintf(formatted, COMMENT_BEGIN + " " + TOOL_CODE + " " + TOOL_MM_FORMAT + " " +
    TOOL_INCH_FORMAT + " " + TOOL_INCH_FORMAT + " " + TOOL_INCH_FORMAT + " " + COMMENT_END + EOL,
    tool_number, size_mm, size_inch, min_drill, max_drill);
    return(formatted);
    }

    //
    // Circles / Arcs
    //
    string ARC_CLOCK = ARC_CW + MOVE_XY + R_FORMAT + FR_FORMAT + EOL;
    string ARC_CCLOCK = ARC_CCW + MOVE_XY + R_FORMAT + FR_FORMAT + EOL;

    I seriously hope some one might help me with this.

    Thanks you for your help


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.