LinkageData can be considered as a small relational database that stores all relevant information of linkages. LinkageData consist of a list of *records* that are identified with record identifiers. Every records have to conform to a simple {_String, _List} pattern. The first part of the record is the record identifier, while the second part is the data.

In[1]:= |

CompileLinkageData | Converts list based LinkageData representation to the new LinkageDataMap representation. |

ViewLDTree | Displays the LinkageData of linkage in a tree form, which enables the user to browse LinkageData interactively. |

In[2]:= |

Out[2]= |

The format of the LinkageData object is -LinkageData, n-, where n is the number of records in the database. The test LinkageData contains currently three records.

In[3]:= |

Out[3]= |

LinkageData object can be queried and modified with standard list manipulation functions such as Part or Delete.

linkage[["id"]] | Overloaded Part function for LinkageData permits indexing with "id" record identifier string |

linkage[["id"]]={data} | Overloaded Set function for LinkageData permits to set part of LinkageData, which is indexed with record identifier |

PrependTo[linkage[["id"]],elem] | Overloaded PrependTo function for LinkageData permits to prepend the data list with elem for "id" record. |

AppendTo[linkage[["id"]],elem] | Overloaded AppendTo function for LinkageData permits to append the data list with elem for "id"record. |

DeleteTo[linkage,"id"] | Delete "id"record from linkage |

LinkageData manipulation functions.

Retrive the "ID2" record using Part function

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]= |

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

In[11]:= |

Out[11]= |

LinkageData is defined a database, which is flexible enough to easily extend with new chunk of data. In order to find the information required by the functions of *LinkageDesigner,* certain number of pre-defined records are introduced. The record identifier and the record data of these pre-defined records are specified rigorously. Hovewer users can extend the LinkageData object by using his/her own record identifier and data.

The string identifiers of the pre-defined records are also defined with constants, which permits to look up using the standard command completion mechanism of *Mathematica* notebooks.

Record Identifier | Description |

$LDMechanismID | Defines the name of the linkage and other linkage instance specific informations (units, WorkBench name, etc.) |

$LDDrivingVariables | List of rules representing the driving variables of the linkage together with their substitutional values. |

$LDSimpleParameters | List of rules representing the simple parameters of the linkage together with their substitutional values. |

$LDStructure | List of records defininig the kinematic pairs of the linkage. |

$LDLowOrderJoint | List of records about the low order kinematic pairs ( type, joint marker, etc..) |

$LDLinkGeometry | Stores the geometric representation of the links. |

