CNC, STL file and Target Depth Issue

Working on a project - a wooden watch box - that I wanted to carve a design into. But I encountered what I think is a strange behavior from Luban, so I am hoping someone can help explain why I’m seeing what I’m seeing.

The wood I am using is maple. The Luban version I am running is 4.13.1-beta.1. The CNC bit I’m using is a V-Bit.

My process is as follows:

  • Create an STL file (using Sketchup) that is text surrounded by a rectangular box. I want the text to be level with the surface of the maple and the area inside the rectangle to be lower than the surface level approximately 1/16". See picture

  • I imported the STL file into Luban’s CNC function and got the design oriented correctly.
  • Created a toolpath with a target depth of 2mm (pretty close to 1/16"). Here are the settings:


  • Ran the job, but got little in the way of depth carved from the wood. Could barely see any material removed.
  • Ended up creating several versions of the same toolpath (using the same STL file) but increased the target depth from 2mm to 3mm, then to 4mm, then to 8mm and finally to 12mm (which is almost 1/2"!). Increasing the target depth did generate closer results to what I was looking for but the target depth set didn’t correspond at all with the actual depth cut into the wood. The run with a target depth of 12mm created a recess around the text, but it was only about 1.5mm. I ran all these tests on the same piece of wood side by side - see the picture below. The numbers above each run are the settings for the target depth.

So I am confused by the results I am seeing. About 9 months ago I created a similar carving, but did not have the same problem that I am seeing now. Not sure if I am doing something different (i.e. wrong), or whether Luban is operating differently now.

I would appreciate it if someone could explain why I’m seeing this strange result.

Thanks,

Rick

Does the milling bit mill “thin air” for a while before actually touching the wood (i.e. bit starts too high), or does it carve immediately, but just too shallow?

I did purposely adjust the height of the bit about 0.1mm above the wood’s surface to avoid getting stray marks on the wood outside the carving area. But that wouldn’t explain why the target depth is so far off. With a target depth of 12mm the carving depth would be close to 1/2" which is actually the depth of the entire piece of wood I was working with.

Rick

I think someone needs to check out the G-Code.

I had some problems with CNC and Luban > 4.10. Maybe try a worth to revert to v4.10 and test there.

I have two PC’s running Luban. One - near the Snapmaker in the garage - is running 4.13.1-beta because of some issue I ran into where it wouldn’t create a toolpath for the laser. The other PC in my office was running 4.13.0.

I recreated the configuration for the carving with a Target Depth of 2mm on both machines. I saved each one as a gcode file. It’s a shame that we can’t export the gcode files that live inside the Snapmaker in cases like this, but since the example was simple to recreate, it wasn’t much of a problem.

Other than the Luban version and the Time & Date info (lines 28 & 29 in the gcode file) the files are the same. I am not a gcode guy, but it seems like the “min_z(mm): -0.253” (line 19) doesn’t equate to the target depth of 2mm, but maybe I’m jumping to conclusions.

I also recreated a gcode file for the same carving but with a 3mm target depth and compared it to the gcode for the 2mm depth. The “min_z(mm)” value changed from -0.253 to -0.379, but that still doesn’t make sense to me. Elsewhere in the file you can see places where the z values have increased, but again, nowhere near the 3mm I would have expected. These three gcode files are attached.

Test Carving.stl_2mm_4.13.1-beta.cnc (198.2 KB)
Test Carving.stl_3mm_4.13.1-beta.cnc (204.4 KB)
Test Carving.stl_4.13.0_2mm.cnc (198.2 KB)

I made gcode files for the other target depths I tried - 4mm, 8mm, and 12mm. I could see the “min_z(mm)” values increase, but it almost seems like the values are off by a factor of 10 - for 2mm it’s -0.253, for 3mm it’s -0379 and for 12mm it’s -1.515. Measured results from the test carvings I actually did would seem to agree with these “min_z” settings since my test carving at 12mm target depth was around 1.5mm.

Based on Wyphorn’s comments, I uninstalled Luban 4.13.0 from my office PC and installed a couple of older versions of Luban - 4.10.0 and 4.10.2 which were probably the versions I was running with in January of this year when I last used the CNC function and it seemed to work correctly.

The result is that the 2mm target depth file on 4.10.0 was exactly the same as the 4.13.1-beta file with the exception of the Luban version line and the Time & Date line. Here’s the 4.10.0 gcode file.

Test Carving.stl_4.10.0_2mm.cnc (198.2 KB)

So I am still a bit confused as to why things are operating the way they are. If someone’s a gcode wiz, I would appreciate any ideas.

Finally, here’s the test carving STL file that I used to import into Luban:

Test Carving.stl (244.1 KB)

I was able to create the carving I needed for a current project, but I’m still not sure why things are not working out as expected.

Anyone got any other ideas, things to check?

Rick

I can solve the mystery. I looked at your model, and the model is 12,7 mm high, but the carving part is only ~1.5mm high. If you select a depth of 2 mm, Luban will scale the whole object to 2mm, i.e. ~1/6th in size, leaving you with 1.5/6th = 0.25 mm engraving depth.

I modified your object to basically only be the engraved part, i.e. ~1.5 mm high:

Test Carving_mod.stl (43.1 KB)

Loading this into Luban and giving 2 mm target depth gets it about right.

If you want to have it precise, perhaps you need to modify the object even a bit more to be exactly the height of the engraving - I eyeballed it.

Ah Ha!

Hauke, you have solved the mystery indeed! Thank you. Your timing was very good. I was literally just composing an email to Snapmaker support to try and get an answer to this issue. Now I don’t have to send that email.

I generated g-code for the modified STL file you created and confirmed what you saw. So, a follow up question to your solution is whether this “scaling” issue is something that is documented in some way in the manuals, or did you discover this on your own, or did I just miss this?

I created the stl file using a 1/2" thick model because I was going to be carving into a 1/2" thick piece of wood. It had not occurred to me that Luban would scale anything based on the entire thickness of the model.

I also went back and looked at the stl file I used for the previous project and the thickness of the model was 2mm while the carving depth was actually 1.58mm. This resulted in a g-code file with a total depth of 1.58mm. I started out that project using a model thickness of 12.5mm, but at some point reduced it to 2mm but don’t recall why I did that. Using your scaling theory, I would have expected the total depth to be roughly 1.25mm, but at this point I’m not going to quibble about that small discrepancy.

Thanks again for the education. Hopefully I will remember this for the next project where I want to carve something to a specific depth.

Rick

Not sure what’s in the manuals, I’m not the guy to read manuals :slight_smile: It was an assumption I was acting on which looked logic to me, as it is the simplest and most pragmatic way to implement this option.