V0.21 Assembly and Animation of a Roller Chain--Update: Using Sub-Assemblies

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

V0.21 Assembly and Animation of a Roller Chain--Update: Using Sub-Assemblies

Post by ppemawm »

This is a follow on to a previous post which addressed a beta test of the new B-spline point on object constraint using a segment of a roller chain as an example. https://forum.freecadweb.org/viewtopic. ... 49#p655749

This new post presents a complete assembly via the Assembly4 workbench of the same roller chain components and solves a problematic LCS flipping problem during animation with the help of jolbas. The following images document the work process:

The simplified pin and chain link bodies are created with PartDesign and saved in the Asembly4 Parts folder.  These are used in Model for assembly.<br /><br />The assembly design starts with a periodic b-spline sketch in Model.  This sketch serves as an assembly solver for the Parent Assembly. <br /><br />Line segments are added to the sketch with the new point on object constraint to represent the chain links.  All the line segments have an equality constraint and a line length chosen that will allow the last vertex to coincide with the first vertex at 0 deg.  Now all the chain link line segments are locked to each other and the b-spline path.  The b-spline can be constrained with a block constraint.<br /><br />A radial line is  added with a Variable 'angle' and constrained to the first line segment vertex at angle=0 (360) deg for use in the Assembly4 animator.  As this angle changes all of the line segments will be dragged around the B-spline to create the animation as shown in the video below.
The simplified pin and chain link bodies are created with PartDesign and saved in the Asembly4 Parts folder. These are used in Model for assembly.

The assembly design starts with a periodic b-spline sketch in Model. This sketch serves as an assembly solver for the Parent Assembly.

Line segments are added to the sketch with the new point on object constraint to represent the chain links. All the line segments have an equality constraint and a line length chosen that will allow the last vertex to coincide with the first vertex at 0 deg. Now all the chain link line segments are locked to each other and the b-spline path. The b-spline can be constrained with a block constraint.

A radial line is added with a Variable 'angle' and constrained to the first line segment vertex at angle=0 (360) deg for use in the Assembly4 animator. As this angle changes all of the line segments will be dragged around the B-spline to create the animation as shown in the video below.
Screenshot 2023-01-28 143301.jpg (270.38 KiB) Viewed 2195 times
The next step is to add LCS 'connectors' to the sketch at each vertex where the roller pins will be located.  Now, the tricky part.  The LCS is attached with Align OZY by selecting the vertex first, then the line segment and THEN the center of rotation vertex as shown in the Attachment panel.  This will force the Y axis of the LCS to always be inboard of the spline path.<br /><br />This attachment logic suggested by Jolbas fully constrains the LCS's to each line segment.<br /><br />At this point it is a good idea to use the animator and check that all of the LCS's stay put from 0-360 deg of rotation.  Make small (few degrees) of incremental changes since the sketch is somewhat sensitive and may freeze-up for too large of angle changes.<br /><br />The LCS's are saved in a Model folder to tidy up the tree.
The next step is to add LCS 'connectors' to the sketch at each vertex where the roller pins will be located. Now, the tricky part. The LCS is attached with Align OZY by selecting the vertex first, then the line segment and THEN the center of rotation vertex as shown in the Attachment panel. This will force the Y axis of the LCS to always be inboard of the spline path.

This attachment logic suggested by Jolbas fully constrains the LCS's to each line segment.

At this point it is a good idea to use the animator and check that all of the LCS's stay put from 0-360 deg of rotation. Make small (few degrees) of incremental changes since the sketch is somewhat sensitive and may freeze-up for too large of angle changes.

The LCS's are saved in a Model folder to tidy up the tree.
Screenshot 2023-01-28 143430.jpg (247.8 KiB) Viewed 2195 times
The rollers can then be assembled to the Parent Assembly sketch using their default Body LCS and the sketch LCS's.  No attachment offset is required.<br /><br />They are all saved in the Pin folder.
The rollers can then be assembled to the Parent Assembly sketch using their default Body LCS and the sketch LCS's. No attachment offset is required.

