V0.20/Assembly4 Challenge--Creo Motorbike

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: V0.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #6

Post by Zolko »

ppemawm wrote: Wed May 11, 2022 7:01 pm I can reduce the step size in the animator, but it will still be slow and choppy, just longer. I have no idea how to speed up the rendering ... I was only trying to show what's possible with basic Part Design and Assembly4.
did you try the "Export" option of the animation ? In there, you choose your file with .mp4 or .gif extension, and it will be rendered to the file. To write mp4-s, The package "cv2" needs to be installed (sorry, I don't remember how that's done, I didn't write that part). Else, you can write as animated GIF.
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: V0.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #6

Post by ppemawm »

Zolko wrote: Wed May 11, 2022 8:19 pm did you try the "Export" option of the animation ?
Thanks for reminding me of that Assembly4 animation option. I completely overlooked that. Piece of cake.
Kunda1 wrote: Wed May 11, 2022 5:18 pm can you redo this clip
I updated the video which is much smoother now but still quite slow.
"It is a poor workman who blames his tools..." ;)
User avatar
kwahoo
Posts: 680
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: V0.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #6

Post by kwahoo »

ppemawm wrote: Wed May 11, 2022 10:17 pm I updated the video which is much smoother now but still quite slow.
Check this https://drive.google.com/file/d/1Gqm51D ... sp=sharing

I increased fps of your video from 10 to 30 using ffmpeg.
I'll delete the video after you download it.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: V0.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #6

Post by ppemawm »

kwahoo wrote: Thu May 12, 2022 2:33 pm I increased fps of your video from 10 to 30...
Thank you. Now I know it can be done. That would be a nice option in Assembly4.
"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.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #7

Post by ppemawm »

The cam and drive chains were added this past week after a little research and trial & error. I have modeled roller chains in the past (V0.16) but was never quite satisfied with the accuracy of alignment as discussed in this earlier post: https://forum.freecadweb.org/viewtopic. ... 18#p142318 AFAIK you cannot use a Draft > PathArray to directly (and easily) assemble a roller chain because only one point on the chain link can be aligned with the path. For straight sections it is OK but not for arcs or at the transition between an arc and tangent line.

Assembly4 offers a couple of different approaches that yields an exact chain assembly alignment rather than the approximate work-around shown in the above post. The two Assembly4 processes are described in the following image captions:

These are the two roller chains required for the bike assembly:  the two cam drive chains on the left view and the main rear wheel drive chain shown in the right view.  The shape of the paths that the chains take are quite different as can be seen in the next images.
These are the two roller chains required for the bike assembly: the two cam drive chains on the left view and the main rear wheel drive chain shown in the right view. The shape of the paths that the chains take are quite different as can be seen in the next images.
Capture38.JPG (351.82 KiB) Viewed 2865 times
The first step in a chain Assembly4 process is to create a sketch of the chain path.  This is the path for the guided cam drive chain consisting of four arcs. Toggle the path to construction geometry (blue).  The next step is to add all the edges with length=pitch of the chain.  These are constrained to the path with point-on-edge and equal length.<br /><br />Although this is a rather tedious process it can be simplified somewhat by creating a short segment, say 10 edges, by using the Sketcher rectangular array tool.  Generate several segments which can then be joined end-to-end with a coincident constraint.  But, you still have to stitch every edge vertex to the chain path.<br /><br />You should end up with a fully constrained sketch.  If you do not know the exact number of chain links then you can release the large arc constraint dimension (toggle to reference dimension) and add or subtract links as required.<br /><br />Since the edges are constrained with point on edge they can be realistically moved along the chain path a small amount &lt; pitch but note that they will incorrectly deviate from the path at the tangency point of the arcs.  This is because the point on edge follows the projected edge it is constrained to rather than the next tangent edge.
The first step in a chain Assembly4 process is to create a sketch of the chain path. This is the path for the guided cam drive chain consisting of four arcs. Toggle the path to construction geometry (blue). The next step is to add all the edges with length=pitch of the chain. These are constrained to the path with point-on-edge and equal length.

Although this is a rather tedious process it can be simplified somewhat by creating a short segment, say 10 edges, by using the Sketcher rectangular array tool. Generate several segments which can then be joined end-to-end with a coincident constraint. But, you still have to stitch every edge vertex to the chain path.

