MV-1020: Model 2D Rigid to Rigid Contact Simulation

Learn how to create Curve Entities and Curve Graphics, use macros to create them simultaneously, and setup a 2D rigid curve to curve contact.

This tutorial will guide you through the 2D rigid body contact capabilities in MotionSolve. This can be used when contact occurs in a plane. You will model a roller type cam-follower mechanism using 2D rigid to rigid contact as there are no out-of-plane contact forces that are expected.


Figure 1.

Review the Model

Review the model by running it using MotionSolve.

Copy the files Cam_Follower_Input.mdl, CamProfile.h3d, Cam_Fixed.csv and Cam_Variable.csv from the location <installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive\ to your <working directory>.
A partially setup model is available for you in MotionView. Everything except for the 2D contact has been setup.

  1. Launch MotionView.
  2. Open the Model by doing one of the following:
    • On the Standard toolbar, click (Open Model).
    • On the menu bar, click File > Open > Model.
  3. From the Open model dialog, select the file Cam_Follower_Input.mdl from your working directory and click Open.
    Review the model for its bodies, graphics, markers, joints, and motion. It will look like the image in Figure 2.


    Figure 2.
  4. Click the (Run panel) icon.
  5. Click the Save and run current model browser button. Then click the Run button.
  6. Once the simulation is completed, close the solver window and the Message Log.
  7. From the Run panel, review the results animation by clicking on the Animate button.
    Notice that the FollowerRoller is not in contact with the Cam since there is no contact defined in the model.


    Figure 3.
  8. Click the (Page Window Layout) button to return to the MotionView window.


    Figure 4.

Create Curve Entity and Curve Graphics

Create the Curve Entity and Curve Graphics for FollowerRoller.

Since the FollowerRoller profile is circular, it can be easily defined using mathematical expressions. First, you will create a closed circular Curve Entity (using the Math option). Next you will create Curve Graphics to associate this Curve Entity with the FollowerRoller body so you can use it to setup the 2D Contact.
  1. Open the Add Curve dialog by doing one of the following:
    • From the Project Browser, right-click on Model and select Add > Reference Entity > Curve.
    • On the Reference Entity toolbar, click the (Curves) icon.
  2. In the dialog, for Label enter Roller_Curve. For Variable, enter crv_roller.
  3. Click OK.


    Figure 5.
  4. From the Properties tab, use the first drop-down menu to change the curve to 3D Cartesian.
    Note: Only 3D Cartesian types of Curve Entities are supported for the Curve Graphics.
  5. Use the fourth drop-down menu to change the curve from Open Curve to Closed Curve.
  6. Click the x radio button, then select Math from the second drop-down menu.
  7. In the Expression Builder, enter 5*SIN(2*PI*(0:1:0.01)). Then hit Enter.
  8. For the Math expressions of the y and z coordinates, enter 5*COS(2*PI*(0:1:0.01)) and 0.0*(0:1:0.01) respectively.


    Figure 6.
    You have finished creating the Curve Entity. Next, you will create a graphic to represent the FollowerRoller body. Later, you will use this to define 2D Contact.
  9. Open the Add CurveGraphic dialog by doing one of the following:
    • From the Project Browser right-click on Model and select Add > Reference Entity > Graphic.
    • On the Reference Entity toolbar, click the (Graphics) icon.
  10. In the drop-down menu, choose Curve.
  11. In the dialog, for Label enter Roller_Curve. For Variable, enter gcrv_roller.
  12. Click OK.
    Figure 7.
    Note: The Body/Point option (Parent type) has been selected by default on the Connectivity tab.
  13. From the Connectivity tab, double-click on the collector. In the dialog, select FollowerRoller.
    The collector is highlighted by default.
  14. Click the collector. In the dialog, select FollowerRevJoint.
  15. Click the collector. In the dialog, choose Roller_Curve. Leave the rest of the options on the panel as default.


    Figure 8.
    Curve Graphics representing the FollowerRoller should now be graphically visible.


    Figure 9.
  16. Now that you have created new graphics, deactivate the original cylinder graphics used to represent the FollowerRoller.
    1. In the Project Browser, right-click on FollwerRoller.
    2. In the context menu, click Deactivate.


      Figure 10.

Create Curve Entity and Curve Graphics for Cam

Divide the cam profile into Fixed and Variable portions to determine the best shape of the cam for achieving a specific displacement profile of the follower.



Figure 11.

The variable portion of the cam will be controlled by the coordinates of some points in the model.

Create Fixed Portion of Cam Profile