They are all saved in the Pin folder.
Screenshot 2023-01-28 143612.jpg (262.07 KiB) Viewed 2195 times
Each chain link is assembled to its appropriate roller LCS using its default body LCS which is purposely located at one of holes at the end of the link.<br /><br />Change the Link element count to two(2) and offset each with their respective placement Y property.  Do not forget to zero out the default X position.  These are shown above as children of the assembled chain link.
Each chain link is assembled to its appropriate roller LCS using its default body LCS which is purposely located at one of holes at the end of the link.

Change the Link element count to two(2) and offset each with their respective placement Y property. Do not forget to zero out the default X position. These are shown above as children of the assembled chain link.
Screenshot 2023-01-28 144336.jpg (281.08 KiB) Viewed 2195 times
.
The following mp4 video was created with the Assembly4 animator Save function:

phpBB [video]

https://www.youtube.com/watch?v=GP2fzBMd4oQ
Animate_RollerChain2b1.FCStd
(75.49 KiB) Downloaded 59 times
See also for further design guidance:
Assembly4 options: https://forum.freecadweb.org/viewtopic. ... 32#p595632
Design spreadsheet to determine center distance: https://forum.freecadweb.org/viewtopic. ... 04#p143004

The complete file is attached for reference. Any question or comments are welcome. Thanks again to JNXD for his valuable b-spline contributions!

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.31641 (Git)
Build type: Release
Branch: master
Hash: d28d63b87b60161419c6c0c532fbbfaed96926b8
Python 3.10.8, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.4
  * fasteners 0.4.15
  * freecad.gears 1.0.0
  * QuickMeasure 2022.10.28
  * Render 2022.2.0
Last edited by ppemawm on Mon Jan 30, 2023 4:34 pm, edited 1 time in total.
"It is a poor workman who blames his tools..." ;)
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: V0.21 Assembly and Animation of a Roller Chain--Update: Using Sub-Assemblies

Post by ppemawm »

The objective of the previous example was to document a method for assembling and animating a simplified roller chain. If you need a model of a realistic roller chain that includes more components then the process becomes a bit tedious particularly for longer chains. The following example simplifies this process by using Assembly4 sub-assemblies as shown in the images below.

The first step is to create the two sub-assembies of components that can be repeated around the perimeter of the chain path as shown in these two views along with a view of the top assembly.<br /><br />The two sub-assembly files are identical except for the spacing of the links which creates an &quot;inside&quot; and an &quot;outside&quot; link sub-assembly.  The spacing is constrained by the Link Y-position in the Property View.<br /><br />Create one file, save a copy, and change its link spacing to suit.
The first step is to create the two sub-assembies of components that can be repeated around the perimeter of the chain path as shown in these two views along with a view of the top assembly.

The two sub-assembly files are identical except for the spacing of the links which creates an "inside" and an "outside" link sub-assembly. The spacing is constrained by the Link Y-position in the Property View.

Create one file, save a copy, and change its link spacing to suit.
Screenshot 2023-01-30 102813.jpg (329.82 KiB) Viewed 1961 times
The assembly begins by inserting a sub-assembly to the Parent Assembly using the LCS's attached to the spline path as in the previous simplified example.
The assembly begins by inserting a sub-assembly to the Parent Assembly using the LCS's attached to the spline path as in the previous simplified example.
Screenshot 2023-01-29 144439.jpg (211.48 KiB) Viewed 1961 times
The process is simply repeated for the the mating sub-assembly alternating as you progress around the perimeter.<br /><br />Sure beats having to assemble individual bodies and adjusting link spacing for every LCS.
The process is simply repeated for the the mating sub-assembly alternating as you progress around the perimeter.

