Adaptive Path/CAM Operation

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Adaptive Path/CAM Operation

Post by RatonLaveur »

Adaptive strategies with a laser process keeps the ablation rate stable, due to constant beam engagement. Quite similar to conventional if you think about it.

The machine does not use a galvo scanner, hence why adaptives are more interesting than conventional laser milling strategies.
RatonLaveur wrote: Fri Sep 06, 2019 7:54 am It seems that the blue generative path is already much more accurate than the resulting G-Code path. Perhaps there's something to be done here?
kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

Hi,

Managed to find simple way to increase accuracy for small tools without affecting the performance for larger tools (and also without needing to adjust the all the parameters, the solution is based just on scaling adjustments within the alg. for tools <1mm).

i.e. before (tool 0.1mm 20% stepover, processing duration ~10 sec):
Selection_074.png
Selection_074.png (40.73 KiB) Viewed 3018 times
after (processing duration ~ 50 sec):
Selection_075.png
Selection_075.png (36.49 KiB) Viewed 3018 times
calculation is 5x slower in this example, but generally speaking slow-down can not be avoided as the alg. naturally needs to process/produce more points to get more accuracy.

Submitted as a PR.

BR,
K.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Adaptive Path/CAM Operation

Post by dubstar-04 »

What would it take to swap the G1 moves for G2 or G3 arc moves?
kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

dubstar-04 wrote: Sat Sep 07, 2019 6:52 pm What would it take to swap the G1 moves for G2 or G3 arc moves?
Although curves produced by the alg. are not actually arcs, in many cases they could probably be approximated with arcs (within some tolerance) and I guess that number of output points would decrease significantly with that. To make this work some arc fitting algorithm would be required, and also if that would be done in C++ then change of the interface between the C++ code and python code would be required (currently C++ part outputs only arrays of points/line segments)
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Adaptive Path/CAM Operation

Post by dubstar-04 »

kreso-t wrote: Sat Sep 07, 2019 7:51 pm
dubstar-04 wrote: Sat Sep 07, 2019 6:52 pm What would it take to swap the G1 moves for G2 or G3 arc moves?
Although curves produced by the alg. are not actually arcs, in many cases they could probably be approximated with arcs (within some tolerance) and I guess that number of output points would decrease significantly with that. To make this work some arc fitting algorithm would be required, and also if that would be done in C++ then change of the interface between the C++ code and python code would be required (currently C++ part outputs only arrays of points/line segments)
If this is something you're interested in working on I would like to help. I understand you're busy with other things but if you ever fancy having a look at it let me know.
kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

dubstar-04 wrote: Sat Sep 07, 2019 8:07 pm
If this is something you're interested in working on I would like to help. I understand you're busy with other things but if you ever fancy having a look at it let me know.
If someone knows a decent python implementation of arc fitting alg. that would as input take a list of points/line segments + tolerance setting and as output produce the list of arcs, it would be relatively easy to include it into adaptive if all that done in python code (no need to change the interfaces to C++, etc.)
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Adaptive Path/CAM Operation

Post by RatonLaveur »

I'm...I'm speechless... If you can share a file that i can use on my current 0.18 py2.7 (i do run a 3.6 too) version the day after that I'd be making some sparks fly!
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Adaptive Path/CAM Operation

Post by dubstar-04 »

RatonLaveur wrote: I'd be making some sparks fly!
Video required....
kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

RatonLaveur wrote: Sat Sep 07, 2019 8:32 pm I'm...I'm speechless... If you can share a file that i can use on my current 0.18 py2.7 (i do run a 3.6 too) version the day after that I'd be making some sparks fly!
The change is done in c++ code so file copy would not work - you need to either build the FreeCAD from source https://github.com/kreso-t/FreeCAD
or wait for the FreeCAD official build (i.e. in https://github.com/FreeCAD/FreeCAD/releases) produced after this pull request is included/merged into master.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Adaptive Path/CAM Operation

Post by RatonLaveur »

dubstar-04 wrote: Sat Sep 07, 2019 8:34 pm Video required....
I cannot guarantee that I can here. But ill be happy to share some in PM.
kreso-t wrote: Sat Sep 07, 2019 8:40 pm The change is done in c++ code so file copy would not work - you need to either build the FreeCAD from source https://github.com/kreso-t/FreeCAD
or wait for the FreeCAD official build (i.e. in https://github.com/FreeCAD/FreeCAD/releases) produced after this pull request is included/merged into master.
I suspected it was there in the hard C++ code, i did take a look at the python file (me and my ignorance) and was surprised to not see much about the actual algo.

Then I'll do just that, get the next 0.19 pre and enjoy the fruits of a civilizeder world. Need a new laptop though...:)
Post Reply