MotionView User's Guide

Coupler

Coupler

Previous topic Next topic Expand/collapse all hidden text  

Coupler

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

This section describes the Coupler Joint entity of MotionView and shows the various usage, creation, and editing methods.

Theory/Background

A Coupler entity defines an algebraic relationship between the degrees of freedom of two or three joints.  This constraint element may be used to model idealized spur gears, rack and pinion gears, and differentials as simple constraints that relate the displacements in a set of joints.  Couplers can be used to specify relationships between Translational, Rotational, and Cylindrical Joints only.

The topological information required to define an Coupler Joint is shown in the figure below:

coupler_diagram_mv

Entity Data Members

The data members of the Coupler can be classified into the following members:

hmtoggle_plus1Connectivity

A Coupler relationship can be defined either between a set of two joints or between a set of three joints.  The topological information required to define a Coupler is show in the figure above.

A two joint Coupler needs the following:

Two Joints – Joint 1 and Joint 2.
In case any or both the joints are Cylindrical Joint(s), the type of Coupling needs to be specified – Translational or Rotational.

A three joint Coupler needs the following:

Three Joints – Joint 1, Joint 2, and Joint 3.
In case any or all the joints are Cylindrical Joint(s), the type of Coupling needs to be specified – Translational or Rotational.

The joint can be modeled as a Single entity or as a Pair entity.

hmtoggle_plus1Properties

Properties of a two Joint Coupler are:

Ratio of Displacement between Joint 1 and Joint 2
In case of User Defined properties for the Coupler:
-USER() function call statement
-Local Subroutine DLL name and path (Optional)
-USER Function Type – DLL/SO, Python, or MATLAB
-USER function name (Optional)

Properties of a three Joint Coupler are:

Ratio of Displacement between Joint 1 and Joint 2
Ratio of Displacement between Joint 2 and Joint 3
In case of User Defined properties for the Coupler:
-USER() function call statement
-Local Subroutine DLL name and path (Optional)
-USER Function Type – DLL/SO, Python, or MATLAB
-USER function name (Optional)

The USER function name for a Coupler entity can be COUSUB, COUXX, or COUXX2.  The properties of a Coupler can be made symmetric with the Left or the Right Coupler acting as the Master property Coupler.

Creating and Editing Couplers

To learn how to add a Coupler to a model, please see the Constraint Entities topic.

hmtoggle_plus1To create/add a Coupler to a model:
1.Once a Coupler has been added to the model using any of the "entity" creation methods, the panel for the coupler entity will automatically be displayed in the panel area.  See the panel examples below:

coupler_panel_conn_tab_mv

Coupler Panel – Connectivity Tab – Two Joints

coupler_panel_conn_tab_three_joints_mv

Coupler Panel – Connectivity Tab – Three Joints

2.From the Connectivity tab, set the Number of joints to constrain drop-down menu to '2' (in order to create a two joint Coupler).

The two joint Coupler definition needs two joints whose displacements are controlled by the Coupler ratio.

3.Click on the Joint 1 collector and pick the desired joint from the graphics area or from the model tree.
4.In the same manner, click the Joint 2 collector and pick the second joint for the Coupler.  
5.If any of the joints are Cylindrical, select the type of the displacement to be controlled by using the drop-down menus located to the right of each selected Joint on the panel (Translational or Rotational).
6.If desired, activate the User defined properties check box in order to display the User-Defined tab for the Coupler (which will allow you to define the properties).

coupler_panel_user_def_check_box_mv

Note - The Properties tab will automatically change into the User-Defined tab.

7.To create a three joint Coupler, set the Number of joints to constrain drop-down menu to '3'.

The three joint Coupler definition needs three joints whose displacements are controlled by the Coupler ratio.

8.Click on the Joint 1 collector and pick the desired joint from the graphics area or from the model tree.
9.In the same manner, click the Joint 2 and Joint 3 collectors respectively, and pick the second and third joint for the Coupler.  
10.Again, if any of the joints are Cylindrical, select the type of the displacement to be controlled by using the drop-down menus located to the right of each selected Joint on the panel (Translational or Rotational).
11.Activate the User defined properties check box in order to display the User-Defined tab for the Coupler (if desired).

Note - The Properties tab will automatically change into the User-Defined tab.

12.To specify the properties of the Coupler, click the Properties tab of the Coupler panel.

coupler_panel_properties_tab_two_joints_mv

