Flexible assemblies. How manage them ?

Discussion about the development of the Assembly workbench.
fcaduser
Posts: 306
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Flexible assemblies. How manage them ?

Postby fcaduser » Tue Jul 28, 2020 1:55 pm

3dview.png
3dview.png (109.54 KiB) Viewed 825 times
Tree.png
Tree.png (28.12 KiB) Viewed 825 times
Hello developers.

I submitted several months ago the problem of flexible assembly, because it's now a significant hurdle slowing my projects. So I imagined a factious machine to exhibit what's going on, in a synthetic fashion (show all the cases), and kept as simple as possible. This issue concerns each applicant workbench as the future assembly module, thus this detached thread.

The key point is of course an engineer wants to shape his project, in particular how it will be split, with functional subdivision in mind. And not how the CAD would be pleased, because it eases its process of constraining.

It's just a first draft. I gave you the tree structure the user would probably wants. For the sake of clarity, pure assemblies are all prefixed using this pattern : A_*.FCStd.
I roughly placed the parts/assemblies in the 3d view, the required constraints are obvious.

An under-constrained sub-assembly :
Gear-motor -> DOF rot=1

An under-constrained sub-assembly inserted several times at same level, but using different configurations :
Cylinder -> DOF rot=1, transl=1

More to come...

So as you can see, even with this miserable examples, you can't fully apply constraints. See all of this as just a starting point for a global thinking about the subject.

(I have a tarball on my pc of this test assembly).
catman
Posts: 232
Joined: Fri Jan 11, 2019 10:42 pm

Re: Flexible assemblies. How manage them ?

Postby catman » Thu Jul 30, 2020 5:27 pm

I am not sure I understood your problem, sorry if this freedback is beside the point, then.

My projects all have that structure and they work great. But I note that my tree looks different from yours. I use pure assembly files (I guess that is what you A-Motor is, I name them "asm_Motor" - just cosmetics), one at each level. Each assembly file includes other (lower) assembly files and uses constraints to assembly them. Each mechanical module gets a folder on disk. Typically only the lowest levels contains pure part files. I also use a lot of STEP files for library parts (e.g. DIN/ISO parts) - gladly realthunder added the import STEP function, so you can directly include that file from the Assembly3 WB.

So the difference I see is, that when I have my "asm_Machine-FCSTD" open, I would see this

Code: Select all

asm_Machine-FCSTD
 Assembly
    constraints
    elements
    parts
        asm_cylinder
        frame
       gear
       lowerArm
       asm_Motor
       rotatingBase
       upperArm
Under "parts" all leafs are links, the "asm_xxx" are links to assemblies, the others are links to direct files. The constraints and elements define the assembly and the kinematics of the structure.

In your tree I do not see that. it looks to me like pure links with no constraints. Maybe thats fine, I have never used that. I only can say that my structure worked quite good so far.
fcaduser
Posts: 306
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Flexible assemblies. How manage them ?

Postby fcaduser » Thu Jul 30, 2020 7:15 pm

Some precision :

The tree shows how the files and directories are stored on my disk.

At the moment I use a2+

Yes, A_Something.FCStd are pure containers, so with constraints stored into them, but *only* imported parts. The prefix is just a personal naming convention to instantly recognize them as assemblies.

A practical example : I can't insert A_Cylinder.FCstd two times into A_Machine.FCStd, with two different states : one with rod retracted, the other with rod expanded, because they are considered *monolithic* inside A_Machine.FCStd, even if I leave a free translation into A_Cylinder.FCStd.

Sorry, it's sometime hard to explain clearly what's going on !
catman
Posts: 232
Joined: Fri Jan 11, 2019 10:42 pm

Re: Flexible assemblies. How manage them ?

Postby catman » Fri Jul 31, 2020 9:06 am

fcaduser wrote:
Thu Jul 30, 2020 7:15 pm
At the moment I use a2+
That was my mistake. Since you linked your post in the Assembly3 thread I assumed that you were using assembly3 workbench with the 0.19 pre-version. So what I wrote would not apply to A2+ automatically.

I was using A2+ some time ago to do so something similar: having a low poly version of a part and a detailed version, which I could swap. Somehow I did not get that done. I found that I could do it with Assembly4. This is also based on the Link-core extensions that Assembly3 uses but based on defining local coordinate systems (LCS) for each part. You can attach serveral parts to another's parts LCS and use <space> to hide/disable the unwanted one. In your case its not different level of detail, its just different states. With Assembly3 that can be done as well. If your have not worked with Assemby3 before, I think Assembly4 might be more suitable for your case.
fcaduser
Posts: 306
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Flexible assemblies. How manage them ?

Postby fcaduser » Fri Jul 31, 2020 9:49 am

I understand the idea you suggested.

The problem is no asm3 plugin are provided. My real projects are really huge, no way I will switch without careful planning. I really hope an official assembly module will be chosen, even if it lacks significant features.
User avatar
jpg87
Posts: 402
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Flexible assemblies. How manage them ?

Postby jpg87 » Fri Jul 31, 2020 4:15 pm

fcaduser wrote:
Tue Jul 28, 2020 1:55 pm
I submitted several months ago the problem of flexible assembly ...
Hello,
here is an example I had built in Asm3 to try to kinematically animate a mechanism :
excavator_coul_arbre.jpg
excavator_coul_arbre.jpg (102.5 KiB) Viewed 581 times

Cinematic animation:
http://help-freecad-jpg87.fr/02assembla ... sm3WB.html

Each object is located in an external file and represented in the assembly by a link.
Each object is here very simplified but could itself be a sub-assembly made up of several parts.

