Path Pocket Shape: 4th-axis Integration

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Thu Jun 06, 2019 10:34 pm

Afternoon, Sir.
Thanks for all the documentation you have contributed lately: OCL and 4th_axis.
Erich Schulz wrote:
Thu Jun 06, 2019 6:14 am
I'm thinking this thread could be well captured in the wiki together with the facing operation, so I've integrated it roughly over here: https://www.freecadweb.org/wiki/Fourth_Axis
The page is off to a good start. Looking through some of the other Path operations wiki pages, I think we will need to isolate and move information and instructions on a per-operation basis. For example, the Profile Faces op that is receiving 4th-axis only has three new 4th-axis settings, whereas the Pocket Shape op has many more. Nonetheless, you have a great start. I'd say leave it for now. We can move and modify as the ops develop.

Erich Schulz wrote:
Thu Jun 06, 2019 6:14 am
... it looks like these are 5 axis operations - is that correct or am I missing something???
Well, yo (yes and no). Yes because counting XYZAB is five; however, no because you can't really access complex angles that require both an A and B axis movement for access to the face/feature. I'm pretty sure I'll have to go back and raise the level of complexity on the rotation-angle analysis algorithm for 4th-axis. It is on my to-do list down the line. For that reason I still say 4th-axis. Perhaps a 4.5-axis label is the best I could give.

Thanks for all the help. Wish I could make it down to the southern hemisphere meet.

Russ
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Tue Jun 11, 2019 8:15 pm

Afternoon All.

I have updated the PathAreaOp and PathPocketShape scripts on the OP of this topic. They are the same versions that I just updated for PR 2231. Remember, you also need both for the PathPocketShape op to function.

Cheers,
Russ
RatonLaveur
Posts: 343
Joined: Wed Mar 27, 2019 10:45 am

Re: Path Pocket Shape: 4th-axis Integration

Postby RatonLaveur » Wed Jun 12, 2019 10:07 pm

Hi Russ,

Thanks for updating the scripts, i've been taking them out for a spin, and it seems things are broken somewhere. Beware that I'm using python 2.7
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: French/Switzerland (fr_CH)


What happened? I prepared an extruded block on which I made 3 holes using the hole tool, and one cylindrical pocket using the pocket tool.

Using the job, I started gentle with face-milling, then proceeded to ask for pocketing the counter bore surface. Profiling this surface works. Pocketing it doesn't. It also generates a funny weird face-milling type path around the body (see screenshot).

Not discouraged for a second, I proceeded to test the other holes and enabling rotations. Funnily enough, same problem occurs. I attach the file as I found it problematic.

Fiddling around with the profiling ops seems to work. Whenever the B(y) rotation axis is involved some serious Boolean gymnastic is required between B-Axis override, Attempt inverse angle, reverse direction and inverse angle...
Also, the behavior regarding profiling is unclear, most of the time, when I get the profile in the location that I want
2019-06-13_00h01_14.png
2019-06-13_00h01_14.png (35.28 KiB) Viewed 272 times
(around the face I selected) it doesn't perform the adequate step-down and stays at the first layer around the face
2019-06-12_23h58_13.png
2019-06-12_23h58_13.png (37 KiB) Viewed 272 times
.

I think overall the promising capabilities you've enabled look great and feel almost right. If the behaviour can be made more intuitive, you've got something that will be able to be machined soon.

Thanks so much for your efforts, I'm ready for your rebuttal and counter-experiments.
Attachments
Test-4f-4thaxisRev.FCStd
(83.4 KiB) Downloaded 8 times
2019-06-12_23h41_30.png
2019-06-12_23h41_30.png (50.89 KiB) Viewed 272 times
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Thu Jun 13, 2019 5:51 am

Evening, J.
Thanks for the continued testing and feedback. I just took a look at the information you posted.
RatonLaveur wrote:
Wed Jun 12, 2019 10:07 pm
Thanks for updating the scripts, i've been taking them out for a spin, and it seems things are broken somewhere.
Indeed, it appears so. Good news though. It isn't what it seems. I loaded your file in my machine with setup pasted at the end of this message. I was able to click `Recompute` on two of the bad paths and they corrected straight away. I did find a line of code that needed adjustment to correct another two - it had to do with depth settings.