You should end up with a fully constrained sketch. If you do not know the exact number of chain links then you can release the large arc constraint dimension (toggle to reference dimension) and add or subtract links as required.

Since the edges are constrained with point on edge they can be realistically moved along the chain path a small amount < pitch but note that they will incorrectly deviate from the path at the tangency point of the arcs. This is because the point on edge follows the projected edge it is constrained to rather than the next tangent edge.
Capture40.JPG (228.68 KiB) Viewed 2865 times
The next step in the Assembly4 process is to define all the LCS connectors needed for the chain assembly.  This can be done by selecting an edge and attaching the LCS with a Z tangent to edge mode as shown in the attachment panel.  This is another tedious process.<br /><br />To assemble simply attach the LCS of the outer or inner chain link pin at one end to one of the path LCS's alternating outer/inner as you proceed with the assembly.  The path LCS will insure that the chain link is exactly aligned even at the tangency transition points in the path.  <br /><br />After about an hour :( you will have a wonderfully accurate model of a guided cam drive chain.
The next step in the Assembly4 process is to define all the LCS connectors needed for the chain assembly. This can be done by selecting an edge and attaching the LCS with a Z tangent to edge mode as shown in the attachment panel. This is another tedious process.

To assemble simply attach the LCS of the outer or inner chain link pin at one end to one of the path LCS's alternating outer/inner as you proceed with the assembly. The path LCS will insure that the chain link is exactly aligned even at the tangency transition points in the path.

After about an hour :( you will have a wonderfully accurate model of a guided cam drive chain.
Capture41.JPG (238.24 KiB) Viewed 2865 times
This is another shape that a chain drive can take if there is slack or sag in the chain.  I took a different approach to assemble this type of chain. First create a sketch of the chain path as in this image.  Add the design constraints such as center distance, angle to horizontal, sag radius, and sprocket radii at the pitch circle.  The chain angle is required for this example because the chain must be able to articulate with the rear wheel assembly.<br /><br />If you do not know the exact number of chain lengths but you do know the pitch, add reference dimensions so that you can calculate the length of the path using expressions as shown in the formula editor above.  Divide the total length by the pitch to get an approximate number of links.  Assembly4 Variables come in very handy for this sort of thing as an alternative to spreadsheets or the DynamicData workbench.
This is another shape that a chain drive can take if there is slack or sag in the chain. I took a different approach to assemble this type of chain. First create a sketch of the chain path as in this image. Add the design constraints such as center distance, angle to horizontal, sag radius, and sprocket radii at the pitch circle. The chain angle is required for this example because the chain must be able to articulate with the rear wheel assembly.

If you do not know the exact number of chain lengths but you do know the pitch, add reference dimensions so that you can calculate the length of the path using expressions as shown in the formula editor above. Divide the total length by the pitch to get an approximate number of links. Assembly4 Variables come in very handy for this sort of thing as an alternative to spreadsheets or the DynamicData workbench.
Capture43.JPG (227.69 KiB) Viewed 2865 times
The next step in this alternative approach is to create a Draft &gt; PathArray of circles representing the pin diameter of the chain links as shown in this image.  Add path LCS's as before but this time sequentially select two circles and attach with Inertial CS mode which both aligns the LCS and locates it at the center of the chain link.<br /><br />Assemble by attaching the center LCS of the inner or outer links to each of the path LCS.  Again, another very tedious process especially for a chain with so many links as this example.  You will likely have to adjust the Attachment Offset rotation of the sprockets until the teeth properly align with the chain links.<br /><br />Persistence will result in another accurate, realistic chain and sprocket assembly.
The next step in this alternative approach is to create a Draft > PathArray of circles representing the pin diameter of the chain links as shown in this image. Add path LCS's as before but this time sequentially select two circles and attach with Inertial CS mode which both aligns the LCS and locates it at the center of the chain link.

Assemble by attaching the center LCS of the inner or outer links to each of the path LCS. Again, another very tedious process especially for a chain with so many links as this example. You will likely have to adjust the Attachment Offset rotation of the sprockets until the teeth properly align with the chain links.

Persistence will result in another accurate, realistic chain and sprocket assembly.
Capture44.JPG (220.49 KiB) Viewed 2865 times
.
I tried several other approaches using the PathArray for LCS's for example but they were not visible to Assembly4. Also tried a path array of pin bodies with their default LCS but again the individual links were not visible to Assembly4. Creo apparently has a tool to align small groups of objects to a path which would be helpful. It would also be helpful if you could align two points on an object with the path array for this purpose. Any feedback on alternative approaches would be appreciated.

If anyone is interested in the chain models as presented please PM me and I will place the two files on Dropbox.

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.28774 (Git)
Build type: Release
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.11.10
  * fasteners 0.3.41
  * fcgear 1.0.0
"It is a poor workman who blames his tools..." ;)
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: V0.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #7