Coupler Panel - Properties Tab – Two Joints

coupler_panel_properties_tab_three_joints_mv

Coupler Panel - Properties Tab – Three Joints

13.In the case of a Two Joint Coupler, type in the displacement ratio between joint one and joint two in the appropriate text box.
14.In the case of a Three Joint Coupler, type in the two displacement ratios between joint one and joint two, and between joint two and joint three in the appropriate text box.
15.If the User-defined properties option has been selected (as mentioned previously in steps 6 and 11), the User-Defined tab will be displayed instead of the Properties tab.

coupler_panel_user_defined_tab_1

Coupler Panel - User-Defined Tab

16.Click in the USER() statement text box and type in the User Subroutine function call.
17.To specify a local subroutine file and function name, activate the check box for Use local file and function name.
18.From the Function Type drop-down menu, select the desired subroutine function type (DLL/SO, Python, or MATLAB).
19.Click the Local File file browser icon and select the required subroutine file.
20.Type in the Function name text box, if a different name from the default function name is displayed.

Note - Steps 15 to 20 (above) apply to both Two Joint and Three Joint Coupler types.

21.When defining the properties for Pair Couplers, activate the check box for Symmetric properties in order to specify the symmetric properties.

coupler_panel_conn_tab_pair_mv

Coupler Panel (Pair) – Connectivity Tab

22.When defining a Pair Coupler, use pair entities for Joint 1, Joint 2, etc.

Note - The same steps as shown above can also be used to define Pair Coupler entities.

hmtoggle_plus1To edit or change the definition of a Coupler entity:
1.Left click the Couplers panel icon entityCouplers-24 on the Constraint toolbar.

The Project Browser will filter the entities and display only the Couplers in the model.

2.Select the desired coupler entity in the Project Browser.

The corresponding panel is automatically displayed.

3.From the Connectivity tab, use the Coupler type drop-down menu to change the coupler type, or use the collectors to change the joints and other attributes.

Coupler in MDL and XML Formats

The model containing the Coupler can be saved in MDL format from MotionView and exported in the MotionSolve XML format.

hmtoggle_plus1Coupler in MDL (Model Definition Language)

The Coupler entity can be of the following types:

1.Single
With fixed linear ratios
With User-defined properties
2.Pair
Asymmetric with fixed linear ratios
Symmetric with fixed linear ratios
Asymmetric with User-defined properties

All of the types of entities mentioned above can be added to the model using the MDL Statements shown below:

Syntax:

*Coupler(coupler_name,        "coupler_label",  2JOINT|3JOINT,

                                         joint_1,

                                         joint_2,

                                         [joint_3],

                                         TRANS|ROT,

                                         TRANS|ROT,

                                         [TRANS|ROT])

 

*SetCoupler(coupler_name, ratio_1, [ratio_2])

Example:

*Coupler( c_jcoup, "Two Joint Coupler", 2JOINT, j_transjt, j_RevJt, TRANS, ROT )

*SetCoupler( c_jcoup, -0.9 )

Syntax:

*SetCoupler(coupler_name, USER, `expr`)

Example:

*SetCoupler(c_jcoup, USER, `USER(10,25)`)

 

*SetLocalUserDLLFlag(c_jcoup, true)

*SetLocalUserFunction(c_jcoup, "COUSUB", DLL)

*SetLocalUserDLL(c_jcoup, "C:/Models/COUSUB.dll")

Syntax:

*CouplerPair(coupler_name, "coupler_label",  2JOINT|3JOINT

                                            joint_1,

                                            joint_2,

                                            [joint_3]

                                            TRANS|ROT,

                                            TRANS|ROT,

                                            [TRANS|ROT])

Example:

*CouplerPair(c_coup_pair, "Coupler Pair", 3JOINT, j_0, j_1, j_2, ROT, ROT, ROT)

*SetCoupler(c_coup_pair, LEFT, 4, 3.2)

Syntax:

*SetCoupler(coupler_name,  , ratio_l, ratio_r)

Example:

*SetCoupler(c_coup_pair,              , 4, 3.2, 4, 3.2)

Syntax:

 

*SetCoupler(coupler_name, , USER, `expr`, `expr`)

 

Example:

*SetCoupler(c_coup_pair2, , USER, `USER(301001, 301003, 25)`, `USER(301002, 301005, 25)`)

 

*SetLocalUserDLLFlag(c_coup_pair2.l, true)

