V0.19 Top Down Assembly Design Using Assembly4--Update #11

Show off your FreeCAD projects here!
aapo
Posts: 287
Joined: Mon Oct 29, 2018 6:41 pm

Re: V0.19 Top Down Assembly Design Using Assembly4

Postby aapo » Thu Jul 16, 2020 7:44 pm

ppemawm wrote:
Thu Jul 16, 2020 3:33 pm
Thanks for the great tip. I will try it out next time I run into an master sketch animation problem.
BTW your animation of the chain links is very cool.
I am glad that I have been able to give at least some small contribution back to the community. :D I've really enjoyed your various explanations about the FreeCAD workflows you've developed, and the models you've used to demonstrate said workflows. They have been most useful for me, especially everything concerning Assembly4. As a matter of fact, your master sketch demonstrations directly led me to try the chain link assembly as an exercise.
User avatar
ppemawm
Posts: 766
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2 Arbor Press

Postby ppemawm » Fri Jul 17, 2020 4:10 pm

Based on the number of viewings of the CI aero engine post it looks like about half of you are interested in the details so I will offer the following brief comments about my work process for the second project, the Arbor Press:

Picture2_masters.jpg
These are the two master sketches used to create the assembly, bodies, and their features. Note that the planes chosen capture maximum symmetry.

This image is of a carbon copy of the master sketch which actually resides in the Model (assembly) portion of the tree. I vacillate where to locate the master since I have yet to find any real advantage one way or another. Since the Model assembly LCS's are attached to the master then it probably makes most sense to locate it in Model as Zolko suggests. A carbon copy of this sketch is then used in the first body in the Part folder.

The inset image is the master for all of the rotating bodies. Details are added to a carbon copy of this sketch to create each body which then becomes another carbon copy 'master' for all of its features.

The 'Z' location of the pinion center line can be linked to the other master by using expressions rather than a hard dimension as shown in this image. In that way, the pinion will move if you have to make a change to the other master's dimension.
.
Picture2_masters.jpg (95.71 KiB) Viewed 1203 times
Capture13_rack.JPG
This image shows how the teeth were modeled for the rack. The gear workbench provides a parametric rack gear object. I modeled the rack two different ways one of which is not parametric.

The first model used a shapebinder of a face from the gear object to pocket the teeth in the cylinder. Although convenient, it is not parametric in that if the number of teeth are changed the rack model will likely break at the chamfer since it depends upon an edge of the pocket feature. That edge may get renumbered if the number of teeth change. The chamfer is easy to fix but still annoying.

A more robust method is shown at the bottom of the tree in which the gear object itself is cut from the cylinder revolution using the part design boolean tool. Now, if the tooth number or modulus is changed the chamfer will survive.

The gear objects are located in a REF folder to keep the tree tidy.
.
Capture13_rack.JPG (239.41 KiB) Viewed 1203 times
Capture14_pinion.JPG
The pinion was created using the same boolean method as the rack. In this instance, I placed a basefeature of the involute gear in its own body before I realized that the gear object can be directly used in the boolean. Note that in this method, the gear body must be located via Placement in its proper 3D location before the boolean operation.

I now prefer the second method used for the rack. Keep it simple.

The gear or pinion body includes three Assembly4 LCS's to locate the other bodies that make up the rotating sub-assembly. These are attached to the pinion shaft master sketch and used later when assembling the Model.
.
Capture14_pinion.JPG (250.91 KiB) Viewed 1203 times
Capture15a.JPG
This view of the tree shows the Model assembly and its LCS's which are attached to the mastersketch located in the Model.

The pinion gear LCS attachment offset rotation angle is defined by a variable 'handle_angle'. It is this variable that can be used to rotate the pinion sub-assembly.

The Z attachment offset of the rack LCS in Model is defined by a variable 'rack' which is a function of the handle angle variable. The rack must move one pitch for every 1/8 turn of the handle since the pinion has eight teeth: handle_angle*pitch*no.teeth/360-Z0 ( at handle_angle=0 deg).

