"Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

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!
spanner888
Posts: 326
Joined: Tue May 28, 2019 10:51 am

"Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by spanner888 »

Release Notes:

Initial demonstration code to integrate "Feed and Speed Calculator FreeCAD addon" into FreeCAD.

Before the details, I need to particularly{spelling edit} acknowledge the following users for their code and encouragement.
onekk, sliptonic, russ4262 {edit: sorry Russ had your username wrong} and of course dubstar-04 for the "Feed and Speed Calculator FreeCAD addon".

Two example scripts are provided:
  • Create sets (ranges) of ToolControllers with feeds and speed that are defined by the "Feed and Speed Calculator FreeCAD addon" and optionally limited to your predefined machine limits. Script also shows how to create ToolControllers without using the "Feed and Speed Calculator FreeCAD addon"
  • Script to use the "Feed and Speed Calculator FreeCAD addon", with/out the CNC limit overrides.
So to the detail. With a few lines of FreeCAD macro, scripted ToolController creation will create
  • a Path Job (optional)
  • Add a range of ToolControllers with incremented Tool diameters to the specified Job
  • Either use your maths to change feed/speed changes for each TC added
  • or use the FS calculater addon to calculate based on stock material
  • FS calculator can also be used to override default calculations so that the feed, speed and power are limited to those suited to your machine

In addition, there are a lot of parameters that need to be set.
A host of defaults are provided to make this task easier.
However all of this is script based, no gui support in FreeCAD, nor in the FS calc addon.

The output is ToolControllers and Tools added to your Job, with the parameters you required already set.
The parameters can be adjusted as required via FreeCAD Path Tools

Intended use scenarios:
  • In every design, create ToolControllers & related tools for every path Operation
  • Ditto, but then save in job templates, for reuse
STATUS:
  • Updated "Feed and Speed Calculator FreeCAD addon" has had basic testing. But changes are only available via scripting and have NOT been added to the GUI at this time.
  • Scripts are a bit rough, and have not yet got to details of things like getting Tool icons correct, or trapping incorrect paths to ToolBit shapes etc.
  • Contributions and suggestions are encouraged, especially as my 'coding skills' are limited.
------------------------------------------------------------
EDIT: 2021-11 Status update & link to primary addon/source:
The addon is not yet "built into" FreeCAD, nor is it in the Addon Manager as yet.

You can find install instructions and download it from here

While this addon currently works well, there are some currently minor bugs and it is felt that there needs to be some further enhancements, such as material based ChipLoad.

Experimental version referred in initial post inldued scripted use to calculate Feeds and speeds, as well as auto-creating Toolcontrollers in a Path Job that have Feeds and Speeds auto calculated. Example scripts are in examples directory.
Last edited by spanner888 on Thu Nov 18, 2021 9:56 pm, edited 2 times in total.
spanner888
Posts: 326
Joined: Tue May 28, 2019 10:51 am

Re: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by spanner888 »

Here is example output, all the ToolControllers, Tools and all the settings created with just two functions calls, after a bit of preliminary document and variable setup.

Top four TC created in one function call, explicitly setting desired values. A second function call created second set of TC, with some user defined parameters and others set by the Feeds and Speeds addon, including optional over ride to ensure outputs all within limits of your CNC.
Output from example script "scripted_creation_Tool_Controllers.FCMacro"
Output from example script "scripted_creation_Tool_Controllers.FCMacro"
Feeds & Speeds & ToolController integration.PNG (13.37 KiB) Viewed 6060 times
Once setup, just need one function call for each Toolbit type required to:
  • Add a range of ToolControllers with incremented Tool diameters to the specified Job
  • Either use your maths to change feed/speed changes for each TC added
    or use the FS calculater addon to calculate based on stock material
  • FS calculator can also be used to override default calculations so that the feed, speed and power are limited to those suited to your machine
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by chrisb »

I want at least give some feedback, although I didn't have any time to have a look at this addition. Nevertheless I'd like to say thank you for this helpful addition!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
spanner888
Posts: 326
Joined: Tue May 28, 2019 10:51 am

Re: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by spanner888 »

chrisb wrote: Tue Jul 06, 2021 7:47 am say thank you for this helpful addition!
That is really appreciated, but in fact 99% of this work & more encouragement came from onekk, sliptonic, russ4262 and of course dubstar-04 for the "Feed and Speed Calculator FreeCAD addon.
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by sliptonic »

Cool! I really REALLY would like and F&S calculator integrated into Path.

For feedback, a couple things pop to mind. These are just suggestions.

Feeds and Speeds is the most confusing thing for new CNC users. I think your dialog could be rearranged to make it even more intuitive:
1 )tabs are usually used to group information, not to make choices. So change the milling/drilling tabs into a radio button group at the top. Changing the setting should change the visible controls.

2) Create three group boxes; one for 'tool, one for 'speed' and one for 'feed'

- Move the diameter, flutes, and material to the tool group box. It would be cool if I could select an existing tool controller and the dialog would populate with the current settings of the TC. Then when OK is clicked, the TC is updated with any changes. This could also have a combobox showing the existing tool controllers in the job.

