how to modify tool bit files

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!
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

how to modify tool bit files

Post by freman »

Hi,

A while back I was editing some fcstd tool definitions which were cunningly renamed FCStd files for defining the geometry to various tools.

Some of those I created to avoid bugs, like zero dimensions crashing stuff, no longer seem to work. I guess there have been changes to the code since.

In trying to define a new tool in FC based on v-bit, I find there are still too many parameters.

Tip-diameter, Diameter, cutting edge height and cutting edge angle over specify the geometry. Only three dimensions are required so one of these is NOT being used. It should not appear in the interface. How do I know which one to avoid? How do I know whether I have correctly configured the tool to get accurate paths?

Assuming the angle is know ( choices are limited like 60 , 90 degrees and can be guessed by eye ) outer diameter ("Diameter") and cutting edge height are readily measurable, it would seem like tip diameter is one which can be least easily determined accurately ( unless it's zero ). So that should be the one which is implied from other dimensions.

Otherwise the dlg needs to accept the last three dimensions entered to set the fourth one automatically and update the inputs.

Equally the chamfer tool presents Diameter in the dlg yet this does not even seem to be defined in the sketch of the tool definition file.

I brought this up about a year ago and it seems like it is still not fixed.

What is the state of play on this?

Thx
Attachments
tool-bit-dlg-chamfer.png
tool-bit-dlg-chamfer.png (80.72 KiB) Viewed 2830 times
tool-bit-dlg.png
tool-bit-dlg.png (47.24 KiB) Viewed 2849 times
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: how to modify tool bit files

Post by freman »

I have just tried to use these two tool types to define a deburr path .

Both were set to 60 deg. 8mm shank and tool diam ( I have a straight tool with a point ) , zero tip diam and 6.93mm edge height. ( 4*tan(60) )

When I look at the deburr path W=1, h=1 , it is 1.73mm ( 1mm * tan(60) ) outside the edge and -2.73mm down in Z.

In my estimation that will just tickle the edge of the part and do zero chamfer , not the 1mm specified.

Am I being dumb or is this tool not getting its sums right :?

EDIT. After some exploration I find setting tool angle to either 60 or 120 has no effect on paths. ( I guess I've found out which param is superfluous !! )

If I set h=0, I get a path along the edge at x= -1.73mm , that look credible. If I set h=1, I get previously indicated offsets so the path has moved down 1mm and outward 1.73mm . That is not consistent with the h=0 path since it does not match the same angle, however it got there.
Attachments
chamfer-problem.FCStd
(791.75 KiB) Downloaded 45 times
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: how to modify tool bit files

Post by freman »

Ah, I have noticed that when I open the tool editor to change dimensions I get this error in report window.

Code: Select all

11:52:26  Updating geometry: Error build geometry(1): Both points are equal
Looks like these sketches still can not cope with a zero tip diameter !! I provided the solution to that I year back :(

It seems the trick was applied to the shoulder to prevent conincident points when there is a straight tool but not applied to fix a tool with a pointed tip ( tip diam = 0 ).

This is a bit of a hack and will introduce a small error in the paths. I added 5um which is good enough for a country job. This should really be based on the user's job sheet giving required accuracy but that comes later. FC should be generalised enough so that someone running small high precision machine does not get a sneaky error assumed to be OK when doing wood work !

Needs some thought. The shoulder hack is fine since this is non critical to paths.
Attachments
tip-fix.png
tip-fix.png (119.28 KiB) Viewed 2794 times
Last edited by freman on Wed Dec 01, 2021 11:24 am, edited 2 times in total.
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: how to modify tool bit files

Post by freman »

OK, I've corrected the tool definitions but the apparent errors in the toolpaths remain.

If I set h=0, it looks right. If I set h=1 it adds 1.73 to both x and z which seems to be a bug assuming this is a 90 tool when it ain't. Can someone check that ?


OS: Fedora 34 (Thirty Four) (LXQt//usr/share/xsessions/lxqt)
Word size of FreeCAD: 64-bit
Version: 0.20.26155 (Git)
Build type: Release
Branch: master
Hash: 0926a4148bcff11249fd4f56bc30256102ffe105
Python version: 3.9.7
Qt version: 5.15.2
Coin version: 4.0.0a
OCC version: 7.5.0
Locale: English/United Kingdom (en_GB)
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: how to modify tool bit files

Post by freman »

It gets worse.

I have discovered that the "cutting edge height" of a v-bit is the vertical flutes of the parallel section after the V. Though no sure how the user is to guess that.

Next, since my tool does not have any side flutes I set that to zero. I close out of the tool config ( which does not update the 3D image of the tool ) and tried to reopen to inspect the tool in 3D.

FC HANGS.

This really needs some work.

Code: Select all

Updating geometry: Error build geometry(11): Both points are equal
Invalid solution from DogLeg solver.                                                                                                               
Program received signal SIGSEGV, Segmentation fault.                                                                                               
#0  /lib64/libpthread.so.0(+0x13a20) [0x7f4f094a0a20]                                                                                              
#1  0x7f4eae0f4ff1 in BRepMesh_Delaun::Contains(int, BRepMesh_Vertex const&, double, int&) const from /usr/local/lib/libTKMesh.so.7+0x271          
#2  0x7f4eae0fc3ba in BRepMesh_Delaun::createTrianglesOnNewVertices(NCollection_Shared<NCollection_Vector<int>, void>&, Message_ProgressRange const&) from /usr/local/lib/libTKMesh.so.7+0x4ca                                                                                                        
#3  0x7f4eae0fd446 in BRepMesh_Delaun::compute(NCollection_Shared<NCollection_Vector<int>, void>&) from /usr/local/lib/libTKMesh.so.7+0x166        
#4  0x7f4eae0fd90a in BRepMesh_Delaun::perform(NCollection_Shared<NCollection_Vector<int>, void>&, int, int) from /usr/local/lib/libTKMesh.so.7+0x2ba                                                                                                                                                 
#5  0x7f4eae0fdd84 in BRepMesh_Delaun::BRepMesh_Delaun(opencascade::handle<BRepMesh_DataStructureOfDelaun> const&, NCollection_Shared<NCollection_Vector<int>, void>&, int, int) from /usr/local/lib/libTKMesh.so.7+0x1c4                                                                             
#6  0x7f4eae1002f1 in BRepMesh_DelaunayBaseMeshAlgo::generateMesh(Message_ProgressRange const&) from /usr/local/lib/libTKMesh.so.7+0x151           
#7  0x7f4eae0e52c3 in BRepMesh_BaseMeshAlgo::Perform(opencascade::handle<IMeshData_Face> const&, IMeshTools_Parameters const&, Message_ProgressRange const&) from /usr/local/lib/libTKMesh.so.7+0x343                                                                                                 
#8  0x7f4eae11adae in BRepMesh_NodeInsertionMeshAlgo<BRepMesh_CylinderRangeSplitter, BRepMesh_DelaunayBaseMeshAlgo>::Perform(opencascade::handle<IMeshData_Face> const&, IMeshTools_Parameters const&, Message_ProgressRange const&) from /usr/local/lib/libTKMesh.so.7+0x9e                          
#9  0x7f4eae10a50c in BRepMesh_FaceDiscret::process(int, Message_ProgressRange const&) const from /usr/local/lib/libTKMesh.so.7+0x12c              
#10  0x7f4eae10ac26 in BRepMesh_FaceDiscret::FaceListFunctor::operator()(int) const from /usr/local/lib/libTKMesh.so.7+0xd6                        
#11  0x7f4eae10b17c in OSD_ThreadPool::Job<OSD_Parallel::FunctorWrapperForThreadPool<BRepMesh_FaceDiscret::FaceListFunctor> >::Perform(int) from /usr/local/lib/libTKMesh.so.7+0x2c                                                                                                                   
#12  0x7f4ea691aab5 in OSD_ThreadPool::performJob(opencascade::handle<Standard_Failure>&, OSD_ThreadPool::JobInterface*, int) from /usr/local/lib/libTKernel.so.7+0x45                                                                                                                                
#13  0x7f4ea691ae7c in OSD_ThreadPool::EnumeratedThread::performThread() from /usr/local/lib/libTKernel.so.7+0x7c                                  
#14  0x7f4ea691aec9 in OSD_ThreadPool::EnumeratedThread::runThread(void*) from /usr/local/lib/libTKernel.so.7+0x9                                  
#15  /lib64/libpthread.so.0(+0x9299) [0x7f4f09496299]                                                                                              
#16  /lib64/libc.so.6(clone+0x43) [0x7f4f07968353]                                                                                                 
                                                                       
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: how to modify tool bit files

Post by sliptonic »

freman wrote: Wed Dec 01, 2021 4:59 pm This really needs some work.
This doesn't appear to be a problem with Path logic but limitations of the sketch based tool shape. The good news is you can define your own vbit tool shape and use that instead. Or come up with an improved tool shape sketch.
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: how to modify tool bit files

Post by sliptonic »

Here's an attempt to fix the cutting edge height==0 crash problem. It adds a tiny positive value to the cutting edge height in the constraint formula.
Attachments
v-bit.fcstd
(13.71 KiB) Downloaded 52 times
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: how to modify tool bit files

Post by freman »

Thanks, that's the technique I posted above and also posted here at least a year ago in a brief exchange with mlampert on this subject. With the caveats of whether this suits all uses at all scales, it is surprising this has not been fixed yet.

I note that some of my suggestions that the sketch is simplified to one half profile rotated 360, have been adopted. This makes the sketches cleaner and simpler. It just seems that some dimensions were treated like this with incremental offsets and others still fall apart when they are set to zero.

Agreed, this is not path as such it is sketches for tools, which is a great idea in itself. I think it just needs some tuning. Either a more general model or several different models for straight tools, chamfer and v-bits.
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: how to modify tool bit files

Post by sliptonic »

freman wrote: Wed Dec 01, 2021 9:28 pm it is surprising this has not been fixed yet.
Apologies. Did I miss your PR?
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: how to modify tool bit files

Post by freman »

No, I think I did a PR but forgot to add the tool files when creating it. Then I got tired of arguing about all this and left it to those who thought they knew better. I don't mind contributing solutions but I don't have time to campaign for them.

It seems several suggestions were taken up. But the 10um trick was not applied to all dimensions which need it. That was why I posted the screen shot above showing how to prevent the zero tip diameter problem.

Current V-bit totally hangs FC when cutting edge height is zero. There is a fixed 10um dimension in there but it makes the top of the tool concave. I don't know whether that is what causes the hang in the model. I also set tool diam and shank to 8mm. I think that is the error trigger. It may be better to have a separate tool for these straight tools rather than treat it as special case of the others forms with several near zero dimensions.

Since shank in non critical, it would be best to frig that dimension rather than any cutting edge dimensions.
Post Reply