Image2gcode engraving - how to improve it

For sure!

I think I will just make a whole separate laser firmware since it needs to get flashed anyway. Re tune it for max accel and jerk.

No way will I let all your hard work sit in a forum thread…No sir!

I appreciate all that you are doing. Kills me that I can’t fire my laser up right now and help out. I am pretty much booked until next Monday. I really want to spend some time and check out all the improvements you guys have made. Also need to get some good test files So I can put together a cool little getting started with a laser post.

That would be awesome. Laser work has became my life. I have done one router job and about 600+ hours of laser work. This machine has paid for itself many times over!

If you need any help let me know. I can test etc.

I’m not sure if it was posted here or on another thread but someone mentioned that the latest RCBUGFIX version of Marlin can be configured to disable LCD updates on short moves.i confirmed this last night. Smooth as butter, no more jerk at every display update.

Btw, started working on image2gcode v2 last night. Will add rotary support with 3d preview and “skip white” options to diagonal and horizontal scanning. That should put it right there with the commercial packages. It will be a vicious1 exclusive of course:)

Excelent Leo!

I also tested the new marlin rcbugfix branch and no more jerk movements at all… but still some minor artifacts in my picture. I’ll test with other pictures.

I can’t wait to see image2gcode v2!!!

That sounds awesome @Leo69. Not sure if you have PEP5 but if you have any questions about the paid version you can ask me.

@Martin DB can you share how you got it to work on your MPCNC?

Sure Jason.

