|On this page…|
The SimMechanics™ Sensors & Actuators library provides a set of Sensor blocks that enable you to measure
Joint motions and forces or torques on joints
Constraint reaction forces and torques
All Sensor output is defined with respect to a fixed, conventional "zero." See Home Configuration and Position-Orientation Measurements following.
Tip You can feed Sensor output back into Actuator blocks to model springs, dampers, and other mechanical devices that depend on force feedback. See the sections Actuating a Body, Actuating a Joint, Adding Internal Forces, and Validating Mechanical Models.
The Body and Joint Sensor blocks can measure the position and/or orientation of bodies and degrees of freedom. They make these measurements relative to the home configuration of the machine, the machine state before the application of initial condition actuators and assembly of disassembled joints. Thus motion sensors include the effect of the latter, which act before the simulation starts.
To sense the position, velocity, or acceleration of a body represented by a Body block with a Body Sensor:
Drag a Body Sensor block from the Sensors & Actuators library into your model.
The Joint Sensor block enables you to measure the motions of degrees of freedom. It can also measure the relative forces and torques between the bodies connected to the joint. These include the computed force or torque (the force or torque needed to reproduce the joint's motion) and the reaction force and torque on a joint primitive. (You cannot measure the computed force or torque on a spherical or weld primitive.) You must connect a separate Joint Sensor block to a Joint block for each joint primitive that you want to sense.
To sense the motions, forces, and torques of a joint primitive contained by a Joint block:
Drag a Joint Sensor block from the Sensors & Actuators library into your model.
The Constraint & Driver Sensor block enables you to measure the reaction forces and torques induced on the constraints modeled by SimMechanics Constraint and Driver blocks.
To sense the reaction force and/or torque induced by a constraint or driver,
Drag a Constraint & Driver Sensor block from the Sensors & Actuators library into your model.
Not all the reaction force/torque components are significant. Only those components projected into the subspace of constrained or driven degrees of freedom (DoFs) are physical. Components orthogonal to the constrained or driven degrees of freedom are not physical.
In this example, you drive a body along the x-axis, but only allow it a prismatic DoF tilted at an angle in the x-y plane. Construct the following model.
Configure the Constraint & Driver Sensor to measure only the reaction force, not the torque. Configure the Linear Driver to drive the Body along the World x-axis, but set up the Prismatic with a primitive axis along (1, 2, 0). The body can then move only along this axis, but is driven along the horizontal x-axis. Measure all motions and forces in World. Leave all other settings at default.
Open the Scopes and run the model. The measured reaction force lies along the x-axis, with a value of -19.62 N (newtons) = -2mg. Because the constrained DoF is not parallel to the x-axis, you need to project the reaction force along the unit vector (1, 2, 0)/ defining the direction of the prismatic primitive to obtain the physical part.
Add to the model the Simulink blocks that form a dot product between the reaction force signal (three components) and the prismatic unit vector (also three components). (You can define a workspace vector for this axis and use it in both the joint and the dot product.) Reconnect Scope1 to measure this physical component of the reaction force.
The physical component of the reaction force is -(19.62 N)·(1/ ) = -8.77 N. The component of the reaction force orthogonal to (1, 2, 0) is not physical.