The Z0 attachment offset of the rack body LINK is adjusted by eye until the mesh of the two gears are sufficiently accurate as shown in the inset image.
.
Capture15a.JPG (236.66 KiB) Viewed 1203 times
arborpress (1).gif
The Assembly4 animator can be used to check for proper operation during assembly by varying the handle_angle variable through its full range of motion as shown in this GIF image.
.
arborpress (1).gif (820.42 KiB) Viewed 1203 times
.
Stay tuned for Update #3 if you are interested in the details for the blowtorch!

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21937 (Git)
Build type: Release
Branch: master
Hash: 0de5a290113800dc5779a76d7e216bd882e0ed1e
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..." ;)
aapo
Posts: 287
Joined: Mon Oct 29, 2018 6:41 pm

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2 Arbor Press

Postby aapo » Fri Jul 17, 2020 6:12 pm

ppemawm wrote:
Fri Jul 17, 2020 4:10 pm
The inset image is the master for all of the rotating bodies. Details are added to a carbon copy of this sketch to create each body which then becomes another carbon copy 'master' for all of its features.
I understand why the first rotating body is made as a carbon copy of this master sketch, as it basically has the same shape as the first body in the rotating structure. However, I didn't quite catch why all the other rotating bodies also get a carbon copy of the rotating master sketch, or did you mean that the other bodies are attached to the first body's carbon copy of the rotating master sketch instead of the rotating master sketch itself?

Fascinating modeling, anyway, thanks for the explanations! Is this kind of carbon-copy strategy used specifically to avoid the dreaded topological problem? Because the original master sketches stay simpler and thus topo-problem proof, or are there also other advantages?
User avatar
ppemawm
Posts: 766
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2

Postby ppemawm » Fri Jul 17, 2020 9:11 pm

aapo wrote:
Fri Jul 17, 2020 6:12 pm
did you mean that the other bodies are attached to the first body's carbon copy of the rotating master sketch instead of the rotating master sketch itself?
No. Not attached, but constrained.

Rather, I am making a master sketch for each new body based on the carbon copy of the master sketch of the assembly or subassembly. Each feature of the new body is made from a carbon copy of this body sketch.

Essentially I have a basic master sketch to capture the location and design intent (constraints) of the assembly interfaces, another one for the subassembly based on a carbon copy of the assembly master, and finally a master sketch for each body based on a carbon copy of the subassembly sketch. A carbon copy of the body master is used to generate most if not all of the features in the body. Hope that helps to clarify the approach.

For example:

Capture_handle.JPG
The geometry for the handle is constrained to the carbon copy of the pinion shaft master. If the handle had additional features, then a carbon copy is made from the above sketch and the feature geometry and constraints are added for each.
.
Capture_handle.JPG (112.61 KiB) Viewed 1159 times
aapo wrote:
Fri Jul 17, 2020 6:12 pm
Is this kind of carbon-copy strategy used specifically to avoid the dreaded topological problem? Because the original master sketches stay simpler and thus topo-problem proof, or are there also other advantages?
That is part of it.

It facilitates top-down design of an assembly using in-context modelling where you create the bodies of an assembly all in the same file in their proper location rather than creating them in separate files at the global origin and then assembling them using constraints from an assembly workbench (bottom-up). When all of the bodies are created using this method the assembly is essentially complete and fully constrained by the master sketches. I.e. if you do it correctly, you can change the master sketch dimensions and all affected bodies will move to their new location which is an essential requirement when creating a new assembly model and its bodies from scratch. I do not know how else to do top-down design.

Assembly4 is then used to reassemble all of the bodies using LCS connectors and to add fasteners and duplicate bodies. In that sense, it is a bit redundant but nicely facilitates animation. It also adds the ability to move each body as needed using the attachment offset to establish rotating clearances, for example, not always captured in the master sketch.

One problem with this approach is that it is a bit messy to save the individual bodies in separate files for reuse since they have to carry their masters with them.
"It is a poor workman who blames his tools..." ;)
aapo
Posts: 287
Joined: Mon Oct 29, 2018 6:41 pm

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2

