• November 22, 2017, 07:39:12 AM
• Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: gcodetools engraving help to make V bit holes of different size efficiently  (Read 3185 times)

0 Members and 2 Guests are viewing this topic.

Offline simonm

  • Sr. Newbie
  • **
  • Posts: 8
I posted this request Re: Inkscape Gcodetools plug-in English support forum #616 at the rather derelict gcodetools forum but hope it will get some help from the more active members here.

 I am very interested in the engrave feature and I'm trying to use it to cut holes of varying diameter to create a stipple effect art work. I have been able to produce gcode using the engrave tutorial but it doesn't use the varying width of the V cutter to make the different hole sizes by plunging to different Z heights. Instead, it plunges and then moves in a star pattern to expand the diameter.

I've attached a picture of the svg holes I'm trying to cut (only need to remove the surface and not go all the way through)
Screenshot (71).png
*Screenshot (71).png
(636.18 kB . 1830x1029)
(viewed 189 times)

and a close up of the gcode path in my gcode simulator (green line)
Screenshot (70).png
*Screenshot (70).png
(535.25 kB . 1797x1011)
(viewed 168 times)


could anyone help / explain how I can ensure the hole width is controlled with different Z depths for a V bit, rather than the radial XY moves? This is making the file take much longer to execute than is necessary.

Thank you!
« Last Edit: May 03, 2017, 08:32:39 PM by simonm »

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
Hah!  I was so excited when I saw that someone replied to our message in the cnc-club forum.  But when I opened, it wasn't a reply to our message, but just another request for support which is yours.

That message I posted there is to try and help Aaronvb, related to his topic:  https://www.inkscapecuttingdesign.com/smf/index.php?topic=1321.0 and also  https://www.inkscapecuttingdesign.com/smf/index.php?topic=1308.0  (which I mention just in case you might be able to help)

I need to put some kind of notifcation at the top of this forum index about this, I guess, since I keep having to explain it so often.

This forum was originally created to help people using Inkscape with the home/craft type of cutter (which typically cut paper, cardboard, or vinyl).  Since these machines more recently have better native software, people don't need Inkscape as much.  So this forum was about to be closed, except that a lot of members wanted to keep it alive because of all the great tutorials.  So I volunteered to take it over.

I've been hoping to be able to expand to helping people with the more industrial type of cutters, such as CNC and other gcode-driven hardware etc.  And we've been getting more messages lately.  But so far, we don't have anyone with those kind of skills or knowledge.  If you read the forum, you can see that I've been helping another guy figure out the gcodetools extensions.  Of course, my ability to help starts and ends with Inkscape.  I don't have any kind of cutter myself.

Anyway, all I could do is fire up Inkscape, and try to figure it out myself.  But we can always hope some people who know the answers will see your posts.  (well, our posts)  I'll see if I can make the forum look more inviting for CNC users too.

Meanwhile, I'll see if I can learn about the Engraving Extension.  When you say:

Instead, it plunges and then moves in a start pattern to expand the diameter.

Just so I'm clear, "start" is a typo for "star", right?  In your screenshot of the gcode simulator, it looks like the tool is cutting a few straight lines, or rays, from where it plunges in, as the center.  But it doesn't appear to be symmetrical, as I would expect.

Have you learned whether....well, I guess it must be  in the gcode - I mean the instructions to cut these short straight  rays from the center/plunge point.  It also looks like it doesn't plunge at the center of the hole, which I would have expected as well.

I notice that smaller set of green lines (in your screenshot), below and to the left of the larger one in the middle -- it doesn't look like it forms a circle.  Do you see what I mean?  If I were to connect the outer end of each ray with a path, it would not be a circle.  I mean, I realize the router bit (is it "bit"?) is round, and would round off the corners.  But you see it's not symmetrical.

Well, maybe I just don't understand what I'm looking at....because I can't come up with a reason for the longer green lines, besides just moving from one dot to the next....?

Could you share the gcode file (NGC)?  Since I don't have such a simulator or hardware, I want to make a sample file with a couple of small circles (dots), and compare the files, so I can recognize the part of the code that's making the dots.  Then I can experiment with the settings, and maybe find the answer you need.  Or if you don't want to share that file, just any sample file which is similar, which is make the dots with the rays. 

2 heads better than 1, right?  At this moment, I don't have time.  But a little later tonight, I can look into it more closely.

