Assembly 4 workbench

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Assembly 4 workbench

Post by OficineRobotica »

Zolko wrote: Wed May 20, 2020 10:41 pm
Hello Zolko. I'm finally getting back to freecad after a long time and I just saw the addition of the animation slider among a ton of other changes. This is such a killer feature. Thank you.

I have an issue when editing bodies that are linked within an assembly and I just can't figure out if this is a bug or this is how it is supposed to be. If I have a body inside my assembly then try to open a sketch of that body , the base(previous) feature of that sketch just dissapears from the viewport, thus missing visual reference and most of all one can't use the "sketcher external geometry actions" because the previous feature is invisible.
baseFeature.gif
baseFeature.gif (174.61 KiB) Viewed 2433 times
Also...when creating a new "model" I get this error message highlited in red. What does that mean?

Code: Select all

Running the Python command 'Asm4_newModel' failed:
Traceback (most recent call last):
  File "/home/.../.FreeCAD/Mod/Assembly4/newModelCmd.py", line 57, in Activated
    lcs0.Support = [(model.Origin.OriginFeatures[0],'')]

list index out of range
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
learner
Posts: 9
Joined: Fri May 15, 2020 7:59 am

Add LCS to assembly

Post by learner »

Hi Assembly 4 users.
Still having fun getting my basic workflow standardised.
Has anyone got a simple example of adding a Local Co-ordinate System to a sub-assembly please? I can add to a single part, but not to an assembly.

Step 1: Create a simple assembly of two instances of a part:
Screenshot_2020-05-22_14-46-34.png
Screenshot_2020-05-22_14-46-34.png (14.61 KiB) Viewed 2428 times
Step 2: Add an LCS to the assembly.

Step 3 (not working): Move the LCS from its default position (straight orange arrow) up to the top corner (curved green arrow)
Screenshot_2020-05-22_14-47-05.png
Screenshot_2020-05-22_14-47-05.png (12.91 KiB) Viewed 2428 times
When I try to do this with Right-click -> Edit datum, I can select features on the model, but nothing changes in the parameters dialog.
Screenshot_2020-05-22_15-04-00.png
Screenshot_2020-05-22_15-04-00.png (16.64 KiB) Viewed 2428 times
This means I can only add sub-assemblies to an assembly by using their LCS_Origin. I can't use my own LCS. Have I just missed something really obvious? :roll:
Thanks in advance!

FYI: Using FreeCAD from git 2020-05-14.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

drmacro wrote: Thu May 21, 2020 7:19 pm But there's still the issue of the end faces of the shafts being co-planer at the same time.
I still don't get it: if you want the faces on both sides of 2 shafts to be coplanar, the only possibility is that they have the exact same length, no ? And in this case, if you constrain 2 faces to be coplanar, the other 2 will be automatically coplanar too.

How would you, in the real world, actually manufacture and build your assembly ?
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Add LCS to assembly

Post by Zolko »

learner wrote: Fri May 22, 2020 5:19 am (not working): Move the LCS from its default position (straight orange arrow) up to the top corner (curved green arrow)
...
When I try to do this with Right-click -> Edit datum, I can select features on the model, but nothing changes in the parameters dialog.
This is because the MapMode isn't App::Link aware, meaning that you cannot use the Attachment Editor of the Map Mode to attach an LCS to a geometrical feature in a linked part.

Therefore, Asm4 provides another method for that: you can attach a datum object (an LCS is a datum object) to a datum object in a child part: you need first to create a datum object in the child part on the location where you will want to place the datum object in the assembly (in your case, on the corner of the cube in the cube part), and then use the "Place Datum" command to place the datum (LCS) in the assembly on the placement of the datum (LCS) in your part. There is an convenient function that does it all for you: "Import Datum": here, all you need to do is, in the assembly, to select the datum in the EDIT: linked part (the specific instance if there are several), and it will create in the assembly a datum of the same type and place it at the same position.

In other words: if you want to use an LCS in a sub-assembly to attach that sub-assembly to a higher level assembly, and you want that LCS to correspond to some particular position in a child part of the sub-assembly, create an LCS in the child part, attach it with MapMode in the child part, and import that LCS into the sub-assembly. You can then use that LCS to attach the sub-assembly into the assembly, and the attachment LCS will follow whatever modification you make in your child part.
try the Assembly4 workbench for FreCAD — tutorials here and here
drmacro
Veteran
Posts: 8862
Joined: Sun Mar 02, 2014 4:35 pm

