Decimal values were a test to check if it is possible to get Marlin to accept them for a better resolution in the power levels.
I don’t think you will need it.
Optimised raster will not engrave white areas of an image.
For example you have logo in JPG that is all black but round on a white background.
The normal raster mode will engrave the whole picture as defined by the size.
Optimized raster will skip all white parts outside the engraved image and shorten the processing time quite a bit.
It is as said really helpful if you have a lot of white background, for an image that is quite dark all over it won’t have real effect on getting shorter engraving times.
i’m having problems with power-levels using the software. Might it be due to source image being grayscale?
here’s original pic https://www.pinterest.com/pin/209698926369444035/
here’s my engraving using Image2Gcode - https://www.instagram.com/p/BEhKFeyjuTY/?taken-by=keedley
looks like some of shades are wrong by power - some really dark areas are too light, some light or shadow areas are too dark.
source image https://s-media-cache-ak0.pinimg.com/736x/3d/78/3c/3d783c9a5d80cdc45c490ec8f400963f.jpg
Can you post screenshots of image2gcode settings or list them here? All settings, feed rate, power, image settings, etc… Screenshots of each settings tan would probably be best.
Ok, here pics of interface tabs and gcode generated.
screenshots
gcode
i’m running it by using a Pronterface using a 5W diode, so half of the power is enough to burn black on 3000 feed.
Also, ‘5’ value is leaving only slightest marks on this speed.
i’m using a dedicated corexy platform for this setup and diode is driven from servo pins using my own Marlin modification. G1 is firing laser, G0 is not firing, M03 code switching laser on and sets "spindle’ power as 0…255 value, directly connected to analogWrite on servo pin where laser TTL is attached.
First of all, I’m impressed by the power of your laser to burn an image that dark at such a high speed and 50% power! I think it’s time for an upgrade:)
What is the purpose of the G1 and G0 commands to fire the laser? I think this is the problem. Image2gcode controls the laser strictly through the ‘S’ values and will use a value S=0 if the laser needs to be off so your G0 and G1 controls just complicate the gcode and add bloat. If you wrote this modified firmware then I’d suggest changing it so the laser is only controlled by the ‘S’ value and ignore the G0 and G1 for laser control. If you’re really into modifying the code then a better revision with a laser as powerful as yours would be to use 12-bit or even 10-bit PWM for the laser. The 8-bit isn’t cutting it for you. An eight bit analogWrite only allows values from 0-255 which match the grayscale levels in your image but when you run at 50% power the grayscales will be interpolated to 50% as well. This means you’ll lose half of your grayscale levels in the image. I modified my Marlin firmware for 12-bit PWM resolution but I’m not using it anymore and can’t seem to find the code. I’ll take another look when I get time.
i’m impressed too, i should say. my first laser was 2W and it wasn’t so satisfying.
i was trying to build a setup i could use with more or less standart toolchain from 3dp - CAM, slicers - for vector engraving. My understanding of g-code - i definitely could be wrong - gives me an idea, that laser is kind of spindle tool, and usually when we operate the mill, tool is rotating constanly, and S values mostly define RPMs. G0 code is a just a move with no tool, G1 - is a move with tool applied. So, i’ve modified G0-G1 codes to accept S values also, along with M3 and M5 codes, for compatibility with pcb milling tools and Artcam i also use with my cnc mill. M codes throttle laser power nicely - when code says M03 S10, next G1 will fire with S10 derived from previous setting, if new not set.
I’ve just assembled this project to some level i could operate it without risking my sight, with enclosure and wiring (mostly) soldered and zip-tied, so my experience with laser is quite limited yet. I’m getting along with new abilities and collecting additional tools to make things i couldn’t think about earlier - like photo engraving, in particular.
I found some g-code generators, that i could modify - in PHP, for example, and i got some reasonable results from them - for example - https://www.instagram.com/p/BEj14e_jufx/?taken-by=keedley
This made with same laser and same 255-step PWM, so dynamic diapason is mostly ok, given my corrugated plywood pieces i use as canvas and poster-like art i consider worth engraving.
unfortunatelly, i could do little with .net software - but software is working nice with color source images, as far as i see. Actually, the php one is failing simillarly on grayscale sources, i think it’s grayscale image filtering routine returns funny results when all the channels have same values. I could easily be wrong, i’m just an amateur coder. Your software is one that could provide some g-code w/o heavy modifications, so thank you for your efforts.
The grayscale filtering in image2gcode should be working ok. If I have time tomorrow I’ll burn your source image from the earlier post. It’s strange that the hat in the source image is black but has no shading in the burned image. If I burn the image correctly then we have to assume that your added G0 / G1 codes may be causing some problems. For vector engraving most software will allow editing of post-processor file to control the laser with single Mcode+ S parameter. I have a post in the software section about dxf2gcode. Give that a shot, it’s as simple as it gets for laser vector engraving.
I’m also having issues with burning a vector based image optimized (taking white out). The image looks fine post process, however when gcode is run to laser the “edge” of vector is burnt. I also tried sending a bitmap and same…the edge is burnt almost as the image is seen as a tool path? Image is completely black/white no gray.
i could burn an image you’re familliar with on my setup - if this could help.
I’m not too familiar with the optimized engraving feature because i didn’t write the code for that feature and haven’t had time to study it. I’ve used it a couple of times and noticed the same dark edge that you did.i think the feedrate picks up on the non- burned areas and slows back down when the burning starts again.it’s possible that the laser is firing as the deceleration is happening and the beam is dwelling on that spot a little longer than the rest. Bryan hasn’t been on the forum for a while but maybe he’ll comment on that. The feature is experimental so you can turn it off if it isn’t working for you. My preferred setting is diagonal raster.if your source image Is just a line drawing dxf or pdf then try dxf2gcode. It will burn a vector image much faster than a raster based toolpath can.
Not sure if it is of any help but I am working on a firmware for my CO2 laser that allows for the mapping of power levels.
Might be an alternative for high powered diode lasers too.
Essentially you set the lowest power level that gives you some visible change as the minimum engraving value in the firmware.
The power mapping happens to a value of max 10000 which allows to spread 256 power levels for the analogwrite command wherever needed.
That way I can even do 8bit engravings on paper without burning through it.
If it is of any help I will give you a link to Github.
I wouldn’t mind seeing this code out of curiosity. An image burned on paper by a Co2 laser would be impressive too if you care to share a pic.
How can say no if the guys who did such great work and helped me so much want to see something
The firmware is here on Github.
It is based on the official Kimbra release and the Turnkey Tyranny additions ported by Nextime.
Some improvement for the raster direction change was made by HakanBastedt who also works on a different approach to regulate the power mapping.
I changed the original Turnkey code to allow for full 8bit engravings and increased the standard input power selection from 0-100 to 0-10000 to allow for the required 8bit mapping within a fixed power level.
The interesting stuff happens in planner.cpp from line 877 to 894, I commented the out the original code for reference so that people can better understand what is actually happening.
To allow for these mods to work the base64 library needed some minor changes as well.
I used the modified Turnkey Tyranny plugin, which is included, to create the code for the below image as it was too big for Image2Gcode.
With base64 encoding the gcode file is still over 6mb big LOL
But for smaller sizes I can do the same with Image2Gcode and for my needs I only modified how the power commands work, e.g. integrating them into the movement string and removing some unwanted gcode that I don’t need on my machine.
Bigger jobs are limited for me using Image2Gcode as so far I had no time to integrate the G7 command and base64 encoding.
Anyway the image was encoded in 254DPI as this and 508DPI are next to perfect resolutions for machines that use pulse settings per mm and not inches.
Image size is 240x175mm, same for the engraving.
Power levels used: Minimum power as set in the firmware: 750
Max power for total black: 1080
Speed: 7200mm/min
Engraving time: 62minutes ,which equals to a real life speed (including the turns) of 7027mm/min based on the line lengths and engravng time.
The power levels correspond to 7.5% for min and 10.8% for max if the original controller would have been used, so you see I basically just increased the resolution here.
The mapping of the 256 power levels happens in the firmware during runtime instead of being integrated in the Gcode, which saves a lot of time and processing.
The high speeds are mainly possible due to a good alignment of the acceleration values to the max speed but only possible in 1/8 stepping at 1/16 stepping I can only reach speeds of around 4200mm/min before running into processing troubles due to the slow CPU and no support for a mathematical co-processor - I need a 32bit board!! LOL
But at 1/8 I still have a calculated accuracy of 0.1mm which should be more than enough for normal jobs, if I need more I can always change the stepping and go slower.
Engraved just on copy paper, so it buckled a littled bit and did not like to stay flat so I can take a proper pic.
GRBL does the laser stuff different to Marlin but people using Marlin might want to try the 254DPI and 508DPI for their engraving jobs.
For me it was the biggest improvement in speed ever.
If you think about it makes actual sense:
254DPI equals 0.1mm pulses, 508DPI 0.05mm pulses - this is far easier in calculations for a 8bit CPU than pixel values of 0.09644 or so.
And since the laser pulses must be timed with the movements, which are also calculated in mm we suddenly get pretty nice looking numbers for movements instead of crap with 4 or 6 digits behind the comma
If there is a way to get around complex flot operation than write the extra code was one of the favourite statements my computer teacher used back in the 90’s LOL
The smudge on her dress was done by the idiot taking not enough care when handling it, so please ingore this imperfection if you can.
Just noticed the link is not working in the previous postin and I can’t edit it anymore.
so I will try again.
Marlin Kimbra for K40 Lasers
Hi again, It have been a while then i was running the laser. I was whiting for the calibration step for the good Laser modules. It was working very well so thanks for that.
Bu i still have problems to use the Image2Gcode software.
The test file you sent me is giving error and the new version 1.0 is giving the same error.
I was able to get the test version running for some times but no more.
I find out that if i don´t use any decimals in the width and height it´s working.
//Peter
error.txt (5.5 KB)
Although most of us diode users wouldn’t benefit from this i have to give you props.you’ve come a long way with your laser.nice work
Thanks for posting dump.that’ll help with troubleshooting.I’ll try to look at it this weekend
@Peter T
I’m curious.were you able to get higher current fron your driver with the test load method In the revised guide?
Hi everybody, first of all thanks for thoses beautifuls projects (cnc, softwares, cool community…). My vicious is now near to be complete and i just bought the jtech 2.8W laser kit. So I would like to use image2gcode and I have exactly the same problem as Peter T. The first “mpcnc” version of Leo69 was fine (not in real life but to create and export clean Gcode) but others versions have the error which seems to be a “just in time” failure. I tried to debbug my computer (no success) but i think like Peter that is something with decimals in width or heights, but we can’t adjust our project to this, decimal are so friendly :). So maybe Leo69 (or somebody else good in programmation eheh) can check it compare to your first “mpcnc” package because I don’t have those kind of knowledge (the working .exe was named 3dpBurner-Image2Gcode-MPCNC.rar). And again thanks everybody for sharing !!