$LDDerivedParametersA | List of explicitly derived parameters. ( p is explicitly derived if it can be expressed as p = f[q1, q2, ...] |

$LDDerivedParametersB | List of implicitly derived parameters. ( p is implicitly derived if it can be expressed as the solution of f[p, q1, q2, ...]== 0) |

$LDLinkGroundTransformation | List of transformation of the Local Link Reference Frames to the Global Reference Frame |

$LDTimeDependentVariables | List of rules of time dependent variables together with the first derivative. |

$LDDrivingVelocities | List of rules representing the first derivative of the driving variables together with their substitutional values.. |

$LDInteractiveDef | Stores linkage definition of a previous LinkageCAD session. |

$LDMassProperties | Stores the mass properties of the links. Mass properties data consist of a list of {inertiaFrame,mass,momentOfInertia} sublist. |

$LDForces | Stores a list of forces that acting on the mechanism. Forces are stored as {{str1,vec},{str2,pointofAttack}} sublist |

$LDTorques | Stores a list of torques vectors acting on the linkage. Torques are stored as {{str1,vec},{str2,pointofAttack}} |

Predefined record identifiers of LinkageData.

New LinkageData can be created with two function CreateLinkage and DefineLinkage. The resulted LinkageData object is not completely empty, because the minimal set of records are already inserted. Since DefineLinkage internally calls CreateLinkage function, therefore only the latter one will be discussed here.

CreateLinkage[str] | creates an empty LinkageData object with str as the name of the linkage. |

DefineLinkage[str, ls] | creates a new linkage with str name and adds a list of kinematic pair definitions (ls). |

option name | default value | |

GroundName | Ground | GroundName defines the name of the ground link. |

WorkbenchName | Workbench | WorkbenchName specifies the name of the workbench link. |

SimpleParameters | {} | SimpleParameters specifies the intial set of simple parameters that can be used in the linkage defintion. |

WorkbenchPlacement | Automatic | Homogenous transformation matrix specifying the placement of the Workbench link w.r.t. the reference coordinate system. |

PlacementName | "Base-0" | Name of the kinematic pair defining the Workbench placement. |

LinkageUnits | Automatic | LinkageUnit specifies the default units used in the linkage. E.g. {Meter,Kilogramm,Second,Newton} |

In[12]:= |

Out[12]= |

CreateLinkage returns a LinkageData object containing 5 records. To investigate the contents of the records brows the LinkageData with ViewLDTree function

In[13]:= |

Out[13]= |

The first element of $LDMechanismID record is the name of the linkage (referred as LinkageName) . LinkageDesigner use a composite naming strategy to identify the entities such as links, geometries, forces,kinematic pairs etc. The name of the linkage is used to create the full name of entities. Every entities have a tring identifier that is called EntityName . The full name of identifiers are composed by concatenating the LinkageName and the EntityName.

There are two help function implemented in LinkageDesigner to manipulate composite names, the GetFullName and GetStrippedName functions.

GetFullName[linkage,"id"] | returns the full name of the "id" using the linkage name of linkage LinkageData |

GetStrippedName[fullName] |

Functions for composite name manipulation. .

In[14]:= |

Out[14]= |

In[15]:= |

Out[15]= |

Beside the name of the linkage, $LDMechanismID contains the full name of the Ground (test@Ground) and the Workbench (test@Workbench) links. These two links were created by CreateLinkage function, together with the first kinematic pair of the $LDStructure record. The Ground link is the reference rigid body of the entire linkage. The LLRF of Ground is the global reference frame for the linkage. The Workbench link is by default connected with a fixed joint to the ground link, and represents the local reference body of the linkage. The LLRF of the Workbench link is the working reference frame of the linkage. This duplication of the reference links has two advantages:

i.) the reference link can be described with a kinematic pair

ii.) the linkage can be placed anywhere by changing only the Ground-Workbench transformation .

By parameterizing the Ground-Workbench transformation the movement of the mechanism -relative to the global reference frame- can be easily modeled. This movement could be used to model mobil or walking mechanism.

i.) the reference link can be described with a kinematic pair

ii.) the linkage can be placed anywhere by changing only the Ground-Workbench transformation .

By parameterizing the Ground-Workbench transformation the movement of the mechanism -relative to the global reference frame- can be easily modeled. This movement could be used to model mobil or walking mechanism.

In[16]:= |

Out[16]= |

The $LDStructure record stores the list of kinematic pairs of the mechanism. The kinematic pairs are the backbone structure of the mechanism, which detemines the movements of the links. Every kinematic pair is described with a subrecord in $LDStructure record. These sub-records stores three information of the kinematic pair:

- String identifier of the kinematic pair ( test@Base-0 )

- Homogeneous transformations of the LLRF of the upper link to the lower one and vice versa. ( {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}} )

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |

In[19]:= |

Out[19]= |

Independent variables are such placeholders that can substituted with any numerical values. Typical independent variables are the joint variables and dimensional parameters. There are two records dedicated to store the independent variables of the linkages:

$LDDrivingVariables | List of rules representing the driving variables of the linkage together with their substitutional values. |

$LDSimpleParameters | List of rules representing the simple parameters of the linkage together with their substitutional values. |

Records of the independent variables.

In[20]:= |

Out[20]= |

In[21]:= |

Out[21]= |

The $LDStructure record of the returned LinkageData object contains three kinematic pairs ( { pendulum@RotationalJoint-1, pendulum@FixedJoint-2} ). The generated homogeneous transformation matrices contain the independent variables q1 and l1. The first symbol is a driving variable, while the second is a simple parameter. Both the driving variables and the simple parameters are independent variables of the linkage. This implies that their values can be changed independently (Note that linkages with connected kinematic graph, the values of the independent variables might constrained by the loop closure equations. Certain combinations of independent variable values result non-real value solution of the loop closure equations. However even in this case there exist a feasibility interval of the variables, where the values can be arbitrarily changed.)