Re: Assembly 4 workbench

Post by drmacro »

Zolko wrote: Fri May 22, 2020 7:20 am
drmacro wrote: Thu May 21, 2020 7:19 pm But there's still the issue of the end faces of the shafts being co-planer at the same time.
I still don't get it: if you want the faces on both sides of 2 shafts to be coplanar, the only possibility is that they have the exact same length, no ?
Hmm...maybe I'm using the term coplaner wrong. When I say the end faces of these two, different length shafts are coplaner, I mean they lie on the same plane as the datum plane shown here:
CoplanerShafts.png
CoplanerShafts.png (136.51 KiB) Viewed 2358 times
And in this case, if you constrain 2 faces to be coplanar, the other 2 will be automatically coplanar too.
How would you, in the real world, actually manufacture and build your assembly ?
If I take two shafts and affix a pulley flush to the end, on each, in order for the belt fit correctly, those pulleys/shaft ends need to be coplaner, no? And the shafts will be aligned with different places or mechanisms in the assembly. (In this case, the shaft in the pillow blocks and the shaft of the motor are required to be parallel to each other and the base plate when it is included, and their ends coplaner for a straight belt between them.)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

drmacro wrote: Fri May 22, 2020 12:57 pm If I take two shafts and affix a pulley flush to the end, on each, in order for the belt fit correctly, those pulleys/shaft ends need to be coplaner, no?
The pulleys need to be coplanar, yes, but why would the shaft ends need to be flush with the pulleys ? Actually, if they were indeed flush, what would prevent the pulleys from falling off the shafts ?
try the Assembly4 workbench for FreCAD — tutorials here and here
drmacro
Veteran
Posts: 8862
Joined: Sun Mar 02, 2014 4:35 pm

Re: Assembly 4 workbench

Post by drmacro »

Zolko wrote: Sat May 23, 2020 11:50 am
drmacro wrote: Fri May 22, 2020 12:57 pm If I take two shafts and affix a pulley flush to the end, on each, in order for the belt fit correctly, those pulleys/shaft ends need to be coplaner, no?
The pulleys need to be coplanar, yes, but why would the shaft ends need to be flush with the pulleys ? Actually, if they were indeed flush, what would prevent the pulleys from falling off the shafts ?
I think I've lost my ability to describe things... 8-)

Umm...the set screw (grub screw) tightened on the shaft? :roll:
Pulley_on_shaft_annot.png
Pulley_on_shaft_annot.png (75.43 KiB) Viewed 2286 times
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

OficineRobotica wrote: Fri May 22, 2020 4:25 am I have an issue when editing bodies that are linked within an assembly and I just can't figure out if this is a bug or this is how it is supposed to be
This certainly looks like a bug. Would you have the possibility to narrow it down to the original cause, so we can try to reproduce it and correct it ?


Also...when creating a new "model" I get this error message highlited in red. What does that mean?

Code: Select all

Running the Python command 'Asm4_newModel' failed:
Traceback (most recent call last):
  File "/home/.../.FreeCAD/Mod/Assembly4/newModelCmd.py", line 57, in Activated
    lcs0.Support = [(model.Origin.OriginFeatures[0],'')]

list index out of range
Thank-yoy for reporting, this also looks like a bug, but I can't reproduce it: what steps did you do to get it ?
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: Assembly 4 workbench--Arandela Mechanism

Post by ppemawm »

Since it seems everyone else in the CAD world has one of these models, I thought we should have one too for FreeCAD. Dimensions for this model were taken from this tutorial: https://www.youtube.com/watch?v=98A_8qSqxh8.

The model was built using the V0.19 PartDesign workbench and assembled /animated with Assembly4 V0.9.4. The following screenshots and brief comments describe the work process:

