Expert Feedback needed: LeadInOut dressup

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
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Expert Feedback needed: LeadInOut dressup

Post by sliptonic »

Hey guys,
I'm trying to resolve a bug I found where the leadInOut dressup produces gcode that gives the simulator problems.

I haven't used the leadInOut dressup much and I didn't write the code so I'm pretty unfamiliar with it. The code is kind of a mess and hard to work on.

Anyway, I found this feature and the corresponding code:

This looks very wrong to me. Cutter compensation should be handled by the post processor but here it is being enabled in a dressup of all places. There's no other place in Path where we're controlling cutter compensation like this.

This will probably cause problems if multiple dressups are stacked and compensation isn't turned off properly or throw errors at the control if the G41/2 is called and compensation is already on.

I think this 'feature' is a mistake and should be removed immediately. Change my mind.
2022-03-31_15-51.png
2022-03-31_15-51.png (34.33 KiB) Viewed 1836 times

Code: Select all

        if obj.UseMachineCRC:
            if self.getDirectionOfPath(obj) == "right":
                results.append(Path.Command("G42", {"D": toolnummer}))
            else:
                results.append(Path.Command("G41", {"D": toolnummer}))
CoderMusashi
Posts: 92
Joined: Mon Nov 19, 2018 8:26 pm

Re: Expert Feedback needed: LeadInOut dressup

Post by CoderMusashi »

I am going to have to agree with you about this possibly causing problems. I am a big advocate on using cutter compensation at the machine for tool wear. It is not hard to add it to a given tool path after it has been generated from freecad if you want the ability to comp at the machine. It did not have a big impact on the code generated that I tested. The dressup is the only place I see using and adding Machine CRC. It could get real ugly though if you are using Geometry compensation as opposed to wear compensation.

For those who read this and do not understand the difference let me briefly explain. Lets say your cutting the outside of a shape and your under or over your desired dimensions by .001 to .01 of an inch. With wear comp you are only telling the machine to compensate just a little and if you programmed your tool paths with sufficient safe distance on entry and exit of maybe .05 of an inch a few hairs of an inch won't be a big deal.

Geometry compensation on the other hand is where you can use say an end mill that is 1/2 instead of a 7/16 and just by putting the .5 value into your compensation your program will cut as it should. The reason it can do this is your CAM software generates code for a toolpath with no cutter compensation. The cutter compensation is done by the machine controller when it reads the G41 / G42. This can get ugly if the max safe distance for the generic tool path was developed with a small distance in mind. If instead of using 1/2 endmill you choose to use a 1 inch you could have a nice crash. That means you need to be at least half the diameter of 1 inch plus the safe distance from where the generic code has you entering and exiting for the cut. If you did not plan ahead for this your gonna have tool crashes.

I never ever recommend using Geometry compensation for this reason. Wear compensation on the other hand can be safer if you are giving yourself .100 of an inch at least for safe distance entry and exit and not compensating a whole lot. A reground 1/2 inch end mill that measures .485 won't make or break you in that case.

The current way FreeCAD compensates for tool diameters is at the computer and not the machine. That means if you have a slightly smaller end mill or some flex your dimensions may be off (if your machine back lash and such are dialed in). So you end up having to just fire up FreeCAD and changing the tool diameter for the toolpath and regenerating the NC code to get your dimensions right. I would rather have people have to do this then crash their equipment due to no planning properly for cutter comp.

I myself have just started looking at the dressups due to recent forum posts. I had never played with them before a few weeks ago.

Nice catch Sliptonic!!!
charleyann
Posts: 20
Joined: Fri Dec 24, 2021 8:39 pm

Re: Expert Feedback needed: LeadInOut dressup

Post by charleyann »

Playing with this a bit this morning and yes, it's confusing.
In the Profile operation “Use Compensation” will comp the path by the radius of the assigned tool but does not use G41/42.
In the LeadInOut dressup “Use machine CRC” does toggle the use of G41/42

