Grenade Actuation with the Assembly4 "Event Scheduler"

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

Grenade Actuation with the Assembly4 "Event Scheduler"

Post by ppemawm »

This simple example shows how the Assembly4 Variables and Animate Assembly features can be used with conditional expressions to demonstrate a sequence of operations for an assembly that has moving bodies. The model was created from drawings found at: https://www.youtube.com/watch?v=vu7__elgLko&t=3s.

The following image captions and the video provide some detail of the modeling and guidance on how to create an Event Scheduler:

I create all assemblies starting with the Assembly4 workbench Part and Body containers which have default LCS's that can be used during assembly.  For this few of bodies they can be saved in the Assembly4 Parts folder in one file as the tree shows or in separate files if more complex. <br /><br />The Model (Assembly) container shows the assembly links and the sequence that was used to create the assembly. It is important to think through the actuation process before assembly so that the dependent link attachments can be added in the proper sequence.<br /><br />All of the bodies in this example are rather straightforward to create except for the main body of the grenade which is seemingly complex.  As it turns out though, there are only two features required from which the multi-transform tool can be used to create the complete body in the following images.
I create all assemblies starting with the Assembly4 workbench Part and Body containers which have default LCS's that can be used during assembly. For this few of bodies they can be saved in the Assembly4 Parts folder in one file as the tree shows or in separate files if more complex.

The Model (Assembly) container shows the assembly links and the sequence that was used to create the assembly. It is important to think through the actuation process before assembly so that the dependent link attachments can be added in the proper sequence.

All of the bodies in this example are rather straightforward to create except for the main body of the grenade which is seemingly complex. As it turns out though, there are only two features required from which the multi-transform tool can be used to create the complete body in the following images.
Capture9.JPG (239.58 KiB) Viewed 2203 times
This is the master sketch of the grenade body.  The sketch can quickly become too complex if you incorporate too many features and more difficult to fully constrain properly.  This sketch is about the limit of what I would typically attempt in a master sketch.
This is the master sketch of the grenade body. The sketch can quickly become too complex if you incorporate too many features and more difficult to fully constrain properly. This sketch is about the limit of what I would typically attempt in a master sketch.
Capture10.JPG (202.17 KiB) Viewed 2203 times
This shows the detail of the Body tree and use of the master sketch to create all of the features in this body.  The sweep path for the subtractive pipes was extracted from a carbon copy of the the master sketch.
This shows the detail of the Body tree and use of the master sketch to create all of the features in this body. The sweep path for the subtractive pipes was extracted from a carbon copy of the the master sketch.
Capture11.JPG (207.46 KiB) Viewed 2203 times
Now to the main point of this example:  Event Scheduler.<br /><br />The first step is to define some variables that can be used in sketch, properties, and link attachment offset expressions. The only independent variable is the Event schedule which captures the four steps that has to occur during the grenade actuation:  pull the ring which straightens and removes the safety pin (1,2) allowing the handle to be extracted (3) which frees the firing pin and spring to extend to their maximum position (4).  Or rather than discrete events, you could use an independent time variable if you want to simulate real time or introduce delays between steps.<br /><br />Once the variables are defined they can be used in sketches (safety pin sweep path), feature properties (spring height), and attachment offsets (safety pin, lever, and firing pin positions).<br /><br />Conditional expressions are used to trip each event in sequence.  Note that the variables are saved alphabetically not logically as entered.  Sometimes I use an alpha-prefix in the variable name so that they are always saved in the intended sequence in the variables table.<br /><br />Once this is functioning properly for each value of the event variable, the process can be automated with the Assembly4 animator as shown in the panel overlay and the short video which follows.
Now to the main point of this example: Event Scheduler.

The first step is to define some variables that can be used in sketch, properties, and link attachment offset expressions. The only independent variable is the Event schedule which captures the four steps that has to occur during the grenade actuation: pull the ring which straightens and removes the safety pin (1,2) allowing the handle to be extracted (3) which frees the firing pin and spring to extend to their maximum position (4). Or rather than discrete events, you could use an independent time variable if you want to simulate real time or introduce delays between steps.

Once the variables are defined they can be used in sketches (safety pin sweep path), feature properties (spring height), and attachment offsets (safety pin, lever, and firing pin positions).

Conditional expressions are used to trip each event in sequence. Note that the variables are saved alphabetically not logically as entered. Sometimes I use an alpha-prefix in the variable name so that they are always saved in the intended sequence in the variables table.

Once this is functioning properly for each value of the event variable, the process can be automated with the Assembly4 animator as shown in the panel overlay and the short video which follows.
Capture7.JPG (238.95 KiB) Viewed 2203 times
phpBB [video]
This image is the Save panel of the animator which records an .mp4 file of the actuation process.  The above video was made using a real time of 1 FPS although the animator itself is agonizingly slow probably due to the additive and subtractive sweeps and spring additive helix.
This image is the Save panel of the animator which records an .mp4 file of the actuation process. The above video was made using a real time of 1 FPS although the animator itself is agonizingly slow probably due to the additive and subtractive sweeps and spring additive helix.
Capture8.JPG (97.22 KiB) Viewed 2203 times
With a little ingenuity I can imagine many different uses for the event scheduler limited only by our ability to describe the steps mathematically in expressions.

For simpler positioning of various configurations, please note that Assembly4 includes a configuration table tool as well which allows you to save various assembly combinations of visibility and link positions in the same file.

This exercise proved to me again that FreeCAD can do most everything other CAD systems can do (and sometime easier) as you will note if you peruse the referenced source tutorial link.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.29936 (Git)
Build type: Release
Branch: master
Hash: 3db79c907cd7ef2f75597efdd82ae288ac23ad01
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.2
  * fasteners 0.3.46
  * fcgear 1.0.0
"It is a poor workman who blames his tools..." ;)
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Grenade Actuation with the Assembly4 "Event Scheduler"

Post by Jee-Bee »

I have heard that the citizen of New York are kind of dutch / European in way of thinking( the moment i heard it it has something to do with weapons so probably it was around the school shooting some monts back... ).
But you prove you just American too :P :lol:
thschrader
Veteran
Posts: 3122
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Grenade Actuation with the Assembly4 "Event Scheduler"

Post by thschrader »

ppemawm wrote: Sat Aug 06, 2022 5:31 pm This simple example shows ...
:)
Sir, state of the art.

What you do is far from my ability.
Keep up the spirit.
User avatar
ThanklessLiving
Posts: 95
Joined: Sat May 30, 2020 1:49 pm

Re: Grenade Actuation with the Assembly4 "Event Scheduler"

Post by ThanklessLiving »

Quite the nonchalant sample there!
Post Reply