The most important difference of driving variables and simple parameters is their influence on the mobility of the linkage. The driving variables determines the mobility of the linkage, while the simple parameters does not influences it. In case of open kinematic pair definition the mobility of the linkage is increased with the number of joint variables. In this case the joint variables represent the remaining Degree of Freedom (DoF) of the upper link relative to the lower link after the kinematic pair definition is applied. In case of rotational joint- out of the possible 6 DoF of the upper link- removes 5 DoF from the upper link. This DoF is the rotation around the z-axis of the joint marker. The value of joint variable "drives" this remaining DoF.

The simple parameters, on the other hand, are basically placeholders of dimensional values. If they are used instead of numbers, all kinematic equations or transformation are generated using the parameter symbols. This way the dimensional values can be easily changed without redefine the whole linkage.

SetDrivingVariables[linkage,{var_{i}→x_{i}..}] | sets var_{i} driving variable of linkage to x_{i} and return the resulted LinkageData |

SetDrivingVariablesTo[linkage,{var_{i}→x_{i}..}] | Set the var_{i} driving variable to x_{i} value and resets the resulted LinkageData to linkage. |

SetSimpleParameters[linkage,{var_{i}→x_{i}..}] | sets var_{i} simple parameter to x_{i} and returns the resulted LinkageData object. |

SetSimpleParametersTo[linkage,{var_{i}→x_{i}..}] | sets var_{i} simple parameter to x_{i} and resets the resulted LinkageData object to linkage. |

Functions for setting the independent variables of LinkageData.

The numerical substitution value of the independent variables ( driving variable, simple parameter ) are stored together with the placeholder symbols, since they are wrapped with a Rule function. Their values can be changed with the SetDrivingVariables and SetSimpleParameters functions.

In[22]:= |

Out[22]= |

In[23]:= |

Out[23]= |

In[24]:= |

Out[24]= |

In case of linkages with simple kinematic graph (serial chain or tree) setting the independent variable is nothing else but replacing the second argument of the Rule function. However for more complicated linkages, setting the independent variables includes the solution of the constraint equations for the new set of independent variables. This is the reason while it is advised to use the setter function instead of directly replace the values of the LinkageData.

There are two kind of dependent variables defined in LinkageData. If the dependent variable (y) can be expressed as the explicit function of the independent variables (x_{1}, x_{2}, ...), than it is stored in the $LDDerivedParametersA record. However if the dependent variable y is defined implicitly with an equation, it is stored in the $LDDerivedParametersB record

Different type of dependent variables.

Implicitly defined variables are generated automatically if a loop closing kinematic pair is defined. DefineKinematicPair function detects, whether the kinematic pair is a loop closing or an open one. In the first case it calculates the mobility of the upper link of the kinematic pair relative to the lower one. Based on the result it constructs the set of non-redundant constraint equations. Finally it removes as many driving variables from the $LDDrivingVariables record as the number of constraint equations. The constraint equations are stored in the $LDDerivedParametersB record.

In[25]:= |

Out[25]= |

In[26]:= |

Out[26]= |

In[27]:= |

Out[27]= |

In[28]:= |

Out[28]= |

In[29]:= |

Out[29]= |

Implicitly defined variables are {q2, q3}. Their value are calculated with FindRoot function after the actual values of the independent variables are substitued. Implicitly defined variables can be converted into explicitly defined variables if the constraint equations are solved in a closed form.

The loop closing constraint equations of the crank-slider mechanism can be easily solved in closed form. It is possible to use the standard Solve function or utilize the PatternSolve utility function of LinkageDesigner.

In[30]:= |

Out[31]= |

One solution method is to eliminate the q3 variable from the two equations and solve the remaining equation for q2.

In[35]:= |

Out[35]= |

In crankSlider linkage the {q2, q3} variables are stored as implicitly defined variables. Using the ReplaceVariables function a new LinkageData can be defined, which defines explicitly these variables.

ReplaceVariables[linkage,{vars}->{eqs}] | deletes existing definition of vars and insert eqs as new definition of vars into $LDDerivedparametersB records. |

ReplaceVariables[linkage,{vars}->{vars→terms}] | deletes existing definition of vars and insert terms as new definition of vars into $LDDerivedParametersA records. |

In[36]:= |

Out[36]= |

In[37]:= |