You can see that the arm and bucket cylinders come from the same PartDesign part and are two independent instances in operation.

According to my point of view, a component purchased commercially (cylinder, motor, ...) must be prepared beforehand in several sub-assemblies.
Maybe some CAD software allows you to make "flexible" assemblies, but I don't find this function essential.
In any case, when we recover the 3D files of a commercial component (often in step format), they are not yet assembled within the meaning of the assembly constraints.

Example of a hydraulic (or pneumatic) cylinder:
1- the cylinder body (with its articulation, joints, guide, ...);
2- the piston of the cylinder (with its articulation, the seals, ...).

Example of an electric motor:
1- the motor body (with its frame, the stator, ...);
2- the rotating part of the motor (rotor, ...).
My website : http://help-freecad-jpg87.fr updated 2020/05/10
fcaduser
Posts: 306
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Flexible assemblies. How manage them ?

Postby fcaduser » Sat Aug 01, 2020 12:19 pm

May be I should try to explain what the interface could show, to my point of view.
Capture d’écran de 2020-08-01 13-13-53.png
Tree interface
Capture d’écran de 2020-08-01 13-13-53.png (26.61 KiB) Viewed 499 times
It's a classic expandable/collapsible tree (the same sort of widget sometime used for traveling through a directory/file structure).

Each assembly node (here named A_*) can be collapsed.

The location on the disk of a part or an assembly doesn't matter, a pointer is used to target where it's located.

I really think it's the clearest way to represent an assembly.

-------

Now, returning to the initial problem.

Opening A_Cylinder *alone*, the user would see the rod with DOF:rot=1, trans=1.

Then opening A_Machine, to now fully constrain the two cylinders, A_machine must store the additional constraints (to fully set the two rods) *inside* itself. THAT'S THE POINT !

I think it's clear.

@jpg87

1) The problem is the structure I see in your example is flat, and I don't want that.

2) I know that components purchased off-the-shelf are problematic when they are assemblies (assuming downloaded as *.step). Step file doesn't manage this sort of flexiblity, as far as I know.
User avatar
Zolko
Posts: 945
Joined: Mon Dec 17, 2018 10:02 am

Re: Flexible assemblies. How manage them ?

Postby Zolko » Sun Aug 02, 2020 3:19 pm

fcaduser wrote:
Tue Jul 28, 2020 1:55 pm
I submitted several months ago the problem of flexible assembly
yes, I remember, it was about a cardan joint, and I gave you a solution to your problem.

fcaduser wrote:
Sat Aug 01, 2020 12:19 pm
May be I should try to explain what the interface could show, to my point of view.
This is a typical example of a solution looking for a problem. Technically, a flexible assembly is actually a badly defined combination of 2 (or more) stiff assemblies. For example, in your example of the motor composed of a stator and a rotor, the stator and the rotor are both fixes to their respective sub-assemblies, and not a flexible assembly of 2 components.

What I would do is to define your motor in a separate file, with all components in separate parts, inside the same file. This way, you can design your motor in a coherent way, even parametrically such that the rotor and stator share the same dimensions. Then, with Asm4, define the locations (LCS) of your moving parts in a master sketch, probably with the help of some variables. Then, insert both parts (Stator and Rotor) separately and attached to their respective locations, as defined previously. This way, your motor (composed of several parts) can be held in a single file, designed parametrically and coherently, and yet still be inserted as separate components with moving parts attached to where they belong.

This, actually, is unique to FreeCAD, and much better than what other 3D CAD systems can propose.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
fcaduser
Posts: 306
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Flexible assemblies. How manage them ?

Postby fcaduser » Mon Aug 03, 2020 10:05 am

So we see appearing here different conceptions of how a tree should be structured.

I perfectly understand the suggested method but I just don't like it. I like to split a machine tree using a logic as close as possible to what the physical equivalent components would be. I'm *prioritizing* assembly process, rather than kinematic logic (although of course I strive to combine both, then if I can it's a clear bonus). This logic is debatable, but I am sure the result I'm getting is not a hodgepodge of incoherence.

Thinking afterwards about the term, may be there is a better word than "flexible" (I reused the one found in the commercial CAD literature), that is simply : "partially constrained". Well, because it's just what exactly happens...

The way I represented the motor was a simplification, the A_stator included in my mind all the fixed parts (casing included). So the A_rotor is indeed underscontrained relatively to its parent A_Motor (dof rot=1). I meant flexible in that way.
Below a better representation closer to reality :
Capture d’écran de 2020-08-03 11-24-16.png
Capture d’écran de 2020-08-03 11-24-16.png (37.77 KiB) Viewed 368 times
Anyway... I'm not trying to convince anyone my method is better than any other. Ideally, a CAD should bestow each user full latitude of how his assembly could be structured (excepted of course an absurdity like a circular reference).

I'm cautious because without a serious reading of the code it's hard to say, but I can't figure at this stage anything preventing the usage of underconstrained sub-assemblies. After opening an assembly, once the recursive loading is done, position of a part/assembly in the tree doesn't matter. I don't see here a fundamental hurdle for an algorithm.
User avatar
Gregory son of Carl
Posts: 77
Joined: Mon Apr 06, 2020 7:42 pm
Location: California

Re: Flexible assemblies. How manage them ?

Postby Gregory son of Carl » Tue Aug 04, 2020 8:57 pm

fcaduser wrote:
Mon Aug 03, 2020 10:05 am
I perfectly understand the suggested method but I just don't like it. I like to split a machine tree using a logic as close as possible to what the physical equivalent components would be.
How about using Groups to replicate the hierarchy of the sub-assemblies? That would let you follow Zolko's method without sacrificing the tree structure.