By the way, welcome to the forum!
  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline simonm

  • Sr. Newbie
  • **
  • Posts: 8
Brynn, sorry to get your hopes up!

A small gcode file (a few cuts, but not the whole piece) is attached. I use http://camotics.org/for FREE and lightweight gcode simulation. I stripped away the wireframe of the stock (the material I'm cutting) to only show the toolpath. I lined the view up over one of the holes and you can see the radial pattern seems to be fairly even distance-wise from the centre of the plunge (which suggests the plunge is central on the hole) but they aren't evenly arrayed around the centre.
Screenshot (72).png
*Screenshot (72).png
(79.67 kB . 1814x1019)
(viewed 164 times)

Then this next picture shows how the holes look from the side. It's clear that the smaller holes are generating a smaller plunge distance in the Z axis but I can't understand why the diagonal radials are needed.
Screenshot (73).png
*Screenshot (73).png
(79.29 kB . 1785x1004)
(viewed 168 times)


Quote
"start" is a typo for "star", right?
Yes! Edited now.

I looked at the gcodetools source code on github and found the section that deals with engraving. Unfortunately I don't really know what to do with it. The engraving function was most significantly improved by Chris Lusby Taylor and the code contains what turns out to be an unreachable email for him. I've reached out to him on Facebook and the British Sundial Society; he has a Google+ profile but no obvious other means of contacting him.

Quote
By the way, welcome to the forum!
Thanks! And thank you for helping people by taking this forum on!


Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
Interesting.  You clearly have some options in your NGC file that I don't have, because I don't know exactly how you set everything up.

But after making some quick circular paths and installing the simulator, it looks like I'm getting circular cutting lines.  Not the rays like yours.  In case it helps, attached are my NGC file and screenshot of simulator.

Since my first theory was that maybe you were getting the "rays" because the circles were so small, I started with several, different size circles.  But even the tiniest of mine, 3 px diameter, is a circle.

I don't know if you can figure it out from the code (I certainly can't), but I can tell you how I set it up, if it would help.

Of course I realize you don't want circles.  You want something like points, and achieve different diameters with the depth of the cutting tool (router, I guess?).  But at least this is my first test.

  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline simonm

  • Sr. Newbie
  • **
  • Posts: 8
Quote
I can tell you how I set it up, if it would help
Yes please! It would be good to understand how the setup drove the results.

I achieved a similar circular tool path using the path_to_gcode function but can't repeat it with the engraving feature.

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
Yes, let's both compare notes.  Because when I load your swirltest file into the simulator, it looks different from mine.  And it also looks different from what you showed.  Obviously I can see the differences in the text files, but like you said, I don't know what they mean.

Orientation Points

Orientation type: 2 points mode
Z surface:  0
Z depth:  -1
Units:  mm

Tools Library

cone

Path to Gcode

>> Path to Gcode tab

Biarc tolerance:  1
Maximum splitting depth:  2
Cutting order:  Path to Path
Depth function:  d
Sort paths.....:  unchecked

>> Options tab

Scale along z axis:  1
Offset along z axis:  0
Select all paths if nothing selected:  checked
Minimum arc radius:  1
Comment gcode:  blank
Get additional comments:  unchecked

>> Preferences tab

File:  name of file
Add numeric suffix....:  unchecked
Directory:  place to save file
Z safe height....:  5
Units:  mm
Post processor:  None
Additional post processor:  blank
Generate log file:  checked
Path to log file:  path to log file

*gctest3.svg
(93.98 kB - downloaded 23 times)


*gctest3.ngc
(8.83 kB - downloaded 21 times)


*gc3logfile.txt
(25.31 kB - downloaded 21 times)


You know, I really enjoy writing tutorials.  If I can learn enough, maybe I could make a series for gcodetools.

PS - I can't figure out how to zoom into the simulator view.  Well actually I can zoom it, but when I load your swirl test file, it's displayed at the edge of the view area.  So when I zoom it, it goes outside the view area.  I can't find any way to move it back into view.  Do you know how?
  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline simonm

  • Sr. Newbie
  • **
  • Posts: 8
I think the main difference between the two tool paths is the path_to_gcode vs engraving feature/function. If I use the path_to_gcode feature I get the same circular path at the base of the plunge as you.

In Camotics you can right click on the tool text on the left hand side of the screen and it will let you edit the tool to be conical and set cone angle, height and diameter, which then leads to more realistic holes in the 3D view (you need to edit the first tool in the list and then then click the green refresh arrow on the top toolbar to see the changes).

