Changeset 839

Show
Ignore:
Timestamp:
11/18/07 23:17:58 (13 months ago)
Author:
otter
Message:

fixes ticket:3
- Changed implementation of MultiBody.Sensors.CutForce/CutTorque/CutForceAndTorque

in order to removed cardinality().

- Moved MultiBody.Interfaces.PartialCutForceSensor to ObsoleteModelica3.

Location:
Modelica/trunk/Modelica/Mechanics/MultiBody
Files:
2 modified

Legend:

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

    r755 r839  
    406406            lineColor={128,128,128},  
    407407            textString="b")}, 
    408            coordinateSystem(extent={{-200,-200},{200,200}}, preserveAspectRatio 
    409             =false)), 
     408           coordinateSystem(extent={{-200,-200},{200,200}}, preserveAspectRatio=false)), 
    410409      Documentation(info="<HTML> 
    411410<p> 
     
    741740          preserveAspectRatio=true, 
    742741          extent={{-100,-100},{100,100}}, 
    743           grid={1,1}), graphics={Line(points={{-70,0},{-100,0}}, color={0,0,0}), 
     742          grid={1,1}), graphics={Line(points={{-70,0},{-100,0}}, color={0,0,0}),  
    744743            Line(points={{70,0},{100,0}}, color={0,0,255})})); 
    745744  equation  
     
    804803          extent={{-100,-100},{100,100}}, 
    805804          grid={1,1}), graphics={ 
    806           Line(points={{-70,0},{-100,0}}, color={0,0,0}), 
    807           Line(points={{70,0},{100,0}}, color={0,0,0}), 
     805          Line(points={{-70,0},{-100,0}}, color={0,0,0}),  
     806          Line(points={{70,0},{100,0}}, color={0,0,0}),  
    808807          Line(points={{0,-100},{0,-70}}, color={0,0,127})})); 
    809808  equation  
     
    816815  end PartialRelativeSensor; 
    817816   
    818   partial model PartialCutForceSensor  
    819     "Base model to measure the cut force and/or torque between two frames"  
    820      
    821     extends Modelica.Icons.RotationalSensor; 
    822     Interfaces.Frame_a frame_a  
    823       "Coordinate system with one cut-force and cut-torque"                          annotation (Placement( 
    824           transformation(extent={{-116,-16},{-84,16}}, rotation=0))); 
    825     Interfaces.Frame_b frame_b  
    826       "Coordinate system with one cut-force and cut-torque"                          annotation (Placement( 
    827           transformation(extent={{84,-16},{116,16}}, rotation=0))); 
    828     Interfaces.Frame_resolve frame_resolve  
    829       "If connected, the output signals are resolved in this frame (cut-force/-torque are set to zero)" 
    830       annotation (Placement(transformation( 
    831           origin={80,-100}, 
    832           extent={{-16,-16},{16,16}}, 
    833           rotation=270))); 
    834      
    835     annotation ( 
    836       Window( 
    837         x=0.37, 
    838         y=0.02, 
    839         width=0.6, 
    840         height=0.65), 
    841       Documentation(info=" 
    842 <HTML> 
    843 <p> 
    844 This is a base class for 3-dim. mechanical components with two frames 
    845 and one output port in order to measure the cut-force and/or 
    846 cut-torque acting between the two frames and 
    847 to provide the measured signals as output for further processing 
    848 with the blocks of package Modelica.Blocks. 
    849 </p> 
    850 </HTML> 
    851 "),   Icon(coordinateSystem( 
    852           preserveAspectRatio=true, 
    853           extent={{-100,-100},{100,100}}, 
    854           grid={1,1}), graphics={ 
    855           Line(points={{-70,0},{-101,0}}, color={0,0,0}),  
    856           Line(points={{70,0},{100,0}}, color={0,0,0}),  
    857           Line(points={{-80,-100},{-80,0}}, color={0,0,127}),  
    858           Text( 
    859             extent={{-132,76},{129,124}},  
    860             textString="%name",  
    861             lineColor={0,0,255}),  
    862           Text( 
    863             extent={{-118,55},{-82,30}},  
    864             lineColor={128,128,128},  
    865             textString="a"),  
    866           Text( 
    867             extent={{83,55},{119,30}},  
    868             lineColor={128,128,128},  
    869             textString="b"),  
    870           Text( 
    871             extent={{-31,-72},{100,-97}},  
    872             lineColor={192,192,192},  
    873             textString="resolve"),  
    874           Line( 
    875             points={{80,0},{80,-100}},  
    876             color={95,95,95},  
    877             pattern=LinePattern.Dot)}), 
    878       Diagram(coordinateSystem( 
    879           preserveAspectRatio=true, 
    880           extent={{-100,-100},{100,100}}, 
    881           grid={1,1}), graphics={ 
    882           Line(points={{-70,0},{-100,0}}, color={0,0,0}), 
    883           Line(points={{70,0},{100,0}}, color={0,0,0}), 
    884           Line(points={{-80,-100},{-80,0}}, color={0,0,127}), 
    885           Line( 
    886             points={{80,0},{80,-100}}, 
    887             color={95,95,95}, 
    888             pattern=LinePattern.Dot)})); 
    889      
    890   protected  
    891     outer Modelica.Mechanics.MultiBody.World world; 
    892   equation  
    893     defineBranch(frame_a.R, frame_b.R); 
    894     assert(cardinality(frame_a) > 0, 
    895       "Connector frame_a of cut-force/-torque sensor object is not connected"); 
    896     assert(cardinality(frame_b) > 0, 
    897       "Connector frame_b of cut-force/-torque sensor object is not connected"); 
    898      
    899     // frame_a and frame_b are identical 
    900     frame_a.r_0 = frame_b.r_0; 
    901     frame_a.R = frame_b.R; 
    902      
    903     // force and torque balance 
    904     zeros(3) = frame_a.f + frame_b.f; 
    905     zeros(3) = frame_a.t + frame_b.t; 
    906      
    907     // deduce cut-force 
    908     if cardinality(frame_resolve) == 1 then 
    909       // frame_resolve is connected 
    910       frame_resolve.f = zeros(3); 
    911       frame_resolve.t = zeros(3); 
    912     else 
    913       // frame_resolve is NOT connected 
    914       frame_resolve.r_0 = zeros(3); 
    915       frame_resolve.R = Frames.nullRotation(); 
    916     end if; 
    917   end PartialCutForceSensor; 
    918817   
    919818  partial model PartialVisualizer  
  • Modelica/trunk/Modelica/Mechanics/MultiBody/Sensors.mo

    r833 r839  
    13541354      annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); 
    13551355    annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-100, 
    1356               -100},{100,100}},  
     1356              -100},{100,100}}, 
    13571357          grid={1,1}),           graphics), Icon(coordinateSystem( 
    1358             preserveAspectRatio=false, extent={{-100,-100},{100,100}},  
     1358            preserveAspectRatio=false, extent={{-100,-100},{100,100}}, 
    13591359          grid={1,1}), graphics={ 
    13601360          Line( 
     
    19661966      Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 
    19671967              100,100}}), graphics={ 
    1968           Line(points={{-70,0},{-101,0}}, color={0,0,0}),  
    1969           Line(points={{70,0},{100,0}}, color={0,0,0}),  
    1970           Line(points={{0,-60},{0,-100}}, color={0,0,255}),  
    1971           Text( 
    1972             extent={{-22,70},{20,46}},  
    1973             textString="s",  
    1974             lineColor={0,0,255}),  
    1975           Line(points={{-98,40},{88,40}}, color={0,0,255}),  
     1968          Line(points={{-70,0},{-101,0}}, color={0,0,0}), 
     1969          Line(points={{70,0},{100,0}}, color={0,0,0}), 
     1970          Line(points={{0,-60},{0,-100}}, color={0,0,255}), 
     1971          Text( 
     1972            extent={{-22,70},{20,46}}, 
     1973            textString="s", 
     1974            lineColor={0,0,255}), 
     1975          Line(points={{-98,40},{88,40}}, color={0,0,255}), 
    19761976          Polygon( 
    1977             points={{102,40},{87,46},{87,34},{102,40}},  
    1978             lineColor={0,0,255},  
    1979             fillColor={0,0,255},  
     1977            points={{102,40},{87,46},{87,34},{102,40}}, 
     1978            lineColor={0,0,255}, 
     1979            fillColor={0,0,255}, 
    19801980            fillPattern=FillPattern.Solid)}), 
    19811981      Documentation(info="<HTML> 
     
    20312031     
    20322032    import SI = Modelica.SIunits; 
    2033     import Modelica.Mechanics.MultiBody.Types; 
    2034      
    2035     extends Modelica.Mechanics.MultiBody.Interfaces.PartialCutForceSensor; 
     2033     
    20362034    Modelica.Blocks.Interfaces.RealOutput force[3]  
    2037       "Cut force resolved in frame_a/frame_b or in frame_resolved, if connected" 
     2035      "Cut force resolved in frame defined by resolveInFrame"  
    20382036         annotation (Placement(transformation( 
    20392037          origin={-80,-110}, 
     
    20452043    parameter Boolean positiveSign=true  
    20462044      "= true, if force with positive sign is returned (= frame_a.f), otherwise with negative sign (= frame_b.f)"; 
    2047     parameter Boolean resolveInFrame_a=true  
    2048       "= true, if force is resolved in frame_a/frame_b, otherwise in the world frame (if connector frame_resolve is connected, the force is resolved in frame_resolve)"; 
     2045     
    20492046    input Real N_to_m(unit="N/m") = 1000  
    20502047      " Force arrow scaling (length = force/N_to_m)"  
     
    20592056      annotation (Dialog(group="if animation = true", enable=animation)); 
    20602057     
     2058    extends Modelica.Mechanics.MultiBody.Sensors.Internal.PartialCutForceSensor; 
     2059     
    20612060    annotation ( 
    2062       preferedView="info", 
    20632061      Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, 
    20642062              100}}), graphics={Text( 
    20652063            extent={{-190,-70},{-74,-96}},  
    2066             lineColor={192,192,192},  
    2067             textString="force")}), 
    2068       Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 
     2064            lineColor={0,0,0},  
     2065            textString="force"), Line(points={{-80,-100},{-80,0}}, color={0,0, 
     2066                127})}), 
     2067      Diagram(coordinateSystem(preserveAspectRatio=true,  extent={{-100,-100},{ 
    20692068              100,100}}), 
    20702069              graphics), 
    20712070      Documentation(info="<HTML> 
    20722071<p> 
    2073 The cut-force acting at the component to which frame_b is 
    2074 connected is determined and provided at the output signal connector  
     2072The cut-force acting between the two frames to which this 
     2073model is connected, is determined and provided at the output signal connector  
    20752074<b>force</b> (= frame_a.f). If parameter <b>positiveSign</b> = 
    20762075<b>false</b>, the negative cut-force is provided (= frame_b.f). 
    2077 If <b>frame_resolve</b> is connected to another frame, then the 
    2078 cut-force is resolved in frame_resolve. 
    2079 If <b>frame_resolve</b> is <b>not</b> connected then the 
    2080 coordinate system in which the cut-force is resolved 
    2081 is defined by parameter <b>resolveInFrame_a</b>. 
    2082 If this parameter is <b>true</b>, then the 
    2083 cut-force is resolved in frame_a, otherwise it is 
    2084 resolved in the world frame. 
    2085 </p> 
     2076 
     2077<p> 
     2078Via parameter <b>resolveInFrame</b> it is defined, in which frame  
     2079the force vector is resolved: 
     2080</p> 
     2081  
     2082<table border=1 cellspacing=0 cellpadding=2> 
     2083<tr><th><b>resolveInFrame =<br>Types.ResolveInFrame2.</b></th><th><b>Meaning</b></th></tr> 
     2084<tr><td valign=\"top\">world</td> 
     2085    <td valign=\"top\">Resolve vector in world frame</td></tr> 
     2086  
     2087<tr><td valign=\"top\">frame_a</td> 
     2088    <td valign=\"top\">Resolve vector in frame_a</td></tr> 
     2089  
     2090<tr><td valign=\"top\">frame_b</td> 
     2091    <td valign=\"top\">Resolve vector in frame_b</td></tr> 
     2092  
     2093<tr><td valign=\"top\">frame_resolve</td> 
     2094    <td valign=\"top\">Resolve vector in frame_resolve</td></tr> 
     2095</table> 
     2096  
     2097<p> 
     2098If resolveInFrame = Types.ResolveInFrame2.frame_resolve, the conditional connector 
     2099\"frame_resolve\" is enabled and output force is resolved in the frame, to 
     2100which frame_resolve is connected. Note, if this connector is enabled, it must 
     2101be connected. 
     2102</p> 
     2103 
    20862104<p> 
    20872105In the following figure the animation of a CutForce 
     
    20952113</HTML>")); 
    20962114  protected  
    2097     outer Modelica.Mechanics.MultiBody.World world; 
    20982115    SI.Position f_in_m[3]=frame_a.f*(if positiveSign then +1 else -1)/N_to_m  
    20992116      "Force mapped from N to m for animation"; 
     
    21062123      r_tail=f_in_m, 
    21072124      r_head=-f_in_m) if world.enableAnimation and animation; 
     2125     
     2126    Internal.BasicCutForce cutForce(resolveInFrame=resolveInFrame, positiveSign= 
     2127          positiveSign)  
     2128      annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); 
     2129    Internal.ZeroPosition zeroPosition if  
     2130      not (resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrame2.frame_resolve)  
     2131      annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); 
    21082132  equation  
    2109     if cardinality(frame_resolve) == 1 then 
    2110       force = Frames.resolve2(frame_resolve.R, Frames.resolve1(frame_a.R, 
    2111         frame_a.f))*(if positiveSign then +1 else -1); 
    2112     elseif resolveInFrame_a then 
    2113       force = frame_a.f*(if positiveSign then +1 else -1); 
    2114     else 
    2115       force = Frames.resolve1(frame_a.R, frame_a.f)*(if positiveSign then +1 else  
    2116               -1); 
    2117     end if; 
     2133    connect(cutForce.frame_a, frame_a)      annotation (Line( 
     2134        points={{-50,0},{-100,0}}, 
     2135        color={95,95,95}, 
     2136        thickness=2, 
     2137        smooth=Smooth.None)); 
     2138    connect(cutForce.frame_b, frame_b)      annotation (Line( 
     2139        points={{-30,0},{100,0}}, 
     2140        color={95,95,95}, 
     2141        thickness=2, 
     2142        smooth=Smooth.None)); 
     2143    connect(cutForce.frame_resolve, frame_resolve)      annotation (Line( 
     2144        points={{-32,-10},{-32,-60},{80,-60},{80,-100}}, 
     2145        color={95,95,95}, 
     2146        pattern=LinePattern.Dot, 
     2147        smooth=Smooth.None)); 
     2148    connect(cutForce.force, force)      annotation (Line( 
     2149        points={{-48,-11},{-48,-60},{-80,-60},{-80,-110}}, 
     2150        color={0,0,127}, 
     2151        smooth=Smooth.None)); 
     2152    connect(zeroPosition.frame_resolve, cutForce.frame_resolve)      annotation ( 
     2153        Line( 
     2154        points={{0,-30},{-32,-30},{-32,-10}}, 
     2155        color={95,95,95}, 
     2156        pattern=LinePattern.Dot, 
     2157        smooth=Smooth.None)); 
    21182158  end CutForce; 
    21192159   
     
    21212161     
    21222162    import SI = Modelica.SIunits; 
    2123     import Modelica.Mechanics.MultiBody.Types; 
    2124      
    2125     extends Modelica.Mechanics.MultiBody.Interfaces.PartialCutForceSensor; 
     2163     
    21262164    Modelica.Blocks.Interfaces.RealOutput torque[3]  
    2127       "Cut torque resolved in frame_a/frame_b or in frame_resolved, if connected" 
     2165      "Cut torque resolved in frame defined by resolveInFrame"  
    21282166         annotation (Placement(transformation( 
    21292167          origin={-80,-110}, 
     
    21352173    parameter Boolean positiveSign=true  
    21362174      "= true, if torque with positive sign is returned (= frame_a.t), otherwise with negative sign (= frame_b.t)"; 
    2137     parameter Boolean resolveInFrame_a=true  
    2138       "= true, if torque is resolved in frame_a/frame_b, otherwise in the world frame (if connector frame_resolve is connected, the torque is resolved in frame_resolve)"; 
    21392175    input Real Nm_to_m(unit="N.m/m") = 1000  
    2140       " Torque arrow scaling (length = torque/Nm_to_m)"  
     2176      "Torque arrow scaling (length = torque/Nm_to_m)"  
    21412177      annotation (Dialog(group="if animation = true", enable=animation)); 
    21422178    input SI.Diameter torqueDiameter=world.defaultArrowDiameter  
    2143       " Diameter of torque arrow" annotation (Dialog(group="if animation = true", enable=animation)); 
     2179      "Diameter of torque arrow" annotation (Dialog(group="if animation = true", enable=animation)); 
    21442180    input Types.Color torqueColor=Modelica.Mechanics.MultiBody.Types.Defaults.TorqueColor  
    2145       " Color of torque arrow"  
     2181      "Color of torque arrow"  
    21462182      annotation (Dialog(group="if animation = true", enable=animation)); 
    21472183    input Types.SpecularCoefficient specularCoefficient = world.defaultSpecularCoefficient  
     
    21492185      annotation (Dialog(group="if animation = true", enable=animation)); 
    21502186     
     2187    extends Modelica.Mechanics.MultiBody.Sensors.Internal.PartialCutForceSensor; 
     2188     
    21512189    annotation ( 
    2152       preferedView="info", 
    2153       Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, 
     2190      Icon(coordinateSystem(preserveAspectRatio=true,  extent={{-100,-100},{100, 
    21542191              100}}), graphics={Text( 
    2155             extent={{-168,-72},{-52,-98}},  
    2156             lineColor={192,192,192},  
    2157             textString="torque")}), 
    2158       Diagram(graphics), 
     2192            extent={{-180,-72},{-64,-98}},  
     2193            lineColor={0,0,0},  
     2194            textString="torque"), Line(points={{-80,-100},{-80,0}}, color={0,0, 
     2195                127})}), 
     2196      Diagram(coordinateSystem(preserveAspectRatio=true,  extent={{-100,-100},{ 
     2197              100,100}}), 
     2198              graphics), 
    21592199      Documentation(info="<HTML> 
    21602200<p> 
    2161 The cut-torque acting at the component to which frame_b is 
    2162 connected is determined and provided at the output signal connector  
     2201The cut-torque acting between the two frames to which this 
     2202model is connected, is determined and provided at the output signal connector  
    21632203<b>torque</b> (= frame_a.t). If parameter <b>positiveSign</b> = 
    2164 <b>false</b>, the negative cut-force is provided (= frame_b.t). 
    2165 If <b>frame_resolve</b> is connected to another frame, then the 
    2166 cut-torque is resolved in frame_resolve. 
    2167 If <b>frame_resolve</b> is <b>not</b> connected then the 
    2168 coordinate system in which the cut-torque is resolved 
    2169 is defined by parameter <b>resolveInFrame_a</b>. 
    2170 If this parameter is <b>true</b>, then the 
    2171 cut-torque is resolved in frame_a, otherwise it is 
    2172 resolved in the world frame. 
    2173 </p> 
     2204<b>false</b>, the negative cut-torque is provided (= frame_b.t). 
     2205</p> 
     2206 
     2207<p> 
     2208Via parameter <b>resolveInFrame</b> it is defined, in which frame  
     2209the torque vector is resolved: 
     2210</p> 
     2211  
     2212<table border=1 cellspacing=0 cellpadding=2> 
     2213<tr><th><b>resolveInFrame =<br>Types.ResolveInFrame2.</b></th><th><b>Meaning</b></th></tr> 
     2214<tr><td valign=\"top\">world</td> 
     2215    <td valign=\"top\">Resolve vector in world frame</td></tr> 
     2216  
     2217<tr><td valign=\"top\">frame_a</td> 
     2218    <td valign=\"top\">Resolve vector in frame_a</td></tr> 
     2219  
     2220<tr><td valign=\"top\">frame_b</td> 
     2221    <td valign=\"top\">Resolve vector in frame_b</td></tr> 
     2222  
     2223<tr><td valign=\"top\">frame_resolve</td> 
     2224    <td valign=\"top\">Resolve vector in frame_resolve</td></tr> 
     2225</table> 
     2226  
     2227<p> 
     2228If resolveInFrame = Types.ResolveInFrame2.frame_resolve, the conditional connector 
     2229\"frame_resolve\" is enabled and output torque is resolved in the frame, to 
     2230which frame_resolve is connected. Note, if this connector is enabled, it must 
     2231be connected. 
     2232</p> 
     2233 
     2234 
    21742235<p> 
    21752236In the following figure the animation of a CutTorque 
     
    21832244</HTML>")); 
    21842245  protected  
    2185     outer Modelica.Mechanics.MultiBody.World world; 
    21862246    SI.Position t_in_m[3]=frame_a.t*(if positiveSign then +1 else -1)/Nm_to_m  
    21872247      "Torque mapped from Nm to m for animation"; 
     
    21942254      r_tail=t_in_m, 
    21952255      r_head=-t_in_m) if world.enableAnimation and animation; 
     2256    Internal.BasicCutTorque cutTorque(resolveInFrame=resolveInFrame, positiveSign= 
     2257         positiveSign)  
     2258      annotation (Placement(transformation(extent={{-62,-10},{-42,10}}))); 
     2259    Internal.ZeroPosition zeroPosition if  
     2260      not (resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrame2.frame_resolve)  
     2261      annotation (Placement(transformation(extent={{-20,-40},{0,-20}}))); 
    21962262  equation  
    2197     if cardinality(frame_resolve) == 1 then 
    2198       torque = Frames.resolve2(frame_resolve.R, Frames.resolve1(frame_a.R, 
    2199         frame_a.t))*(if positiveSign then +1 else -1); 
    2200     elseif resolveInFrame_a then 
    2201       torque = frame_a.t*(if positiveSign then +1 else -1); 
    2202     else 
    2203       torque = Frames.resolve1(frame_a.R, frame_a.t)*(if positiveSign then +1 else  
    2204               -1); 
    2205     end if; 
     2263    connect(cutTorque.frame_a, frame_a) annotation (Line( 
     2264        points={{-62,0},{-100,0}}, 
     2265        color={95,95,95}, 
     2266        thickness=2, 
     2267        smooth=Smooth.None)); 
     2268    connect(cutTorque.frame_b, frame_b) annotation (Line( 
     2269        points={{-42,0},{100,0}}, 
     2270        color={95,95,95}, 
     2271        thickness=2, 
     2272        smooth=Smooth.None)); 
     2273    connect(cutTorque.torque, torque) annotation (Line( 
     2274        points={{-60,-11},{-60,-80},{-80,-80},{-80,-110}}, 
     2275        color={0,0,127}, 
     2276        smooth=Smooth.None)); 
     2277    connect(cutTorque.frame_resolve, frame_resolve) annotation (Line( 
     2278        points={{-44,-10},{-44,-74},{80,-74},{80,-100}}, 
     2279        color={95,95,95}, 
     2280        pattern=LinePattern.Dot, 
     2281        smooth=Smooth.None)); 
     2282    connect(zeroPosition.frame_resolve, cutTorque.frame_resolve) annotation (Line( 
     2283        points={{-20,-30},{-44,-30},{-44,-10}}, 
     2284        color={95,95,95}, 
     2285        pattern=LinePattern.Dot, 
     2286        smooth=Smooth.None)); 
    22062287  end CutTorque; 
    22072288   
     
    22112292    import Modelica.Mechanics.MultiBody.Types; 
    22122293     
    2213     extends Modelica.Mechanics.MultiBody.Interfaces.PartialCutForceSensor; 
    2214     Modelica.Blocks.Interfaces.RealOutput load[6]  
    2215       "Cut force and cut torque resolved in frame_a/frame_b or in frame_resolved, if connected" 
     2294    Modelica.Blocks.Interfaces.RealOutput force[3]  
     2295      "Cut force resolved in frame defined by resolveInFrame"  
    22162296         annotation (Placement(transformation( 
    22172297          origin={-80,-110}, 
    22182298          extent={{10,-10},{-10,10}}, 
    22192299          rotation=90))); 
     2300    Modelica.Blocks.Interfaces.RealOutput torque[3]  
     2301      "Cut torque resolved in frame defined by resolveInFrame"  
     2302         annotation (Placement(transformation( 
     2303          origin={0,-110}, 
     2304          extent={{10,-10},{-10,10}}, 
     2305          rotation=90))); 
    22202306     
    22212307    parameter Boolean animation=true  
     
    22232309    parameter Boolean positiveSign=true  
    22242310      "= true, if force and torque with positive sign is returned (= frame_a.f/.t), otherwise with negative sign (= frame_b.f/.t)"; 
    2225     parameter Boolean resolveInFrame_a=true  
    2226       "= true, if force and torque are resolved in frame_a/frame_b, otherwise in the world frame (if connector frame_resolve is connected, the force/torque is resolved in frame_resolve)"; 
    22272311    input Real N_to_m(unit="N/m") = 1000  
    2228       " Force arrow scaling (length = force/N_to_m)"  
     2312      "Force arrow scaling (length = force/N_to_m)"  
    22292313      annotation (Dialog(group="if animation = true", enable=animation)); 
    22302314    input Real Nm_to_m(unit="N.m/m") = 1000  
    2231       " Torque arrow scaling (length = torque/Nm_to_m)"  
     2315      "Torque arrow scaling (length = torque/Nm_to_m)"  
    22322316      annotation (Dialog(group="if animation = true", enable=animation)); 
    22332317    input SI.Diameter forceDiameter=world.defaultArrowDiameter  
    2234       " Diameter of force arrow" annotation (Dialog(group="if animation = true", enable=animation)); 
     2318      "Diameter of force arrow" annotation (Dialog(group="if animation = true", enable=animation)); 
    22352319    input SI.Diameter torqueDiameter=forceDiameter " Diameter of torque arrow"  
    22362320                                  annotation (Dialog(group="if animation = true", enable=animation)); 
    22372321    input Types.Color forceColor=Modelica.Mechanics.MultiBody.Types.Defaults.ForceColor  
    2238       " Color of force arrow"  
     2322      "Color of force arrow"  
    22392323      annotation (Dialog(group="if animation = true", enable=animation)); 
    22402324    input Types.Color torqueColor=Modelica.Mechanics.MultiBody.Types.Defaults.TorqueColor  
    2241       " Color of torque arrow"  
     2325      "Color of torque arrow"  
    22422326      annotation (Dialog(group="if animation = true", enable=animation)); 
    22432327    input Types.SpecularCoefficient specularCoefficient = world.defaultSpecularCoefficient  
     
    22452329      annotation (Dialog(group="if animation = true", enable=animation)); 
    22462330     
    2247     SI.Force force[3]  
    2248       "Cut force resolved in frame_a/frame_b or in frame_resolved, if connected"; 
    2249     SI.Torque torque[3]  
    2250       "Cut torque resolved in frame_a/frame_b or in frame_resolved, if connected"; 
     2331    extends Modelica.Mechanics.MultiBody.Sensors.Internal.PartialCutForceSensor; 
     2332     
    22512333    annotation ( 
    2252       preferedView="info", 
    2253       Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, 
    2254               100}}), 
    2255            graphics), 
    2256       Diagram(graphics), 
     2334      Icon(coordinateSystem(preserveAspectRatio=true,  extent={{-100,-100},{100, 
     2335              100}}), graphics={ 
     2336          Line(points={{-80,-100},{-80,0}}, color={0,0,127}),  
     2337          Line(points={{0,-100},{0,-70}}, color={0,0,127}),  
     2338          Text( 
     2339            extent={{-188,-70},{-72,-96}},  
     2340            lineColor={0,0,0},  
     2341            textString="force"),  
     2342          Text( 
     2343            extent={{-56,-70},{60,-96}},  
     2344            lineColor={0,0,0},  
     2345            textString="torque")}), 
     2346      Diagram(coordinateSystem(preserveAspectRatio=true,  extent={{-100,-100},{ 
     2347              100,100}}), 
     2348              graphics), 
    22572349      Documentation(info="<HTML> 
    22582350<p> 
    2259 The cut-force and cut-torque acting at the component to which frame_b is 
    2260 connected are determined and provided at the output signal connector  
    2261 <b>load</b>: 
    2262 </p> 
    2263 <pre> 
    2264   load[1:3] = frame_a.f; 
    2265   load[4:6] = frame_a.t; 
    2266 </pre> 
    2267 <p> 
     2351The cut-force and cut-torque acting between the two frames to which this 
     2352model is connected, are determined and provided at the output signal connectors  
     2353<b>force</b> (= frame_a.f) and <b>torque</b> (= frame_a.t). 
    22682354If parameter <b>positiveSign</b> = 
    2269 <b>false</b>, the negative cut-force and negative 
    2270 cut-torque is provided (= frame_b.f and frame_b.t). 
    2271 If <b>frame_resolve</b> is connected to another frame, then the 
    2272 cut-force and cut-torque are resolved in frame_resolve. 
    2273 If <b>frame_resolve</b> is <b>not</b> connected then the 
    2274 coordinate system in which the cut-force and cut-torque is resolved 
    2275 is defined by parameter <b>resolveInFrame_a</b>. 
    2276 If this parameter is <b>true</b>, then the 
    2277 cut-force and cut-torque is resolved in frame_a, otherwise it is 
    2278 resolved in the world frame. 
    2279 </p> 
     2355<b>false</b>, the negative cut-force and cut-torque is provided  
     2356(= frame_b.f, frame_b.t). 
     2357 
     2358<p> 
     2359Via parameter <b>resolveInFrame</b> it is defined, in which frame  
     2360the two vectors are resolved: 
     2361</p> 
     2362  
     2363<table border=1 cellspacing=0 cellpadding=2> 
     2364<tr><th><b>resolveInFrame =<br>Types.ResolveInFrame2.</b></th><th><b>Meaning</b></th></tr> 
     2365<tr><td valign=\"top\">world</td> 
     2366    <td valign=\"top\">Resolve vectors in world frame</td></tr> 
     2367  
     2368<tr><td valign=\"top\">frame_a</td> 
     2369    <td valign=\"top\">Resolve vectors in frame_a</td></tr> 
     2370  
     2371<tr><td valign=\"top\">frame_b</td> 
     2372    <td valign=\"top\">Resolve vectors in frame_b</td></tr> 
     2373  
     2374<tr><td valign=\"top\">frame_resolve</td> 
     2375    <td valign=\"top\">Resolve vectors in frame_resolve</td></tr> 
     2376</table> 
     2377  
     2378<p> 
     2379If resolveInFrame = Types.ResolveInFrame2.frame_resolve, the conditional connector 
     2380\"frame_resolve\" is enabled and the output vectors force and torque are resolved in the frame, to 
     2381which frame_resolve is connected. Note, if this connector is enabled, it must 
     2382be connected. 
     2383</p> 
     2384 
     2385 
    22802386<p> 
    22812387In the following figure the animation of a CutForceAndTorque 
     
    22902396</HTML>")); 
    22912397  protected  
    2292     outer Modelica.Mechanics.MultiBody.World world; 
    22932398    parameter Integer csign=if positiveSign then +1 else -1; 
    22942399    SI.Position f_in_m[3]=frame_a.f*csign/N_to_m  
     
    23122417      r_tail=t_in_m, 
    23132418      r_head=-t_in_m) if world.enableAnimation and animation; 
     2419    Internal.BasicCutForce cutForce(resolveInFrame=resolveInFrame, positiveSign= 
     2420          positiveSign)  
     2421      annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); 
     2422    Internal.BasicCutTorque cutTorque(resolveInFrame=resolveInFrame, positiveSign= 
     2423         positiveSign)  
     2424      annotation (Placement(transformation(extent={{-2,-10},{18,10}}))); 
     2425    Internal.ZeroPosition zeroPosition if  
     2426      not (resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrame2.frame_resolve)  
     2427      annotation (Placement(transformation(extent={{60,30},{80,50}}))); 
    23142428  equation  
    2315     if cardinality(frame_resolve) == 1 then 
    2316       force = Frames.resolve2(frame_resolve.R, Frames.resolve1(frame_a.R,