Assembly 3 - constraint with expression to control rotation

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bambuko
Veteran
Posts: 2185
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Assembly 3 - constraint with expression to control rotation

Post by bambuko »

It should be trivial ;) but has so far defeated me...
I have one degree of freedom left in my assembly (rotate around axle axis)
and would like to constrain it with an expression to control the angle from horizontal.
I am familiar with:
https://github.com/realthunder/FreeCAD_ ... xpressions
and have tried to work it out myself, but failed miserably :oops:
so would appreciate any advice, please.
expression.jpg
expression.jpg (412.91 KiB) Viewed 748 times
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Assembly 3 - constraint with expression to control rotation

Post by jpg87 »

The files to be downloaded are the controls of the movements and they are commented on:
http://help-freecad-jpg87.fr/0269_ass_ex_creat_Glob.php
My website : http://help-freecad-jpg87.fr updated 2023/11/06
User avatar
bambuko
Veteran
Posts: 2185
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Assembly 3 - constraint with expression to control rotation

Post by bambuko »

Thank you, as usual :)
The immediate question, that has prompted me to post here (and I don't think is answered in your otherwise excellent tutorial) is the business of starting point.
For your design it doesn't matter, just as long as it rotates round? (starting point is random?)

I need to have crankpin centre at 0 deg to start with and then rotate it using an expression.
No need for macros - I am happy to do it manually (it would be nice I guess to have it as well but not bothered about it for my design process).

I will now study your tutorial and see if I can apply it ;)
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
bambuko
Veteran
Posts: 2185
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Assembly 3 - constraint with expression to control rotation

Post by bambuko »

I had a good look at your suggested tutorial.
Lot of useful stuff, but it doesn't solve what I want to do (hope I have explained it well enough).

Best promise to me is skeleton sketch idea explained here:
https://github.com/realthunder/FreeCAD_ ... ton-Sketch

and in more details here:
https://solvespace.com/linkage.pl

OK... it adds even more complications/things to learn (so it will not be quick or easy).
Plus, what I miss from RealThunder's short tutorial, is: how do I constrain my solid models against this skeleton sketch?

I will carry on trying but it is a big mountain (at least for me) I am trying to climb :mrgreen:
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
bambuko
Veteran
Posts: 2185
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Assembly 3 - constraint with expression to control rotation

Post by bambuko »

Making progress :mrgreen:

Created skeleton sketch of the motion, added angular constraint (between the crank and baseline) and spreadsheet crank angle value to control the position.
Now just need to work out how to use this sketch to constrain my model assembly...

BTW here in this simplest model (on purpose - KISS) baseline is horizontal, but in real life more often than not motion was inclined at an angle -
easily catered for as well :ugeek:


skeleton.jpg
skeleton.jpg (360.86 KiB) Viewed 640 times


One thing that puzzles me though is the "axial move" command behaviour with Draft lines :?
Horizontal are fine and easy to rotate in the plane of Draft sketch, but inclined lines appear to be not on the plane of the sketch.
I really do not have a clue why???

trans.jpg
trans.jpg (32.43 KiB) Viewed 604 times
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
Post Reply