Use a .csv file containing x, y, and z coordinates of points to create a Curve Entity.

  1. Open the Add Curve dialog by doing one of the following:
    • From the Project Browser right-click on Model and select Add > Reference Entity > Curve.
    • On the Reference Entity toolbar, click the (Curves) icon.
  2. In the dialog, for Label enter Cam_fixed_Curve. For Variable, enter crv_cam_fix. Then click OK.
  3. From the Properties tab, use the first drop-down menu to change the curve to 3D Cartesian.
  4. Verify the fourth drop-down menu selection is set to Open Curve.
  5. From the Properties tab, click on the x radio button. Retain the default File option in the second drop-down menu.
  6. Click and select Cam_Fixed.csv from the <working directory>.
  7. Click Open.
  8. For component, select Column 1. Retain all other values in the panel as default.


    Figure 12.
  9. For the y and z radio buttons, for Component select Column 2 and Column 3 respectively.
  10. Create a Curve Graphic to visualize the cam and make sure the import data is located as per your requirements.
    1. Repeat steps 9 through 16 in Create Curve Entity and Curve Graphics using the information in Table 1.
      Table 1.
      Variable Value
      Label Cam_Fixed_Curve
      Variable gcrv_cam_fix
      Body Cam
      Origin Point Global Origin
      Curve Cam_Fixed_Curve


      Figure 13.
      Curve Graphics representing the fixed portion of Cam should now be visible.


      Figure 14.

Create Variable Portion of Cam Profile

Use a macro to automatically create both the Curve Entity and Curve Graphics using the existing points in the model.

  1. Create points for the model in one of the following ways:
    • From the menu bar, click Macros > Create Points > Using Coordinates.
    • On the MotionView Toolbar, click (Create Points using Coordinates).


  2. In the Parametric Points dialog, click the (file browser).
  3. Select the Cam_Variable.csv and click Open.
  4. Click OK to create 10 points (0 through 9).


    Figure 15 shows the newly created points.
    Figure 15.
  5. Now that you have created new graphics, deactivate the original H3D file graphics used to represent the Cam.
    1. In the Project Browser, right-click on Cam.
    2. In the context menu, click Deactivate.
      .

      Figure 16.

      Now use the newly created points to create the variable portion of the cam profile using the Create Curve from Points/Nodes macro.

  6. Open the Create Curve from Points/Nodes macro in one of the following ways:
    • From the menu bar, click Macros Create Curve from Points/Nodes/Edges/Faces.
    • On the MotionView toolbar, Click (Create Curve from Points/Nodes button).


    Figure 17.
  7. Double-click the collector and select Cam body.
  8. Edit the Labels prefix for the Curve Entity and the Curve Graphics to be created to Cam_Variable_Curve.
  9. For the collector, select Point 0 in one of the following ways:
    • Click Point 0 in the modeling window.
    • Click the collector. In the Select a Point dialog, double-click on Point 0 from the filtered list of points.
    Point 0 is highlighted in the modeling window and listed in the panel.
  10. Repeat step 9 to pick the remaining points (1 through 9).
    The panel should look as shown in Figure 18.


    Figure 18.
    Note: A node associated with File graphic H3D can also be picked. However, the curve created would not be parametrically linked with the node. Picking a point retains the parametric relation between the point and the curve.
  11. Click Create.
    A new Curve Entity and a new Curve Graphics (Cam_Variable_Curve) has been added to the model.


    Figure 19.
    The newly created Curve Graphics representing the variable portion of the Cam should now be visible in the modeling window.


    Figure 20.
  12. Review the newly created Curve Entity by selecting it from the Model Tree in the Model Browser.
    Note: Click (as shown in Figure 21) to see how the X, Y and Z values in the panel are parametrically pointing to the points selected while using the macro. Thus, by changing the coordinates of these Points in the model, the curve can be modified.


    Figure 21.

Create Merged Curve of Cam Profile

Merge both fixed and variable portions of the Cam and create a new closed curve to setup the 2D Contact.

