Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Body translation and rotation sensor

First Generation/Sensors & Actuators

The Body Sensor block senses the motion of a body represented by a Body block. You connect the Body Sensor to a Body coordinate system (CS) on the Body whose motion you want to sense. The sensor specifically measures the motion of the origin of this Body CS.

The Body Sensor measures the components of translational and rotational motion in any combination of:

Position, velocity, and acceleration vectors. The position vector has its tail at the World CS origin.

Rotation matrix, angular velocity, and acceleration vectors. Rotation matrices are output as nine-element row vectors arranged in column-major order.

In the block dialog, you choose the reference coordinate system (CS) axes in which these components are represented.

The input is the connector port connected
to the Body being sensed. The outport is a set of Simulink^{®} signals
or one bundled Simulink signal of the selected matrix and/or
vector components.

A body's orientation rotation matrix * R* relates
the components of the same vector

The columns of the rotation matrix * R* are
the components of the Body CS unit basis vectors measured with respect
to the World axes.

See Representations of Body Motion and Representations of Body Orientation for more details on representing body position and orientation, rotation matrices, and angular velocity.

The Body Sensor block can measure the position and/or orientation
of a body. It measures these relative to the home configuration of
the machine, the machine state *before* the application
of initial
condition actuators and assembly of disassembled
joints. Thus the Body Sensor includes the effect of the latter,
which act before the simulation starts.

The dialog has one active area, **Measurements**.

**With respect to CS**In the pull-down menu, choose the coordinate system in which the body motion components are represented: either the

`Local (Body CS)`

to which the Sensor is connected or the default`Absolute (World)`

.In the

`Absolute`

case, the rotation matrixand the motion vectors have components represented in the inertial World CS axes. In the*R*`Local`

case, the same body motion components are premultiplied by the body's inverse orientation rotation matrix*R*^{-1}=*R*^{T}.Each vector measurement is a row vector in the Simulink output signal. The selected signals are ordered in the same sequence as the dialog.

Select the check box for each of the possible measurements you want to make:

Translational motion:

**Position**,**Velocity**, and**Acceleration**vectors:,*r*= d*v*/dt, and*r*= d*a*/dt, respectively.*v*Rotational motion:

**Angular velocity**and**Angular acceleration**vectors and**Rotation matrix**:The

**Rotation matrix**is the 3-by-3 orthogonal rotation matrix:*R*$$\left(\begin{array}{ccc}{R}_{11}& {R}_{12}& {R}_{13}\\ {R}_{21}& {R}_{22}& {R}_{23}\\ {R}_{31}& {R}_{32}& {R}_{33}\end{array}\right)$$

representing rotational orientation and satisfying

*R*^{T}=*R**RR*^{T}=. The components are output columnwise as a 9-component row vector:*I**(R*_{11},*R*_{21},*R*_{31},*R*_{12}.*, ... )*If you choose the

**With respect to coordinate system**as`Absolute (World)`

, the**Rotation matrix**measures the body's rotational orientation with respect to the World CS. Recall the relationship of vector components in the World and body coordinate axes,*v*_{W}=·*R**v*_{b}.If you choose the

**With respect to coordinate system**as`Local (Body CS)`

, the**Rotation matrix**returns the 3-by-3 identity matrix*R*^{T}=*R*.*I*The angular velocity is ω

_{j}= (1/2)Σ_{ik}ɛ_{ijk}Ω_{ik}, where the matrix Ω = +(d*R/dt)*R*^{T}= -*R*(dR*^{T}/dt), and ɛ is the permutation symbol. The angular acceleration is α = dω/dt.

In the **Units** pull-down menus, choose the
units for each of the measurements you want:

Translation: the defaults are

`m`

(meters),`m/s`

(meters/second), and`m/s`

^{2}(meters/second^{2}), respectively, for**Position**,**Velocity**, and**Acceleration**.Rotation: the defaults are

`deg/s`

(degrees/second) and`deg/s`

^{2}(degrees/second^{2}), respectively, for**Angular velocity**and**Angular acceleration**. The**Rotation matrix**is dimensionless.

**Output selected parameters as one signal**Select this check box to convert the output signals into a single bundled signal. The default is selected. If you clear it, the Body Sensor block will grow as many Simulink outports as there are active signals selected, one port for each selected signal.

If the check box is selected, the Simulink signal out has all the active (selected) signals ordered into a single row vector, in the same order you see in the dialog. Nonselected components are removed from the vector signal.

The sensor outputs are ordered and labeled as follows.

Body Sensor Output Signal Label Position p Velocity v Angular velocity av Rotation matrix [R] Acceleration a Angular velocity aa

Here is a Body Sensor connected to a Body:

You must connect the Body Sensor to the Body at one of its Body CS ports. The Sensor measures the motion of that Body CS.

Body, Body Actuator, Constraint & Driver Sensor, Joint Sensor, Mechanical Branching Bar

See Kinematics and Machine Motion State, Representations of Body Motion, and Representations of Body Orientation for more details on representing body position and orientation.

See Sensing Motions and Forces.

See the relevant entries in the Glossary about body orientation: axis-angle rotation, Euler angles, right-hand rule, and rotation matrix.

Was this topic helpful?