Out[37]= |

In[38]:= |

Out[38]= |

The pre-defined LinkageData records contains some auxiliary utility records that are used in the visualization and simulation of the linkages.

$LDLinkGeometry | Stores the geometric representation of the links. |

$LDLowOrderJoint | Stores kinematic data of the low order joints. |

$LDLinkGroundTransformation | Stores the transformation of every LLRF to the Global Reference Frame. |

In order to visualize a linkage, the geometric representation of the links should be stored. The $LDLinkGeometry record stores the geometric representations of the link, which is a Graphics3D object. Geometries can be defined to the links using different functions such as:

DefLinkGeometryTo[linkage,type] | assigns simplified geometries to every links of linkage. The geometries of the links are determined by the center points of the joint markers. |

linkage[[$LDLinkGeometry,link]]=Graphics3D[...] | Sets the geometry of the link in the $LDLinkGeometry record of LinkageData. |

option name | value | |

AppendLinkGeometry | Automatic | the geometric representation contains only a text primitive, withthe name of the link. |

AppendLinkGeometry | None | the geometric representation is an empty Graphics3D object |

AppendLinkGeometry | gr | Botth link will use the same Graphics3D object gr |

AppendLinkGeometry | {grLower,grUpper} | the geometric representation of the lower link is grLower while the upper link is grUpper |

AppendLinkGeometry options of DefineKinematicPair function

In[39]:= |

Out[39]= |

In[40]:= |

Out[40]= |

In[41]:= |

Out[41]= |

In[42]:= |

Out[42]= |

During the simulation of the linkage the position of every LLRF should be calculated relative to the global reference frame. These transformation matrices are calculated using the kinematic graph of the linkage. Sometimes it speeds up the animation if the link-ground transformations are calculated in advance to spare the time of calculations before each animation steps. The $LDLinkGroundTransformation record is calculated and appended if the PlaceLinkage function is called. All animation function recognize the presence of $LDLinkGroundTransformation record and use it if it is defined.

PlaceLinkage[linkage,mx] | Sets the transformation matrix between Ground and Workbench link to mx homogeneous matrix |

PlaceLinkage[linkage] | Recalculates the $LDLinkGroundTransformation matrices and returns the resulted LinkageData. |

PlaceLinkageTo[linkage] | Recalculates the $LDLinkGroundTransformation matrices and re-sets to linkage. |

AppendLinkGroundTransformation | Option of PlaceLinkage function. If true re-calculate and inserts the $LDLinkGroundTransformation record to the linkage. |

Manipulate $LDLinkGroundTransformation record.

In[43]:= |

Out[43]//MatrixForm= | |

The pre-defined crank slider mechanism has already a placement transformation which parameterize the orientation and position of the whole linkage. This placement transformation is stored in the Ground-Workbench kinematic pair.

Retrieve the Ground-Workbench transformation of crank slider mechanism (Note that the name of the Workbench is link0)

In[44]:= |

Out[44]= |

In[45]:= |

Out[46]//MatrixForm= | |

LinkageData by default does not contains kinematic records, because the basic analysis does not requires it. In order to calculate the velocity or acceleration, the linkage should be converted into a time dependent linkage. As the linkage is converted into time dependent linkage *LinkageDesigner* calculates and stores the required records in $LDTimeDependentVariables and $LDDrivingVelocities records.

$LDTimeDependentVariables | contains the contains the first derivative of the time dependent variables with respect to the time symbol. |

$LDDrivingVelocities | stores the velocity values of the driving variables. |

$LDDerivedParametersB | stores the list of implicitly derived dependent parameter record of the linkage. |

Kinematics related records in LinkageData.

Two function is defined in LinkageDesigner to calculate kinematics record: ToTimeDependentLinkage or NToTimeDependentLinkage functions. The primary task of these functions is to calculate the first derivatives of all time dependent variables and store them in the $LDTimeDependentVariables record.

ToTimeDependentLinkage[linkage,t] | Calculates the first derivatives of the time dependent variables with respect to t and fill up the $LDTimeDependentVariables and $LDDrivingVelocities records of linkage. |

NToTimeDependentLinkage[linkage,t] | Generates the equations of the first derivatives of the time dependent variables with respect to t. The generated equations are appended to the $LDDerivedParametersB record. |

