"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

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

Post by spanner888 »

dubstar-04 wrote: Sat Jul 10, 2021 3:35 pm 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
Hi Dan

Thanks for the updates, looking good. I can confirm user now gets warning if no document opened or job in document and tab order etc work well.

So while looking at these changes, I realised there were more situations to handle. A lot of below, is detailed 'fine tuning'. Great if can be updated, but also possibly can wait until more people look at and validate.

I will have a look at possible ways to handle the tool type (Endmill, drill, lathe), and also what options might be available to handle Tool material (HSS, Carbide), and also displaying imperial units, then discuss with you.


What if, while FS calc open, the User does things like:
  • - closes document, then click Update TC in FS calc:

    Code: Select all

    		08:46:36  Traceback (most recent call last):
    		08:46:36    File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\FandS_mine\PathFeedsAndSpeedsGui.py", line 113, in update_tool_controller
    		08:46:36      tc = self.get_tool_controller()
    		08:46:36    File "C:\Users\spanner888\AppData\Roaming\FreeCAD\Mod\FandS_mine\PathFeedsAndSpeedsGui.py", line 103, in get_tool_controller
    		08:46:36      jobs = FreeCAD.ActiveDocument.findObjects("Path::FeaturePython", "Job.*")
    		08:46:36  AttributeError: 'NoneType' object has no attribute 'findObjects'
    
  • deletes job (& all it's TC) or just deletes one TC in a job, then try to update it from FS calc:
    NO ERROR reported!! So nothing to indicate to user something has gone wrong.
  • Opens a TC to edit in Tasks toolControler edit. Then clicking Update TC, does works successfully to update any TC, but the TC open in edit pane does not update. So potential confusion and any changes made in TC edit, would overwrite changes from FS Calc.Guess this would require detecting if TC edit panel is open while FS calc opens to give error.

    Below here acceptable as is?
  • changes TC in FreeCAD - then if click Update TC in FS calc, while overwrite any Feed, rpm changes just made. OK, user should realise.
  • adds job/TC ...just not listed in FS calc, so user SHOULD notice and SHOULD realise what they have done.
  • opens two or more FS calc. Currently can run more than one instance of the FS calc. Is this an issue? I can think of possible user confusion, but otherwise all ok?
  • Closes, then reopens document, while FS calc left open? Then FS calc click Update TC, does works successfully. Situation is unusual and potentially confusing, but no error, so suggest leave behaviour as is.


I also had a closer look at behaviour of the FS calc input fields:
  • Tool section: Tool diameter and Flutes, suggest these be disabled from editing. Especially as user might think these changes sent back to FC toolBit. I also noticed that changing Flute does update FS calc outputs, but changing Tool dia does not. Disabling these inputs would address all these.
    Changing tool material from HSS to Carbide, does change outputs and of course needs to be left active, not disabled.
  • Feed section: All fields trigger updated FS calcs, ie as expected.
  • Speed section: Selecting a material does update the Surface Speed, but no outputs change. I think the Power output should update.
    Changing the RPM (override) field does update the outputs as expected.
Pressing "esc" key while editing an input field, closes the FS calc. This is to me unexpected and annoying, but not a disaster.

Surface speed input accepts alpha characters as well.

Adding surface speed units - would reduce some user confusion.

Same for spindle speed, except that rpm is not a FC unit or property. So I was looking into PropertyQuantity to create an RPM unit https://forum.freecadweb.org/viewtopic.php?f=10&t=47992
But then found that rpm is apparently NOT a unit - see https://en.wikipedia.org/wiki/Revolutions_per_minute
So just suggest adding next to label to say "Spindle speed: (RPM)".

Similarly Chipload should be labelled as Chipload (mm/tooth)

Looks like one outcome of current inputs that use FC properties, is that these fields have a green tick, once value & units correctly entered, which is OK. But the fields without units have double arrows (spinboxes?). This is just minor inconsistency, probably not easy to change or even worthwile changing.

At some point need a version number in ui

At some point someone will want Imperial units....maybe could just use users FC preference, but also requires FS calc UI to change default units.
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 the TC 'knows' what kind of tool it has and can tell the calculator which type of calculation it wants done.
I can see the TC 'knows' which tool, but what not kind of tool, ie Endmill or Drill or Lathe?

Reviewing both the ToolController and Tool default fields and does not show any reference to a Tool being an Endmill or Drill or Lathe.

Only weak link is from the Tool label, or maybe shapefile name. I say weak link because if either of these is used, for example, how will a user calculate FS for a user defined tool, when the FS calc will know nothing about that user defined tool? Also how are some of the default tools categorised, then with this approach?

Any hints?
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: Sun Jul 11, 2021 12:40 am
What if, while FS calc open, the User does things like:
  • - closes document, then click Update TC in FS calc:
  • deletes job (& all it's TC) or just deletes one TC in a job, then try to update it from FS calc:
    NO ERROR reported!! So nothing to indicate to user something has gone wrong.
Thanks for the testing and feedback. These are valid points.

I have pushed a new commit making the dialog modal, So the user is unable to interact with the FreeCAD mainwindow while the Feeds and speeds dialog is open.

Thanks,
Dan
Last edited by dubstar-04 on Sun Jul 11, 2021 5:48 am, edited 3 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: Sun Jul 11, 2021 2:15 am
sliptonic wrote: Fri Jul 09, 2021 2:12 pm the TC 'knows' what kind of tool it has and can tell the calculator which type of calculation it wants done.
I can see the TC 'knows' which tool, but what not kind of tool, ie Endmill or Drill or Lathe?

Reviewing both the ToolController and Tool default fields and does not show any reference to a Tool being an Endmill or Drill or Lathe.

Only weak link is from the Tool label, or maybe shapefile name. I say weak link because if either of these is used, for example, how will a user calculate FS for a user defined tool, when the FS calc will know nothing about that user defined tool? Also how are some of the default tools categorised, then with this approach?

Any hints?
I'm not sure if we need to know the tool type.

I think the drilling parameters could be calculated for every tool and written to the vertical feedrate on the tool controller.

This should be acceptable for all milling and drilling tools?

Something Like:
verticalfeed.png
verticalfeed.png (105.65 KiB) Viewed 3664 times
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 »

spanner888 wrote: Sun Jul 11, 2021 12:40 am
I will have a look at possible ways to handle the tool type (Endmill, drill, lathe), and also what options might be available to handle Tool material (HSS, Carbide), and also displaying imperial units, then discuss with you.
Tool material is included in the toolbit definition.
toolmaterial.png
toolmaterial.png (10.62 KiB) Viewed 3661 times
I think we just use whatever the user has defined there?

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: Sun Jul 11, 2021 5:47 am I think the drilling parameters could be calculated for every tool and written to the vertical feedrate on the tool controller.

This should be acceptable for all milling and drilling tools?
I think it would be a great start, however I am pretty sure that the plunge feed for endmills are different to that for drills. So by default users would use a drill plunge feed for an endmill. I have no idea weather that could be or is often an issue or not, as I have not yet gotten past setting my vertical milling rates to "dam slow".

Would be great if some experienced machinists could "chip in" here!

Ideally it would be great to both endmill and drill plunge feed rates, but this also gets into the area of never ending features.....

Maybe we could do this as per your example layout, but supplement with some usage notes about this. After all, this is a generic calculator, so there are all sorts of reasons users will need to tweak the output. I will add this to my notes/todo, as I was already planning some content.
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: Sun Jul 11, 2021 6:19 am Tool material is included in the toolbit definition.

toolmaterial.png

I think we just use whatever the user has defined there?

Thanks,

Dan
Sure, I will also add that to usage notes, to help get people in the habit of setting this.

Have you had any thoughts on what to do if we get pushed into handling tool coatings?
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

I sneaked a look at your latest changes and cannot find any issues this time, instead I only have a few hopefully useful suggestions.

Suggest adding TC label to line 101 of PathFeedsAndSpeedsGui.py, eg:

Code: Select all

print(tc.Label, ":- tool props:", dia, flutes, material, chipload)
so report pane is like:

Code: Select all

TC: T1 :- tool props: 1.0 mm 0 HSS 0.0 mm
Had thought about suggesting similar to prepend Job label to TC dropdown, but I think that will be too messy.

Yet another refinement - move Spindle Speed to be first/top output listed, because it is first calculated, and then subsequent feed(s) depend on it and similarly Spindle Power required, also depends on feed as well as on rpm.

Having this logical order, makes it a lot easier for novices to understand interactions when you change inputs.

Outputs - split into two sections to clearly show outputs that will update selected TC & a second lower section titled something like "Information" or "Reference" to show the Spindle Power and also should list the Material Removal rate (Q in the calcs), you never now it may help someone, and makes your tool look even better !

Tool flutes field can still be edited.

Only grey area for me, is the default Chipload value of "self.toolDia * 0.01". I am not saying anything wrong with it, just I have not seen any references/discussion on a default like that. While we can address probably this in tooltip and doco, it would be great to have some background on why that default, or "Default Chipload is set intentionally low/medium/..."
User avatar
JoshM
Posts: 456
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

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

Post by JoshM »

Just read this thread, and bravo on the F&S integration!

One question I had is if the tool controllers generated are limited to tools existing in a tool library? I ask because I wasn’t clear if output was limited to tools owned by the user, or if it generated arbitrary recommendations?
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 »

JoshM wrote: Sun Jul 11, 2021 6:18 pm Just read this thread, and bravo on the F&S integration!

One question I had is if the tool controllers generated are limited to tools existing in a tool library? I ask because I wasn’t clear if output was limited to tools owned by the user, or if it generated arbitrary recommendations?
Hi Josh

thanks for your encouragement.

Regarding the generated ToolControllers:
  • First, please note that generating ToolControllers only occurs in one of of the example scripts, so it is NOT actually part of the F&S calculator.
  • The code to generate ToolControllers (& ToolBits) in your job, can also be used without The F&S calculator. In this case the script would set all ToolController & ToolBit parameters to defaults, which you can then set and there is some helper code to change parameters such as ToolBit diameter and Feeds and Speeds by a user defined multiplier for each ToolController created. All of this is scripted only and you would need to edit the script, to remove existing calls to the F&S calculator. You can of course use edit all of these Tc & ToolBits after running the script, using the builtin freeCAD features.
  • The script does generate (create), both ToolControllers and Tools and all their parameters, but does rely on using existing ToolBit shape files. Script does not set the ToolBit icon resource, so you only get a generic block.
  • Both example scripts work with the master branch of the F&S calc, but not in the UI_Overhaul pull request. Some minor changes to match latest changes are required & will happen soon.
{Edit to answer your last point} Yes the script does "generate arbitrary" ToolControllers and associated ToolBits, but does rely on using existing ToolBit shape files.
Post Reply