Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (assembly2relaunch)

Postby manuelkrause » Tue Jul 10, 2018 5:40 pm

kbwbe wrote:
Tue Jul 10, 2018 5:14 pm
manuelkrause wrote:
Tue Jul 10, 2018 5:08 pm
@kbwbe:
What do you think: Can I help you a little by adding some more documentation to the README.md at "Usage of A2plus workbench:"? First only a feature list with some copy&paste of the tooltips' information?
Appreciated. Please PM drafts.
I don't want to irritate your workflow. I may stumble over typos in the code files' tooltips, that I could fix as well, when at it. So I'd prefer to send you a diff style patch in PM. If you don't agree, just make a different proposal that's most convenient for you.
User avatar
jpg87
Posts: 342
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Another approach to assembly solver (A2plus)

Postby jpg87 » Tue Jul 10, 2018 7:08 pm

Hello,
I started (positive) tests with A2p.
I have a question for the moment: how do we test the remaining movements after one or more constraints?
... and a check: is the first integrated part always the reference part (locked in a transparent way)?
Thank you in advance and good job.
My website : http://help-freecad-jpg87.fr updated 2020/03/08
Turro75
Posts: 175
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Postby Turro75 » Tue Jul 10, 2018 7:45 pm

jpg87 wrote:
Tue Jul 10, 2018 7:08 pm
Hello,
I started (positive) tests with A2p.
I have a question for the moment: how do we test the remaining movements after one or more constraints?
... and a check: is the first integrated part always the reference part (locked in a transparent way)?
Thank you in advance and good job.
Good point. For what I've seen in the source it is. I didn't understand how priorities are handled, it looks like the order is the creation of the constraints as a fifo.

In complex assemblies could be mandatory start solving from constraints which involve fixed parts, then go to the others by threating the first object as fixed part.
I remember solidworks that allowed to change the order of the solver and it was also possible disabling a specific constraint.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Tue Jul 10, 2018 8:12 pm

Turro75 wrote:
Tue Jul 10, 2018 7:45 pm
jpg87 wrote:
Tue Jul 10, 2018 7:08 pm
Hello,
I started (positive) tests with A2p.
I have a question for the moment: how do we test the remaining movements after one or more constraints?
... and a check: is the first integrated part always the reference part (locked in a transparent way)?
Thank you in advance and good job.
Good point. For what I've seen in the source it is. I didn't understand how priorities are handled, it looks like the order is the creation of the constraints as a fifo.

In complex assemblies could be mandatory start solving from constraints which involve fixed parts, then go to the others by threating the first object as fixed part.
I remember solidworks that allowed to change the order of the solver and it was also possible disabling a specific constraint.
Yes, this had been the great advantage of the last solidworks I had used, too. Anyways, we'd alltogether make the A2plus at least as powerful. Over time. :-)
kbwbe
Posts: 939
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Tue Jul 10, 2018 8:21 pm

@jpg87

thank you for testing...

Answers to your questions:
- test remaining movements after constraining: ATM nothing special implemented, just move/rotate part manual away and solve again. You will see what is missing.

- reference part:
Same as in Assembly 2. The first imported part is automatically fixed (Fixed Position = True in object tree)
You always can edit this property to False. But in this case you should fix another one instantly. Otherwise your whole assembly will move free
in coordinate system. As the solver will move each part which is constrained and not fixed.

@Turro75
FYI: There is no priority of constraints. Order of creation does not matter. You have the fixed parts and all others. The solver calculates the move data of all movable parts and then, in next step, it moves all parts quasi simultan. But it is recommended to set constraints first to the fixed part, second to the neighbors etc.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.45c, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
jbe
Posts: 279
Joined: Sun Nov 10, 2013 4:18 pm
Location: France, Châteauroux

Re: Another approach to assembly solver (A2plus)

Postby jbe » Wed Jul 11, 2018 6:07 am

Hello,
Can you add a button to symmetry the last constraint, especially for plane-to-plane constraints (to return a part).
There is this button in Assembly 2, and it was very useful.
Thank you.
Turro75
Posts: 175
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Postby Turro75 » Wed Jul 11, 2018 10:09 am

kbwbe wrote:
Tue Jul 10, 2018 8:21 pm

@Turro75
FYI: There is no priority of constraints. Order of creation does not matter. You have the fixed parts and all others. The solver calculates the move data of all movable parts and then, in next step, it moves all parts quasi simultan. But it is recommended to set constraints first to the fixed part, second to the neighbors etc.
Hi Kbwbe,

Your solver is effective but I think it would improve by handling priorities and by keeping low the number of rigids involved during calcmovedata.
let's say we have an assembly with a structure like this: Part1 is fixed and arrows identify a constraint and obj1 to obj2.
Cattura1.PNG
Cattura1.PNG (37.11 KiB) Viewed 320 times
At the moment the solver skips all rigids marked as fixed. which is good. My suggestion is to create 2 new parameters:
a list of "fathers" rigids and
a temporary fixed parameter which is set to rigid.fixed at the creation of the rigid. then it become true as all "Fathers" are marked as tempfixed EDIT and successfully solved END EDIT.

every rigid should be involved in calculation only if all fathers are marked as tempfixed.

coming back to the picture above the solver should do this sequence:
fix part1 (which is already marked as fixed)
solve part2 and part4 and mark them as tempfixed
solve part3 part5 part6 part8 and mark them as tempfixed
solve part7

does this make sense for You?
Last edited by Turro75 on Wed Jul 11, 2018 11:03 am, edited 1 time in total.
kbwbe
Posts: 939
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Wed Jul 11, 2018 10:48 am

Hi @Turro75,

very good. I am just sitting here and are thinking about exact same things. Solver will needs more logic to control such things.
This will save a lot of computation time.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.45c, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
Turro75
Posts: 175
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Postby Turro75 » Wed Jul 11, 2018 11:21 am

Well I was sure You agreed

moreover if there are moveable rigids but none of them has all fathers tempfixed so the assembly is not valid and You can immediately stop calculation.

Of course the constraint can be wrong, but at least You can catch in advance if the sequnce is correct or corrupted.

Another advantage, the order of insertions of parts and constraints is not important the only thing is respecting these 3 rules:
1) in an assembly at least one part must be marked as fixed
2) when creating a constraint always select as first the reference object and then the object that must be moved.
3) manually pay attention to recursive constraint creation

I think it's difficult doing it better than this.
I worked for Years with commercial grade CAD and ignoring the 3 rules above caused an unresolved assembly in the 100% of the cases.
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Wed Jul 11, 2018 5:33 pm

Am just playing with some subassembly operations. What is easier from the solver's sight ATM: circularEdgeConstraint with value offset edited, or the two corresponding ones, first axialConstraint and second planeCoincidentConstraint with edited offset? Hope, I haven't ask this before on here and you don't consider it too dumb.

EDIT
And again something forgotten to ask: Does the "Update parts" work recursively over sub-assemblies? Any known limits?
EDIT END

TIA,
Manuel