As for zooming, you need pan once you have zoomed, which I appreciate is not easy to find the workpiece in this software.

I was pleased with my first steps editing gcodetools last night - it was producing lines of gcode that were too long for my cnc controller (arduino running grbl) and the job was rejected, even though I had selected the rounding to 4 decimal places in the post processing menu. I found the relevant file (gcodetools.py) and changed it to 2 decimal places (0.01mm precision!) and the resultant gcode was within the grbl size limit. Hooray! I also changed the file that presents the engraving feature menu and "apply" button and changed the text of the post processor option to state that it rounds down to 2 decimal places. A text editor such as notepad++ is invaluable for this kind of thing, if others are tempted to do something similar.

I'm optimistic that the variable hole diameter can be implemented with a simple plunge path, but I don't have the skills at the moment to interrogate the code and  make the necessary changes. I'm going to ask the hackaday community for help on this as it's well within the abilities of that community.

Please could you try playing with the engraving feature and let me know what you discover? There's every chance I've missed something!

I can say that a good set of tutorials on gcodetools would be valuable to many people as the few tutorials kindly put on the Russian forum are using old UI versions, haven't had good translation support (but Nick's English is way better than any second language I speak so I'm not judging) and does not discuss a broad range of use cases for each feature.

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
Ok this is interesting, although I'm not sure if it will be helpful.  I got a log file, so I can share it, if it would be helpful.  Let me know.

The only thing I changed in the circles, is their size.  But for some reason, the larger ones, it looks like it cuts the circle in straight segments.  But the smaller ones are showing those rays, like you got.  I have no idea why it starts to cut on the side of the largest circle, and then moves over and plunges further.  I guess it's possible the simulator got it wrong, but I really have no idea.

Btw, I used whatever options were already showing in the Engraving dialog.  I don't really know what they do anyway.

But I'm just wondering about the option Minimum Distance for Engraving.  Exactly what distance is that?  Because the radius of the 2nd largest circle is just over 10 mm (the minimum distance is set at 10 mm).  That's the horizontal distance between nodes.

I'm going to try adding more nodes to these circles and see what happens.  There are several Inkscape features which work better if you add extra nodes.  It can't hurt to try, right?  If I get different results, I'll post in the next message.

  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
Very strange!

Look what happens when I add extra nodes.  It doesn't seem to affect most of them, but the 2nd largest one, and maybe a couple of the smaller ones, it bizarre  really.

There's either something wrong with the gcode, or it's something wrong with the simulator.  I have no way of knowing which.

  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
Oh!  I'll bet how the gcode handles the different size circles has something to do with the diameter of the tool!  I mean, you couldn't expect to make a hole or "dot", I mean just a simple plunge in and out, to be 20 mm wide, if the tool is only 10 mm wide.  So that must have something to do with why the gcode is different, between the largest and the smallest holes.

It might be an optical illusion, but the smaller holes look to me like they are shallower than the larger one, on the bottom row. Let me try to find that side view that you showed for yours....

OMG!  Yes, they are shallower.  See the screenshot.  Isn't that what you're looking for?

Well, you still need to deal with the rays....unless it doesn't really matter?

I think you're on a good road, finding people who can tweak the code.  I think this is one of those situations where these are awesome tools, but yet very basic tools, for which you need more expertise to get something more than just basic.
  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
Just had another thought.  On the Engraving tab of the Engraving dialog, where it says about the depth being a function of the radius -- isn't that what we're seeing with that side view?

Still I'm also wondering exactly what Minimum Arc Radius is.  Does that mean, the smallest circle it can handle?

Is there a way to change the tool diameter?  There is a way to change it somewhere, I'm sure I've seen it....


Oh ok, you can just use the Inkscape's Text tool to change it, and change in the green box.  Look what happens when I change the tool diameter to 20 mm
  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
So yes, the diameter of the tool makes a big difference.  But it's still making those rays.  And I agree with you, that should be unnecessary!

Although remember that my last test was done using the extra nodes.....  Well, I'll leave it to you to try with only the usual 4 nodes, and changing the tool diameter.  Maybe I'll have more time this weekend.