Post by chrisb »

Another post to bookmark, thanks!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: V0.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #7

Post by adrianinsaval »

absolutely marvelous! would you be open to sharing the project files? Seems like cool splashcreen material.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: V0.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #7

Post by chrisb »

adrianinsaval wrote: Thu May 19, 2022 1:18 pm absolutely marvelous! would you be open to sharing the project files?
This was asked before (see above), but the plans are copyrighted.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: V0.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #8

Post by ppemawm »

Several "free-form" bodies have been added to the motorcycle assembly. No dimensional drawings are provided for these parts so they must be created in-context pretty much free hand. For those new users, the following images capture what basic PartDesign tools and how some of this was done for the exhaust pipes and gas tank.

These are the components that have been added including the gas tank, gas cap, front and rear exhaust pipes, the 2-in-1 flanged collector, and the tuner's exit diffuser.<br /><br />These were all created free-form and in-context at the top assembly level since it was necessary to make sure that the parts could fit within the confines of the frame and surrounding components as the models took shape.<br /><br />It is convenient at the top level to make everything in the Assembly4 tree not-visible except for those parts surrounding the work piece.
These are the components that have been added including the gas tank, gas cap, front and rear exhaust pipes, the 2-in-1 flanged collector, and the tuner's exit diffuser.

These were all created free-form and in-context at the top assembly level since it was necessary to make sure that the parts could fit within the confines of the frame and surrounding components as the models took shape.

It is convenient at the top level to make everything in the Assembly4 tree not-visible except for those parts surrounding the work piece.
Capture46.JPG (258.34 KiB) Viewed 2520 times
The exhaust pipes were created with pads and revolves without any sketches as discussed in previous posts in order to stay within the PD workbench.  The front exhaust body started from a pad of the shapebinder transferred from the mating flange interface as highlighted in this image which also locates the pipe in the assembly.  The datum lines used for the revolve axes were attached to the pad faces.  <br /><br />I usually predetermine the number of pads and elbows required and then proceed without too much concern about clearances until the pipe is completed.  Then you can go back and tweak the pad length, revolve angle, and elbow radii, and axis inclination to finalize the overall shape.  <br /><br />A similar process was used for the rear exhaust pipe except it did start with a sketch for a cylinder revolve  rather than a pad.  The sketch was located at the flange interface by assembling it with its default LCS to an imported LCS of the flange bolted to the engine.
The exhaust pipes were created with pads and revolves without any sketches as discussed in previous posts in order to stay within the PD workbench. The front exhaust body started from a pad of the shapebinder transferred from the mating flange interface as highlighted in this image which also locates the pipe in the assembly. The datum lines used for the revolve axes were attached to the pad faces.

I usually predetermine the number of pads and elbows required and then proceed without too much concern about clearances until the pipe is completed. Then you can go back and tweak the pad length, revolve angle, and elbow radii, and axis inclination to finalize the overall shape.

A similar process was used for the rear exhaust pipe except it did start with a sketch for a cylinder revolve rather than a pad. The sketch was located at the flange interface by assembling it with its default LCS to an imported LCS of the flange bolted to the engine.
Capture47.JPG (202.29 KiB) Viewed 2520 times
The 2-in-one &quot;binnocular&quot; collector was created with a simple loft from carbon copy sketches as shown in this image.  Note that the circle at the exit of the collector consists of four arcs carefully positioned with respect to the double pipe entrance sketch otherwise the loft will not succeed.  Sometimes it a bit trial-and-error.<br /><br />For some reason, this sketch would not stay constrained but sometimes would indicate redundancy so I should probably  investigate an alternate constraint scheme than trying to have all four arcs with coincident centers.<br /><br />The PartDesign &gt; Thickness tool would not work at all with this shape so if I wanted a thin wall collector I would have to create another smaller loft body cut from the larger outside using a PD boolean or try a loft with the sketches including the inner wall.  For a shape as this, the latter is not always successful in my experience.
The 2-in-one "binnocular" collector was created with a simple loft from carbon copy sketches as shown in this image. Note that the circle at the exit of the collector consists of four arcs carefully positioned with respect to the double pipe entrance sketch otherwise the loft will not succeed. Sometimes it a bit trial-and-error.