RatonLaveur wrote:
Wed Jun 12, 2019 10:07 pm
Beware that I'm using python 2.7 ... Version: 0.18.16093 (Git)
I have not located my binary archives. I think I have your version, or one very close to unzip and test with. I don't recall if I have the 2.7 version. Likely I have the 3.6 because I began to personally transition about that time from 2.7 to 3.6 once I was able to compile OCL for 3.6. Anyhow, I think the distant version differences probably have a role to play in the erroneous paths being generated.


RatonLaveur wrote:
Wed Jun 12, 2019 10:07 pm
Using the job, I started gentle with face-milling, then proceeded to ask for pocketing the counter bore surface. Profiling this surface works. Pocketing it doesn't. It also generates a funny weird face-milling type path around the body (see screenshot).
Not discouraged for a second, I proceeded to test the other holes and enabling rotations. Funnily enough, same problem occurs. I attach the file as I found it problematic.
The "weird face-milling" type paths usually appear when no face is entered in the Base Geometry tab. This can occur due to errors with the `extensions` feature included in the PocketShape tool. Otherwise, I only found Pocket_Shape002 to be set incorrectly; it was set to `EnableRotation = B(y)`, but needed `A(x)`.


RatonLaveur wrote:
Wed Jun 12, 2019 10:07 pm
Fiddling around with the profiling ops seems to work. Whenever the B(y) rotation axis is involved some serious Boolean gymnastic is required between B-Axis override, Attempt inverse angle, reverse direction and inverse angle...
If I recall, the B-Axis Override has been fixed permanently since 0.18.16093. B(y) rotations are rendering correctly since. For that reason, I have not made any adjustments to it within the code I have been working on. And, I have not been testing for compatibility with older versions. My apologies. If I get time, I will put a little more effort into testing and ensuring better backward compatibility with the 0.18 stable release.



RatonLaveur wrote:
Wed Jun 12, 2019 10:07 pm

Also, the behavior regarding profiling is unclear, most of the time, when I get the profile in the location that I want 2019-06-13_00h01_14.png(around the face I selected) it doesn't perform the adequate step-down and stays at the first layer around the face2019-06-12_23h58_13.png.
This looks and sounds familiar from testing. I have made some depth and orientation analysis improvements in the code. I can offer a few suggestions also:
  • When working with rotation enabled operations, you may have to manually override the Start Depth or Final Depths to see if that corrects the issue.
  • Yes, toggling the InverseAngle property will correct the issue in some instances. If the lead in drop-down of the cutter is cutting through the model, rather than starting on the perimeter of the model and moving toward it, then the InverseAngle or the ReverseDirection probably need adjusted.
  • Keep in mind:
    1. ReverseDirection should always change the path 180 degrees. No more. No less.
    2. InverseAngle is used to correct a mistaken minus(-) sign. For example, you may notice the path points at the correct face, but is approaching from a slightly wrong direction. Say the face requires a 30 degree rotation to be normal at Z-axis. The code may offer a path at -30 degrees to the face. This is when you would try InverseAngle toggle. This would change the -30 to 30 degrees for the path.



RatonLaveur wrote:
Wed Jun 12, 2019 10:07 pm
I think overall the promising capabilities you've enabled look great and feel almost right. If the behaviour can be made more intuitive, you've got something that will be able to be machined soon.
I have improved the AttemptInverseAngle feature to be more intuitive. If set to True, it will automatically attempt the InverseAngle (if set to False) upon determining the initial rotation was not correct. Additionally, it will help when I get some documentation posted to the Wiki, rather than the scattered bits and pieces here on the forum. My goal has been to get some consistency with property names and functionality before drafting much documentation. Once we have some reliability, documentation will be easier to write.