Edit
I think I just had what Oprah calls "the Ah-Ha Moment"!  If you take a 10 mm diameter tool, with a single plunge in and out, it can only make a 10 mm wide hole, right?  Plus!  Plus, if it plunges deeper than the tool is high, the sides of the hole are going to be straight up, no angle, except at the very bottom of the hole, according to the height of the tool.  I'm talking about a side view or cross section of the hole.  So no wonder it's making those rays!  That's how it's making the angle for the cut.  Right?!!

Yes, you definitely need some custom code to do this!

The code needs to tell it to make a single plunge, because this engraving code apparently can only make lines, something with length.  And the code needs to tell it how deep to make the plunge.  AND.  And, Inkscape needs to be capable of giving the code some clue about the depth.  Whether that might be color or opacity....  I'm not sure if stroke width would be appropriate, but possibly.  But somehow Inkscape needs to give a clue for the code to use.

And I have an idea that this kind of code would be useful for a lot of people.  I'm sure plenty of other people would like to do what you're doing - sort of like 3D pointilism, right?  Or 3D half tones sort of!  Anyway, what I mean is that if you can get someone to do this, and they are inclined towards open source, it could really be a whole new gcode dialog for Inkscape!
  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline simonm

  • Sr. Newbie
  • **
  • Posts: 8
Wow Brynn, you've been so helpfully busy!

I have posted instructions on how to change the decimal places for your gcode on the gcodetools forum because I saw a few posts before ours there was a man who wanted to know. Here's the link Re: Inkscape Gcodetools plug-in English support forum #617

So, while I was doing that you were noticing the engraving characteristics. The diagonal (including Z axis movement) rays are what makes the Engraving function special. The process detects where the tool may be trying to cut tight corners which are below it's nominal or max diameter. If you have a V shaped tool, you can decrease the effective diameter at the surface plane of the stock you are cutting by lifting it up in the Z axis. Here's an example of the same V bit cutting variable width letters.
Screenshot (78).png
*Screenshot (78).png
(639.56 kB . 720x482)
(viewed 159 times)


The concept is indeed to cut halftone or stipple style images with a V cutter. I agree that others might enjoy this application!

So, are the rays a problem? At the scale of hole I have been using so far (0.5-3mm) they don't spoil the look of the hole but if I went larger I suspect they would make non-round holes. The main issue with the rays is that a CNC cutter has reasonable mass and the acceleration and velocity settings are carefully controlled. If I want to go backwards and forwards over very short distances the machine takes a disproportionate amount of extra time to do this than it would to cut the equivalent total length of multiple short rays if you added them into a straight line, because it never has a chance to get up the velocity ramp before it has to stop and significantly change direction. This makes production of a several hundred or thousand hole piece waaaay longer than it should, hence my interest in investing the time in the code to speed things up by purely controlling the width of hole at the top surface through Z axis control. I know that Engraving has this feature working in principle but there's something weird going on with it's calculations, as demonstrated by your excellent comparison of circles with varying diameters.

What weirdness could that be? Well, as I was trundling through the code in the gcodetools.py file for the decimal places post on the other forum, I saw a section which may be a clue as to what is going on. Screenshot (79).png
*Screenshot (79).png
(265.94 kB . 1068x751)
(viewed 162 times)


Code: [Select]
#Don't draw zero radius circles
This is interesting as it's in the engraving section of the file. Perhaps the extension thinks we're trying to cut a hole that is smaller than the tool and does something funny. Anyway, I'm going to try and have a look at this to see if there's a way out.

I also wondered about whether this is a peculiar foible of curves and that other shapes with straight edges would be unaffected. As you are the Inkscape ninja, do you have a way to globally replace a circle with a polygon (doesn't really matter how many sides for now - trinagles, squares and hexagons would be great - don't need to try and approximate a circle with 32 sided polygon)?

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
I also wondered about whether this is a peculiar foible of curves and that other shapes with straight edges would be unaffected. As you are the Inkscape ninja, do you have a way to globally replace a circle with a polygon (doesn't really matter how many sides for now - trinagles, squares and hexagons would be great - don't need to try and approximate a circle with 32 sided polygon)?

I don't completely follow you.  By "globally" you mean change all the circles in a file, right?  I don't know of any way, but probably a script could be written to do that.  I don't know how to write scripts, although I do have a general understanding what kind of things they can do.  Or maybe some way using the commandline.

Sorry, I have to go offline for a while.  Maybe back tonight or this weekend.
  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline simonm

  • Sr. Newbie
  • **
  • Posts: 8
