Assembly 4 workbench

Discussion about the development of the Assembly workbench.
OficineRobotica
Posts: 140
Joined: Thu Feb 21, 2019 8:17 am

Re: Assembly 4 workbench

Postby OficineRobotica » Fri May 22, 2020 4:25 am

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 581 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
learner
Posts: 6
Joined: Fri May 15, 2020 7:59 am

Add LCS to assembly

Postby learner » Fri May 22, 2020 5:19 am

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 574 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 574 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 574 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
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » 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 ? 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 v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
Zolko
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Re: Add LCS to assembly

Postby Zolko » Fri May 22, 2020 7:31 am

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 v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
drmacro
Posts: 742
Joined: Sun Mar 02, 2014 4:35 pm

Re: Assembly 4 workbench

Postby drmacro » Fri May 22, 2020 12:57 pm

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 506 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.)
User avatar
Zolko
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » 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 ?
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
drmacro
Posts: 742
Joined: Sun Mar 02, 2014 4:35 pm

Re: Assembly 4 workbench

Postby drmacro » Sat May 23, 2020 12:22 pm

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 434 times
User avatar
Zolko
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Sun May 24, 2020 10:59 am

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 v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
ppemawm
Posts: 645
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: Assembly 4 workbench--Arandela Mechanism

Postby ppemawm » Tue May 26, 2020 3:53 pm

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:

Picture2.jpg
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 210 times
Picture1.jpg
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 210 times
Picture3.jpg
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 210 times
Picture4.jpg
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 210 times
arendela5.gif
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 210 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
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench--Arandela Mechanism

Postby Zolko » Tue May 26, 2020 5:31 pm

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 v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here