## Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
Turro75
Posts: 170
Joined: Mon Aug 15, 2016 10:23 pm

### Re: Another approach to assembly solver (A2plus)

manuelkrause wrote:
Wed Jul 18, 2018 7:34 pm
@Turro75:

What I haven't understood so far is, what do you mean with "arrows are constraints with weight"? Is the weight determined by the sum of constraints, the sum of reduced DOF (by all current constraints for a part) or something of both mixed, when dealing with father-> son <- father (etc.) relationships. For me, I'd admit, I don't get it ATM.

Manuel
Hi Manuel,

each arrows is a constraints in Your assembly, direction of the arrow is from father to son and the weigth is the number of DOF lost (or locked) in the son after the constraint.
Who is father and who is son? it depends on Your assembly, let's say You want move piston by an handle connected to the crankshaft

this is the chart:
Manuel Engine Analisys.PNG (36.63 KiB) Viewed 198 times
cranckshaft (B) is locked in position by the frame (A) so the arrow goes from A to B and it locks 5 DOF (circular edge) on the shaft.
rods are constrained to shaft by circular edge (5 DOF)
pistons are constrained by cylinder (which are part of A) and rods

it makes sense?

let's try to analyze how it should be as in an engine the piston move the shaft:

Manuel Engine Analisys_B.PNG (32.92 KiB) Viewed 198 times
This time the arrows are inverted and even the values of DOF on each son are different.
Turro75
Posts: 170
Joined: Mon Aug 15, 2016 10:23 pm

### Re: Another approach to assembly solver (A2plus)

Hi Manuel ,

again on crackshaft
cranckshaft analisys.PNG (27.32 KiB) Viewed 196 times
in the real world A and B are fully constrained so You have to lock Rotation in the circular edge which constraints them, Actually You must do the same on every circular edge. in this case all constraints with weigth of 5 become 6 so the incremental solver will easily and fast identify the right placement of subassemblies without the need of exotic guessing.

It doesn't always happen but when You respect the reality the result is usually better.
kbwbe
Posts: 881
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

### Re: Another approach to assembly solver (A2plus)

Hi Manuel,

find attached corrected crankShaft-reference-file. You had a lot of fixed parts. Therefore it was impossible to solve.
I assembled with master-version...

Edit1
Better we should implement a warning. "constraint xy between fixed parts could not be solved!". ATM solver ignores fixed parts and reports success.
/Edit1

Edit2
@project4, i just checked, only the object lables have been changed ! Object Names are still the old ones...
/Edit2
Attachments
crankshaft-reference-corrected.fcstd
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.31, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

### Re: Another approach to assembly solver (A2plus)

@Turro75:

Your explanations and descriptions are really good now. (In the meaning of, that even I understand them.)
I have no knowledge to give it a form of algorithm.

Manuel
Last edited by manuelkrause on Wed Jul 18, 2018 10:15 pm, edited 1 time in total.
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

### Re: Another approach to assembly solver (A2plus)

@kbwbe,

I didn't want you to re-do my assembly at all. I wanted to do that but failed. In my humble opinion, I've only fixed either A _OR_ B for further constraining. Did you see remainders of both of them or even others in the posted file? If so, why do they remain when I removed all constraints?

Manuel
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

### Re: Another approach to assembly solver (A2plus)

OMG, sorry!

@kbwbe, you're absolutely right, there were too many fixed parts in it.

Shame on me,
Manuel
kbwbe
Posts: 881
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

### Re: Another approach to assembly solver (A2plus)

Hi Manuel,
have a look at Part E in original posted file by your self.
It is constrained, but has fixedPosition = True. So it can not be moved by solver.
After solving, there will nothing on screen change.
Also:
Part I and part O are fixed.
If you delete all constraints, property fixedPosition in object tree will remain..
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.31, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
Posts: 80
Joined: Fri Mar 16, 2018 11:10 pm

### Re: Another approach to assembly solver (A2plus)

kbwbe,

Thanks for your work on updating the assembly bench! I've skimmed though the thread, so sorry if I missed it.
Is it possible to simulate gear/chains angle constraints with your assembly solver?

I do not expect it's realistic to do a full interference analysis to move the gears depending on the mechanical shape of their teeth, but would if be possible to indicate a angle ratio between the different axis IE consider them like cylinders without slippage?

The other issue to consider, but that might be out of this bench scope, is that to get the gears to mate properly the initial angle (before any rotation is applied) is dependent on the relative position of the 2 axis and the parity of the number of teeth... The reason is that tools to create gears generality create them with a fix orientation (first tooth on the horizontal-right, for both Part-design involute & FCgears).

My goal is to do an animation of a parametric mechanical watch movement, that allow change of location of the shafts and change of the gear geometry. I managed to do it for a small group of 4 gears using master sketches and expressions in the angle properties of parts / bodies, but it's really clunky and tedious to make...

So if the assembly can take care of some of the constraints that would be interesting.

Thanks
Cheers
kbwbe
Posts: 881
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

### Re: Another approach to assembly solver (A2plus)

i think it is to difficult for this workbench ATM. We are fighting still with the basics.

I did somehow similar things in past. I did not use master sketches, everything was done by scripts and math.
Look for simulation scripts in forum.
If interested, i can PM you a special script i used some time ago. But you should be able to read python programs.

Hope it helps..
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.31, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

### Re: Another approach to assembly solver (A2plus)

@kbwbe:

Mmmh, the fixed constraints were needed in a very early version of A2plus. For the version of today, they are unneeded or even hindering. I've seen errors twice, when setting correct values, but the solver said NO. This is quite good, if user knows to understand, to remove the WRONG 'fixed' setting or related constraint. But we should face user messages later.

Here's a new "crankshaft" assembly from my hands, hopefully fully constrained, this time even with all 'lock-rotation' in place, as it's a sub-assembly to rotate in the engine only as itself. Feel free to disrupt it again.

EDIT: It confirm's to @Turro75's A -> O graph except for some constraints added.
/EDIT

Manuel
Attachments
crankshaft-reference.B.fcstd