"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!
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.
Pull request merged.

I have made a draft PR here:

https://github.com/dubstar-04/FeedsAndSpeeds/pull/11

This includes an updated ui and now uses tool controllers:
fands.png
fands.png (54.13 KiB) Viewed 4371 times
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 »

dubstar-04 wrote: Thu Jul 08, 2021 9:05 pm Pull request merged.
Looks great and you made the changes very fast.

The new workflow to select a TC, get and tweak parameters, then update the TC is really simple, quick and removes the current manual back and forth data issues.

Some things I noted:
  • Only shows ToolControllers from first Job in active document.
  • Is it your intent to allow users to change Tool diameter and number of flutes? At the moment user can change, but these do not update the Toolbit.
    One view is that logically changing those features of a Toolbit means creating a new Toolbit, and another view is that it is a very nice convenience to make that change quickly (if the FS UI allowed it).
  • Only "calculate for opType: Milling", does not switch to drilling default parameters or calculations when a drill type TC is selected.
  • Tooltips for Surface speed and Spindle Speed need updating. Would also be great to add tooltip descriptions on other input fields.
  • Readme.md will need updating to remove most of what I added and reflect new version, but that can probably wait a bit until changes settle a bit.
  • Finally, as a novice cnc'er whoI grew up with imperial units, that was some time back, so would be great to have the power output also listed in Watts, which then gives all units in metric.
EDIT: A couple more found while preparing to demo to someone:
  • Input field tab order is not linear down the screen.
  • remove my old unused code & notes
  • If no job in doc, or no doc:

Code: Select all

15:44:45  Traceback (most recent call last):
15:44:45    File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\FandS_mine\PathFeedsAndSpeedsGui.py", line 191, in Show
15:44:45      panel = FeedSpeedPanel()
15:44:45    File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\FandS_mine\PathFeedsAndSpeedsGui.py", line 27, in __init__
15:44:45      self.setup_ui()
15:44:45    File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\FandS_mine\PathFeedsAndSpeedsGui.py", line 54, in setup_ui
15:44:45      self.load_tools()
15:44:45    File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\FandS_mine\PathFeedsAndSpeedsGui.py", line 87, in load_tools
15:44:45      job = FreeCAD.ActiveDocument.findObjects("Path::FeaturePython", "Job.*")[0]
15:44:45  IndexError: list index out of range
Also do you prefer discuss these here and maybe keep the interest flowing or in github?
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:
Also do you prefer discuss these here and maybe keep the interest flowing or in github?
Discussing on the forum is ideal. The PR is draft and not ready for testing. I'm just paranoid of loosing work again, so I pushed it.

spanner888 wrote: Only shows ToolControllers from first Job in active document.
This is an interesting work flow question. Where should the FS calculator be initiated from?

- A button on the TC dialog? - Show a single TC at a time?
- From the menu - show all the TC's in the document and allow selecting them from the dropdown

spanner888 wrote: Is it your intent to allow users to change Tool diameter and number of flutes? At the moment user can change, but these do not update the Toolbit.
One view is that logically changing those features of a Toolbit means creating a new Toolbit, and another view is that it is a very nice convenience to make that change quickly (if the FS UI allowed it).
IMO the FC calculator should only update the TC Feed rate and spindle speed. Allowing the other parameters to be changed from the calculator is great for convenience but I don't think the user should be able to change the tools outside of the toolbit dock / tool manager.

A couple of options:

- None of the parameters are editable. We have an edit button that opens the toolbit for editing?
- The flutes and chipload are editable but not written back to the tool? How to communicate this to the user?
- We allow updating any of the tool parameters and write them back to the tool

spanner888 wrote: Only "calculate for opType: Milling", does not switch to drilling default parameters or calculations when a drill type TC is selected.

The draft doesn't currently have the ability to calculate for drilling operations. This needs to be reimplemented in a way that makes sense for milling, drilling and turning.

Not really sure of a clean way to do this at the moment.

sliptonic wrote: Thoughts?
spanner888 wrote: Thoughts?
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 »

dubstar-04 wrote: Fri Jul 09, 2021 8:13 am interesting work flow question. Where should the FS calculator be initiated from?
For the current Feeds&Speeds gui, I prefer to launch from an added path toolbar icon, as well as a menu item and extend the gui to have Job and ToolController selections. However the ToolController already has an editor Task pane, so maybe the ideal is there. But I really would like to hear what others think on this.

dubstar-04 wrote: Fri Jul 09, 2021 8:13 am I don't think the user should be able to change the tools outside of the toolbit dock / tool manager.
Agreed. I feel to start with simple, clean workflow, so this part of the workflow is Feeds & Speeds into ToolController.
Anyone needs to change ToolBit - FC has the ToolBits system for that, and changing existing workflow would need careful thought.

dubstar-04 wrote: Fri Jul 09, 2021 8:13 am draft (Feeds & Speeds calc) doesn't currently have the ability to calculate for drilling operations. This needs to be reimplemented in a way that makes sense for milling, drilling and turning.
Initial thoughts were just to classify default ToolBits into these categories within the Feeds & Speeds calc, but this won't cater for user defined ToolBits. So the next obvious approach is and added ToolBit property, which means some FC code and ways to update users existing ToolBits. Again it would be good to hear from other on this as well.
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 »

dubstar-04 wrote: Fri Jul 09, 2021 8:13 am
spanner888 wrote: Only shows ToolControllers from first Job in active document.
This is an interesting work flow question. Where should the FS calculator be initiated from?