For some reason, this sketch would not stay constrained but sometimes would indicate redundancy so I should probably investigate an alternate constraint scheme than trying to have all four arcs with coincident centers.

The PartDesign > Thickness tool would not work at all with this shape so if I wanted a thin wall collector I would have to create another smaller loft body cut from the larger outside using a PD boolean or try a loft with the sketches including the inner wall. For a shape as this, the latter is not always successful in my experience.
Capture48.JPG (242.42 KiB) Viewed 2520 times
The gas tank was created with a PD boolean common combining pad bodies from the side and top views.  This image shows the side pad body and the sketch used for a separate body for the top side pad shown in the next image.
The gas tank was created with a PD boolean common combining pad bodies from the side and top views. This image shows the side pad body and the sketch used for a separate body for the top side pad shown in the next image.
Capture49.JPG (237.88 KiB) Viewed 2520 times
This image shows the half pad for the top side sketch and the sketch used for the side pad body.  These sketches are attached to the assembly global planes.  The pad is mirrored across the XZ plane before it is combined with the boolean common.  Several large fillets nicely rounded off the tank and a revolve and groove added the gas cap  mating flange.  An LCS for the gas cap assembly was also added to the sketch creating the flange in the tank body.<br /><br />Note that the side sketch is located where it belongs in the frame since the gas tank as created does not have a unique assembly interface to locate it with an LCS as usually preferred.  To do that I would have to design attachment points on the tank and frame which I've yet to do.<br /><br />In order to show both the pad and sketch in this image the Property View has to be toggled from Result to Tools.<br /><br />I am not sure why the side pad body &quot;Gas_Tank&quot; is left outside the body &quot;Gas_Tank_Top&quot; containing the boolean which makes the tree a bit confusing.  Seems like it should only be shown in the body containing the boolean.  Perhaps it is because of how I preselect the two bodies before invoking the boolean tool.  I'll have to research that.
This image shows the half pad for the top side sketch and the sketch used for the side pad body. These sketches are attached to the assembly global planes. The pad is mirrored across the XZ plane before it is combined with the boolean common. Several large fillets nicely rounded off the tank and a revolve and groove added the gas cap mating flange. An LCS for the gas cap assembly was also added to the sketch creating the flange in the tank body.

Note that the side sketch is located where it belongs in the frame since the gas tank as created does not have a unique assembly interface to locate it with an LCS as usually preferred. To do that I would have to design attachment points on the tank and frame which I've yet to do.

In order to show both the pad and sketch in this image the Property View has to be toggled from Result to Tools.

I am not sure why the side pad body "Gas_Tank" is left outside the body "Gas_Tank_Top" containing the boolean which makes the tree a bit confusing. Seems like it should only be shown in the body containing the boolean. Perhaps it is because of how I preselect the two bodies before invoking the boolean tool. I'll have to research that.
Capture50.JPG (274.03 KiB) Viewed 2520 times
.
The panelling or fairing for the rear wheel mud guard is about the only component left before we can call it complete. I will likely have to learn the Curves workbench for that task which I look forward to.

Before that, I want to check and see if the completed rear wheel assembly articulates as it should and there are no issues with clearances at the extreme of vertical travel. I'll include an Assembly4 GIF if I can get it all to work in the next post.

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.28774 (Git)
Build type: Release
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.11.10
  * fasteners 0.3.41
  * fcgear 1.0.0
"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.20/Assembly4 Challenge--Creo Motorbike (work in progress) Update #9

Post by ppemawm »

Whenever you are creating a complex assembly it is worthwhile to check that parts do not collide especially for those that have to move as in this motorcycle example. That is why it is important that the model be fully parametric and robust enough to withstand the dimensional changes describing any articulation of components. In this motorcycle model, the rear suspension sub-assembly including the drive chain must be able to move vertically in a properly constrained manner so that you can check for collision at the extreme limits of motion.

The following images present a method for doing this using global variables, expressions, and the Assembly4 animator.