Postby aapo » Fri Jul 17, 2020 11:27 pm

ppemawm wrote:
Fri Jul 17, 2020 9:11 pm
No. Not attached, but constrained.

Ah, now I understand, that's clever! I've previously attached the lower-level master-sketches to upper-level master-sketch by using LCS:s, which also works, but this method seems to be actually better. If I'm correct, the carbon copies in your method automatically follow the copied master sketch by expression engine, at least according to this documentation https://wiki.freecadweb.org/Sketcher_CarbonCopy. Thus, the model becomes parametric kind of automatically, right? I have done this by adding the expressions manually to the LCS:s, but the parametrization of CarbonCopies seems to be automatic, cool!

I guess by using your method there's actually no need for any of the assembly workbenches, but you can do assembly directly by Sketcher and PartDesign workbenches; who knew! :D

It facilitates top-down design of an assembly using in-context modelling where you create the bodies of an assembly all in the same file in their proper location rather than creating them in separate files at the global origin and then assembling them using constraints from an assembly workbench (bottom-up). When all of the bodies are created using this method the assembly is essentially complete and fully constrained by the master sketches. I.e. if you do it correctly, you can change the master sketch dimensions and all affected bodies will move to their new location which is an essential requirement when creating a new assembly model and its bodies from scratch. I do not know how else to do top-down design.

There is another way, namely start from the master sketch and attach the bodies' sub-sketches to master sketches using LCS:s. That way you can link all the sketches, and the bodies they form, so that they parametrically follow changes in any of the sketches. It is basically the same, except you need to do the links manually, and you need Asm4 for this approach. I like this approach, because I can isolate the bodies in different files, if I want. And, if I edit the bodies through the whole master assembly file, I'll see how the bodies interact if a parameter changes; and on the other hand it's possible to edit a some sub-file without the whole assembly cluttering the view. The big downside is the jumping LCS:s, so quite often in practice I simply use the same Asm4 Variables for sketches and the LCS positioning. Then, the LCS:s don't jump, but there's a lot of manual expression typing, admittedly. In that sense the CarbonCopy method seems rather clever, I'll need to try it.

Assembly4 is then used to reassemble all of the bodies using LCS connectors and to add fasteners and duplicate bodies. In that sense, it is a bit redundant but nicely facilitates animation. It also adds the ability to move each body as needed using the attachment offset to establish rotating clearances, for example, not always captured in the master sketch.

One problem with this approach is that it is a bit messy to save the individual bodies in separate files for reuse since they have to carry their masters with them.
Hmm, right. Maybe the best approach would be to use the CarbonCopy method for bodies that always 'belong' together, and Asm4 for connecting these groups together. There definitely seems to be a lot of VERY different ways to do something reasonable in FreeCAD! :D
abdullah
Posts: 3858
Joined: Sun May 04, 2014 3:16 pm

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2 Arbor Press

Postby abdullah » Sat Jul 18, 2020 5:34 am

ppemawm wrote:
Fri Jul 17, 2020 4:10 pm

Stay tuned for Update #3 if you are interested in the details for the blowtorch!
You can bet I will :)

Keep the nice stuff coming ;)
User avatar
ppemawm
Posts: 766
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2

Postby ppemawm » Sat Jul 18, 2020 4:24 pm

aapo wrote:
Fri Jul 17, 2020 11:27 pm
There is another way, namely start from the master sketch and attach the bodies' sub-sketches to master sketches using LCS:s.
I have linked sketches together using LCS's for 3D movement but not sure if that is what you are suggesting. I would love to see an example. Perhaps you can post one with some brief comments/images of your process either in the Assembly or Users Showcase forums?
"It is a poor workman who blames his tools..." ;)
aapo
Posts: 287
Joined: Mon Oct 29, 2018 6:41 pm

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2

Postby aapo » Sat Jul 18, 2020 10:41 pm