Sure beats having to assemble individual bodies and adjusting link spacing for every LCS.
Screenshot 2023-01-29 144604.jpg (254.31 KiB) Viewed 1961 times
This is the completed assembly.<br /><br />I added this version to the original file that is why you see two Configurations spreadsheets 'SubAssembly' and 'Individual_Components'.  Assembly4 Configurations tool allows you to have several versions in the same assembly file with different visibility and/or XYZ positions such as in exploded views.  Very handy.
This is the completed assembly.

I added this version to the original file that is why you see two Configurations spreadsheets 'SubAssembly' and 'Individual_Components'. Assembly4 Configurations tool allows you to have several versions in the same assembly file with different visibility and/or XYZ positions such as in exploded views. Very handy.
Screenshot 2023-01-29 144806.jpg (255 KiB) Viewed 1961 times
.
Please PM if you would like the files and I will place them on Dropbox for a limited time.
"It is a poor workman who blames his tools..." ;)
matthyuz
Posts: 33
Joined: Sat Sep 16, 2017 8:01 pm

Re: V0.21 Assembly and Animation of a Roller Chain--Update: Using Sub-Assemblies

Post by matthyuz »

As always, excellent and exciting, the samples you make of your work in FreeCAD. I always look forward to your new post. Thank you.
There's something I can't help but ask, if the spline is fully constrained, and the segments that represent the links are all the same, what ensures that rotating them on the spline doesn't lengthen or shorten as they move?
I didn't download the model, but my logic says that the perimeter of the polygon varies based on the starting point.
I hope I have made myself understood, english is not my native language.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: V0.21 Assembly and Animation of a Roller Chain--Update: Using Sub-Assemblies

Post by ppemawm »

matthyuz wrote: Tue Jan 31, 2023 5:18 pm if the spline is fully constrained, and the segments that represent the links are all the same, what ensures that rotating them on the spline doesn't lengthen or shorten as they move?
I am not all that knowledgeable regarding spline behavior but here is my best guess:

1. All the line segments have an equality constraint to a fixed dimensional constraint of a line segment so they can not change length.
2. The line vertices are constrained to each other head to tail and to the spline with the new point on object constraint
3. The spline itself has a block constraint to lock its position--https://wiki.freecad.org/Sketcher_ConstrainBlock

Somehow all that allows the line segment polygon to slide around the spline just like a real sprocket chain.

Hope that helps to clarify.
"It is a poor workman who blames his tools..." ;)
rock.vice
Posts: 22
Joined: Sat Jan 02, 2021 6:12 pm

Re: V0.21 Assembly and Animation of a Roller Chain--Update: Using Sub-Assemblies

Post by rock.vice »

This example is a true inspiration! Many thanks to you and the developers for this new powerful FreeCAD weapon!

I am just wondering if there is a simple way in A4 to keep constant the speed of every single element along the path.
I think that using an angle to control the motion of the chain cannot be used if you need to make the chain movement in sync with a sprocket and a crown wheel. So far I was not able to identify a possible solution, but I am not an experienced user of this workbench.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: V0.21 Assembly and Animation of a Roller Chain--Update: Using Sub-Assemblies

Post by ppemawm »

rock.vice wrote: Mon Feb 06, 2023 1:17 pm ...using an angle to control the motion of the chain cannot be used if you need to make the chain movement in sync with a sprocket...

It seems like if the center of rotation of the angle variable is the same as one of the sprockets that sprocket should stay in sync with the chain if the incremental sprocket rotation is constantly adjusted by the ratio of the angle variable radius and the fixed sprocket radius. Then, the other sprocket rotation can be related to the first sprocket by the ratio of the no. of teeth. I will try to come up with a simple example.
rock.vice wrote: Mon Feb 06, 2023 1:17 pm I am just wondering if there is a simple way in A4 to keep constant the speed of every single element along the path.
The Attachment > Map Path Parameter can be used to move an LCS around a spline at constant speed with Assembly4, but, unfortunately, we do not have that type of constraint in Sketcher. The sketch is necessary to keep the all the links connected AFAIK.
"It is a poor workman who blames his tools..." ;)
Post Reply