Assembly4 Master sketch

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
sjam986
Posts: 23
Joined: Tue May 12, 2020 10:07 am

Assembly4 Master sketch

Postby sjam986 » Sat Jun 06, 2020 4:54 am

Assembly4 Master sketch problem:
I have created a very simple model of an engine crankshaft - no parts or bodies yet - just an Assembly4 model with variables and a master sketch with one line from the origin to a point 23 mm radius on the YZ plane, 30 deg acw from the Y axis. The crankshaft rotates about the X axis and the Z axis is vertical. Hence the master sketch is on the YZ plane.
The variables are Angle_crank = 30 deg and R_main = 23 mm.
I selected the master sketch and in Map Mode I selected LCS_Origin as the attachment with mode Object's YZ plane. In the master sketch the new Z axis is along the line from the origin.
I then selected the model, created a new coordinate system LCS_crank with first attachment 'Vertex' - 'Sketch_master:Vertex1' and second attachment 'Line' - 'Sketch_master:Edge1' with mode 'Align O-Z-Y'.
When animated the line rotates as it should in the YZ plane but the axes swap over as the new Y axis passes the old Z axis.
If I follow the same process with the sketch on the XY plane, everything works perfectly. However, with the sketch in the YZ plane, It doesn't work.
What am I doing wrong?

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21097 (Git)
Build type: Release
Branch: master
Hash: a5ab09aa0941cc945e59848897b160f8cbfc0831
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/New Zealand (en_NZ)
User avatar
Zolko
Posts: 941
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4 Master sketch

Postby Zolko » Sat Jun 06, 2020 11:20 am

sjam986 wrote:
Sat Jun 06, 2020 4:54 am
The variables are Angle_crank = 30 deg and R_main = 23 mm.
I selected the master sketch and in Map Mode I selected LCS_Origin as the attachment with mode Object's YZ plane.
...
I then selected the model, created a new coordinate system LCS_crank with first attachment 'Vertex' - 'Sketch_master:Vertex1' and second attachment 'Line' - 'Sketch_master:Edge1' with mode 'Align O-Z-Y'.
Since you only specified 1 axis, FreeCAD must infer the second axis, and it does so according to some algorithm that you can't know, and that swaps orientation whenever it feels comfortable about it.

So try the reverse order : attach LCS_crank to LCS_Origin, in its AttachmentOffset set the rotation angle around the X axis to Angle_crank. Create a Datum Point and attach it to LCS_crank, and offset it by R_main in the Z direction (this point will be the rotation reference). Then, in your master sketch, import this point as external feature, and draw the rest.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
sjam986
Posts: 23
Joined: Tue May 12, 2020 10:07 am

Re: Assembly4 Master sketch

Postby sjam986 » Sun Jun 07, 2020 7:27 am

So try the reverse order : attach LCS_crank to LCS_Origin, in its AttachmentOffset set the rotation angle around the X axis to Angle_crank.
That worked. So far so good.
I could not get the Datum point etc. to work. I lost count of the number of permutations I tried!
However, creating LCS_arm in the crank_body and then using 'Place linked Part' to link crank_body LCS_arm to parent LCS_crank worked and correct rotation resulted.
So, many thanks for your help - I am inspired to do more!
Last edited by Kunda1 on Sun Jun 07, 2020 10:48 am, edited 1 time in total.
Reason: fixed broken quote tag