Changeset 1170

Show
Ignore:
Timestamp:
09/29/08 06:54:05 (2 months ago)
Author:
otter
Message:

Bugs in MultiBody.Sensors corrected (reported by Johan Andreasson and by Jakub Tobolar):
- AbsoluteSensor/AbsoluteVelocity: differentiated vectors not in the world frame

but in the resolveInFrame frame.

- RelativeSensor

If resolveInFrame <> frame_resolve and resolveInFrameAfterDifferentiation = frame_resolve,
a translation error occured, since frame_resolve was not enabled in this situation.

- RelativeVelocity

The velocity has been computed by differentiating in the resolveInFrame frame.
This has been corrected, by first transforming the relative position in to frame_a,
differentiating here and then transforming into resolveInFrame

- TransformRelativeVector

The transformation was wrong, since the parameters frame_r_in and frame_r_out have
not been propagated to the submodel that performs the transformation

- The release notes have been updated.

Location:
Modelica/trunk/Modelica
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Modelica/Mechanics/MultiBody/Sensors.mo

    </
    r1091 r1170  
    1 within Modelica.Mechanics.MultiBody; 
     1within Modelica.Mechanics.MultiBody;  
    22package Sensors "Sensors to measure variables" 
     3  extends Modelica.Icons.Library; 
     4 
    35  model AbsoluteSensor 
    46    "Measure absolute kinematic quantities of frame connector" 
     
    5254    extends Modelica.Mechanics.MultiBody.Sensors.Internal.PartialAbsoluteSensor; 
    5355 
    54     Interfaces.Frame_resolve frame_resolve if  
    55           resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 
     56    Interfaces.Frame_resolve frame_resolve if resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 
    5657      "If resolveInFrame = Types.ResolveInFrameA.frame_resolve, the output signals are resolved in this frame" 
    5758       annotation (Placement(transformation( 
     
    6263      "= true, if animation shall be enabled (show arrow)"; 
    6364    parameter Modelica.Mechanics.MultiBody.Types.ResolveInFrameA resolveInFrame 
    64       = 
    65       Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_a 
    66       "Frame in which vectors are resolved before differentiation (1: world, 2: frame_a, 3: frame_resolve)"; 
     65      = Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_a 
     66      "Frame in which vectors are resolved (1: world, 2: frame_a, 3: frame_resolve)"; 
    6767    parameter Boolean get_r=false 
    6868      "= true, to measure the absolute position vector of the origin of frame_a" 
     
    102102      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
    103103 
    104     parameter Modelica.Mechanics.MultiBody.Types.ResolveInFrameA 
    105       resolveInFrameAfterDifferentiation = resolveInFrame 
    106       "Frame in which vectors are resolved after differentiation (1: world, 2: frame_a, 3: frame_resolve)" 
    107       annotation(Dialog(tab="Advanced", group="if get_v or get_a or get_z", enable=get_v or get_a or get_z)); 
    108  
    109     annotation (Diagram(coordinateSystem(preserveAspectRatio=true,  extent={{-100, 
    110               -100},{100,100}}, 
    111           grid={1,1}),  graphics), 
    112                          Icon(coordinateSystem(preserveAspectRatio=true, 
    113             extent={{-100,-100},{100,100}}, 
    114           grid={1,1}), graphics={ 
     104    annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
     105              -100},{100,100}}),                                     graphics), 
     106                         Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
     107              -100},{100,100}}), graphics={ 
    115108          Line( 
    116109            visible=get_r, 
     
    207200<p> 
    208201Via parameter <b>resolveInFrame</b> it is defined, in which frame  
    209 a vector is resolved (before differentiation): 
     202a vector is resolved: 
    210203</p> 
    211204  
     
    239232  
    240233<p> 
    241 Note, derivatives 
    242 of absolute kinematic quantities are always performed with 
    243 respect to the frame, in which the vector to be differentiated 
    244 is resolved. After differentiation, it is possible via parameter 
    245 <b>resolveInFrameAfterDifferentiation</b> (in the \"Advanced\" menu) 
    246 to resolve the differentiated 
    247 vector in another frame. 
     234Velocity, acceleration, angular velocity and angular acceleration are 
     235determined by differentiating them in the world frame and then transforming 
     236them in to the frame defined by <b>resolveInFrame</b>. 
    248237</p> 
    249238<p> 
     
    251240</p> 
    252241<pre> 
    253    r = resolve2(frame_a.R, frame_a.r0); 
    254    v = <b>der</b>(r); 
     242   v0 = <b>der</b>(frame_a.r0); 
     243   v  = resolve2(frame_a.R, v0); 
    255244</pre> 
    256 is returned, i.e., he derivative of the absolute distance from the 
    257 world frame to the origin of frame_a, resolved in frame_a. If  
    258 <b>resolveInFrameAfterDifferentiation</b> = Types.ResolveInFrameA.frame_resolve, then 
    259 v is additionally transformed to: 
    260 </p> 
    261 <pre> 
    262    v = resolveRelative(<b>der</b>(r),frame_a.R, frame_resolve.R); 
    263 </pre> 
    264   
     245is returned, i.e., the derivative of the absolute distance from the 
     246world frame to the origin of frame_a, resolved in frame_a.  
     247</p> 
    265248  
    266249<p> 
     
    305288 
    306289  protected 
    307     AbsolutePosition position(resolveInFrame=resolveInFrame) if  
    308                                                   get_r or get_v or get_a  
     290    AbsolutePosition position(resolveInFrame=resolveInFrame) if get_r  
    309291      annotation (Placement(transformation(extent={{10,10},{-10,30}}, 
    310292          rotation=90, 
    311           origin={-40,0}))); 
    312  
    313     Blocks.Continuous.Der der1[3] if get_v or get_a         annotation (Placement(transformation( 
    314           extent={{-10,-10},{0,0}}, 
     293          origin={-80,-60}))); 
     294 
     295  protected 
     296    AbsoluteVelocity velocity(resolveInFrame=resolveInFrame) if get_v  
     297                                                             annotation ( 
     298        Placement(transformation( 
     299          extent={{10,-10},{-10,10}}, 
     300          rotation=90, 
     301          origin={-60,-60}))); 
     302    Modelica.Mechanics.MultiBody.Sensors.AbsoluteAngles absoluteAngles(sequence= 
     303          sequence, guessAngle1=guessAngle1) if get_angles  
     304      annotation (Placement(transformation(extent={{-10,10},{10,-10}}, 
    315305          rotation=-90, 
    316           origin={-55,-30}))); 
    317     Blocks.Continuous.Der der2[3] if get_a     annotation (Placement(transformation( 
    318           extent={{0,0},{10,10}}, 
    319           rotation=-90, 
    320           origin={-25,-40}))); 
    321     Modelica.Mechanics.MultiBody.Sensors.AbsoluteAngles absoluteAngles( 
    322                                            sequence=sequence, guessAngle1= 
    323           guessAngle1) if                     get_angles  
    324       annotation (Placement(transformation(extent={{-10,-10},{10,10}}, 
    325           rotation=-90, 
    326           origin={20,-14}))); 
    327     AbsoluteAngularVelocity angularVelocity(resolveInFrame=resolveInFrame) if  
    328                                                                 get_w or get_z  
     306          origin={20,-60}))); 
     307    AbsoluteAngularVelocity angularVelocity(resolveInFrame=resolveInFrame) if get_w  
    329308      annotation (Placement(transformation(extent={{-10,-10},{10,-30}}, 
    330309          rotation=-90, 
    331           origin={80,-14}))); 
    332  
    333     Blocks.Continuous.Der der3[3] if get_z     annotation (Placement(transformation( 
    334           extent={{-20,-20},{0,0}}, 
     310          origin={70,-60}))); 
     311 
     312  protected 
     313    Blocks.Continuous.Der der1[3] if get_a                  annotation (Placement( 
     314          transformation( 
     315          extent={{-6,-6},{6,6}}, 
    335316          rotation=-90, 
    336           origin={110,-60}))); 
    337     Internal.ZeroForceAndTorque zeroForce1  
    338       annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); 
    339     Internal.ZeroForceAndTorque zeroForce2 if resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve  
    340       annotation (Placement(transformation(extent={{70,30},{50,50}}))); 
    341  
     317          origin={-20,-34}))); 
     318  protected 
     319    Blocks.Continuous.Der der2[3] if get_z     annotation (Placement( 
     320          transformation( 
     321          extent={{-6,-6},{6,6}}, 
     322          rotation=-90, 
     323          origin={100,-46}))); 
     324 
     325  protected 
    342326    Modelica.Mechanics.MultiBody.Sensors.TansformAbsoluteVector 
    343       transformVector_v(                       frame_r_in=resolveInFrame, 
    344         frame_r_out=resolveInFrameAfterDifferentiation) if get_v  
    345       annotation (Placement(transformation(extent={{-70,-64},{-50,-44}}))); 
     327      transformVector_a( 
     328        frame_r_in=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world, 
     329        frame_r_out=resolveInFrame) if  
     330         get_a  
     331      annotation (Placement(transformation(extent={{-10,-70},{-30,-50}}))); 
    346332    Modelica.Mechanics.MultiBody.Sensors.TansformAbsoluteVector 
    347       transformVector_a(                       frame_r_in=resolveInFrame, 
    348         frame_r_out=resolveInFrameAfterDifferentiation) if get_a  
    349       annotation (Placement(transformation(extent={{-30,-80},{-10,-60}}))); 
    350     Modelica.Mechanics.MultiBody.Sensors.TansformAbsoluteVector 
    351       transformVector_z(                       frame_r_in=resolveInFrame, 
    352         frame_r_out=resolveInFrameAfterDifferentiation) if  
     333      transformVector_z( 
     334        frame_r_in=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world, 
     335        frame_r_out=resolveInFrame) if  
    353336         get_z  
    354       annotation (Placement(transformation(extent={{90,-95},{110,-75}}))); 
    355  
     337      annotation (Placement(transformation(extent={{90,-80},{110,-60}}))); 
     338 
     339  protected 
    356340    outer Modelica.Mechanics.MultiBody.World world; 
    357341 
     
    362346      specularCoefficient) if world.enableAnimation and animation; 
    363347 
     348  protected 
     349    AbsoluteVelocity absoluteVelocity(resolveInFrame=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world) if get_a  
     350      annotation (Placement(transformation( 
     351          extent={{10,-10},{-10,10}}, 
     352          rotation=90, 
     353          origin={-20,-12}))); 
     354    AbsoluteAngularVelocity absoluteAngularVelocity(resolveInFrame=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world) if  
     355         get_z  
     356      annotation (Placement(transformation(extent={{40,-10},{60,10}}, 
     357          rotation=0))); 
     358    Internal.ZeroForceAndTorque zeroForce1  
     359      annotation (Placement(transformation(extent={{-60,20},{-40,40}}))); 
     360    Internal.ZeroForceAndTorque zeroForce2 if resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve  
     361      annotation (Placement(transformation(extent={{80,20},{60,40}}))); 
    364362  equation 
    365363    connect(zeroForce1.frame_a, frame_a)  
    366364                                    annotation (Line( 
    367         points={{-80,40},{-90,40},{-90,0},{-100,0}}, 
    368         color={95,95,95}, 
    369         thickness=0.5, 
    370         smooth=Smooth.None)); 
    371     connect(der2.u, der1.y) annotation (Line( 
    372         points={{-20,-39},{-20,-35},{-60,-35},{-60,-30.5}}, 
    373         color={0,0,127}, 
     365        points={{-60,30},{-80,30},{-80,0},{-100,0}}, 
     366        color={95,95,95}, 
     367        thickness=0.5, 
    374368        smooth=Smooth.None)); 
    375369    connect(absoluteAngles.angles, angles) annotation (Line( 
    376         points={{20,-25},{20,-67.5},{20,-67.5},{20,-110}}, 
     370        points={{20,-71},{20,-90},{20,-90},{20,-110}}, 
    377371        color={0,0,127}, 
    378372        smooth=Smooth.None)); 
    379373    connect(angularVelocity.frame_a, frame_a)         annotation (Line( 
    380         points={{60,-4},{60,20},{-90,20},{-90,0},{-100,0}}, 
     374        points={{50,-50},{50,-40},{20,-40},{20,0},{-100,0}}, 
    381375        color={95,95,95}, 
    382376        thickness=0.5, 
    383377        smooth=Smooth.None)); 
    384378    connect(angularVelocity.w, w)                 annotation (Line( 
    385         points={{60,-25},{60,-110}}, 
    386         color={0,0,127}, 
    387         smooth=Smooth.None)); 
    388     connect(angularVelocity.w, der3.u)             annotation (Line( 
    389         points={{60,-25},{60,-30},{100,-30},{100,-38}}, 
    390         color={0,0,127}, 
    391         smooth=Smooth.None)); 
    392     connect(der1.y, transformVector_v.r_in)  
    393                                           annotation (Line( 
    394         points={{-60,-30.5},{-60,-42}}, 
    395         color={0,0,127}, 
    396         smooth=Smooth.None)); 
    397     connect(transformVector_v.r_out, v)   annotation (Line( 
    398         points={{-60,-65},{-60,-110}}, 
    399         color={0,0,127}, 
    400         smooth=Smooth.None)); 
    401     connect(transformVector_v.frame_a, frame_a)  
    402                                               annotation (Line( 
    403         points={{-70,-54},{-90,-54},{-90,0},{-100,0}}, 
    404         color={95,95,95}, 
    405         thickness=0.5, 
    406         smooth=Smooth.None)); 
    407     connect(transformVector_v.frame_resolve, frame_resolve)  
    408                                                           annotation (Line( 
    409         points={{-50,-53.9},{-47,-53.9},{-47,-54},{-41,-54},{-41,0},{100,0}}, 
     379        points={{50,-71},{50,-94},{60,-94},{60,-110}}, 
     380        color={0,0,127}, 
     381        smooth=Smooth.None)); 
     382    connect(frame_resolve, position.frame_resolve)         annotation (Line( 
     383        points={{100,0},{114,0},{114,-90},{-80,-90},{-80,-60},{-89.9,-60}}, 
    410384        color={95,95,95}, 
    411385        pattern=LinePattern.Dot, 
    412386        smooth=Smooth.None)); 
    413     connect(frame_resolve, position.frame_resolve)         annotation (Line( 
    414         points={{100,0},{-50,0},{-50,-6.18447e-016},{-49.9,-6.18447e-016}}, 
    415         color={95,95,95}, 
    416         pattern=LinePattern.Dot, 
    417         smooth=Smooth.None)); 
    418387    connect(frame_resolve,zeroForce2. frame_a) annotation (Line( 
    419         points={{100,0},{80,0},{80,40},{70,40}}, 
     388        points={{100,0},{90,0},{90,30},{80,30}}, 
    420389        color={95,95,95}, 
    421390        pattern=LinePattern.Dot, 
     
    423392    connect(angularVelocity.frame_resolve, frame_resolve)         annotation ( 
    424393        Line( 
    425         points={{70.1,-14},{80,-14},{80,0},{100,0}}, 
     394        points={{60.1,-60},{66,-60},{66,-90},{114,-90},{114,0},{100,0}}, 
    426395        color={95,95,95}, 
    427396        pattern=LinePattern.Dot, 
    428397        smooth=Smooth.None)); 
    429     connect(der2.y, transformVector_a.r_in)      annotation (Line( 
    430         points={{-20,-50.5},{-20,-58}}, 
    431         color={0,0,127}, 
    432         smooth=Smooth.None)); 
    433     connect(transformVector_a.frame_a, frame_a)      annotation (Line( 
    434         points={{-30,-70},{-90,-70},{-90,0},{-100,0}}, 
     398    connect(transformVector_a.frame_a, frame_a) annotation (Line( 
     399        points={{-10,-60},{0,-60},{0,-40},{20,-40},{20,0},{-100,0}}, 
    435400        color={95,95,95}, 
    436401        thickness=0.5, 
    437402        smooth=Smooth.None)); 
    438403    connect(transformVector_a.frame_resolve, frame_resolve)      annotation (Line( 
    439         points={{-10,-69.9},{-10,-70},{-1,-70},{-1,0},{100,0}}, 
     404        points={{-30,-59.9},{-40,-59.9},{-40,-90},{114,-90},{114,0},{100,0}}, 
    440405        color={95,95,95}, 
    441406        pattern=LinePattern.Dot, 
    442407        smooth=Smooth.None)); 
    443408    connect(transformVector_a.r_out, a)          annotation (Line( 
    444         points={{-20,-81},{-20,-110}}, 
    445         color={0,0,127}, 
    446         smooth=Smooth.None)); 
    447     connect(der3.y, transformVector_z.r_in)     annotation (Line( 
    448         points={{100,-61},{100,-73}}, 
     409        points={{-20,-71},{-20,-110}}, 
     410        color={0,0,127}, 
     411        smooth=Smooth.None)); 
     412    connect(der2.y, transformVector_z.r_in)     annotation (Line( 
     413        points={{100,-52.6},{100,-58}}, 
    449414        color={0,0,127}, 
    450415        smooth=Smooth.None)); 
    451416    connect(transformVector_z.r_out, z)         annotation (Line( 
    452         points={{100,-96},{100,-110}}, 
     417        points={{100,-81},{100,-110}}, 
    453418        color={0,0,127}, 
    454419        smooth=Smooth.None)); 
    455420    connect(transformVector_z.frame_a, frame_a)     annotation (Line( 
    456         points={{90,-85},{-90,-85},{-90,0},{-100,0}}, 
     421        points={{90,-70},{80,-70},{80,-40},{20,-40},{20,0},{-100,0}}, 
    457422        color={95,95,95}, 
    458423        thickness=0.5, 
    459424        smooth=Smooth.None)); 
    460425    connect(transformVector_z.frame_resolve, frame_resolve)     annotation (Line( 
    461         points={{110,-84.9},{120,-84.9},{120,0},{100,0}}, 
     426        points={{110,-69.9},{110,-70},{114,-70},{114,0},{100,0}}, 
    462427        color={95,95,95}, 
    463428        pattern=LinePattern.Dot, 
    464429        smooth=Smooth.None)); 
    465430    connect(frame_a, position.frame_a)         annotation (Line( 
    466         points={{-100,0},{-90,0},{-90,20},{-60,20},{-60,10}}, 
    467         color={95,95,95}, 
    468         thickness=0.5, 
    469         smooth=Smooth.None)); 
    470     connect(position.r, der1.u)         annotation (Line( 
    471         points={{-60,-11},{-60,-19}}, 
    472         color={0,0,127}, 
     431        points={{-100,0},{-80,0},{-80,-40},{-100,-40},{-100,-50}}, 
     432        color={95,95,95}, 
     433        thickness=0.5, 
    473434        smooth=Smooth.None)); 
    474435    connect(absoluteAngles.frame_a, frame_a) annotation (Line( 
    475         points={{20,-4},{20,20},{-90,20},{-90,0},{-100,0}}, 
     436        points={{20,-50},{20,0},{-100,0}}, 
    476437        color={95,95,95}, 
    477438        thickness=0.5, 
    478439        smooth=Smooth.None)); 
    479440    connect(position.r, r)         annotation (Line( 
    480         points={{-60,-11},{-60,-15},{-100,-15},{-100,-110}}, 
     441        points={{-100,-71},{-100,-110}}, 
     442        color={0,0,127}, 
     443        smooth=Smooth.None)); 
     444    connect(velocity.frame_a, frame_a) annotation (Line( 
     445        points={{-60,-50},{-60,-40},{-80,-40},{-80,0},{-100,0}}, 
     446        color={95,95,95}, 
     447        thickness=0.5, 
     448        smooth=Smooth.None)); 
     449    connect(velocity.frame_resolve, frame_resolve) annotation (Line( 
     450        points={{-50,-60},{-40,-60},{-40,-90},{114,-90},{114,0},{100,0}}, 
     451        color={95,95,95}, 
     452        pattern=LinePattern.Dot, 
     453        smooth=Smooth.None)); 
     454    connect(velocity.v, v) annotation (Line( 
     455        points={{-60,-71},{-60,-110}}, 
     456        color={0,0,127}, 
     457        smooth=Smooth.None)); 
     458    connect(der1.y, transformVector_a.r_in) annotation (Line( 
     459        points={{-20,-40.6},{-20,-48}}, 
     460        color={0,0,127}, 
     461        smooth=Smooth.None)); 
     462    connect(absoluteVelocity.v, der1.u) annotation (Line( 
     463        points={{-20,-23},{-20,-26.8}}, 
     464        color={0,0,127}, 
     465        smooth=Smooth.None)); 
     466    connect(absoluteVelocity.frame_a, frame_a) annotation (Line( 
     467        points={{-20,-2},{-20,0},{-100,0}}, 
     468        color={95,95,95}, 
     469        thickness=0.5, 
     470        smooth=Smooth.None)); 
     471    connect(absoluteAngularVelocity.frame_a, frame_a) annotation (Line( 
     472        points={{40,0},{-100,0}}, 
     473        color={95,95,95}, 
     474        thickness=0.5, 
     475        smooth=Smooth.None)); 
     476    connect(absoluteAngularVelocity.w, der2.u) annotation (Line( 
     477        points={{61,0},{80,0},{80,-30},{100,-30},{100,-38.8}}, 
    481478        color={0,0,127}, 
    482479        smooth=Smooth.None)); 
    483480  end AbsoluteSensor; 
    484  
    485   extends Modelica.Icons.Library; 
    486481 
    487482  model RelativeSensor 
     
    492487 
    493488    Interfaces.Frame_resolve frame_resolve if  
    494           resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_resolve 
     489          resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_resolve or  
     490          resolveInFrameAfterDifferentiation == Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_resolve 
    495491      "If resolveInFrame = Types.ResolveInFrameAB.frame_resolve, the output signals are resolved in this frame" 
    496492       annotation (Placement(transformation( 
     
    626622            color={0,0,127}, 
    627623            smooth=Smooth.None), 
    628           Line( 
    629             points={{95,80},{50,80},{50,49}}, 
    630             color={0,0,0}, 
    631             pattern=LinePattern.Dot, 
    632             smooth=Smooth.None), 
    633624          Text( 
    634625            extent={{-132,90},{129,138}}, 
     
    792783      annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); 
    793784 
     785  protected 
    794786    Blocks.Continuous.Der der1[3] if get_v_rel or get_a_rel annotation (Placement(transformation( 
    795787          extent={{-10,-10},{0,0}}, 
     
    808800      annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); 
    809801 
     802  protected 
    810803    Blocks.Continuous.Der der3[3] if get_z_rel annotation (Placement(transformation( 
    811804          extent={{-10,-10},{0,0}}, 
     
    819812      annotation (Placement(transformation(extent={{70,50},{50,70}}))); 
    820813 
     814  protected 
    821815    Modelica.Mechanics.MultiBody.Sensors.TansformRelativeVector 
    822816      transformVector_v_rel(                       frame_r_in=resolveInFrame, 
     
    833827      annotation (Placement(transformation(extent={{90,-95},{110,-75}}))); 
    834828 
     829  protected 
    835830    outer Modelica.Mechanics.MultiBody.World world; 
    836831 
     
    932927    connect(transformVector_v_rel.frame_resolve, frame_resolve)  
    933928                                                          annotation (Line( 
    934         points={{-50,-45.9},{-47,-45.9},{-47,-46},{-42,-46},{-42,80},{100,80}}, 
     929        points={{-50,-45.9},{-47,-45.9},{-47,-47},{-42,-47},{-42,80},{100,80}}, 
    935930        color={95,95,95}, 
    936931        pattern=LinePattern.Dot, 
     
    11321127          origin={110,0}))); 
    11331128 
    1134     Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve if resolveInFrame == 
    1135       Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 
     1129    Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve if  
     1130      resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve 
    11361131      "Coordinate system in which output vector v is optionally resolved"  
    11371132      annotation (Placement(transformation(extent={{-16,-16},{16,16}}, 
     
    11431138 
    11441139    parameter Modelica.Mechanics.MultiBody.Types.ResolveInFrameA resolveInFrame 
    1145       = 
    1146     Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_a 
     1140      = Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_a 
    11471141      "Frame in which output vector v shall be resolved (1: world, 2: frame_a, 3: frame_resolve)"; 
    11481142 
    1149   protected 
    1150     Internal.BasicAbsolutePosition position(resolveInFrame=resolveInFrame)  
    1151       annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); 
    1152  
    11531143    annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
    1154               -100},{100,100}}, 
    1155           grid={1,1}),           graphics), Icon(coordinateSystem( 
    1156             preserveAspectRatio=true,  extent={{-100,-100},{100,100}}, 
    1157           grid={1,1}), graphics={ 
     1144              -100},{100,100}}),                                              graphics), Icon(coordinateSystem( 
     1145            preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics 
     1146          ={ 
    11581147          Line( 
    11591148            points={{70,0},{100,0}}, 
     
    12131202  
    12141203<pre> 
    1215     r = MultiBody.Frames.resolve2(frame_a.R, frame_a.r_0); 
    1216     v = der(r); 
     1204    v0 = der(frame_a.r_0); 
     1205    v  = MultiBody.Frames.resolve2(frame_a.R, v0); 
    12171206</pre> 
    12181207  
    12191208</html>")); 
    1220     Modelica.Mechanics.MultiBody.Interfaces.ZeroPosition zeroPosition if  
    1221       not (resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve)  
    1222       annotation (Placement(transformation(extent={{20,-50},{40,-30}}))); 
    1223  
     1209 
     1210  protected 
     1211    Internal.BasicAbsolutePosition position(resolveInFrame=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world)  
     1212      annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); 
    12241213    Blocks.Continuous.Der der1[3]                           annotation (Placement(transformation( 
    12251214          extent={{-20,-20},{0,0}}, 
    12261215          rotation=0, 
    1227           origin={60,10}))); 
     1216          origin={10,10}))); 
     1217    TansformAbsoluteVector tansformAbsoluteVector( 
     1218      frame_r_in=Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.world, 
     1219        frame_r_out=resolveInFrame) annotation (Placement(transformation( 
     1220          extent={{10,-10},{-10,10}}, 
     1221          rotation=90, 
     1222          origin={50,0}))); 
     1223    Modelica.Mechanics.MultiBody.Interfaces.ZeroPosition zeroPosition  
     1224      annotation (Placement(transformation(extent={{-60,-60},{-80,-40}}))); 
     1225    Modelica.Mechanics.MultiBody.Interfaces.ZeroPosition zeroPosition1 if  
     1226         not ( 
     1227      resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrameA.frame_resolve)  
     1228      annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); 
    12281229  equation 
    1229     connect(position.frame_resolve, frame_resolve)         annotation (Line( 
    1230         points={{0,-10},{0,-100}}, 
     1230    connect(position.r, der1.u) annotation (Line( 
     1231        points={{-39,0},{-12,0}}, 
     1232        color={0,0,127}, 
     1233        smooth=Smooth.None)); 
     1234    connect(position.frame_a, frame_a) annotation (Line( 
     1235        points={{-60,0},{-100,0}}, 
     1236        color={95,95,95}, 
     1237        thickness=0.5, 
     1238        smooth=Smooth.None)); 
     1239    connect(der1.y, tansformAbsoluteVector.r_in) annotation (Line( 
     1240        points={{11,0},{19.5,0},{19.5,7.34788e-016},{38,7.34788e-016}}, 
     1241        color={0,0,127}, 
     1242        smooth=Smooth.None)); 
     1243    connect(tansformAbsoluteVector.r_out, v) annotation (Line( 
     1244        points={{61,-6.73556e-016},{71.5,-6.73556e-016},{71.5,0},{110,0}}, 
     1245        color={0,0,127}, 
     1246        smooth=Smooth.None)); 
     1247    connect(zeroPosition.frame_resolve, position.frame_resolve) annotation (Line( 
     1248        points={{-60,-50},{-50,-50},{-50,-10}}, 
    12311249        color={95,95,95}, 
    12321250        pattern=LinePattern.Dot, 
    12331251        smooth=Smooth.None)); 
    1234     connect(zeroPosition.frame_resolve, position.frame_resolve)  
     1252    connect(tansformAbsoluteVector.frame_a, frame_a) annotation (Line( 
     1253        points={{50,10},{50,20},{-70,20},{-70,0},{-100,0}}, 
     1254        color={95,95,95}, 
     1255        thickness=0.5, 
     1256        smooth=Smooth.None)); 
     1257    connect(tansformAbsoluteVector.frame_resolve, zeroPosition1.frame_resolve)  
    12351258      annotation (Line( 
    1236         points={{20,-40},{0,-40},{0,-10}}, 
     1259        points={{49.9,-10},{50,-10},{50,-50},{60,-50}}, 
    12371260        color={95,95,95}, 
    12381261        pattern=LinePattern.Dot, 
    12391262        smooth=Smooth.None)); 
    1240     connect(der1.y, v)     annotation (Line( 
    1241         points={{61,0},{110,0}}, 
    1242         color={0,0,127}, 
    1243         smooth=Smooth.None)); 
    1244     connect(position.r, der1.u) annotation (Line( 
    1245         points={{11,0},{38,0}}, 
    1246         color={0,0,127}, 
    1247         smooth=Smooth.None)); 
    1248     connect(position.frame_a, frame_a) annotation (Line( 
    1249         points={{-10,0},{-100,0}}, 
    1250         color={95,95,95}, 
    1251         thickness=0.5, 
     1263    connect(tansformAbsoluteVector.frame_resolve, frame_resolve) annotation (Line( 
     1264        points={{49.9,-10},{50,-10},{50,-50},{0,-50},{0,-100}}, 
     1265        color={95,95,95}, 
     1266        pattern=LinePattern.Dot, 
    12521267        smooth=Smooth.None)); 
    12531268  end AbsoluteVelocity; 
     
    15851600    "Measure relative velocity vector between the origins of two frame connectors" 
    15861601    extends Internal.PartialRelativeSensor; 
    1587     Blocks.Interfaces.RealOutput v_rel[3](each final quantity="Velocity", each 
     1602    Modelica.Blocks.Interfaces.RealOutput v_rel[3](each final quantity="Velocity", each 
    15881603        final unit =                                                                        "m/s") 
    15891604      "Relative velocity vector resolved in frame defined by resolveInFrame"  
     
    16031618    Modelica.Mechanics.MultiBody.Types.ResolveInFrameAB.frame_a 
    16041619      "Frame in which output vector v_rel shall be resolved (1: world, 2: frame_a, 3: frame_b, 4: frame_resolve)"; 
    1605  
    1606   protected 
    1607     Internal.BasicRelativePosition relativePosition(resolveInFrame=resolveInFrame)  
    1608       annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); 
    16091620 
    16101621    annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
     
    16241635            extent={{18,-80},{102,-110}}, 
    16251636            lineColor={0,0,0}, 
    1626             textString="r_rel")}), 
     1637            textString="v_rel")}), 
    16271638      Documentation(info="<html> 
    16281639<p> 
    16291640The relative velocity vector between the origins of frame_a and of frame_b are