vlachoudis / bCNC

GRBL CNC command sender, autoleveler and g-code editor
GNU General Public License v2.0
1.58k stars 536 forks source link

Adaptive clearing for pocket operation #815

Open Harvie opened 6 years ago

Harvie commented 6 years ago

Please add feature to mill pockets using adaptive toolpaths. It helps to reduce deflection and allows to make deeper cuts (=tools will last longer, because you can use full length of blade, not only end of it) by keeping constant engagement in XY direction (could say "constant stepover", but it's more complex than plain stepover approach).

image

Avalonnw commented 6 years ago

You realize there are CAM processors out there that do that, right?

Harvie commented 6 years ago

@Avalonnw Exactly. That's why i think bcnc can do it too. Every time i post issue about CAM functionality some fusion 360 fan pops out of nowhere. Why even bother watching bcnc? Pretty much everything can be done by different software packages. With this kind of attitude we can all just go home and use something else. But this is bcnc repository, so i don't care if solidworks already does this.

Avalonnw commented 6 years ago

Fair enough. I personally don't use bCNC for it's CAM as it's generally very confusing than any other option available. To me it's a nice grbl controller that can do many things others can not.

Harvie commented 6 years ago

bcnc is extremely handy 2D CAM once you unconfuse yourself. not really for complex 3D parts, but i always use it for quick 2D jobs, because the workflow is much faster in such cases. Especialy the fact that it does not differ between sketch/drawing and toolpath (g-code) was confusing at first, but then it got really useful. it's like swiss knife.

vlachoudis commented 6 years ago

@Harvie I tend to agree with you (not because I wrote it :) but for simple 2D operations or almost real-time control make the CNC machine behaving like a sophisticated hand-tool, and it is faster than all other solutions. For complex things I use fusion 360, but there like all other packages you have to prepare everything in the program simulate it and then transfer to the machine. In bCNC the CAM algorithms especially the pocketing algorithm, as well the workflow needs to be improved. My only problem is the lack of time. If someone is willing to sketch the algorithm it would be faster to implement.

Harvie commented 6 years ago

This guy looks like he can help. But i guess, that we have to first implement way to work with differences of shapes. Since it does not make much sense to have 2D adaptive, but not have such basic feature as islands in pockets. Especially when these algorithms work on removing material from area rather than following contours of the area.

http://www.freesteel.co.uk/wpblog/faq/#progrep

Also gave me interesting idea about "trochoidal machining", that's similar concept, not as cool, but WAAAAY easier to implement. Trochoid. Similary to adaptive clearing it might enable people to machine harder materials that they would be able without it. Basicaly you take endmill and work it in circles acting as bigger endmill:

image

We can probably use existing bCNC tools to generate pocket toolpath for bigger endmill and then postprocess it to emulate such diameter by trochoidal moves of smaller one. Maybe we can even reuse driller code which drills along path to do circles along the path instead! :-)

image

image

These strategies allow to do deeper cuts with the same machine. They achieve this by precisely controlling radial depth of cut rather than axial depth of cut (which is what bCNC does now...)

Harvie commented 6 years ago

I've written some elementary and highly experimental trochodial plugin:

image

Point of this plugin is that i can experiment with cuts driven by radial depth of cut rather than by axial. Just as proof of concept to see if it makes sense on my machine...

Harvie commented 6 years ago

image

Harvie commented 6 years ago

New island based tabs even play nice with trochoidal mode!

image

image

Harvie commented 6 years ago

image

Trochoidal now supports ARCs! :-)

MARIOBASZ commented 6 years ago

I put here examples of my previous version of trochoidal cutting: I start from the logger plugin mutating and adding the features to allow cutting at different heights, adjusting the diameter at the corners, fast return to the same way back, although with errors that I must correct . I'm rewriting a portrait of the trochoidal version of Harvie. Maybe some of my ideas serve to complement and add to yours, such as adaptive routing for trochoidal cutting, and need help to solve some issues. My intuition is that it serves for some simple operations such as trochoidal ramp or to change for chamfer, where I work in 2D and then complements the cut on the design of a surface mesh is more comprehensive PRUEBA TROCOIDAL_2.txt image

with and without a corner adaptation

image

image

MARIOBASZ commented 6 years ago

Issue: Joints between trochoids: I had not thought of the rectification of the ridges when cutting, it has its advantages but it also slows down the operation, sometimes this inconvenience is negligible or it is convenient to make a final pass. What I used most is a wider radius arc for the junction between trochoids. There was also an option of "overcutting" (going and coming back cutting), but I do not know if it makes sense image

