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 » Fri Apr 26, 2019 1:18 pm

cox wrote:
Wed Apr 24, 2019 6:45 pm
...For the time being it feels like, all I have time to play with is diapers :-)
One just potty trained and working on the second...

Thanks!
Russ
RatonLaveur
Posts: 341
Joined: Wed Mar 27, 2019 10:45 am

Re: Path Pocket Shape: 4th-axis Integration

Postby RatonLaveur » Fri Apr 26, 2019 2:41 pm

Hello gents,

Russ, I've been trying out the new options and they fit just right.

The B-axis override is fantastic to visualize the correct path in FreeCAD...of course, it means that the actual NC code viewed with NCviewer is all scrambled :)

I'll play around with the B and A axis selections. Thanks a lot!

As soon as i'm comfortable enough with this, I'll definitely machine something and show :)
Attachments
EdgeChannels.FCStd
(184.56 KiB) Downloaded 13 times
WithoutBAxisOverride.png
WithoutBAxisOverride.png (173.73 KiB) Viewed 497 times
WithBaxisOverride.png
WithBaxisOverride.png (46.01 KiB) Viewed 497 times
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Sat Apr 27, 2019 1:54 am

Good evening, Mates.
RatonLaveur wrote:
Fri Apr 26, 2019 2:41 pm
The B-axis override is fantastic to visualize the correct path in FreeCAD...of course, it means that the actual NC code viewed with NCviewer is all scrambled :)
REMEMBER: Toggle all "B_Axis Error Override" properties to FALSE before exporting gcode for your machine.
This will leave B(y) axis rotations to appear incorrect in FreeCAD, but should be fine in the real world and NCViewer and Camotics.

RatonLaveur wrote:
Fri Apr 26, 2019 2:41 pm
I'll play around with the B and A axis selections. Thanks a lot!
This "Use Rotation" property will need some adjustments within the code. I don't think it functions quite as smoothly as we would like. It does, nonetheless, provide the intended result within my limited testing.

Wsk8 wrote:
Wed Apr 24, 2019 4:36 pm
... all ops are usually based on the model :)
I have updated the scripts attached to the initial post of this topic. Version 1f_testing should respect XYZ linear translations done within Job setup. Also, a property to select the rotational axis is available.

Thanks for the feedback gentlemen! Proceed with caution and the correct feeds and speeds... :)

Cheers,
Russell
mlampert
Posts: 1345
Joined: Fri Sep 16, 2016 9:28 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby mlampert » Sun Apr 28, 2019 10:21 pm

I finally had some time to look at your changes and I might be doing something wrong (I usually do). Attached file results in the following Path:
Capture.PNG
Capture.PNG (14.93 KiB) Viewed 430 times
The pocket is in the positive Z direction and doesn't need any rotation. There's also something funny with the depths happening. Regardless of what I set the "FinalDepth" to it gets reset to being -10 during the recompute. And although "StartDepth" is at +22 the actual path starts at -22.

This is great stuff - I love it!
Attachments
4th-axis.FCStd
(56.95 KiB) Downloaded 16 times
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Sun Apr 28, 2019 11:30 pm

Afternoon, MLampert.
mlampert wrote:
Sun Apr 28, 2019 10:21 pm
I finally had some time to look at your changes and I might be doing something wrong (I usually do)...
The pocket is in the positive Z direction and doesn't need any rotation. There's also something funny with the depths happening. Regardless of what I set the "FinalDepth" to it gets reset to being -10 during the recompute. And although "StartDepth" is at +22 the actual path starts at -22.
Please don't be upset. I opened the file, toggled the "Reverse Direction" property, and recomputed. Wha-lah.

This is an issue perhaps your expertise or @Sliptonic, or @JoshM, or another one of the many FC contributors could help me solve.

I don't know if FreeCAD, NO, if I have the know how to tell FreeCAD how to identify the direction of any pocket toward the exterior of the Model. From looking at your model, and based on usage of FreeCAD, and developing this script modification, I bet that your pocket in question was made by setting a cube, right-side-up, atop the body and doing a cut operation. This would leave the bottom face of that cube as the bottom of the pocket. This is the result of the script's analysis of that face using face.Surface.Axis: value is probably -Z or (0,0,-1). Therefore, the script thinks the direction of the pocket should be down, -Z.

I haven't taken time to figure out the algorithm needed to correctly orient any pocket's direction toward the outside of the Model. So... I have the "Reverse Direction" property for just these cases. At this, point, I think allowing the user to simply "Reverse Direction" of the pocket seems the easiest solution, and less difficult to code. If I find time, I may look into such an algorithm improvement. It would be great for certain!
mlampert wrote:
Sun Apr 28, 2019 10:21 pm
This is great stuff - I love it!
+1 !

Let the chips fly, amigo.
Russell
Attachments
4th-axis_Reverse-Direction.png
Solution: toggle the "Reverse Direction" property.
4th-axis_Reverse-Direction.png (148.38 KiB) Viewed 419 times
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Fri May 03, 2019 5:54 am