- In the 'speed' box put the material selection and RPM fields. Material selection is just a shortcut for the user to select an appropriate surface speed so setting the material should display the surface speed in an input field. Surface speed should be overridable just like RPM. If the user has a strange material they should be able to override the surface speed here. Alternatively, you could add a checkbox labeled 'override' if checked, the surface speed field is read/write. If unchecked, it's calculated.

- The RPM override is kinda clunky. It should work like I suggest for surface speed. Display the default RPM in an input field that the user can override.

- The 'feed' box then has the inputs for the WOC & DOC.

All the input controls for diameter, WOC, DOC, and FPT should use gui::inputfield so they are units aware. The user should be able to input the units in whichever schema they want.

I wish we were more consistent in our terminology. 'Feed Per Tooth' seems to be in common use among tool users but manufacturers seem to prefer 'chipload'. I used 'chipload' in the toolbit attributes. I wish we had used 'Depth of Cut (DOC)' and 'Width of Cut (WOC)' from the beginning but we didn't. So I would suggest the following terms to be consistent with Path:
Instead of FPT, use 'chipload'
instead of DOC, use 'step down'
instead of WOC, use 'step over'

It would be nice to include this directly with Path so strings can be translated as well.
spanner888
Posts: 326
Joined: Tue May 28, 2019 10:51 am

Re: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by spanner888 »

sliptonic wrote: Wed Jul 07, 2021 7:14 pm Cool! I really REALLY would like and F&S calculator integrated into Path.

For feedback, a couple things pop to mind. These are just suggestions.
Thanks for all those suggestions, they are a great step in moving this forward. Unless I misunderstood, nearly all were about the 'gui' side of the F&S calculator. This is a existing addon and I first saw it from one of several (many?) forum F&S discussions last December https://forum.freecadweb.org/viewtopic. ... 10#p460615, when Dan
dubstar-04 wrote:"ping"
offered it to the community.

I have not made any changes to the gui yet, except for one very minor bugfix.

What I have done is what I think is a pretty good first step in making a
sliptonic wrote: Wed Jul 07, 2021 7:14 pm F&S calculator integrated into Path.
This is exactly what my post and code is about. Driven by a few issues between chair and keyboard, I realised I could integrate the existing F&S calculator into FreeCAD. It is highly likely my integration approach is not very good, not to mention the coding, so I released for discussion as a first step.

What does it actually do?

From a script (examples included), you can easily create one, or a range of ToolControllers in the specified Job, based on FS calculator output. Each ToolController created has the diameter incremented by a specified amount.

The calculator can optionally be used to override default calculations so that the feed, speed and power are limited to those suited to your machine.

If you want you can also just use your own parameters and optionally increment or decrement by some % for each ToolController created.

ToolBit shape and all the numerous settings can be adjusted to your needs, for each range of TC.

While a script is not as pretty as a gui, it does really help relieve two issues for me, namely transcription errors between the gui and TC (that chair and keyboard issue), as well as one level of boredom & frustration with repeating yet another simple task over and over....

Post above with picture shows two ranges of TC created with just two function calls (after all the setup done).

My code is a bit rough, but the created TC can produce gcode, although I have not yet run a job as my CNC buried under a kit greenhouse at the moment.

What next?

Really up to the community. For me it is almost good enough, and my current CNC skill level, just need to extend the chipload to use a material based lookup, and either add some how to description, or code for vertical feed recommendations. But possibilities are endless, for example chip thinning warning or changes based on cutting side, or finishing or roughing.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by dubstar-04 »

sliptonic wrote: Wed Jul 07, 2021 7:14 pm Cool! I really REALLY would like and F&S calculator integrated into Path.

For feedback, a couple things pop to mind. These are just suggestions....
That's great feedback, thank you.

I will update the add-on to implement these changes.

I was working on updating the FreeCAD materials to include Path data. The add-on then lets the user assign a material directly to the stock (or retrieves it from the stock if already set).

Unfortunately my laptop hard drive died along with a lot of work and it knocked the wind out of my sails but I would like to revisit that idea.

Thanks,

Dan
Last edited by dubstar-04 on Thu Jul 08, 2021 6:01 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: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by dubstar-04 »

spanner888 wrote: Wed Jul 07, 2021 11:10 pm
What next?
The plan with the feeds and speeds add-on was to have a playground to test some ideas and prove the code before it gets merged into FreeCAD.

It is really great to see it being used by someone other than me, and I like that the things you are trying never occurred to me.

It would be preferable to me if we worked on this together rather than maintain two separate projects.

Would you be willing to make a PR and merge your work into the original project?

Proposal:

- Merge your work
- implement Sliptonics feedback
- Get the addon in to the FreeCAD addons (for more exposure and testing)

Thanks,

Dan
spanner888
Posts: 326
Joined: Tue May 28, 2019 10:51 am

Re: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by spanner888 »

Hi Dan

thanks for your comments, and ouch that computer, that hurts.

I have sent a pull request and happy to follow your lead and help out in any way.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: "Feed and Speed Calculator addon" integration & update including scripted creation of ToolControllers

Post by dubstar-04 »

spanner888 wrote: Thu Jul 08, 2021 9:02 am Hi Dan

thanks for your comments, and ouch that computer, that hurts.

I have sent a pull request and happy to follow your lead and help out in any way.

Fantastic! Thank You!

I will have a look at those later and see if I can start rearranging the UI.

Thank you,

Dan
Post Reply