LibLathe - Lathe Path Generation

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
CoderMusashi
Posts: 92
Joined: Mon Nov 19, 2018 8:26 pm

Re: LibLathe - Lathe Path Generation

Post by CoderMusashi »

I posted this in the Tutorials and Videos section of the forum and thought it would be a good idea to post the video link for YouTube here as well. I must say the code is very clean. I would like to tackle the tooling controller portion but don't know where to start any suggestions? Here is the link to the LibLathe tutorial https://youtu.be/dULogG9cfPc
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: LibLathe - Lathe Path Generation

Post by dubstar-04 »

CoderMusashi wrote: Thu Nov 05, 2020 10:13 am I posted this in the Tutorials and Videos section of the forum and thought it would be a good idea to post the video link for YouTube here as well. I must say the code is very clean. I would like to tackle the tooling controller portion but don't know where to start any suggestions? Here is the link to the LibLathe tutorial https://youtu.be/dULogG9cfPc

Wow, This is amazing! Thank you for taking the time to make a video, Its strange watching someone else use it, it makes me feel dirty. I like it. :D

I really appreciate the offer of support, the tools will be created using the new toolbit system, this is currently in progress:

LatheToolbit.png
LatheToolbit.png (70.06 KiB) Viewed 1879 times


If you are keen to help I listed a few tasks here:

https://forum.freecadweb.org/viewtopic. ... 40#p437807

One task that would be really helpful is understanding how we can created a rotated profile of a model.

Aim:
Create a clone of the model and remove partial features (flats, keyways, holes, etc) so they are not processed as part of the turning CAM and ensure all protuding features are revolved.

This is a really interesting project that can be done independently from liblathe and FreeCAD integration. Creating a macro and testing some ideas, asking for help in the main development forum and generally playing around with Python and FreeCAD.

Thanks,

Dan
Last edited by dubstar-04 on Fri Nov 06, 2020 8:05 am, edited 2 times in total.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: LibLathe - Lathe Path Generation

Post by dubstar-04 »

CoderMusashi wrote: Thu Nov 05, 2020 10:13 am https://youtu.be/dULogG9cfPc
A few notes on your comments:

- Using the addon will currently cause an error if the tool name doesn't match the standard insert name e.g. DCMT070204R or CCMT070204R (I've been using the name to test while I work on the toolbits)
- you dont have to draw the model on the XZ plane, model can be orientated later in the path workbench: https://twitter.com/i/status/1321946616421601281
- The x values are negative because liblathe defaults to a 'traditional' lathe mode. There is a Github issue to define the orientation and get the correct code suit your machine.
lathe.jpg
lathe.jpg (18.84 KiB) Viewed 1857 times

Thanks,

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

Re: LibLathe - Lathe Path Generation

Post by dubstar-04 »

- Revolved / Rotated Model Explaination -

The challange should you wish to accept; Create a revolved / rotated / defeaturing macro:

defeature.jpg
defeature.jpg (40.47 KiB) Viewed 1778 times

The macro should create a clone of the selected body and make adjustments to revolve / remove any features that would cause the model to be turned incorrectly.

If you don't have the time or inspiration to contribute such a macro but you have a idea that you think might work please post a reply or pm me if you prefer.

Thanks,

Dan
Attachments
Lathe Example.FCStd
(57.1 KiB) Downloaded 63 times
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: LibLathe - Lathe Path Generation

Post by dubstar-04 »

I seem to be at a point where lathe tooling is starting to become a consideration for LibLathe integration.

My initial thoughts are to have a UI (macro attached) where the user can input the lathe insert geometry, something like:
toolbitUI.png
toolbitUI.png (31.8 KiB) Viewed 1720 times

This would provide the toolbit parameters:
- D = name of the toolbit shape file (X for custom geometry)
- 6.35 = edge length dimension for the insert
- 0.4 = radius dimension for insert
- DCMT070204R - The toolbit string that is currently used by LibLathe

