Recent change to movement with safe and clearance height

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!
etrombly
Posts: 144
Joined: Thu Dec 05, 2019 6:50 pm

Recent change to movement with safe and clearance height

Post by etrombly »

While working on a fix for this bug https://forum.freecadweb.org/viewtopic. ... 26#p391726 I noticed that it looked like clearance height was being used for all moves. From the way I understood it safe height should be used for moves within an operation, and clearance height should be used between operations. I included a change to make it behave that way in the fix, here https://github.com/FreeCAD/FreeCAD/pull/3389 . So please keep an eye out for the change and let me know if it causes any issues.
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Recent change to movement with safe and clearance height

Post by chrisb »

etrombly wrote: Sun Apr 26, 2020 1:00 am I noticed that it looked like clearance height was being used for all moves.
And I think that is correct. Safe height is used where non rapid feeds are used so that the tool doesn't hit the surface at full rapid speed. The space above safe height can be used for clamping and a tool should not hit the clamps just because the horizontal moves are within one operation. In many cases it is possible to use it for horizontal moves, but then the user should decrease the clearance height.

Image linked from the documentation:
Image
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
etrombly
Posts: 144
Joined: Thu Dec 05, 2019 6:50 pm

Re: Recent change to movement with safe and clearance height

Post by etrombly »

That makes sense, but I think maybe the name should be changed then. Clearance and safe height are only ever used for rapid moves. The way it was coded was actually like clearance and plunge height, and internally they were named retract and resume height. Is there a reason it was called safe instead of plunge? I can switch it back to traveling at clearance height for intra-operation moves, if that was the intended behavior.
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Recent change to movement with safe and clearance height

Post by chrisb »

I have investigated the safe and clearance stuff and found in my version some minor errors and inconsistencies.

I have this pocket operation:
Snip macro screenshot-eb6a99.png
Snip macro screenshot-eb6a99.png (9.4 KiB) Viewed 1878 times
To see what's going on I added a tower at the right with a step at SafeHeight and the top at clearance height.
Snip macro screenshot-1897aa.png
Snip macro screenshot-1897aa.png (1.77 KiB) Viewed 1878 times
Observations (verified with the inspect tool):
1) All horizontal rapid moves within the operation are at clearance height. That's good!
2) The first downwards move (plunge) at the very right goes down to safe height with a rapid speed, and further down with regular speed. Good!
3) All other downward moves go down from clearance height to the solid with normal speed. That's not bad, but it's not good either. As in the first move it could go down to safe height at rapid speed.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
etrombly
Posts: 144
Joined: Thu Dec 05, 2019 6:50 pm

Re: Recent change to movement with safe and clearance height

Post by etrombly »

I can change it to that behavior. That's why I was a little confused by the terminology though. From what I've seen safe height is either referred to as plunge height, or clearance is retract height and safe height is clearance height (in other software). Clearance is even called retract in the code. I think from the desired behavior it would make a lot more sense to call safe height plunge height.

Here's how it is with the current behavior I changed it to:
Image

Image
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Recent change to movement with safe and clearance height

Post by chrisb »

I have added a (red) clamp to the model, which I attach, so others don't have to rebuild it (sorry etrombly, should have danoe so before).
Snip macro screenshot-5bb9a8.png
Snip macro screenshot-5bb9a8.png (15.24 KiB) Viewed 1843 times
.

When I create G-code manually I need 3 different heights. I ordered them here in the sequence of the milling process

1) Tool change height. My mill needs additional vertical space to get the tools out and in. It is something above clamping height plus tool and machine dependent height.
This height is only needed between operations.
This height does currently not exist in FreeCAD.

2) Height above clamping for horizontal rapid moves.
These can occur within an operation and between operations.
This height is currently called "Clearance height", as the movement area is cleared from all obstacles.

3) Height where normal moves start. It is used to hit the material smoothly and not at full rapid speed. It is usually only a few millimeters.
This height is only needed within an operation.
This height is currently called "Safe height" because it is safe for vertical rapid moves above.

To me it would minimize misunderstandings if these heights are called
1) Tool change height
2) Clearance height or Clamping height
3) Plunge height

I would appreciate it, if we could find very clear notions for the communication with the users. Of course it should be named in a consistent way in the code too. I am willing to help getting this straight, but I would postpone it until after the 0.19 release, because some instabilities can be expected for a certain period of time.
Attachments
millHeights.FCStd
(40.41 KiB) Downloaded 49 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: Recent change to movement with safe and clearance height

Post by Wsk8 »

chrisb wrote: Mon Apr 27, 2020 7:24 am 1) Tool change height. My mill needs additional vertical space to get the tools out and in. It is something above clamping height plus tool and machine dependent height.
This height is only needed between operations.
This height does currently not exist in FreeCAD.
Because it doesn't exist in gcode either. Tool change is performed by an M6 command. Height is managed by machine controller.
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Recent change to movement with safe and clearance height

Post by chrisb »

Wsk8 wrote: Mon Apr 27, 2020 8:45 am
chrisb wrote: Mon Apr 27, 2020 7:24 am This height does currently not exist in FreeCAD yet.
Because it doesn't exist in gcode either. Tool change is performed by an M6 command. Height is managed by machine controller.
I didn't mean it should be implemented right away, nevertheless it is an important height in the machining process. Besides, there are other things we can do, which don't have a direct equivalent in G-code.
I don't know if other controllers move to a certain height on an M6 command, mine doesn't. It's not a problem for me, I don't have to mill hundreds or thousands of equal parts where time can really be an issue, so I can simply set clearance height to tool change height.

I named it, because we have to get things very clear before putting them into code. Especially if expectations and reality differ, it can have severe consequences on a professional mill. Of course you should check and try before you start real milling, but things which seem to be very clear may not have been tested.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
cahlfors
Posts: 91
Joined: Tue Jan 24, 2012 8:27 pm
Location: Sweden

Re: Recent change to movement with safe and clearance height

Post by cahlfors »

Thanks for explaining this chrisb!
I have seen the picture with the definitions many times before over the years, but it was not until your example above that i finally got what safe and clearance is for. To me, they are just synonyms, hence difficult to understand.
electrical engineer
Ubuntu or Mint
Mendel 3d-printer/OctoPrint
LinuxCNC
Optimum BF20L mill
etrombly
Posts: 144
Joined: Thu Dec 05, 2019 6:50 pm

Re: Recent change to movement with safe and clearance height

Post by etrombly »

chrisb wrote: Mon Apr 27, 2020 7:24 am

1) Tool change height. My mill needs additional vertical space to get the tools out and in. It is something above clamping height plus tool and machine dependent height.
This height is only needed between operations.
This height does currently not exist in FreeCAD.

2) Height above clamping for horizontal rapid moves.
These can occur within an operation and between operations.
This height is currently called "Clearance height", as the movement area is cleared from all obstacles.

3) Height where normal moves start. It is used to hit the material smoothly and not at full rapid speed. It is usually only a few millimeters.
This height is only needed within an operation.
This height is currently called "Safe height" because it is safe for vertical rapid moves above.
How's this?

Image
Post Reply