A quick cookbook:

  1. Download last marlin version from here
    https://github.com/MarlinFirmware/Marlin/archive/RCBugFix.zip
  2. Uncompress the zip file, copy Marlin folder into your Arduino folder.
  3. Take Marlin 1.1.0RC7 customized by Vicious from this site.
  4. Search all the “MPCNC” ocurrences in Configuration.h and Configuration_adv.h files from 1.1.0RC7 customized version to the new one.
  5. In Configuration_adv.h search for the line ENSURE_SMOOTH_MOVES and delete the comment bars (//)
  6. Copy _Bootscreen.h from 1.1.0RC7 version to the new one.
  7. Open Arduino IDE, go to your new marlin folder and open marlin.ino, compile/upload to your Arduino Mega as ussual.

Let me know if you need help. I’m writing this from memory, may be I’ve missed some step.

Sounds easy enough. I will give it a try when my new diodes come in. Unless Vicious beats me to it.

We are already using the bugfix release you just need to un-comment that line. I’m pretty sure. Can’t really mess with until monday, sorry guys.

New Software Leo!!!How do you do it? I need some lessons. Sweet maybe we can get this all worked out at the same time and have an even easier to use laser.

It is odd though, I swear I have a pic that burned just fine. I have to dig it out and see it the issue is on that one.

I have a bit of work ahead of me but I’m working on it so it will come. The 3d graphics are a pain, I suck at trig! As far as firmware goes, it would be nice to find time to create an application that can apply selected patches to the firmware. There are mods that can be done for laser pwm, spindle control, etc… It would be cool select the mods you want and the app would just regex through the applicable files and apply the patches. Maybe someday I can work on that because I have patches on my firmware that are a pain to redo every time I upgrade firmware. Next project after this upgrade will be the router pid though. That will be fun. I’ll be in touch with you if I get that working. Maybe we can get some kits put together or something. I can’t see that costing more than 20$ to build. Crazy what they charge for them.

Marlin is getting so big now they really need to build it like the repetier firmware where it kinda builds a new version depending on your options. I love that it is all in there and I understand that it gets cleaned up in the compile but dam they support like 80 different lcd’s and a whole list of other stuff that makes it a little daunting just to get through the standard config.h and now the advanced config as well. Forget about it if you want to make real changes to it anymore. Back at robo me and Austin went through it and added all kinds of stuff, lights that react to temp and percentage of print done, reconfigured the lcd…I would never dig into it anymore. getting too big.

It needs to be modular. xyz motion, extruder1, extruder2, auto level, lcd, thermistor, delta or cartesian. I like how the new lcd graphics work. If there is a graphics file it displays it, if not, no big deal. That is how marlin should be. Line 1-is there an autolevel file? line 2- is there an lcd file…but I’m a hardware guy not a software guy. imagine if all the motion stuff was in one tab, it would be so easy to tune a machine…still to this day Jerk is a mystery to most people, and they just figured out it hasn’t worked this whole time…that’s when you know your stuff is too all encompassing, when you miss your own feature.

Man the router PID thing. I look at it at least once a month I get ready to buy all the stuff and try to build one. There is no way that should cost $120. They are the only game in town they can charge whatever they want. The equations, sensing, and hardware all all easy. The part I don’t understand is the ssr side. You have to have an ssr that senses the a/c zero point? If you know how to handle the power modulation to the router we can whip this up in no time. I think. I think this would be the largest improvement to any small form factor router that there is, even when routing by hand. Heck all rotary tools should have this built in, all of them. Imagine even a dremel that keeps its speed consistent. I want this.

All I had was yellow paper to burn your image onto so it came out really light. I see artifacts on my image too though. I looked at some wood engravings that I’ve done in the past and no artifacts. Weird. I was running with an older version of my laser driver back then so maybe it’s related to that. Then again it is a fairly blurry image up close so you might try a different image to eliminate that possibility. If you don’t figure this out soon then I’ll hook up my old driver and see if it makes a difference.

Thanks Leo for your time to try it.

Today I’ve tested with diagonal scanning, 1200 mm/min, default acceleration/jerk and it seems no artifacts!

I’ll try other pictures this weekend.

So true about Marlin. I would switch to Grbl if they fully ported it to the MEGA board/Ramps Combo . Grbl is nice but just not enough I/O, timers, etc…on the Uno board to support a multi-purpose machine and all of the add-ons. I know there are other options out there now but Marlin is so hackable and does it all, even if it isn’t perfect.

I haven’t had time to really dig into the PID thing either but I should get some time off in the next few weeks so I want to get the board layout done and components ordered. Hopefully they’ll get here in time. No SSR is needed. The zero-cross detection is done by a few passive components and a dedicated interrupt on the Arduino firmware. The power modulation is handled by an opto-coupled TRIAC. All cheap components. The Vishay TCRT5000 sensor is used for the RPM sensing on the spindle and the rest is just an LCD and a few more passive components and connectors.

I actually got excited to see a PID motor controller on ebay a few days ago . Had PWM input so it would’ve been easy to drive with an Arduino and optical RPM sensor for a closed loop system. Too bad it only supported DC motor spindles:(

You’re my hero!

That looks good. Glad to hear it.

@Jason , I wouldn’t mind taking a look at gcode from PEP5 with white space skipping enabled. I’m still on the fence about how I want to do it. I think Bryan had added it to i2gc as an experimental feature but in my opinion the quality of the image suffered with it turned on but to be fair, I only tested it once. It looks like the code would just ignore all white space so if you had white space in the middle of the image, say 50 pixels worth, a g1 move would be added to burn the next dark pixel. We’re using very high firmware accel settings for raster engraving so large moves are not a good idea in the middle of an image because the acceleration factor affects the speed over a larger distance and you get inconsistent results and dark patches.

I’m guessing that the PEP5 skip white feature is only skipping white at the outer edges of the image to avoid this but I’m hoping you can confirm.

@vicious1 I’m trying to resist the urge to buy all of the components until I understand it a bit better and can find a way to simplify it. For example, all of the components used for the zero-cross detection can probably be replaced by an optocoupler with a built-in zero cross circuit like the MOC3041. Makes it cheaper and easier to assemble.

Optocoupler is always better right? This is where I don’t have any experience. I could cobble something together but I’m never sure when things need filters or some extra capacitors. At my last job I would put together a basic circuit, and a board layout and always have to leave room because the EE always seemed to add components for some reason. He never wanted to tell me what it was for. Either I was an idiot or he just wanted to look like he was needed…Kidding, I’m sure there is a reason.

Could that really do it all? Everything about it looks fine, I have no idea about the speed it switches though That’s your department. So the diagram in figure 14 is everything and the arduino come in through pin1&2. Seriously a few resistors, capacitor, and a triac(?) that’s it for the 115v side? So should I have some stuff sent your way?

Lol. I’m in the same boat as you as far as knowing exactly what’s needed. I have some components on the way so I’ll be able to get a few things until it’s right, or I burn the house down. I do have an oscilloscope so that’ll help with the testing. Should have an RC snubber circuit on the triac for an inductive load like a motor but I think I can avoid that by using an alternistor triac instead of the standard variety. I have about 6 good pages bookmarked and between them all I should be able to get the circuit sorted out. The software side will be much easier. I’m used to simple DC microcontroller circuits so this is a big learning curve. It’ll be fun.

@leo69 you can send me an image and I will run it thru pep5. Include you settings etc

@vicious1 the ensure_smooth_moves is not in the current version of the MPCNC firmware… Unless I missed an update.