ppemawm wrote:
Sat Jul 18, 2020 4:24 pm
I have linked sketches together using LCS's for 3D movement but not sure if that is what you are suggesting.
Yes, exactly that. Most of the stuff I do is for a company, so I can't really put anything serious online. However, I just made a silly bare-bones example showing my modeling workflow. Basically, I build a skeleton about what I want the model to do, add this "main thing" using a sketch, and then bolt on more auxiliary stuff (sketches and bodies) as needed, until I have a functional design. In the simple example attached, everything could easily be done by one sketch in one file without LCS:s, but it's just to show the technique I use for attaching sketches to each others by using Asm4 and the Expression engine to make it parametric. Rather straightforward technique, really. Basically, I glue sketches and bodies together by LCS:s. It doesn't become a mess, because I add the sub-parts in new FCStd files, so that I get the Asm4 "Model" structure for every subpart. This keeps everything as a tree of Models, where sub-Models and their sub-sub-Models etc reside.

So, as in the small two-file example, I usually add every new part into a new file, which causes a problem I forgot to mention earlier: The sub-assembly Variables cannot depend on the main assembly Variables, because otherwise they would cause a cyclic dependency. Or, actually they can depend on the sub-assemblies, if one abuses the Expression Engine; and everything even works for a while as long as it is all in the RAM, but when loading such a model from disk the file-load logic goes haywire when it detects the cyclic DAG during the model loading. To overcome that, it is possible to link the sub-model Variables to the main assembly, which of course does not cause a cyclic dependency (because editing the Variable through a link is just like editing it in-place). So, in my example's main assembly there is a "Variables_sub" linked variables in the main assembly, through which you can control the linked subassemblies. Unfortunately, the Asm4 animation does not support these linked sub-variables (just direct variables), so that if you want to animate this kind of multi-file model with dependencies between files, you'll need to use a python macro directly from the main assembly. However, losing the automated animation ability is a small nuisance compared to the advantage of the natural hierarchy of the sub-model structure, at least for me. Also, this kind of structure reflects the way that parts are stuck on each others in real life; and adding a new part (or actually a sub-Model) to the Model occurs directly at the position and orientation it resides in the 3D-space, so it is in-place designing, which makes it easy to design the necessary sub-models (I think your Sketch CarbonCopy method has this same advantage).
Attachments
Asm4_Example_Mechano.FCStd
(21.38 KiB) Downloaded 60 times
Asm4_Example.FCStd
(17.22 KiB) Downloaded 52 times
User avatar
ppemawm
Posts: 766
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2

Postby ppemawm » Sun Jul 19, 2020 4:46 pm

aapo wrote:
Sat Jul 18, 2020 10:41 pm
I just made a silly bare-bones example showing my modeling workflow.
Not so silly. Thank you for sharing your file and workflow.

I learned so much studying your tree, step-by-step:

1. How to get the master sketch into ASM4 Model by simply assembling it. Avoids the out-of-scope warning I usually get with drag/drop of a carbon copy.
2. Your approach allows you to create the bodies in their own file at the global origin (which has some advantages BTW) and 'assemble' each in its Model at its proper location controlled by the master sketch. And then, go to the main assembly file, assemble the link in Model which puts all of the bodies in context where you can then modify or finish the body! Amazing.
3. I better understand why to use the OZX, OZX, etc. attachment modes which I have rarely used.
4. How to use the variables across the linked external files which I had not done or did not know I needed yet. Thanks again.

I am imagining your workflow or something similar that which would facilitate team design of a bespoke assembly and its bodies:

1. A senior designer defines the assembly and sub-assembly master sketches in an Assembly file with interface dimensions and necessary design intent constraints.
2. He can then establish files for each body and 'assemble' the master sketches links into the body Models and assemble (links) the body files in the Assembly file Model. He could go as far to create the basic envelope of the body in-context.
3. Now, another designer(s) can access each file and detail the body using (carbon copies?) of the master sketch as guidance somehow. Unfortunately, this is not" in context" so there is still a chance that it will have to be modified in the Assembly file.

Do you have any thoughts or suggestions on the above approach?

