Laser gcode

This topic contains 16 replies, has 4 voices, and was last updated by  ductsoup 1 year, 10 months ago.

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #3919

    ductsoup
    Participant

    What tools are the MPCNC laser people here using? I’m finding the J Tech Photonics Inkscape plugin cumbersome in practice even for simple things like calibration and material tests.

    Attachments:
    #3931

    ductsoup
    Participant

    Hmm, crickets. Ok then … found a decent plugin for Inkscape. The only problem is it’s generating code for the LinuxCNC dialect, not Marlin (MPCNC).

    KnoxMakers/KM-Laser

    The Inkscape extensions are written in Python so I lightly modified the KM code. Needs a couple hours work but it looks promising. Below is a teaser.

    BEFORE

    %
    M64 P0 ( M64 OFF/ M62 ON)
    G01 Z-0.000001 F10000
    (Header)
    G21 (All units in mm)
    
    (Start cutting path id: path4379)
    M68 E0 Q0.65
    S10000 (PULSERATE) F400 (FEEDRATE)
    G00 X455.641130 Y9.141111
    M3 (UNLOCK)
    M62 P0 (BURN ON MOVE)
    G01 X455.641130 Y18.836110 Z-0.000001 F400.000000
    G01 X458.641124 Y18.836110 Z-0.000001
    G01 X458.641124 Y31.546112 Z-0.000001
    G01 X455.641130 Y31.546112 Z-0.000001
    G01 X455.641130 Y44.236111 Z-0.000001
    G01 X458.641124 Y44.236111 Z-0.000001
    G01 X458.641124 Y56.946113 Z-0.000001
    G01 X455.641130 Y56.946113 Z-0.000001
    G01 X455.641130 Y69.636112 Z-0.000001
    G01 X458.641124 Y69.636112 Z-0.000001
    G01 X458.641124 Y82.346112 Z-0.000001
    G01 X455.641130 Y82.346112 Z-0.000001
    G01 X455.641130 Y92.041113 Z-0.000001
    G00 Z0.000001 (LASER OFF)
    M64 P0
    M5 (LOCK)
    
    (End cutting path id: path4379)

    AFTER

    G90 ; set absolute positioning
    G92 X0 Y0 ; set the current position as home
    ;G00 Z43 ; set the Z axis focal point
    G21 ; set units to mm
    
    ; Start cutting path id: path5187
    G00 F1000
    G00 X455.641130 Y9.141111
    M106 S255 ; Laser ON
    G4P0
    G01 X455.641130 Y18.836110 Z-0.000001 F400.000000
    G01 X458.641124 Y18.836110 Z-0.000001
    G01 X458.641124 Y31.546112 Z-0.000001
    G01 X455.641130 Y31.546112 Z-0.000001
    G01 X455.641130 Y44.236111 Z-0.000001
    G01 X458.641124 Y44.236111 Z-0.000001
    G01 X458.641124 Y56.946113 Z-0.000001
    G01 X455.641130 Y56.946113 Z-0.000001
    G01 X455.641130 Y69.636112 Z-0.000001
    G01 X458.641124 Y69.636112 Z-0.000001
    G01 X458.641124 Y82.346112 Z-0.000001
    G01 X455.641130 Y82.346112 Z-0.000001
    G01 X455.641130 Y92.041113 Z-0.000001
    G4 P0 ; Laser OFF
    M107 S0
    
    ; End cutting path id: path5187
    
    #3942

    SteveC
    Participant

    This looks great. Please post your progress. I have a driver and am ordering a 445nm diode. Why is there a G4 0ms pause after turn on and before turnoff?

    Thanks,
    Steve C

    #3944

    ductsoup
    Participant

    You’re sharp.

    That’s an artifact from the J-Tech plugin generated code that I intentionally replicated. I’m finding that without it the LCD display gets out of sync with the Octoprint stream/machine motion making it useless for all practical purposes. Further testing is indicated. Not sure of the original intent, all it seems to do with my rig is make an unsightly defect when the delay is more than zero.

    Ran the full test code this morning. Marlin does seem to tolerate G00 vs G0 and the result was very promising.

    I’m on Github so I’ll probably fork or branch at some point after I decide how far I want to go with this. No problem sharing the interim plugin code if you’re interested.

    #3959

    ductsoup
    Participant

    Ok, this is nuts but, the gcode looks far more reasonable. I didn’t have time to test it today but it’ll work.

    Rather than hack the previously hacked KMLaser version of gcodetools I hacked the version that comes pre-installed with Inkscape. It only took maybe half a dozen edits to set an appropriate Z and get rid of the inappropriate for laser Z axis plunge so you can at least manually order the generated paths. Basically do the marking then cut the interior perimeters before the exterior so it stays attached to the stock until the last minute and doesn’t shift.

    In Inkscape I setup five layers, from top to bottom; draft, light etch, heavy etch, interior cuts and finally exterior cuts. Each layer has it’s own orientation points to set the Z and passes and, a tool definition for the feedrate. The draft layer is necessary because some of the KMLaser plugins break if orientation points or a tool is present.

    Marlin does seem to tolerate G00 instead of G0 and comments wrapped in parentheses so that makes things simpler.

    Obligatory rant and credit … this is *TOTALLY NOT* the way to do this.

    The layer approach seemed native so I kept that as I’ve also seen it done that way in commercial CAM systems. The gcodetools authors did an exceptional job on the really hairy math, the code is quite good. However, the documentation is practically non-existent (you have to speak Python and read the code to understand how to use it). They did miss a couple of very straightforward computational geometry algorithms that’d make this plugin a breeze to use. The header/footer file that needs to be present in the output directory is just annoying but I do kind of get why they did it that way.

    Further testing is indicated.

    Attachments:
    #3964

    SteveC
    Participant

    Found you on Github. I’m definitely interested in your changes. You have inspired me to gather up the rest of the hardware to get this going. I use a Makita router so I will make a simple holder that clamps inside that mount.
    Thanks,
    Steve C

    #4005

    ductsoup
    Participant

    Remember, you asked for updates.

    The insight for today was the Marlin firmware wasn’t tolerating the different styles of comments as I thought last week, it was simply discarding anything it didn’t understand. That got randomly weird in the dry runs so I hacked the Python code deeper and got a more acceptable result.

    For stupid complicated Rhino geometry like this, DXF import is unsuitable. Pull it into Inkskape as an enhanced Windows metafile instead.

    Attached is the fast etch identification markers and the internal cuts on 3mm plywood. In a word, perfect. I’m intentionally torture testing MPCNC to industrial machine tool standards just for fun. To date, I’m very impressed with MPCNC.

    Attachments:
    #4007

    SteveC
    Participant

    My daughter working on a dual major, BS in Biology and BFA in Studio Art/Illustration and will love that cutting. What power J Tech laser are you using, 2.0, 2.8, 3.8W?

    #4010

    ductsoup
    Participant

    That’s a 2.8W laser vs 3mm plywood at 1 pass and 600 mm/min to etch, 4 passes and 150 mm/min to cut (factory recommendation). The trick is to work out a feed that will result in a 1mm cut for a given material, then adjust the Z for each cut pass to keep the laser in focus. Just that bit took 72 minutes.

    Bee Mobile

    #4014

    SteveC
    Participant

    Thanks for the link to the bee design. So adjust feed rate for a 1mm depth cut with focus at surface? Then Z should lower 1 mm for each subsequent pass? I’ve got a lot of reading to do.

    #4015

    ductsoup
    Participant

    That seems to be the consensus.

    Epic fail today. Should’ve taken another 20 minutes and also cut the external profile to release those pieces while I was at it. Overnight the humidity spiked and the material warped and changed dimensions significantly. The upside is that most of the internal cuts yesterday pretty much fell out on their own.

    The worst part is I work with stainless steel every day and should’ve known better. Eh, $2 lesson learned.

    #4596

    alan
    Participant

    hey @ductsoup – where did you get the factory feed rate and depth of 1mm/pass from?

    I just ordered my machine today, but ordered the new 3.8w one for some better speed of cuts on 1/8″ ply, and will be looking for some some initial idea on the feed rate and cutting pass depth for this particular laser.

    #4915

    alan
    Participant

    Not entirely happy with the JTECH plugin myself…where can I find yours?

    Also, would love that calibration test file as well.

    #5900

    A Trap
    Participant

    Hey guys,
    Just starting my build, but I have built a laser etcher before. Good results from Inkscape using the links from this site http://3dpburner.blogspot.com/p/files.html he has done a lot of great work too. So support him when/if you can.

    Cheers!

    #5904

    alan
    Participant

    It’s A Trap…literally.

    Welcome to the forums Trap.

    Another member has done some mods with the 3dpburner files to work better with the Jtech version, particularly using the M106 Sxxx to control laser intensity, as I think the original 3dpburner software was using M3 Sxxx.

    The files are posted…somewhere, I just can’t remember which thread they’re in!

    #5922

    A Trap
    Participant

    Thanks for the welcome:)

    Sorry for the duplicate post.

    Adam

    #6128

    ductsoup
    Participant

    Sorry for the delay, life got weird for a while there.

    It definitely gets the job done but it’s a quick and dirty hack. Not something I’d feel comfortable signing my name to or committing to supporting at GitHub. The other reason is the modifications are pretty trivial, nothing you couldn’t do manually with search and replace. That said, I’m open to sharing the code so you can check it out and run with it if you like.

Viewing 17 posts - 1 through 17 (of 17 total)

You must be logged in to reply to this topic.