- A button on the TC dialog? - Show a single TC at a time?
- From the menu - show all the TC's in the document and allow selecting them from the dropdown
My first thought is to implement it from a couple different places but that might get both confusing and difficult to maintain. There's a conceptual question here about what's going on. Is 1) the TC opening a dialog/tool to get feeds and speeds and then updating itself or 2) Is the calculator gathering information and then updating the ToolController(s)? Who's doing the work and who's being worked upon? It's tempting to make the calculator work on all the TCs at once but I think that's a mistake.

I would suggest making the FS calculator as much of a stand-alone tool as reasonable. Don't couple it too tightly to the other objects in the system. This will make it easier to change and improve going forward. So we should be able to launch it and pass it all the information it requires to do its thing. It should give back a set of results. It is up to the calling entity to update the TC (or do something else). But don't pass the calculator the actual TC object or expect it to update the TC when finished. That would mean that the calculator now knows something about how tool controllers work and are implemented and will break if the TC changes.

My suggestion is a button inside the TC that launches the calculator and gets back Feed/Speed. The TC then updates itself. I have some ideas how this can be extended to make the UI even smoother but lets start there.
spanner888 wrote: Is it your intent to allow users to change Tool diameter and number of flutes? At the moment user can change, but these do not update the Toolbit.
One view is that logically changing those features of a Toolbit means creating a new Toolbit, and another view is that it is a very nice convenience to make that change quickly (if the FS UI allowed it).
IMO the FC calculator should only update the TC Feed rate and spindle speed. Allowing the other parameters to be changed from the calculator is great for convenience but I don't think the user should be able to change the tools outside of the toolbit dock / tool manager.
[/quote]

Yes, exactly. Same logic. We don't want to couple the calculator too tightly to the TC. That will make it harder to maintain both.
spanner888 wrote: Only "calculate for opType: Milling", does not switch to drilling default parameters or calculations when a drill type TC is selected.

The draft doesn't currently have the ability to calculate for drilling operations. This needs to be reimplemented in a way that makes sense for milling, drilling and turning.
[/quote]

If the calculator is launched from a TC, then the TC 'knows' what kind of tool it has and can tell the calculator which type of calculation it wants done.

Great stuff!
Powerbook
Posts: 8
Joined: Sun Apr 11, 2021 6:39 pm

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

Post by Powerbook »

Good evening everyone,

Thank you for this tool !

I would like help with the translation into French.
I'm new to Freecad :oops: , how can I help with the translation?

Is the documentation: https://wiki.freecadweb.org/Translating ... _workbench the right entry point?

Thank you.
Regards,
Chris.
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 »

Great! Thanks for getting involved. If this is to be part of the FreeCAD source, rather than an add-on, then the user-visible strings will be wrapped in translation strings like this. This makes all the strings accessible through the translation framework which is described here. Also, check outFreeCAD's translation page.
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: Fri Jul 09, 2021 2:12 pm making the FS calculator as much of a stand-alone tool as reasonable. Don't couple it too tightly to the other objects in the system.
Sounds reasonable.

Below is some thinking out loud on details of how this might look to user, and leading to how to implement.

For each TC user wants to set/calc Feeds & speeds
  1. Double click on desired TC to open ToolController Edit Task Pane.
  2. click on FS calc button (passes Tool dia, flutes, Tool Type (Endmill/Drill/Lathe), maybe in future material to FS calc)
  3. In FS calc set material etc, each change auto updating displayed outputs (ie User does not need to press Calc button)
  4. Once user accepts outputs, click button to close FS calc & return outputs back to task pane
  5. Then what? Just auto update TC, with ability to undo, or just manually edit, or give chance to review changes? Not clear how to manage this step to me yet.
Queries.
What happens if user forgets to close the FS calc?
What if they open more than one?
What if they open one, then select a different TC, or Job, or something completely different?

I am not saying can't use your suggested workflow, just trying to understand how we can make it very robust and 'smooth & easy.

One way forward might still be to "embed" the FS calc in say lower section of ToolController Edit Task Pane. This would eliminate many of my queries above. But would need to be coded so still standalone code and not tightly coupled, ie not passing/returning each TC. I have no idea if tis is possible, but hope to trigger more ideas.

On top of all that as mentioned in discussion last December, or even earlier, it would also be great for the FS calc to be completely independent of FC, so other communities could use it. This might be possible, but with my limited experience, I can't image an easy single code base solution .
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:

[*]Only "calculate for opType: Milling", does not switch to drilling default parameters or calculations when a drill type TC is selected.

[*]Tooltips for Surface speed and Spindle Speed need updating. Would also be great to add tooltip descriptions on other input fields.

[*]Readme.md will need updating to remove most of what I added and reflect new version, but that can probably wait a bit until changes settle a bit.

[*]Finally, as a novice cnc'er whoI grew up with imperial units, that was some time back, so would be great to have the power output also listed in Watts, which then gives all units in metric.
[/list]
Hi spanner888,

I have updated the PR and except for drilling, I think all the reported issues have now been addressed.

PR Here:

https://github.com/dubstar-04/FeedsAndSpeeds/pull/11

I would appreciate some eyes on it if you get a chance.

Thanks,

Dan
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: Fri Jul 09, 2021 2:12 pm ...

If the calculator is launched from a TC, then the TC 'knows' what kind of tool it has and can tell the calculator which type of calculation it wants done.
...
Thanks for the feedback and input. Much appreciated.

I think we are all aligned with the intention here.

I'm a bit fuzzy with some of the details but I think we're best just having a go at an implementation and seeing what works.

Thanks again,

Dan
Post Reply