Assembly 3 - constraint with expression to control rotation

Discussion about the development of the Assembly workbench.
User avatar
bambuko
Posts: 390
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Assembly 3 - constraint with expression to control rotation

Postby bambuko » Wed Apr 07, 2021 8:17 am

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 220 times
User avatar
jpg87
Posts: 499
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Assembly 3 - constraint with expression to control rotation

Postby jpg87 » Wed Apr 07, 2021 8:46 am

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 2021/04/15
User avatar
bambuko
Posts: 390
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Assembly 3 - constraint with expression to control rotation

Postby bambuko » Wed Apr 07, 2021 9:09 am

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 ;)
User avatar
bambuko
Posts: 390
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Assembly 3 - constraint with expression to control rotation

Postby bambuko » Wed Apr 07, 2021 3:06 pm

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:
User avatar
bambuko
Posts: 390
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Assembly 3 - constraint with expression to control rotation

Postby bambuko » Wed Apr 07, 2021 5:52 pm

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 112 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 76 times