Convert linkages into time dependent ones.

In[47]:= |

Out[47]= |

In[48]:= |

Out[48]= |

In[49]:= |

Out[49]= |

In[50]:= |

Out[50]= |

In[51]:= |

Out[51]= |

In[52]:= |

Out[53]= |

Dynamical calculation requires also some pre-defined records where the mass properties of the links, the forces and torques acting on the linkage can be stored.

$LDMassProperties | Stores the mass properties of the links. Mass properties data consist of a list of {inertiaFrame,mass,momentOfInertia} sublist. |

$LDForces | Stores a list of forces that acting on the mechanism. Forces are stored as {{str1,vec},{str2,pointofAttack}} sublist |

$LDTorques | Stores a list of torques vectors acting on the linkage. Torques are stored as {{str1,vec},{str2,pointofAttack}} |

Records of the dynamical calculation.

In[54]:= |

Out[55]= |

In[56]:= |

Out[56]= |

The double pendulum linkage has already defined $LDMassProperties record. LinkageDesigner provides a number of function that calculates the mass properties of links based on their geometries. If the mass properties are not known the CalculateMassProperties function can determine the mass, center of gravity and moment of inertia of closed polyhedron geometrical models assuming uniform density.

CalculateMassProperties[linkage,dens] | calculates the mass properties of all links of linkage using dens density value and assigns the {frame,mass,moment of inertia } values to the $LDMassProperties record. The function returns the updated LinkageData record. |

CalculateMassProperties[linkage,{name1→dens1,name2→dens2,...}] | calculates the mass properties of the specifies links using the specified densities. |

CalculateMassProperties[linkage] | calculates the mass properties of all geometries using unit density. |

In[57]:= |

Out[57]= |

In[58]:= |

Out[58]= |

In[59]:= |

Out[59]= |

CalculateWeight[linkage,gvec] | function calculates the the weight vector to links based on the mass property definition. The weight vector is inserted into the $LDForces record of linkage. Weight vector is calculated as m*gVec, where m is the mass of the link and gVec is the gravity vector. Weight vector is acting at the center of mass of the link. The function returns the resulted LinkageData record. |

CalculateWeight[linkage] | function calculates the the weight vector to all links assuming that the gravity vector is {0,-9.81,0} |

DefineForceVector[linkage,{lName_{1},pt},{lName_{2},f}] | function adds one force vector to the LinkageData of linkage. The force vector is defined with a point of attack (pt) which is defined w.r.t lName_{i}'s LLRF and the force vector (f), which is defined w.r.t lName2's LLRF. lName1 and lName2 are link names of linkage. The function returns the resulted LinkageData. |

DefineForceVector[linkage,lName,f] | function adds a force definition to the LinkageData of linkage assuming that the point of attack is the origin of lName and the force (f) is defined with respect to the Ground of the linkage. |

In[60]:= |

Out[60]= |

In[61]:= |

Out[61]= |

In[62]:= |

Out[62]= |

DefineTorqueVector[linkage,{lName_{1},pt},{lName_{2},t}] | function adds a torque vector to the LinkageData of linkage. The torque vector is defined with a point of attack (pt) which is defined w.r.t lName_{1}'s LLRF and the torque vector (t) which is defined w.r.t lName_{2}'s LLRF. lName1 and lName2 are link names defined in linkage. Torque definition is inserted to LinkageData of linkage. The function returns the resulted LinkageData. |

DefineTorqueVector[linkage,lName,t] | function adds a torque definition to the LinkageData of linkage assuming that the point of attack is the origin of lName and the force (t) is defined with respect to the Ground of the linkage. |

As soon as the mass properties and forces/torques are defined on the linkage, the LinkageData contains all information that is required for static or dynamical analysis of the mechanism.

In[63]:= |

Out[63]= |

Set the driving variables to 15° and 45° respectively these value will be used as initial values at start time

In[64]:= |

Out[64]= |

SolveLagrangian[linkage,{t,start,end}] | function calculates the Lagrangian of the linkage, define the Lagrange's equations and numerically differentiateit. It returns the list of interpolation functions of the driving variables. |

In[65]:= |

Out[65]= |

In[66]:= |

Out[66]= |

In[67]:= |

Out[67]= |