Image2Gcode – Free Raster Image Laser Engraving Software – Modified for MPCNC

New Home Forum Software Development Image2Gcode – Free Raster Image Laser Engraving Software – Modified for MPCNC

This topic contains 286 replies, has 43 voices, and was last updated by  John 1 week, 2 days ago.

Viewing 30 posts - 91 through 120 (of 287 total)
  • Author
    Posts
  • #8280

    Noname007
    Participant

    Ok, looking very good so far 🙂
    The first try with the changed firmware seems to overburn in the dark areas but that will be addressed with lower power levels for the next run.
    For the first time ever I can control the laser power with around 13byte accuracy, yes had to adjust the available power levels from 0 to 10.000 in order to get the control range required for these insane power levels.

    But there is still some flaw in the gode generated by the V1.0, please have a look:
    (Generated by 3dpBurner Image2Gcode v1.0)
    (@Feb.26.2016 22:24:37)
    M05
    G90
    G21
    F3600
    G0 Y7377483; Move to top left corner and begin box
    G92 X0 Y7377483
    M03 S5
    G0 X60
    G0 Y0
    G0 X0
    G0 X0 Y73.8
    G1
    M03 S0
    G1 X0 G1 Y73.7
    M03 S508
    G1 X0.1
    G1 X0.2

    The move to begin the box is still messed up and calculated wrong.
    “G0 X0
    G0 X0 Y73.8
    G1”
    Why?
    This first G0 and the G1 command seem a bit useless to me.

    Apart from being burnt deep in the dark areas the engraving so far has a never seen level of detail.
    Will see to get the power parameters optimized so I can do a proper engraving on 3mm plywood.
    The speed is still painfully slow, so the next step will be to search the code for a way to optimise the command buffering for both the serial and the Gcode commands.
    This involves messing with the look ahead buffer memory allocations and possibly more, so proper testing will be required.
    I just love Image2Gcode 🙂
    So I have to ask again: do you guys mind if I promote it a bit more?

    #8317

    Noname007
    Participant

    Here are some of the test engravings so far:

    old firmware
    This was done with the original Turnkey Tyranny firmware, as you can see there was no chance to get results.

    New firmware before clean
    This was the first engraving with the modified firmware but the power settings were far from good.

    after cleaning
    Same one but with the burnt stuff removed.

    better settings
    Here we are with the final firmware mod and some more defined settings for Image2Gcode.

    after cleaning
    And here afer the cleaning…

    So who said 8bit photo engravings can’t be done on a CO2 Laser machine?
    All it takes is the great guys here giving us a fantastic tool and some Arduino with the tight firmware.
    No expensive 3000$ machine or Picengrave, just chinaware combined with good freeware 🙂
    Like Hannibal always said “I love it when a plan comes together!”

    #8319

    Bryan
    Participant

    Wow! That looks great! I’m happy you were able to dial in the settings. Was that using the optimized rastering? I’d be interested to know what your file size and estimated time were before/after optimization. The threshold value is another thing to fiddle with. It ignores any power level less than that percentage of the maximum laser value. (I never made that clear in my original posting)

    #8320

    Bryan
    Participant

    I’m a little puzzled why you keep getting wrong values (or missing decimals) for the bounding box… its all based off the image size. As far as the moves, it is based off of standard CNC axis (bottom left corner is 0,0). It first jogs to the upper left corner (no matter where you had it set via the origin control panel) and then jogs clockwise around the limits of the picture.

    Does this happen with every image? Because I have not been able to reproduce the same results

    #8321

    Noname007
    Participant

    Image size is about 60x73mm.
    Resolution 300DPI, estimated time in pronterface was 13minutes but took 42minutes to do.
    And done just with standards, not the optimized rastering, this will come in the next testrun.
    Will also fiddle with the threshold to check how it works.
    But as said, so far I am impressed.
    Guess it means you have beaten Picengrave on all accounts here 😉

    Not sure if you can spot the bright areas left of the chin and under the chin – they are actually toally black in the original image but for some reason did not get any laser power during the engraving, like being reversed out.

    #8324

    Noname007
    Participant

    And as requested with optimized rastering, set to 1% as everything higher will ignore too much image.
    Maybe finer settings here would be nice.
    optimized rastering
    Estimated time in Pronterface: 8:07, real time 35:50min.
    But this time I used a resultion of 0.12 to see if there is much difference in detail, also power was between 560 and 815.

    #8325

    Noname007
    Participant

    Ok, currently doing some test on glass – anyone interested?
    If so I leave some pics 😉

    #8329

    karltinsly
    Participant

    I’d love to see the results on glass, though my 2.8w laser isn’t capable of it.

    #8342

    Noname007
    Participant

    Here is a first impression on glass:
    glass
    What seems to look hlaf decent is in fact total crap 🙁
    Turned out the photo is created by tiny pieces of glass that exploded off the surface and melted together, almost like frosted glass.
    When you clean it off to get rid of the fine glass particles with a brush you are left with surface that looks like a big shard the shape of your image was chuked out.
    Have to try it again as I dropped the wet glass.
    Next one will be with less power more laser pulses per mm in the hope to stop the fusing of the glass.
    If that is no good I will try find a way to fuse them together more permanently.
    That’s the bad thing about glass, it shatters but does not burn away like wood LOL

    Almost how I would like it:
    glass2

    #8376

    Noname007
    Participant

    I noticed some coding issues in my last test, apart from the ones mentioned above.
    When setting the resolution to 0.12, 0.13, or 0.14 with a bigger engraving I got a lot of weird Y-axis moves before the actual job begins.
    Like as if it is trying to engrave the first line vertically instead of horizontally.
    There is also often a massive difference in filesize when going up or down just 0.01 for the resolution.
    As if sometimes mostly lines instead of dots are used.

    This last one made me think again about experimenting with the code to combine the movements and later to include the power settings into the movements as well.
    On a simple calibration graph the time went down from 11minutes to just over 3minutes.
    But for this to get the same result I had to increase the power levels manually to adjust for the higher movement speed.
    The current way of generating the G1 moves blows the files up too much.
    As long as there is no change in power all G1 commands before the last can be deleted to create a single line instead of dots.
    Currently I have to set the resolution to 0.2 and the image DPI to 100 to be able to engrave a 23x17cm image, would be great to try that again in a much finer resolution 😉

    #8398

    Andrew
    Participant

    Bryan,

    Man I cant wait for diagnal to be added to the newest version, for example in this acrylic job which I created in image2gcod v4, there was so much space in image that was not lasered at all due to white background after I removed original background in inkscape to seperate it from the image I wanted. Trace bitmap multi scan tool, so freaking awesome lol. Your program works so awesome man, seriously crazy sick man. I wonder a couple things though again knowing nothing of code writing lol. It possible to perhaps create a few general shapes that could be used to size around an image such as this one I attached in order to cut project out after print is done? Another question is could you possibly allow for dither to spread from 1 to say 5? I did check my marlin code as well as included it in a post last week and could not find where my feed rates were maxed out. I can only attach images here where others are able to include embedded in their post. Also tested on glass, tile, and metal but found that most use a laser marking material called ceremark, which creates like a printed ink design with no etching.

    #8403

    Andrew
    Participant

    Bryan,

    Man I cant wait for diagonal to be added to the newest version, for example in this acrylic job which I created in image2gcod v4, there was so much space in image that was not lasered at all due to white background after I removed original background in inkscape to separate it from the image I wanted. Trace bitmap multi scan tool, so freaking awesome lol. Your program works so awesome man, seriously crazy sick man. I wonder a couple things though again knowing nothing of code writing lol. It possible to perhaps create a few general shapes that could be used to size around an image such as this one I attached in order to cut project out after print is done? Another question is could you possibly allow for dither to spread from 1 to say 5? I did check my marlin code as well as included it in a post last week and could not find where my feed rates were maxed out. I can only attach images here where others are able to include embedded in their post. Also tested on glass, tile, and metal but found that most use a laser marking material called ceremark, which creates like a printed ink design with no etching.

    #8421

    Bryan
    Participant

    Andrew,

    Great work! I really like what you’ve done. At some point, I would like to add vector engraving to the tool. With that, you could easily do what you want.
    I can look into varying the dithering setting too.

    #8422

    Bryan
    Participant

    Are you referring to line after line of simple G1 Y moves with nothing in between? I am aware of that, and I haven’t had the time lately to fix it.

    Filesize increases exponentially with increasing resolution. So it’s to be expected.

    -It has already been determined by Leo69 and others that the M106 command has to be on its own line.

    “The current way of generating the G1 moves blows the files up too much.
    As long as there is no change in power all G1 commands before the last can be deleted to create a single line instead of dots.
    Currently I have to set the resolution to 0.2 and the image DPI to 100 to be able to engrave a 23x17cm image, would be great to try that again in a much finer resolution ?”
    — Can you provide an example of the moves that aren’t needed?

    #8423

    Andrew
    Participant

    Man your my new hero lol, the wood engravings I have done also turn out awesome again all done with v4 of image2gcode, the image in acrylic was done at level 63 max 0 min feed 5000, which I can adjust on the fly via turn knob to faster or slower feed rates. At max 63 my amp meter on laser doesnt make it to mid point, which means the laser would burn at twice that value to hit 100% max laser power. which explains allot if you think about it because at 255 or normal max output for most in this group, I would be 125 or so above my max.

    This image took about an our since it had to scan/print even the areas that were white in the image at 100mm by 100mm So when ever the diagonal option comes back into play in the new version of software I will be all over it lol to cut that time in half. There is so much that goes into getting an image ready to print and that is with using a tool that does the majority of the hard stuff for us, cant image what it is like to create a software to do the work like what you have done with image2gcode, absolutely amazes me. Thank you again for all your efforts man, have I asked you before if you have a donate page? to help further the process of development from folks like myself?

    #8425

    Bryan
    Participant

    Feel free to spread the word about it. However, I do have some reservations about opening up support to everyone. I’ve been helping out you K40 guys out of the generosity of my heart 😉 and in the hopes that one day I may have my own and make use of it. However, my priorities are with the MPCNC based setup that most of us on this board that have lasers are running.

    #8428

    Noname007
    Participant

    Will try to get some small sample together so you see what I mean.
    As a sidenote: What would be all needed to compile the program myself from sources?
    If I find the time on weekend I might try to fiddle around with the code a bit myself.
    Give me a few hours and will upload a Rar archive somewhere with the code examples and some explanations.

    #8429

    Noname007
    Participant

    Great!
    It seems this forum is nice enough to allow the upload directly, so here it goes 😉

    #8925

    Andrew
    Participant

    Bryan-

    I sent you a PM here a while back and not certain you got it? Either way this topic has not had any new posts in some time now, like everything else in this arena everything is changing at such a crazy pace newer, bigger, better lol. I am hoping you have made some progress in the vector abilities of image2gcode as well as the ability to cut diagonally. For whatever reason the diagonal cutting seems more proportionate than the horizontal cuts, even if my slide bearings were 100%, Id still prefer diagonal cuts. Let me know if there is anything I can do to help you in the progress.

    Regards
    Andrew

    #8932

    Bryan
    Participant

    Andrew,
    I saw your message and responded to it over 5 days ago. As I said in the message, I have been quite busy using my CNC to make things for craft fairs and I haven’t been able to mess with this much at all. As for right now, vector capabilities is a low priority because it’s a pretty big addition and I am currently using inkscape for that.

    What do you mean “diagonal cutting seems more proportionate than the horizontal cuts”?

    #8933

    Bryan
    Participant

    Noname007,
    Are you sure that you checked the box “Optimized Raster (Horizontal Only)” ?
    I loaded the image that you supplied and checked that box and it does not have any extraneous G1 commands.

    If you download the entire source code from the github link, you can open the project in visual studios. I have been doing revisions with that (it is written in C#)

    #8963

    Andrew
    Participant

    Bryan,

    All good man and sorry for the bother. I am not sure where I would check to see a response to pm lol so I must have missed it. I can understand the vector aspect being a huge add and like you I use inkscape, although I am not very good at it yet lol. In fact I just got raster capabilities to work after six months of coding issues with my firmware on laser as well as software used for inskape exporter plugin. I ended up having to do cmd install on both then had to modify my firmware to accept raster code from plugin all which I know nothing about lol.

    About the horizontal and diagonal cutting, I have not taken exact measurements however the difference are seen in the items I produced. The horizontal items when set beside diagonal seem shorter/wider while diagonal cuts more inline with set sizes in image2gcode. When printing or cutting in either horizontal or diagonal I thought the image would be the same? Regardless the end result with diagonal cut/print seem more in line with measurements in code. Tried to attach two images but they are to big, I will do some measurements when I get time. I just need to get busy and pull the gantry apart again to replace the slide bearings for y axis then I can print horizontal again without catching. Can you suggest a good cnc machine to start with that could also be used for 3d printing?

    #8964

    Noname007
    Participant

    I used the optimized raster later on when realising that it not only affects the white areas of the image.
    So that problem was solved with some logic that I should have applied sooner 😉
    Anyways, I modified the source code a bit so it is directly suited for the Turnkey Tyranny firmware.
    All unwanted code was removed like the box around the engraving.
    By the way the weird coordinates with no decimal seperator seem to be related to the locale settings.
    No matter what I tried I either got a comma or nothing at all to seperate.
    As I don’t really need that move I commented it out as well.
    So all I need to change is the G92 offset in the header to get what I want and where I want it.

    Found a workaround for totally black areas not being engraved as well:
    Within Image2Gcode increase the brightness by 10% and reduce the contrast by 10% – now all shades will be interpolated correctly.
    So far I was unable to locate the source of the problem but the workaround works 😉

    Here is the top of a Gcode file with these changes:

    ;(Generated by 3dpBurner Image2Gcode v1.0)
    ;(@Mrz.13.2016 20:37:00)
    M05

    G92 X-135 Y-50
    G90

    G21

    G1 F6000

    M03 S0
    G1 X0 S0
    G1 Y49.92
    G1 X0.12 S896
    G1 X0.24 S890
    G1 X0.48 S888
    G1 X0.6 S886
    G1 X0.72 S889
    G1 X0.84 S895
    G1 X0.96 S899
    G1 X1.08 S904
    G1 X1.2 S907

    If anyone with a CO2 Laser wants to try it, there is a temp version of the program uploaded here.
    Still trying some changes but if anyone needs the source files then I will upload them as well.

    #9012

    Noname007
    Participant

    Tested Miss Monroe in 65mm wide with a resolution of 0.1 and the engraving took just 35min.
    Still some pinholes here and there, so next step is to play with the firmware and buffers to eliminate those.
    Might just need some changes in regards to prefering the G1 commands for the look ahead planner.
    Once you started with real 8bit engravings you wonder why you ever bothered with raster engravings, although I have to say they work better on glass.
    Thanks again guys for making this possible!

    #9030

    Noname007
    Participant

    Here is Miss M. engraved on a sheet of copy paper:
    Monroe on paper
    Sure, printing her would be faster and maybe in better quality but I wanted to see if I can tune the laser to do it without buring through the paper.
    Except for a few pinholes it went quite well, time was 26 minutes for the 65mm wide image at 0.10 resolution.

    #9043

    Ryan
    Participant

    im having the same problem with this software as I do with piclaser. Anything more than 200mm/m or so and my cnc shakes and stutters down the line . of course this doesnt happen in laseretch, or moving 5000mm/m in any other software… for some reason, its these image softwares that screw me up

    #9072

    Leo69
    Participant

    @Ryan can you post a bit of gcode from laseretch and image2gcode for comparison? Laseretch doesn’t do Grayscale so the files are probably much lighter. Are you running gcode off sdcard? If not then which host software? What speed are your serial coms at? All are factors that may contribute

    #9085

    Noname007
    Participant

    Maybe I can shed some light into this…
    The way the code is generated is quite intense, but there is no way to avoid massive Gcode files if you want good quality 8bit engravings.
    Then there is the way the controller/firmware works.
    Usually they try to “look ahead” to get some movements stored for smooth operation.
    This sadly fails in standard configurations as we simply have too many lines of code that constantly change.
    The main issue however is speed – not the speed of motors but the speed of your connection.
    Keep in mind that the next command needs to be available for processing before the current move is over.
    It is not like cutting a 100mm line with fixed settings and a fixed speed – in these 100mm you can have more than 100 single commands…
    When it comes to Arduino’s or similar processors you need to consider the serial com chip and the CPU speed as well.
    57600baud is about the max the Mega can handle before something get’s dropped or mangled up.
    A reliable speed on my machine for 0.10 resolution is 850mm/min – anything above and the machine runs into troubles.
    Can do 2400mm/min if I really want to but than there is banging, pinholes and so on.
    Still working on utilising the bigger memory of the Mega to store commands and serial communication.

    Edit: Increasing the buffer to 256 fixes some of the issues and the movement is smoother but still not perfect.
    From the SD it works a tiny bit better and filesize is no issue either, unlike with Pronterface always complaining.
    Not sure when I find some time to dissect Marlin again and if I can make some changes to the look ahead buffer there….

    #9096

    Ryan
    Keymaster

    Okay, I can’t believe how sharp you guys are. So this sounds like if we drop back down to 16th stepping we would cut the commands transferred in half correct? Smoother laser etching? Easy fix, remove a few jumpers and flash a new firmware? This also might help because most kits are sold with the large lcd, resource hog?

    #9129

    Ryan
    Participant

    If you wanna toss me a new firmware, and let me know which jumpers to remove (im guessing just the one thats on the X and Y steppers) ill try it out

Viewing 30 posts - 91 through 120 (of 287 total)

You must be logged in to reply to this topic.