My personal view would be to have the “Use machine CRC” selection in the operation and have the dressups follow what is selected there.

As a long time CNC programmer / instructor I agree with CoderMusashi. I have always used and taught wear comp rather than geometry comp. It is much safer and easier to manage.


OS: Linux Mint 20.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: cb9dda708494f3d20ec153c7881b9795a550c265
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods:
* A2plus 0.4.55
* ThreadProfile 1.81.0
* kicadStepUpMod 10.11.6
* Assembly4 0.11.10
* fasteners 0.3.38
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Expert Feedback needed: LeadInOut dressup

Post by sliptonic »

Here's another one. I can't, for the life of me, figure out what this feature is supposed to do.

Playing with it changes the leadin/out but not in a way that I can see being useful.

The tooltip is "The Mode of Point Radiusoffset or Center"

Anyone know what the use-case of this thing is? Again, without a useful argument, I'm inclined to kill it off.
2022-04-04_18-04.png
2022-04-04_18-04.png (36.55 KiB) Viewed 1517 times
User avatar
freman
Veteran
Posts: 2198
Joined: Tue Nov 27, 2018 10:30 pm

Re: Expert Feedback needed: LeadInOut dressup

Post by freman »

My personal view would be to have the “Use machine CRC” selection in the operation and have the dressups follow what is selected there.
I'm with Charlie on that. This is too specific to be in a dressup. Dressups should do just that and no more.
The tooltip is "The Mode of Point Radiusoffset or Center"
I've only used this dressup simply to step down diagonally between levels without paying much attention to detail.

Guessing : where does the lead-in start: at point of tool contact ( radius ) or tool axis ( centre line ).

I did not get the step down exactly where I expected. So not understanding this may be why.
eajmarceau
Posts: 73
Joined: Tue Feb 22, 2022 9:16 pm

Re: Expert Feedback needed: LeadInOut dressup

Post by eajmarceau »

sliptonic wrote: Mon Apr 04, 2022 11:10 pm The tooltip is "The Mode of Point Radiusoffset or Center"

Anyone know what the use-case of this thing is? Again, without a useful argument, I'm inclined to kill it off.
The use case for this was presented in the posting

https://forum.freecadweb.org/viewtopic. ... 94#p593094

but I added my own comments on that approach in that conversation stream.
dtay
Posts: 20
Joined: Fri Jan 17, 2020 12:52 pm

Re: Expert Feedback needed: LeadInOut dressup

Post by dtay »

Here is an example of a lead in move compensating for the tool radius at the start and end of a path. With modern controls it is recommended to use this style of cutter compensation. Without it you will lose functionality. Such as feed rate optimization on contours. CFC on 840D for instance: https://support.industry.siemens.com/cs ... 3&lc=en-AT
CRC.JPG
CRC.JPG (42.15 KiB) Viewed 1176 times


I agree with applying this as a global setting to the entire tool path.
User avatar
luvtofish
Posts: 83
Joined: Thu Mar 31, 2022 8:45 pm

Re: Expert Feedback needed: LeadInOut dressup

Post by luvtofish »

    dtay wrote: Mon May 09, 2022 9:37 pm Here is an example of a lead in move compensating for the tool radius at the start and end of a path. With modern controls it is recommended to use this style of cutter compensation. Without it you will lose functionality. Such as feed rate optimization on contours. CFC on 840D for instance: https://support.industry.siemens.com/cs ... 3&lc=en-AT

    CRC.JPG



    I agree with applying this as a global setting to the entire tool path.
    I concur. I’ve read up on how my cnc control performs leadin and leadout and it is recommended to start at least a tool width away. This allows any CRC to adjust and angle in to the work as it begins the cut just as you’ve shown. If the distance is to close, the transition to CRC can gouge the workpiece before arriving at the proper tool path curve. How does Path handle CRC now? I don’t recall seeing any G41/42 in the tests I’ve ran.
    Post Reply