The fixed and variable Curve Graphics of Cam generated in Step 3.1 and Step 3.2 cannot be used in setting up contact since they are using open Curve Entities. You generated these in order to verify if the curve data is in the correct location. For a continuous contact between FollowerRoller and Cam, you need closed curves. In this step you will merge the fixed and variable portions of the Cam and, in the process, learn how to use a mathematical function (CAT) to concatenate two Curve Entities.
  1. Insert a new Curve entity by repeating steps 1 through 5 for step Create Curve Entity and Curve Graphics using the input details listed in Table 2.
    Table 2.
    Variable Value
    Label Cam_Curve
    Variable crv_cam
    Curve Type 3D Cartesian
    Open/Closed Closed
  2. From the Properties tab, click the x radio button, then select Math from the second drop-down menu.
  3. In the Expression Builder, enter {CAT(crv_cam_fix.x, crv_0.x)}. Then hit Enter.
  4. For the Math expressions of the y and z coordinates, enter {CAT(crv_cam_fix.y, crv_0.y)} and {CAT(crv_cam_fix.z, crv_0.z)} respectively.
    Note: By using CAT function, you are able to append the data-points of variable portion of cam to the data-points of fixed portion of cam. The panel should display merged data of both fixed and variable portions of cam profile.


    Figure 22.
    You have finished creating the Curve Entity. Next, you will create a graphic to represent the Cam body. Later, you will use this to define 2D Contact.
  5. Open the Add CurveGraphic dialog by doing one of the following:
    • From the Project Browser right-click on Model and select Add > Reference Entity > Graphic.
    • On the Reference Entity toolbar, click the (Graphics) icon.
  6. In the drop-down menu, choose Curve.
  7. In the dialog, for Label enter Cam_Curve. For Variable, enter gcrv_cam.
  8. Click OK.
    Note: The Body/Point option (Parent type) has been selected by default on the Connectivity tab. For this process you will use the Marker option since you already have a CamMarker in the model which is associated with Cam (Body) and PivotPoint (Point).
  9. From the Connectivity tab, select the drop-down menu of Parent and change it to Marker.
  10. Double-click on the collector.
  11. In the Select a Marker dialog, select CamMarker and click OK.
  12. Double-click on the collector.
  13. In the Select a Curve dialog, select Cam_Curve.


    Figure 23.
    The Curve Graphics representing the Cam should now be visible in the modeling window.
    Figure 24.

Set Up 2D Contact

Define a contact between Cam and FollowerRoller using their respective Curve Graphics.

  1. On the Force Entity toolbar, right-click on the (Contact) button.
  2. In the dialog, for Label enter 2D Contact 0 and retail the default Variable.
  3. In the drop-down menu, change the Type to 2D Rigid to Rigid and click OK.


    Figure 25.
  4. In the Connectivity tab, click the (I Body) collector. Then select the Cam body by clicking its Curve Graphics in the modeling window.


    Figure 26.
    (J Body) collector is highlighted automatically.
  5. Click the collector and select the FollwerRoller body in the dialog.
    The Contact panel should now appear as shown in Figure 27:


    Figure 27.
    Note: Fixed and Variable Curve Graphics are selected by default since they are associated with Cam body. You can remove the same from the contact definition as they are not required.
  6. Under , deselect (or uncheck) Cam_Fixed_Curve and Cam_Variable_Curve.
  7. Review the side of selected curves that will be in contact.
    1. Click to check the Highlight contact side check box.
      Note: The arrow display indicates the inside of Cam and FollowerRoller as contacting side. This needs to be corrected.
    2. For both and curves, click to check the Flip Contact Side box.
      Note: The highlighted contact side for both the bodies should now be as shown in Figure 28:


      Figure 28.
  8. In the Properties tab, retain the default selections.
  9. In the Advanced tab, activate the Find precise contact event and Change simulation max step size options with the default values.

Save and Run the Model

Save the 2D Contact model and run it using MotionSolve.

  1. From the menu bar, click File > Save As > Model.


    Figure 29.
  2. In the dialog, browse to your <working directory> and specify the file name as Cam_Follower.mdl.


    Figure 30.
  3. Run the model.
    A 2D curve contact simulation should run faster than an equivalent model using 3D contact where the solver must work harder to determine contact for a 2D tessellated geometry.
    1. Click the (Run panel) icon.
      Note: To obtain accurate results, a smaller step size and a finer print interval have been selected in this model. You can review them by clicking the Simulation Settings… button.
    2. Click the (file browser) and specify the new name for the file as Cam_Follower.xml.
    3. Click Save.


      Figure 31.
  4. Click the Run button.

Post-Process the Results

Review the MotionSolve simulation summary using HyperView and HyperGraph.

After the simulation is complete, MotionSolve prints out a summary table like for 3D contact (both on screen-solver view window and in the log file generated) that lists the contact pairs ordered by maximum penetration depth and by maximum contact force for this simulation.


Figure 32.
  1. Click the Animate button to review the animation in HyperView.
  2. Review the contact force.
    1. Select Vector plot.
    2. Set the Results type to Contact Force.
    3. Click Apply. Then click (Start Animation).


      Figure 33.
  3. Plot the FollowerShaft vertical displacement during the entire simulation using HyperGraph.
    1. In the MotionView window, on the Run panel, click the Plot button.
      This will open an .abf file in HyperGraph.
    2. Click (Build Plots).
    3. For Y Type (Axis), select Body. For Y Request, select FollowerShaft. For Y Component, select Y.
    4. Click Apply.


    Figure 34.
  4. Optional: In MotionView, edit the coordinates of any/all points (Point 0 to Point 9) to get updated Cam profile and re-run the model to investigate its effect on Contact Force on Cam or FollowerShaft Displacement.