Step to identify general plant inputs
The input of interest is the single rotational axial force is applied to the wheel Revolute Joint to move the mouse.
1. Click the GPlant_Input icon of the Control group in the Communicator tab. The General Plant Input List dialog box appears as shown in Figure 1. For more information, click here.
Figure 1 General Plant Input List dialog box
2. Add a GPlant input as the name of the actuator.
3. Add an expression function as a following figure.
Figure 2 Expression dialog box
4. Open the dialog box of Rotational Axial force by double clicking RotationalAxial1 in the Database window. And then input the expression function defined in the upper step.
Figure 3 Rotational Axial force dialog box
Step to identify general plant outputs
The output of interest is the displacement and velocity between the ball and the Mouse body pointer. This distance is in the X direction.
1. Click the. GPlant_Output icon of the Control group in the Communicator tab. The General Plant Output List dialog box appears as shown in Figure 1. For more information, click here.
Figure 1 General Plant Output dialog box
2. Add plant outputs as expression functions. At this dialog, the defined expression functions are as following figures.
Figure 2 Expression dialog box
Step to set interface information
1. Save the RecurDyn model in the normal fashion.
2. Click the GCoSim icon of the Control group in the Communicator tab. The General CoSim dialog box appears. For more information, click here.
Figure 1 General CoSim dialog box
3. Click Add button.
4. Define the name of General CoSim as “GCoSim1”.
5. Select the type of General CoSim as Simulink.
6. Click the PIN (…) button. The General Plant Input List (GCoSim1) dialog box appears.
Figure 2 General Plant Input List (GCoSim1) dialog box
7. Click Add button. Automatically “Control_torque” is input. And Click OK button.
8. Likewise Clink the POUT (…) button. The General Plant Output List (GCoSim1) dialog box appears.
Figure 3 General Plant Output List (GCoSim1) dialog box
9. Click Add button twice. Automatically “displacement” and “velocity” are input. And Click OK button.
10. Click CoSim(…) button. The Simulink (GCoSim1) dialog box appears.
Figure 4 Simulink (GCoSim1) dialog box
11. Select the Host Program as Simulink.
12. Export the M file to create a Plant Block after defining the names.
13. Edit Sampling Period (Control Time Step).
14. Check Use Identical Solution of RDHost Option.
15. Click OK.
16. Save the RecurDyn model and terminate the RecurDyn program.