Adaptive toolpath part incursion bug in 0.20.2

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!
areseeuu
Posts: 3
Joined: Sat Mar 18, 2023 7:23 pm

Adaptive toolpath part incursion bug in 0.20.2

Post by areseeuu »

I have a gantry router (a PrintNC) that I occasionally cut steel with. Since a PrintNC uses a high speed spindle and is nowhere near as rigid as a VMC mill, slotting in steel is something I try very hard to avoid. For today's part, I had a need to profile part of a shape, so I figured I would model a mock part that would result in the desired trochoidal milling path - but when I generated the path, it cuts in an unexpected place that would screw up the part. I reduced the mock part to the minimum complexity needed to recreate the issue - here's what it is:
freecad-adaptive-path-part-incursion.png
freecad-adaptive-path-part-incursion.png (26.79 KiB) Viewed 1099 times
freecad-adaptive-path-part-incursion-closeup.png
freecad-adaptive-path-part-incursion-closeup.png (46.3 KiB) Viewed 1099 times
The part is two sketches: The first one is a 50mmx50mm square centered on the origin and padded to 10mm height. The detail of the second sketch is shown here:
freecad-adaptive-path-part-incursion-pocket-sketch.png
freecad-adaptive-path-part-incursion-pocket-sketch.png (48.39 KiB) Viewed 1099 times
Then, create the Job object, leave everything as the default, then select the face of the pocket and click Adaptive. The screenshots above were without the finishing profile option checked, but it shows the same deviation:
freecad-adaptive-path-part-incursion-operation-options.png
freecad-adaptive-path-part-incursion-operation-options.png (109.86 KiB) Viewed 1099 times
Playing around with this, I've noticed that if I decrease the upper angle constraint to 5.46 degrees or less, it goes away. 5.47 degrees shows the bug.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by chrisb »

Hi and welcome to the forum!

Please add the file - and your full FreeCAD infos.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
areseeuu
Posts: 3
Joined: Sat Mar 18, 2023 7:23 pm

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by areseeuu »

Here's the file:
freecad-adaptive-path-part-incursion.fcstd
(56.25 KiB) Downloaded 21 times
Here's the FreeCAD info:

Code: Select all

OS: Debian GNU/Linux bookworm/sid (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.20.2.
Build type: Release
Python 3.11.1, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by GeneFC »

areseeuu wrote: Sat Mar 18, 2023 8:04 pm
This exact problem came up on the forum several months ago. (I looked, but could not find the previous discussion.)

It seems to be related to very specific parameter settings causing some sort of math failure.

I do not know any fix at this time other than watching for it and then tweaking parameters to get rid of the bad moves.

Someone else may have more information.

Gene
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by Russ4262 »

areseeuu wrote: Sat Mar 18, 2023 9:35 pm Here's the file: ...
The solution is to increase the "Stock to Leave" value to greater than zero. I use 0.001 mm because that is within my tolerance, but you might use 0.5 mm, and then add a Profile op afterward to remove that material.

Russell

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.32198 (Git)
Build type: Release
Branch: master
Hash: f51b2156f35399cab38eef1e957a59ad5a11de66
Python 3.8.16, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * FC_SU
  * freecad.gears 1.0.0
  * PathExp
  * Z_MacroStartup
Attachments
freecad-adaptive-path-part-incursion_current.fcstd
Compatible file with 0.21 code structure.
(74.59 KiB) Downloaded 18 times
Change the "Stock to Leave" value to something greater than zero.  Follow up with a Profile op if need be.
Change the "Stock to Leave" value to something greater than zero. Follow up with a Profile op if need be.
Snip macro screenshot-3b50b2.png (97.4 KiB) Viewed 996 times
areseeuu
Posts: 3
Joined: Sat Mar 18, 2023 7:23 pm

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by areseeuu »

This is working! Thank you Russell!
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by chrisb »

You can decrease the diameter of the tool by the same amount in case 1µ is too much :) .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by MRx »

So easy apply my fix and the issue is gone :-)

I am not going to spend a single second anymore on that particular code part since I'm working on other things.
I'm using this patch since it was released and never looked back.
Back then I had tons of issues with FreeCAD because I worked on a project which seemed to be a bit difficult for FreeCAD and which has shown me several limitations...
After I released this patch I was already working on other things.
If someone doesn't like what the patch looks like feel free to change it... but the FreeCAD way seems whatever waste developers time and keep going with the bug - OK

The reason why this bug happens is in clipper, the fix addresses that values which are directly nearby will be filtered. eg. 1,3,6,7,8 - 7 will be filtered out since clipper cannot handle the direct next number when shrinking or growing an outline.

https://github.com/FreeCAD/FreeCAD/pull/5276
Last edited by MRx on Tue Mar 21, 2023 12:52 am, edited 6 times in total.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by chrisb »

I have added a section "Known issues" to the wiki of Path Adaptive
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Adaptive toolpath part incursion bug in 0.20.2

Post by Russ4262 »

chrisb wrote: Mon Mar 20, 2023 7:23 pm I have added a section "Known issues" to the wiki of Path Adaptive
I recommend that the suggested solution not be to adjust the diameter of a tool, but use a reasonable value for "Stock to Leave" and then follow the Adaptive op with a Profile op to finish the side walls. I think this is more in line with how a machinist might mill the part, using the Adaptive op for clearing, then a Profile and possible Pocket/Surface op for the final finish.

Just my recommendation. I would not want someone to adjust the tool size, then forget about the adjustment and use that tool on another operation, which would then introduce an error in that machining process.

Thanks for all your help, sir. Your support for FreeCAD users is fantastic!

Russell
Last edited by Russ4262 on Tue Mar 21, 2023 2:32 am, edited 1 time in total.
Post Reply