WOLFRAM SYSTEM MODELER
DistanceMeasure the distance between the origins of two frame connectors |
SystemModel["PlanarMechanics.Sensors.Distance"]
The distance between the origins of frame_a
and of frame_b
are determined and provided at the
output signal connector distance
. This
distance is always positive. Derivatives of this
signal can be easily obtained by connecting the
block
Modelica.Blocks.Continuous.Der
to distance
(this block performs analytic differentiation
of the input signal using the der(…)
operator).
In the following figure the animation of the
sensor is shown. The light blue coordinate system is
frame_a
, the dark blue coordinate system is frame_b
,
and the yellow arrow is the animated sensor.
If the distance is smaller then the parameter s_small
(in the "Advanced" menu), it is approximated such that its derivative is
finite for zero distance. Without such an approximation, the derivative would
be infinite and a division by zero would occur. The approximation is performed
in the following way: If distance > ssmall, it is
computed as sqrt(r*r) where r is the
position vector from the origin of frame_a
to the origin of frame_b
.
If the distance becomes smaller then ssmall, the "sqrt()"
function is approximated by a second order polynomial, such that the function
value and its first derivative are identical for sqrt() and the polynomial at
ssmall.
Furthermore, the polynomial passes through zero. The effect is, that the distance
function is continuous and differentiable everywhere. The derivative at zero distance
is 3/(2*ssmall).
animation |
Value: true Type: Boolean Description: = true, if animation shall be enabled (show arrow) |
---|
arrowDiameter |
Default Value: planarWorld.defaultArrowDiameter Type: Diameter (m) Description: Diameter of relative arrow from frame_a to frame_b |
---|---|
arrowColor |
Default Value: Modelica.Mechanics.MultiBody.Types.Defaults.SensorColor Type: Color Description: Color of relative arrow from frame_a to frame_b |
specularCoefficient |
Default Value: planarWorld.defaultSpecularCoefficient Type: SpecularCoefficient Description: Reflection of ambient light (= 0: light is completely absorbed) |
s_small |
Default Value: 1.E-10 Type: Position (m) Description: Prevent zero-division if distance between frame_a and frame_b is zero |
frame_a |
Type: Frame_a Description: Coordinate system fixed to the component with one cut-force and cut-torque |
|
---|---|---|
frame_b |
Type: Frame_b Description: Coordinate system fixed to the component with one cut-force and cut-torque |
|
distance |
Type: RealOutput Description: Distance between the origin of frame_a and the origin of frame_b |
planarWorld |
Type: PlanarWorld Description: Planar world model |
|
---|---|---|
arrow |
Type: Arrow Description: Visualizing an arrow with variable size; all data have to be set as modifiers (see info layer) |
PlanarMechanics.Examples Power and distance sensor demo |
Developed 2010 at the DLR Institute of System Dynamics and Control