RatonLaveur wrote:
Wed Jun 12, 2019 10:07 pm
Thanks so much for your efforts, I'm ready for your rebuttal and counter-experiments.
You are quite welcome, Sir. I really appreciate your patience, investment, participation and time in the matter. I have had a lot of fun.


I will again post the most recently updated version 2g-testing scripts for your benefit, and that of the greater FC community.

Gratefully,
Russ


Of late, I have been developing using this below, but have pulled some additional recent commits in from the FC master repo:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16886 (Git)
Build type: Release
Branch: master
Hash: ed47e962d2c821bf1792889f6d7bdf457dcf6c9e
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
Test-4f-4thaxisRev_3.png
Test-4f-4thaxisRev_3.png: 2g-testing version
Test-4f-4thaxisRev_3.png (155.47 KiB) Viewed 252 times
Test-4f-4thaxisRev_3.FCStd
Your file recomputed on my machine with updated 2g-testing scripts
(66.39 KiB) Downloaded 7 times
RatonLaveur
Posts: 343
Joined: Wed Mar 27, 2019 10:45 am

Re: Path Pocket Shape: 4th-axis Integration

Postby RatonLaveur » Thu Jun 13, 2019 7:28 am

Russ, thanks for a very detailed response. My next step is to fully switch to FC0.18 Py 3.6. I had only downgraded a couple of months ago because OCL wasn't ready yet beyond 2.7 on windows. But since everyone is so damn productive I'll catch up to speed.

I'll rework from there. Play with the depths on profiling.

And follow up on the details of your post.
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Thu Jun 13, 2019 1:42 pm

RatonLaveur wrote:
Thu Jun 13, 2019 7:28 am
Russ, .... But since everyone is so damn productive I'll catch up to speed.
You're throwing way too much credit my way. I seem to keep producing more error-filled code! I can't call that productive... :lol:

Cheers, mate. Have a great day. No hurries here.

Glad you're on our team.

Russ
RatonLaveur
Posts: 343
Joined: Wed Mar 27, 2019 10:45 am

Re: Path Pocket Shape: 4th-axis Integration

Postby RatonLaveur » Fri Jun 14, 2019 8:24 am

Hello gents,

I performed the following actions:

- Deleted Fc0.18 - Py 2.7
- Installed the current x64 official version from Fc website - Py 3.6
- Attempted rev. 2f of Pocket and Profile: same issue as before.
- Copied the new rev. 2g from Russ: see screenshot. All good it seems!

Note: anyone noticed a slower performance of the computer with the newer 0.18 version? Mine is so much slower...not sure I like it, not sure where it comes from.
Attachments
2019-06-14_10h21_02.png
2019-06-14_10h21_02.png (177.69 KiB) Viewed 184 times
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: Path Pocket Shape: 4th-axis Integration

Postby Erich Schulz » Fri Jun 14, 2019 12:00 pm

oh is this working on 0.18?

I upgraded to freecad-daily but currently the bath workbench is broken so i'm stuck

should I drop back to 0.18?

also Russ - have you thought about dropping your 3 files into a git repo?

i should even be possible to make a little install script
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Fri Jun 14, 2019 11:03 pm

Afternoon All.
I have updated the Properties section of the Path_Pocket_Shape and the Path_Profile wiki pages. It will add some support to those who make use of it. The 'Usage' section is still lacking. Perhaps we can work together on that.

Also, I have word that the current PR 2231, with fixes for issues mentioned in this topic and others, might be close to merging into FC master.
Thanks @sliptonic and @mlampert for your consistent support.

Russ
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Fri Jun 14, 2019 11:06 pm

Erich Schulz wrote:
Fri Jun 14, 2019 12:00 pm
I upgraded to freecad-daily but currently the bath workbench is broken so i'm stuck
Erich Schulz wrote:
Fri Jun 14, 2019 12:00 pm
should I drop back to 0.18?
Erich Schulz wrote:
Fri Jun 14, 2019 12:00 pm
also Russ - have you thought about dropping your 3 files into a git repo?