The arc splices do not solve the problem of jerk: reading, this problem occurred at the origin of the railway by centrifugal force, and is resolved in the trace of motorways when passing from straight (infinity radius) to curve or the inverse, no It limits only to tangent. It would have to use a spiral for splicing clothoid? http://www.matematicasdigitales.com/espirales/ http://juanfernandosaninmaths.blogspot.com/2012/08/curvas-en-carreteras-utilizando.html?m=1

Harvie commented 6 years ago

i didn't knew that i can use R for G2 and G3. I was only using I J notation. R makes much more sense in some cases. I like your examples. If you are going to base on my plugin, please se the latest version: https://github.com/Harvie/bCNC/blob/master/plugins/trochoidal.py

it has support for arcs now, but it's still not merged upstream.

MARIOBASZ commented 6 years ago

I'm going to upload the trochoid profile plug, on which the trochoidal cut runs. It would be good to modify the way the notice to start corner adjustment works, I think of adding a line with a comment and reading it interpret as such (I suspect that in islands and in tab in operation of court works in that way). Help: I ​​like how the selection of several blocks works in both profile and pocket: it disables the original, it inserts the result underneath them, (it does not take into account if there are G0 movements inside it to inform that I finish a block but I think that solved that problem). It would be nice to be able to adjust to this way of selecting

MARIOBASZ commented 6 years ago

Download your latest version, now it works correctly on islands. Cutting operation: Remarks: by its nature, it is assumed that the sketch ends when the value of Z changes, if you use helical ramp, and you want to modify some parameter or just do it again, this happens: First operation: image next operation: In the case of semicircles, having intermediate heights ... Houston, we're in trouble !!! image Solutions that occur to me: 1- Keep the original, disable and generate new route 2- Recognize sketch finish while Z does not exceed depth increment

Another problem: It is a problem that I had already encountered when working from the Drill plugin and then I understood why: When generating trochoid, the origin of the first vector is the end of the previous block (regardless of which one is selected) is from where comes. I generated trocoide on the circle, image

When wanting to generate ramp cutting, this happens: image

If I change that G1 to G0, since it is not a closed route, it rises to Z safely before the next step at depth

image

MARIOBASZ commented 6 years ago

Curious compunction in pocket followed by cut on ramp (single pass or intermediate): It reaches half depth in one direction, and the second half in the opposite direction ... why?

Harvie commented 6 years ago

It reaches half depth in one direction, and the second half in the opposite direction ... why?

This happens when you CUT path that is not closed loop. However i never meant to combine helical and trochoidal operations, so i didn't tested it, maybe i'll make this work later. However there's still week of my intensive work (including important fixes) left unmerged and i don't have motivation to continue in my efforts while being so. So you have to wait until @vlachoudis mades up his mind about future of bCNC, before i continue adding new features.

MARIOBASZ commented 6 years ago

I have uploaded the path complement for trochoidal cutting and icons. Work on your version even without merging. It is desirable to modify the way you implement the warning alarm for the option of adapting the trochoids in the corners

MARIOBASZ commented 6 years ago

I had not read your comment. Up to here a very laborious and disinterested work that you have done. A hug

Harvie commented 6 years ago

@MARIOBASZ i have fixed the problem with cutting of trochoids, i'll publish as soon as possible:

image

Harvie commented 6 years ago

Curious compunction in pocket followed by cut on ramp (single pass or intermediate): It reaches half depth in one direction, and the second half in the opposite direction ... why?

If you do helix on closed shape (like circle), you don't have to go back. But if you do ramp on open shape (like line), you have to go back and forth (because the shape ends and you can only go back), which would result in cutting twice depth in some places. See this:

image

Green is desired depth of cut. Red is place where it gets cut twice. It's not very efficient, but it was best i came up with. If wanna know more, please continue in #590

Harvie commented 6 years ago

THIS is the reason why we need trochoidal and similar strategies:

https://www.youtube.com/watch?v=Oy3IJ3EjYTo

MPCNC is 3D printed CNC router, but here it is: with right CAM software it cuts aluminum like butter!!! Impressive!

MARIOBASZ commented 5 years ago

trocoidal cut .... well it's amazing: I have drilled 13mm aluminum in a single pass, (my machine has a 500W spindle, in traditional cut with passes greater than 0.10mm depth suffers), with 6.00mm cutter, slot diameter 7.50 -> trochoid diameter 1.50, ae = 0.03mm F500 rpm 12000, upload video https://youtu.be/eEgLi-IIRZQ https://youtu.be/Jj0FOH8Rg-E

Harvie commented 5 years ago

Note to self: FreeCAD has python code for adaptive toolpath generation:

https://forum.freecadweb.org/viewtopic.php?f=15&t=30127 https://github.com/kreso-t/FreeCAD_Mod_Adaptive_Path

Harvie commented 3 years ago

Heekscad Adaptive Clearing Tool Path Library https://github.com/jf---/libactp https://github.com/Heeks/libactp-old