Insert naming is based on the following:
http://www.mitsubishicarbide.com/en/tec ... tification

sliptonic wrote: ping
mlampert wrote: ping
I am very much open to ideas; do you think this will fit with the current toolbit workflow?

Thanks,

Dan
Attachments
TurnTool.ui
(8.27 KiB) Downloaded 65 times
TurnTool.FCMacro
(5.21 KiB) Downloaded 74 times
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: LibLathe - Lathe Path Generation

Post by sliptonic »

dubstar-04 wrote: Sun Nov 08, 2020 3:35 pm
My initial thoughts are to have a UI (macro attached) where the user can input the lathe insert geometry, something like:

toolbitUI.png


This would provide the toolbit parameters:
- D = name of the toolbit shape file (X for custom geometry)
- 6.35 = edge length dimension for the insert
- 0.4 = radius dimension for insert
- DCMT070204R - The toolbit string that is currently used by LibLathe
I don't understand the need for another UI.

The idea of Toolbit is that the shape is modeled parametrically and the named constraints in the model become properties in the toolbit editor. This is done automatically.

It seems like a 'D' type tool insert should be a shapefile. The length and radius are named constaints. If that works, you get the UI for free so there should be no need to create a new one.

Automatic naming is another consideration but the precedent is already set for the toolbit to suggest a name based on the shapefile so perhaps that can be extended.

One thing I don't know about is how deep in the shapefile model the named constraints are parsed. With rotary tools, all the named constraints are in the sketch but other kinds of tools might require a more complex body with named constraints at different levels, or even properties in a spreadsheet in the shapefile document.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: LibLathe - Lathe Path Generation

Post by dubstar-04 »

sliptonic wrote: I don't understand the need for another UI.
This is where I am struggling. The toolbits currently work for lathe tools and that is great, but it can be difficult to know how to convert the isocode into actual values.

This is a photo of a couple of packets from my lathe tooling, note the iso code:

LatheTools.jpg
LatheTools.jpg (148.74 KiB) Viewed 1657 times

It would be nice to have a way to convert this code to the correct dimensions for the toolbit. If it was a 'help' or 'info' page on the toolbit ui and the values could be copied, that would be really nice.

Thanks,

Dan
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: LibLathe - Lathe Path Generation

Post by Wsk8 »

@dubstar-04

Could you provide your current lathe tool library? I always get following error, which seems to be a tool lib problem:

Code: Select all

File "C:\Users\w\AppData\Roaming\FreeCAD\Mod\FreeCAD_Turning_Addon\LibLathe\liblathe\tool.py", line 35, in set_tool
    raise ValueError("Tool Input String Incomplete")
<class 'ValueError'>: Tool Input String Incomplete
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: LibLathe - Lathe Path Generation

Post by dubstar-04 »

Wsk8 wrote: Mon Nov 09, 2020 8:17 am @dubstar-04

Could you provide your current lathe tool library? I always get following error, which seems to be a tool lib problem:

Code: Select all

File "C:\Users\w\AppData\Roaming\FreeCAD\Mod\FreeCAD_Turning_Addon\LibLathe\liblathe\tool.py", line 35, in set_tool
    raise ValueError("Tool Input String Incomplete")
<class 'ValueError'>: Tool Input String Incomplete
I am working on that this week. for now if you rename your tool to DCMT070204R it should work with legacy tool.

I am hoping new toolbits will work by the the end of the week.

Thanks,

Dan
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: LibLathe - Lathe Path Generation

Post by Wsk8 »

Hello,

tried it, but failed. So i printed the file name and it seems "ToolBit" is passed as tool_string. Don't know where this comes from...
I hardcoded DCMT070204R into LL and then it worked :D
Path looks also good, except it doesn't create roughing passes.

mfg
Attachments
ll.png
ll.png (29.38 KiB) Viewed 1613 times
Post Reply