|On this page…|
For certain applications, you must specify joint motion directly. Inverse dynamic analysis is one example. In this analysis mode, you prescribe joint motion and determine the actuation forces and torques required to achieve that motion.
In this example, you prescribe the angular trajectory of a four-bar revolute joint. You prescribe that trajectory directly using the Revolute Joint block. You then sense and plot the actuation torque required to achieve the prescribed trajectory.
Before continuing, you must have completed example Model Four-Bar Linkage.
This example is based on the four_bar_linkage model that you created in example Model Four-Bar Linkage. To add joint motion input and actuation torque output to that model:
Open the four_bar_linkage model.
In the dialog box of the Base-Crank Revolute Joint block, specify these parameter settings.
|Actuation > Torque||Automatically Computed|
|Actuation > Motion||Provided by Input|
|Sensing > Actuator Torque||Selected|
The joint block displays two physical signal ports. Input port q accepts the joint angular position. Output port t provides the joint actuation torque required to achieve that angular position.
In the Internal Mechanics > Damping Coefficient parameter of the Revolute Joint block dialog boxes, enter 5e-4.
Drag these blocks into the model.
|Simulink-PS Converter||Simscape > Utilities||1|
|PS-Simulink Converter||Simscape > Utilities||1|
|To Workspace||Simulink > Sinks||1|
|Scope||Simulink > Sinks||1|
|Signal Builder||Simulink > Sources||1|
Connect the bocks as shown in the figure.
Specify these block parameters.
|To Workspace||Variable name||tcrank|
|PS-Simulink Converter||Output signal unit||N*m|
|Simulink-PS Converter||Units > Input signal unit||rev|
|Input Handling > Filtering and derivatives||Filter input|
|Input Handling > Input filtering order||Second-order filtering|
In the Signal Builder window, specify the joint angular trajectory as shown in the figure.
This signal corresponds to a constant angular speed of 1 rev/s from t = 1s onwards.
Run the simulation. Mechanics Explorer opens with a dynamic display of the four-bar model.
In the Mechanics Explorer toolstrip, click the isometric view button for a 3-D viewpoint.
Open the Scope window. It displays the joint actuation torque required to achieve the prescribed motion input.
Change actuation mode from motion input to torque input. Then, verify that the angular velocity of the Base-Crank Revolute Joint block equals 1 rev/s. This angular velocity corresponds to the original motion input you prescribed.
Disconnect the Signal Builder and To Workspace blocks from the model.
In the dialog box of the Base-Crank Revolute Joint block, change these parameter settings.
|Parameter||Original Setting||New Setting|
|Actuation > Torque||Automatically computed||Provided by Input|
|Actuation > Motion||Provided by Input||Automatically Computed|
|Sensing > Velocity||Unselected||Selected|
|Sensing > Actuator Torque||Selected||Unselected|
In the PS-Simulink Converter block dialog box, change Output signal unit to rev/s.
In the Simulink-PS Converter block dialog box, change Input signal unit to N*m.
From the Simulink Sinks library, drag a From Workspace block and connect it as shown in the figure.
In the dialog box of the From Workspace block, enter in the Data parameter tcrank.
The tcrank timeseries data provides the sensed actuation torque of the original motion-actuated model.
For the sensed actuation torque to yield the original prescribed motion, the initial joint states of the two model versions (one with the original prescribed motion as input, the other with the sensed actuation torque as input) must be the same.
When a model contains joints with motion inputs, the initial state is dictated by the motion inputs. If the model contains no motion inputs, the initial state is dictated solely by joint state targets, if any.
In this example, the motion input sets the initial state of the Base-Crank Revolute Joint block at zero degrees. To ensure that simulation of the torque-actuated model starts from the same initial state, you must specify a position state target of zero degrees for the Base-Crank Revolute Joint block.
In the dialog box of the Base-Crank Revolute Joint block, select State Targets > Specify Position Target.
In Value, enter 0 and click OK.
Run the simulation. Mechanics Explorer displays the updated model. Click the isometric view button for a 3-D viewpoint of the model.
Open the Scope window. It displays the joint angular velocity, in rev/s units, due to the prescribed torque input.
The angular velocity remains constant at 1 rev/s from t = 1s onwards—precisely as prescribed in the original motion input.