These are the four components of the mechanism.  The manivela or crank is rotated which causes the arandela to &quot;wobble&quot; in-place.  I have no idea what it's practical use is, perhaps as a cam of some sort.<br /><br />All of the bodies were created as a single file in an Assembly4 (Asm4) Parts folder.  Note that in zolko's latest Asm4 revision the Part container is no longer required for assembly which nicely simplifies the tree.<br /><br />In this model, the arandela was created at the global origin and the other bodies created in context at their proper location.<br /><br />In each body, local coordinate system (LCS) &quot;connectors or mates&quot; are attached to each mating edge of the body.  While this is quite convenient, it is susceptible to the topological renaming problem if any features are changed.  Usually, you should attach the LCS's to a master sketch(es) if you can for a more robust assembly.
These are the four components of the mechanism. The manivela or crank is rotated which causes the arandela to "wobble" in-place. I have no idea what it's practical use is, perhaps as a cam of some sort.

All of the bodies were created as a single file in an Assembly4 (Asm4) Parts folder. Note that in zolko's latest Asm4 revision the Part container is no longer required for assembly which nicely simplifies the tree.

In this model, the arandela was created at the global origin and the other bodies created in context at their proper location.

In each body, local coordinate system (LCS) "connectors or mates" are attached to each mating edge of the body. While this is quite convenient, it is susceptible to the topological renaming problem if any features are changed. Usually, you should attach the LCS's to a master sketch(es) if you can for a more robust assembly.
Picture2.jpg (58.76 KiB) Viewed 2062 times
This is the complete assembly of the bodies links in Model.  Note that the upper crank is a duplicate of the lower.  The bodies were assembled in this order: <br /> <br />--base is attached to the Model origin LCS<br />--lower crank is connected to the lower base bearing<br />--pino or axle is attached to the lower crank<br />--upper crank is attached to the axle<br />--upper crank angle offset is rotated to match the base upper bearing location<br />--arandela is attached to the lower crank as shown in the next image
This is the complete assembly of the bodies links in Model. Note that the upper crank is a duplicate of the lower. The bodies were assembled in this order:

--base is attached to the Model origin LCS
--lower crank is connected to the lower base bearing
--pino or axle is attached to the lower crank
--upper crank is attached to the axle
--upper crank angle offset is rotated to match the base upper bearing location
--arandela is attached to the lower crank as shown in the next image
Picture1.jpg (70.9 KiB) Viewed 2062 times
This is an example of how the LCS's are connected to assemble the arandela.  It was not necessary to constrain the arandela to the base to prevent rotation about the axle.  <br /><br />Notice that if you had these parts on a workbench you would not be able to assemble them with this design.  Too easy to create something in the computer that can't be built...
This is an example of how the LCS's are connected to assemble the arandela. It was not necessary to constrain the arandela to the base to prevent rotation about the axle.

Notice that if you had these parts on a workbench you would not be able to assemble them with this design. Too easy to create something in the computer that can't be built...
Picture3.jpg (77.68 KiB) Viewed 2062 times
A variable &quot;rotation_angle&quot; was defined and used in the expression for the angle of the upper crank LCS Z-axis attachment offset.  This LCS is attached to the upper crank origin axis.
A variable "rotation_angle" was defined and used in the expression for the angle of the upper crank LCS Z-axis attachment offset. This LCS is attached to the upper crank origin axis.
Picture4.jpg (84.33 KiB) Viewed 2062 times
The Assembly4 &gt; animate assembly can then be used to simulate the mechanism motion by changing the rotation angle variable.  BTW the slider in the animator is a handy way to check specific locations of the mechanism.
The Assembly4 > animate assembly can then be used to simulate the mechanism motion by changing the rotation angle variable. BTW the slider in the animator is a handy way to check specific locations of the mechanism.
arendela5.gif (532.95 KiB) Viewed 2062 times
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20887 (Git)
Build type: Release
Branch: master
Hash: 42c56d9fef82b484448e3730eb7da69c48fe1374
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)
"It is a poor workman who blames his tools..." ;)
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench--Arandela Mechanism

Post by Zolko »

ppemawm wrote: Tue May 26, 2020 3:53 pm The model was built using the V0.19 PartDesign workbench and assembled /animated with Assembly4 V0.9.4.
It's a pleasure and a lot of pride to see what you are able to do with some of the tools where I can participate, thank-you for that.
try the Assembly4 workbench for FreCAD — tutorials here and here
Post Reply