*SetLocalUserDLL(c_coup_pair2.l, "C:/Models/COUSUB.dll")

*SetLocalUserFunction(c_coup_pair2.l, COUSUB, DLL)

 

*SetLocalUserDLLFlag(c_coup_pair2.r, true )

*SetLocalUserDLL(c_coup_pair2.r, "C:/Models/COUSUB.dll")

*SetLocalUserFunction(c_coup_pair2.r, COUSUB, DLL)

Please refer to the *Coupler, *CouplerPair, *SetCoupler, and *SetCouplerPair topics for a detailed description of each MDL statement.

Note: To learn how to create a complete model using MDL statements, please refer to tutorial MV-1060: Introduction to MDL.

hmtoggle_plus1Coupler in XML Format

The Coupler when exported to the MotionSolve XML format is defined as a Constraint_Coupler statement.

Syntax:

<Constraint_Coupler

   id                     = "integer"

   label                  = "Coupler Entity Label"

   joint1_id              = "integer"

   freedom_1              = { "T" | "R" }

   joint2_id              = "integer"

   freedom_2              = { "T" | "R" }

[

   joint3_id              = "integer"

   freedom_3              = { "T" | "R" }

]

{

      coefficients        = "double, double [, double]"

   |

      usrsub_dll_name     = "valid_path_name"

      usrsub_param_string = "USER( [[par_1][, ...][, par_n]] )"

      usrsub_fnc_name     = "custom_fnc_name" >

   |

      script_name       = valid_path_name

      interpreter         = "PYTHON" | "MATLAB"

      usrsub_param_string = "USER( [[par_1 [, ...][,par_n]] )"

      usrsub_fnc_name        = "custom_fnc_name" >

}

</Constraint_Coupler>

In case of a three joint Coupler with linear properties the model statement will be as shown below:

<Constraint_Coupler

  id                  = "301002"

  label               = "Three Joint Coupler"

  joint1_id           = "301003"

  freedom_1           = "R"

  joint2_id           = "301004"

  freedom_2           = "R"

  joint3_id           = "301005"

  freedom_3           = "R"

  coefficients        = "1. 1. 1.5"

/>

In case of a three joint Coupler with User-defined properties, the model statement will be as shown below:

<Constraint_Coupler

  id                  = "101004"

  label               = "Coupler Pair User-left"

  joint1_id           = "101006"

  freedom_1           = "R"

  joint2_id           = "101007"

  freedom_2           = "R"

  joint3_id           = "101008"

  freedom_3           = "R"

  usrsub_param_string = "USER(301001,301003,25)"

  usrsub_dll_name     = "C:/Models/COUSUB.dll"

  usrsub_der1_name    = "COUXX"

  usrsub_der2_name    = "COUXX2"

/>

To understand the complete syntax of the Constraint_Coupler XML model statement, please refer to the MotionSolve Reference Guide Page for Constraint_Coupler.

Creating and Editing Couplers using Tcl

In MotionView, Tcl can be used to add any MDL entities to the model. There are two TCL commands that can be used to add an entity:

hmtoggle_arrow1InterpretEntity

Syntax:

mdlmodel_handle InterpretEntity new_handle keyword varname label

In case of the Coupler the statement will look as shown below:

mdlmodel_handle InterpretEntity joint Coupler c_jcoup "\"Two Joint Coupler\"" 2JOINT j_transjt j_RevJt "TRANS" "ROT" ;

hmtoggle_arrow1InterpretSet

Syntax: 

mdlmodel_handle InterpretSet keyword tokens;

In case of the Coupler the statement will look as shown below:

mdlmodel_handle InterpretSet SetCoupler c_jcoup -0.9;

The InterpretEntity command is used to add entities to the model and the InterpretSet command is used to set the entity properties.  So in the case of the Coupler, the properties that can be set are the Joint Initial Conditions. Extended definitions for InterpretEntity and InterpretSet can be found in the HyperWorks Desktop Reference Guide.

Note - When using the InterpretEntity and InterpretSet commands, it is important to also use the Evaluate command in order for the changes to take effect immediately.

To learn how to create a complete model using Tcl commands, please refer to tutorial MV-1040: Model Building Using Tcl.

See Also:

Coupler Panel

Adding and Removing Entities

*Coupler (MDL Model Statement)

*CouplerPair (MDL Model Statement)

Constraint_Coupler (XML Command)

InterpretEntity (Tcl Command)

InterpretSet (Tcl Command)