Morning FC Users,
I just posted updated versions of the two scripts involved in the Path Pocket Shape 4th-axis integration; they are available with the initial post of this topic. Some errors have been corrected:
  • Fixed broken PathWB operations related to PathAreaOp.py script: Tuple size differences in return values from Profile Faces, Mill Faces, and other tools based on PathAreaOp.py script are fixed. The affected tools seem to be back in action.
  • Depth parameter issue reported by @Sliptonic has been addressed. Tests results are correct, so far.
  • You might need to delete and recreate any Path Pocket Shape operations you have, after you install these scripts.
Thank you for testing and reporting errors.
More good news: @Mlampert and I agree we have found the missing negative sign to make the B-axis rotations render correctly in FC. Well, @Mlampert probably knew all along, where as I had to fumble around and backtrack code with python sniffing dogs trained from birth. But, that is beside the point. Initial testing after compiling the corrected code yields positive results. Thanks, @MLampert for all your coding contributions and other help! Once we get the correction committed to the master branch, the 4th-axis scripts we have been testing can be edited to remove the "B-axis render override" flag. Hallelujah!

Later,
Russell
RatonLaveur
Posts: 341
Joined: Wed Mar 27, 2019 10:45 am

Re: Path Pocket Shape: 4th-axis Integration

Postby RatonLaveur » Thu May 16, 2019 11:31 am

Gentlemen,

I was rubbing my hands with the added file, hoping to check for capabilities and interesting behaviors.
To my surprise, the 3D pocket is now behaving as if Russ had not performed his magic over last few weeks.

I'm using both of the most up-to-date files in the original post of this thread (rev. i usable)

Is there something I'm missing?

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)
Attachments
2019-05-16_13h29_08.png
2019-05-16_13h29_08.png (176.58 KiB) Viewed 302 times
MultiHolePolar.FCStd
(65.25 KiB) Downloaded 14 times
User avatar
Russ4262
Posts: 222
Joined: Sat Jun 30, 2018 3:22 pm

Re: Path Pocket Shape: 4th-axis Integration

Postby Russ4262 » Sat May 18, 2019 3:39 am

Evening RatonLaveur,
I opened your file. I see the problem - one of them.
RatonLaveur wrote:
Thu May 16, 2019 11:31 am
Is there something I'm missing?
It looks like you used the 3D Pocket tool originally. It does not support 4th-axis, yet. You need to use the Path Pocket Shape tool - circled in the attached image.


28 May 2019: Moved usage instructions to initial post in topic.


Submitting this model for assistance here in the forum has also exposed another error in the existing code. Pocket_Shape 4 is missing, as seen in the image. The operation is present, but no path is made. This is an error in the face analysis algorithm in the code; this pocket is mistakenly identified with the following error>> PathPocketShape.ERROR: Pocket does not support shape Model-Body001.Face3. I will take a look at it and work to correct the problem. I do not know if it is related to the use of the polar array or some other analysis issue.

Thanks!
Russell
Attachments
MultiHolePolar (1).FCStd
(70.82 KiB) Downloaded 10 times
MultiHolePolar_1-Path_Shape-Use_Rotation.png
MultiHolePolar_1-Path_Shape-Use_Rotation.png (171.74 KiB) Viewed 262 times
Last edited by Russ4262 on Tue May 28, 2019 6:11 pm, edited 1 time in total.
RatonLaveur
Posts: 341
Joined: Wed Mar 27, 2019 10:45 am

Re: Path Pocket Shape: 4th-axis Integration

Postby RatonLaveur » Sat May 18, 2019 8:24 am

Hello Russ,

Thanks a lot. I don't know how I have become inept at using it after playing with it for the last few weeks. Thanks for the help.

Yes the model i made to really push the boundaries of what the 4th axis can do. It's parametric, you'll notice. That the holes are initially cardinal (aligned with X and Y) but all you have to do to make this into a nightmare is to add a few repetition on the polar pattern :) then it's compound angle...oh boy.

Cheers.

J.
RatonLaveur
Posts: 341
Joined: Wed Mar 27, 2019 10:45 am

Re: Path Pocket Shape: 4th-axis Integration

Postby RatonLaveur » Tue May 28, 2019 12:12 pm

Hello gents,

A little bit more feedback. Finally confident that I could use the 4th axis integration for actual testing in my 3+2 machine, I prepare a comparatively simple model: a square tip to be cut from square rod.

Fooling around with the options, the use of the Path Pocket shapes moves the model relative to the stock in a funny way. I see no reason why path pocket should move the work piece model that way.

To repeat the issue:
1. open Job setup
2. orient the tip to either X or Y axis (Z is now transversal to the feature main-axis.
3. select one of the faces of the tip, and select the pocket based on face
4. press apply (with intention of activating rotation of the A(x) and B(y) axis in the data tab afterwards.

What happens: the model moves relative the stock back to a main Z orientation.
Results are scrambled.

Strange strange.

Attached: pictures of what happens.
Attached: model to play with.
Attachments
TipCutting.FCStd
(26.37 KiB) Downloaded 13 times
OriginalIntendedOrientation.png
OriginalIntendedOrientation.png (10.22 KiB) Viewed 185 times
PocketingFaceReorientsPartUnduly.png
PocketingFaceReorientsPartUnduly.png (18.48 KiB) Viewed 185 times