[Bug] 3dPocket Offset + Min Travel option may lead to problematic toolpaths

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!
Post Reply
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

[Bug] 3dPocket Offset + Min Travel option may lead to problematic toolpaths

Post by pathfinder »

Hello,


I suspect that this is a known issue, but at the off-chance that it isn't, I thought it's probably a good idea to report it here. I may open an issue in Github; I haven't found one that looks relevant, but since I wouldn't be surprised to learn that it's a known problem, I thought it's best to wait for input first.


To the issue:

Basically, if you use the offset pattern for the 3d Pocket and use the min travel option, It can jump to deeper cutting depths in areas where there's still material on top.

In the attached file, if you run it through the simulator or export and inspect the code, you can see that it clears the outermost perimeters on all depth levels first and leaves a column of material in the middle, which means it'll cut into thicker and thicker material, which can be bad. I have observed this on other 3d shapes as well, but the half sphere illustrates the issue nicely.

Now, there's obviously a workaround which is simply not combining offset and the min travel option. This is more of a PSA post I guess.

Version:

Code: Select all

OS: Arch Linux (XFCE/xfce)
Word size of FreeCAD: 64-bit
Version: 0.21.30377 (Git) AppImage
Build type: Release
Branch: master
Hash: 2462f4c7a05745488bb9e81ccc7ba0f386f78849
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Curves.backup1662935656.4450686
  * Curves 0.5.8
Attachments
PocketIssue.FCStd
(54.26 KiB) Downloaded 22 times
Last edited by pathfinder on Mon Sep 26, 2022 7:39 pm, edited 1 time in total.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: [Bug?] 3dPocket Offset + Min Travel option may lead to problematic toolpaths

Post by GeneFC »

I may be wrong, but I recall some discussion a few months ago that said the Min Travel option does not really work correctly.

I suspect what you want instead is "keep tool down", which appears to work correctly and more or less does what the Min Travel would be expected to do.

The keep tool down option seems to be available only in the Property Panel, not the Task Panel.

Gene
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: [Bug?] 3dPocket Offset + Min Travel option may lead to problematic toolpaths

Post by pathfinder »

GeneFC wrote: Sun Sep 25, 2022 12:04 am I suspect what you want instead is "keep tool down", which appears to work correctly and more or less does what the Min Travel would be expected to do.
Well, in my particular situation, not quite.

I do a lot of operations where there's big arrays of separate pockets and the min travel option leads to each pocket being finished before the next one gets worked on. Otherwise, the machine would work layer by layer, moving from pocket to pocket, which means a lot of unnecessary rapid travel time.

Using min travel often reduces operation time to less than half its original time for me. The tool down option doesn't help with this.

I'm not a programmer, but I can imagine that there is no easy fix for this. You'd basically have to come up with a system to somehow sort a point cloud. That doesn't sound easy to me.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: [Bug?] 3dPocket Offset + Min Travel option may lead to problematic toolpaths

Post by GeneFC »

Try both the Min Travel and the Keep Tool Down at the same time. I played with your file a bit more, including making two pocket shapes.

It appeared that each pocket was completed individually, and the center post problem went away.

Probably needs more testing.

Gene
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: [Bug?] 3dPocket Offset + Min Travel option may lead to problematic toolpaths

Post by pathfinder »

GeneFC wrote: Sun Sep 25, 2022 8:21 pm
It appeared that each pocket was completed individually, and the center post problem went away.
Hm, it does something different for sure, but as far as I can tell from the simulation, it still creates an issue.

When I turn on keep tool down in the original file without changing anything else, it will start with the middle column first, but at some point, it will go to outer paths that are deeper than they should be.

I.e. the problem is the same, the paths are just in a different order.

In this particular situation, with the right amount of step-over, it might be a viable and maybe even advantageous path to bore out the middle first, then cut the sides with more depth but lower step over, but it's not intentional and the situation will be very different on other shapes.

Btw, I tested the other patterns and apart from ZigZag, they all show problematic behavior (i.e. milling deeper paths first).
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: [Bug?] 3dPocket Offset + Min Travel option may lead to problematic toolpaths

Post by GeneFC »

OK, here is the test file I tried. It simply doubles the size of the original pad and adds a second copy of the groove. I did not change anything in the sketches or any other part of the body.

I added the second pocket to the 3D pocket operation, but I did not change anything else. The two pockets were completed one at a time, as desired, but the center post issue remained.

I then changed Keep Tool Down to True. The pockets were still completed one at a time, but the center post problem was gone.

I am surprised you do not see the same thing, but I really have nothing more to add.

Code: Select all

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.21.30454 (Git)
Build type: Release
Branch: master
Hash: 5df954690787dedbbf3c35f658f010f388474676
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * FeedsAndSpeeds 0.4.0
  * FeedsAndSpeeds-master.zip
  * Help 1.0.3
  * offline-documentation
PocketIssueGFC.FCStd
(68.16 KiB) Downloaded 19 times

Gene
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: [Bug?] 3dPocket Offset + Min Travel option may lead to problematic toolpaths

Post by pathfinder »

GeneFC wrote: Mon Sep 26, 2022 4:22 pm
I am surprised you do not see the same thing, but I really have nothing more to add.
As am I. I opened and ran the simulation on your test file, which works fine.

But as soon as I open the task dialog for it and close it using "OK", it recalculates it and creates a bad toolpath again.

I kinda suspect that the keep tool down part wasn't the solution here, but just you recalculating the toolpath on your system. Interesting.

Maybe doing a clean install will fix it, but I gotta find out how to save my settings first.


Anyway, thanks for your input.
Post Reply