Sense Forces and Torques Acting at Joints
Simscape™ Multibody™ provides force and torque sensing in joint blocks. You can use this sensing capability to compute and output various types of forces and torques acting directly at joints. Force and torque types that you can sense include those due to:
Joint actuation inputs
Joint actuation inputs, constraints, and internal mechanics combined
In this tutorial, you explore the different types of force and torque sensing that Simscape Multibody joint blocks provide.
At the MATLAB® command prompt, enter
Multibody opens a rack and pinion model that you can use to explore the
force and torque sensing capability of joint blocks.
Sense Actuation Torque
The rack and pinion model contains an actuation torque input that drives the pinion revolute joint. A Simulink-PS Converter block processes the input signal using a second-order filter, smoothing any abrupt changes or discontinuities the signal may have. To sense the actuation torque as observed at the Revolute Joint block:
In the Revolute Joint block dialog box, select Z Revolute Primitive (Rz) > Sensing > Actuator Torque. The block exposes a physical signal port, labeled t. This port outputs the 3-D vector components of the joint actuator torque in a Simscape physical signal.
Drag the following blocks into the model:
Connect the blocks as shown in the figure.
Simulate the model. The To Workspace block outputs the actuator torque signal into a time-series variable, simout, available in the MATLAB base workspace.
At the MATLAB command prompt, enter:MATLAB plots the vector components of the joint actuator torque. All but the Z component are zero throughout the simulation.
Compare the actuator torque plot to the original input signal in the Signal Builder block. Neglecting any signal smoothing due to the second-order filtering, the two signals are identical. The following figure shows the original input signal.
Actuator force and torque sensing enables you to analyze the required forces and torques to yield a prescribed joint trajectory. Use this feature in your model to perform inverse dynamic and other types of analysis.
Sense Constraint Forces
Joint constraint forces, which act normal to the joint primitive axes, restrict motion to the allotted joint degrees of freedom. In the Revolute Joint block, the constraint forces resist the pull of gravity, keeping the pinion fixed with respect to the world frame. To sense the constraint forces:
In the Mechanism Configuration block, set Uniform Gravity to
Constant. This setting ensures that gravity acts on the rack and pinion system. Check that the gravity vector is
[0 0 -9.80665].
In the Revolute Joint block dialog box, select Composite Force/Torque Sensing > Constraint Force. The block exposes the physical signal port fc. This port provides the vector components of the joint-wide constraint force in a Simscape physical signal. By default, this is the constraint force that the follower port frame exerts on the base port frame, resolved in the base port frame.
Deselect Z Revolute Primitive (Rz) > Sensing > Actuator Torque.
Check that the PS-Simulink Converter block now connects to the physical signal port fc.
Simulate the model. At the MATLAB command prompt, enter:MATLAB plots the constraint force components with respect to time. All but one component are zero throughout simulation. The Z component, which opposes the gravity vector, is the only component needed to hold the joint frames in place.
Constraint forces ensure that weld joint frames remain fixed with respect to each other. You can place a Weld Joint block inside a body subsystem to sense the internal forces and torques acting within that body during simulation. For an example of how you can do this in a double pendulum model, see Sense Constraint Forces.
Sense Total Forces
In addition to actuation and constraint forces and torques, joint frames can also interact by exchanging internal forces and torques. These forces and torques, which are due to spring and damper elements internal to the joint itself, enable you to account for mechanical energy dissipation and storage between the joint frames. You can sense the total composite force and torque acting at a joint, which includes contributions from actuation, constraint, and internal forces and torques. To sense the total torque acting between the port frames of the Revolute Joint block:
In the Revolute Joint block dialog box, select Composite Force/Torque Sensing > Total Torque. The block exposes the physical signal port tt. This port outputs the total torque acting between the joint frames as a Simscape physical signal.
Deselect Composite Force/Torque Sensing > Constraint Force.
Simulate the model.
At the MATLAB command prompt, enter:
MATLAB plots the vector components of the total torque vector as a function of time. All but one component are zero throughout simulation. The nonzero component, a torque directed about the Z axis, contains torque contributions from actuation and internal torques, but none from constraint torques.
The torque peaks correspond to the actuation torque values specified in the input signal. These peaks decay with time due to the internal damping torques specified in the Revolute Joint block dialog box. The damping torques cause the energy dissipation evident in the transient portions of the total torque plot.
To verify that the total torque excludes any contribution from constraint torques, try sensing the constraint torques directly. A plot of the constraint torques will show that they are in fact negligible.