What you may notice in the video is that the upper bound of the suspension is a collision of the rear tire with the taillight and the lower bound is a collision with the chain and frame. What was a bit surprising to me, not knowing much about independent suspensioned motorcycles, is that the center distance between the chain sprockets is not constant. Upon closer look notice that the chain must rotate about a different pivot (drive sprocket) than the rear suspension which explains why the chain must have some slack or sag so that it does not bind.


phpBB [video]


This video was created with the Assembly4 Animator > Export function.

In order to accommodate the variable center distance between the two sprockets, I had to go back to the master sketch constraining the motion and add a variable reference dimension (blue) between the sprockets as shown in this image.  The other reference linear dimension is the spring length.  The orange dimension is the independent variable (ground_height2) representing the vertical position of the rear suspension assembly.<br /><br />One way to expose the Assembly4 Variables globally is to create a master variable file (per zolko, Assembly4 forum) containing those variables needed in sub-assemblies and the top assembly.  This master variable file is assembled to each of the files requiring access to the master.  The top assembly is animated using the animator in the master variable file.<br /><br />If you plot the chain center distance(CD)  as calculated by the master sketch vs the ground height as shown in this Excel graph you can see that CD is nonlinear.  A second order trendline was used to fit the data from the master sketch so that the variable dimensions could be calculated by expressions.  Normally you can access the sketch reference dimensions directly with an expression but for some reason I kept getting an unallowed circular reference which I did not research any further..<br /><br />The master variables use is shown in the next two images for the chain and shock absorber spring.
In order to accommodate the variable center distance between the two sprockets, I had to go back to the master sketch constraining the motion and add a variable reference dimension (blue) between the sprockets as shown in this image. The other reference linear dimension is the spring length. The orange dimension is the independent variable (ground_height2) representing the vertical position of the rear suspension assembly.

One way to expose the Assembly4 Variables globally is to create a master variable file (per zolko, Assembly4 forum) containing those variables needed in sub-assemblies and the top assembly. This master variable file is assembled to each of the files requiring access to the master. The top assembly is animated using the animator in the master variable file.

If you plot the chain center distance(CD) as calculated by the master sketch vs the ground height as shown in this Excel graph you can see that CD is nonlinear. A second order trendline was used to fit the data from the master sketch so that the variable dimensions could be calculated by expressions. Normally you can access the sketch reference dimensions directly with an expression but for some reason I kept getting an unallowed circular reference which I did not research any further..

The master variables use is shown in the next two images for the chain and shock absorber spring.
Capture51.JPG (324.54 KiB) Viewed 2319 times
This is the chain path sketch that was modified to allow the center distance to vary by making the radius of the sag in the chain a reference dimension and using the contact angle on the drive sprocket as a constraint.  <br /><br />The center distance is dimensioned with an expression using the calculated master variable as can be seen in the formula Editor in this sketch from the Drive_Chain2 subassembly.
This is the chain path sketch that was modified to allow the center distance to vary by making the radius of the sag in the chain a reference dimension and using the contact angle on the drive sprocket as a constraint.

The center distance is dimensioned with an expression using the calculated master variable as can be seen in the formula Editor in this sketch from the Drive_Chain2 subassembly.
Capture52.JPG (214.42 KiB) Viewed 2319 times
The length of the spring is handled by the height parameter of the AdditiveHelix shown in this image.  The dimension comes from the master variable calculated with the equation shown in the Excel graph as a function of the ground height.  The 8 mm subtraction accounts for the diameter of the spring wire.
The length of the spring is handled by the height parameter of the AdditiveHelix shown in this image. The dimension comes from the master variable calculated with the equation shown in the Excel graph as a function of the ground height. The 8 mm subtraction accounts for the diameter of the spring wire.
Capture53.JPG (215.99 KiB) Viewed 2319 times
This is the current state of the assembly showing all sub-assemblies and individual components that are included in the top assembly model tree.  A long dusty road, but I still learned a few things on the way which is always good.
This is the current state of the assembly showing all sub-assemblies and individual components that are included in the top assembly model tree. A long dusty road, but I still learned a few things on the way which is always good.
Capture54.JPG (303.56 KiB) Viewed 2319 times

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.28918 (Git)
Build type: Release
Branch: master
Hash: e1f2685734
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.11.10
  * fasteners 0.3.41
  * fcgear 1.0.0
"It is a poor workman who blames his tools..." ;)
Post Reply