BTW in your example you could have used a Draft > Make polar array wit out all of the LCS's after you assemble the first. The downside is that you cannot move each independently AFAIK.
"It is a poor workman who blames his tools..." ;)
aapo
Posts: 287
Joined: Mon Oct 29, 2018 6:41 pm

Re: V0.19 Top Down Assembly Design Using Assembly4--Update #2

Postby aapo » Sun Jul 19, 2020 6:59 pm

ppemawm wrote:
Sun Jul 19, 2020 4:46 pm

Not so silly. Thank you for sharing your file and workflow.

I learned so much studying your tree, step-by-step:

1. How to get the master sketch into ASM4 Model by simply assembling it. Avoids the out-of-scope warning I usually get with drag/drop of a carbon copy.
2. Your approach allows you to create the bodies in their own file at the global origin (which has some advantages BTW) and 'assemble' each in its Model at its proper location controlled by the master sketch. And then, go to the main assembly file, assemble the link in Model which puts all of the bodies in context where you can then modify or finish the body! Amazing.
3. I better understand why to use the OZX, OZX, etc. attachment modes which I have rarely used.
Thanks. When I finally discovered list item 2 and understood the advantages, it was quite a heureka moment for me. In practice, I usually set the sub-model LCS:s by coordinate values and angles by using Variables and Expression Engine. When I use the same variables in the involved body sketches for the same dimensions, the combination is a) 100 % topo problem proof, and b) completely parametric (the sketches and LCS:s move by the same variables, when edited). I only use the sketch attachment option for complicated movements/attachments, where simple Variable solutions cannot be found. But even then, using your master sketch approach, the topo problems are usually quite manageable.

4. How to use the variables across the linked external files which I had not done or did not know I needed yet. Thanks again.
Yes, that is very powerful, although it is also a very tricky beast, because it is easily possible, without any warnings, to introduce a cyclic dependency by using Expression Engine to make the sub-models depend on the main model variables. This makes it possible to edit and use the model, but FreeCAD refuses to load such assembly (it chokes in a cyclic DAG). I wish it would be possible to have the Asm4 Variables excluded from the cyclic dependency check, but I understand why it's necessary for preventing endless calculation loops for badly designed models. However, directly linking the sub-assembly Variables to the main assembly is not a dependency (from the sub-models' point of view), so it should work fine. And indeed, changing the sub-assembly variables through main model is then a procedural operation, not a calculation dependency, and this is ok both theoretically and in practice. Unfortunately, the Asm4 animation button does not (at least yet) support this. Hopefully Zolko expands the workbench in this direction, too :D

I am imagining your workflow or something similar that which would facilitate team design of a bespoke assembly and its bodies:

1. A senior designer defines the assembly and sub-assembly master sketches in an Assembly file with interface dimensions and necessary design intent constraints.
2. He can then establish files for each body and 'assemble' the master sketches links into the body Models and assemble (links) the body files in the Assembly file Model. He could go as far to create the basic envelope of the body in-context.
3. Now, another designer(s) can access each file and detail the body using (carbon copies?) of the master sketch as guidance somehow. Unfortunately, this is not" in context" so there is still a chance that it will have to be modified in the Assembly file.

Do you have any thoughts or suggestions on the above approach?
That is more or less how I try to work, except that I work alone, and quite often I actually do in-context editing/modeling by accessing the sub-Models through the links in the main Model. That way the whole model is visible, even if you just edit some sub-model features. Sometimes, if everything is very cluttered, I click on the individual sub-file, and everything around the detail vanishes, and I can concentrate on the detail. It is a very neat workflow. Thus, maybe in your team design workflow suggestion it might be reasonable to keep the files in a common file server, where only the senior designer would have read-write access at the file level to the main model, and other designer see it as read-only. That way all the designers could work in-context and see the whole model, but only edit their specific areas.

BTW in your example you could have used a Draft > Make polar array wit out all of the LCS's after you assemble the first. The downside is that you cannot move each independently AFAIK.
Exactly, and exactly. That is what makes my example slightly silly, because I used a lot of clicking to make the LCS:s independent, but didn't use the independence at all (because the example was simple, and meant just to show how I normally use the Asm4 workbench).