By "globally" you mean change all the circles in a file, right?
Yes, that's what I meant. Thanks

Offline simonm

  • Sr. Newbie
  • **
  • Posts: 8
Some interesting results from a  little test. I decided to check the gcode paths for a hexagon and some circles of varying diameters relative to the conical tool size.
Here's the test svg
Screenshot (86).png
*Screenshot (86).png
(102.45 kB . 864x781)
(viewed 164 times)

Here's the hexagon - comes out nicely and you can see the toolpaths are correct for the corners:
Screenshot (80).png
*Screenshot (80).png
(255.18 kB . 1920x1080)
(viewed 168 times)

Screenshot (81).png
*Screenshot (81).png
(158.48 kB . 1920x1080)
(viewed 162 times)

Screenshot (82).png
*Screenshot (82).png
(149.04 kB . 1920x1080)
(viewed 167 times)

However things look strange when the other holes are in shot! Somehow the hexagon gets scaled up.
Screenshot (83).png
*Screenshot (83).png
(157.02 kB . 1920x1080)
(viewed 158 times)

So I decided to see if using the Path/Object to Path/Union of all six paths/items did anything and it then removed material around the shapes. Oh well!
Screenshot (84).png
*Screenshot (84).png
(402.79 kB . 1920x1080)
(viewed 158 times)

Screenshot (85).png
*Screenshot (85).png
(245.31 kB . 1920x1080)
(viewed 161 times)

All this is driving me towards looking harder at the code.

Offline brynn

  • Administrator
  • *****
  • Posts: 227
  • Country: us
  • Gender: Female
    • Inkscape Community
When you say you used Path/Object and Path/Union....?  Do you mean Object to Path, and then Union?

When I was testing, I was always testing with a circular path.  I didn't think it would work with the circle shape, because I thought it had to be paths for the gcode.

But, I didn't try combining the paths.  Well now I'm curious -- now I have to test!

Well I didn't get anything much different.  But I did find something that I didn't notice before.  Whenever I was using Path to Gcode dialog, it would draw the colored segments with black arrowheads right on top of the paths.  But this time, I notice when I was using the Engraving dialog, that those were outside the screen area, on the canvas.

But now that I can see them, I see where there might be a different problem.  With Path to Gcode, there was a black arrowhead wherever there is a node.  And if you're not careful with the offset paths (cutting paths) you'll end up with several nodes on one point.  I wasn't clear if that would cause a problem with the actual cutting, but because the arrowheads were point in different directions (when the nodes were stacked up), I really wondered.

But here with Engraving, there are black arrowheads going backwards and forwards!  I don't know what that could mean, but it seems potentially problematic to me.

Here's the large circle, which I think is looking like a circle instead of a hole, because it's larger than the cutting tool diameter.  But still, the arrowheads going in opposite directions is curious!

gc-engr-ah1.png
*gc-engr-ah1.png
(36.72 kB . 628x532)
(viewed 157 times)


And here's one of the smaller circles, which probably is more correct.  But since these are made of those rays, it's a short path going outwards, and another short path going inwards (as you can see on the right, where I spread the pieces out, for clarity).  Well, that makes sense.  But what are those extra, one-node paths (which I moved up above the place where I spread out the ray paths).

gc-engr-ah2.png
*gc-engr-ah2.png
(35.59 kB . 653x496)
(viewed 154 times)


As far as I can tell, each single node path is right at the outer end of the short 2-node path which makes the rays.  I don't know what that would mean for the actual cutting.

Oh, holy crap!  I decided to try to align the SVG paths with the arrowhead objects, to find out if those one-node paths might correspond to the original nodes.  But those gcode paths (arrowheads) are nothing close to the size of the original paths (which I made blue, for clarity)!  See below screenshot.

gc-engr-ah3.png
*gc-engr-ah3.png
(48.25 kB . 768x473)
(viewed 160 times)


I wonder what that means?  I have everything set for mm, so it's not about conflicting units.  Maybe it's about one of those other options, which I don't know what they mean?  Well, in any case, if these gcode paths are the actual cutting paths, they are nothing close to the correct size of thes original paths!

Edit -- well actually the arrowheads are dark blue, instead of black....
  • 0.92.2
  • Windows 7 Pro, 64-bit

Offline BDH

  • Newbie
  • *
  • Posts: 1
I'm curious as to what kind of machine you were going to run this on.