Changeset 839
- Timestamp:
- 11/18/07 23:17:58 (13 months ago)
- Location:
- Modelica/trunk/Modelica/Mechanics/MultiBody
- Files:
-
- 2 modified
-
Interfaces.mo (modified) (4 diffs)
-
Sensors.mo (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Modelica/trunk/Modelica/Mechanics/MultiBody/Interfaces.mo
r755 r839 406 406 lineColor={128,128,128}, 407 407 textString="b")}, 408 coordinateSystem(extent={{-200,-200},{200,200}}, preserveAspectRatio 409 =false)), 408 coordinateSystem(extent={{-200,-200},{200,200}}, preserveAspectRatio=false)), 410 409 Documentation(info="<HTML> 411 410 <p> … … 741 740 preserveAspectRatio=true, 742 741 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}), 744 743 Line(points={{70,0},{100,0}}, color={0,0,255})})); 745 744 equation … … 804 803 extent={{-100,-100},{100,100}}, 805 804 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}), 808 807 Line(points={{0,-100},{0,-70}}, color={0,0,127})})); 809 808 equation … … 816 815 end PartialRelativeSensor; 817 816 818 partial model PartialCutForceSensor819 "Base model to measure the cut force and/or torque between two frames"820 821 extends Modelica.Icons.RotationalSensor;822 Interfaces.Frame_a frame_a823 "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_b826 "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_resolve829 "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 frames845 and one output port in order to measure the cut-force and/or846 cut-torque acting between the two frames and847 to provide the measured signals as output for further processing848 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 protected891 outer Modelica.Mechanics.MultiBody.World world;892 equation893 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 identical900 frame_a.r_0 = frame_b.r_0;901 frame_a.R = frame_b.R;902 903 // force and torque balance904 zeros(3) = frame_a.f + frame_b.f;905 zeros(3) = frame_a.t + frame_b.t;906 907 // deduce cut-force908 if cardinality(frame_resolve) == 1 then909 // frame_resolve is connected910 frame_resolve.f = zeros(3);911 frame_resolve.t = zeros(3);912 else913 // frame_resolve is NOT connected914 frame_resolve.r_0 = zeros(3);915 frame_resolve.R = Frames.nullRotation();916 end if;917 end PartialCutForceSensor;918 817 919 818 partial model PartialVisualizer -
Modelica/trunk/Modelica/Mechanics/MultiBody/Sensors.mo
r833 r839 1354 1354 annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); 1355 1355 annotation (Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-100, 1356 -100},{100,100}}, 1356 -100},{100,100}}, 1357 1357 grid={1,1}), graphics), Icon(coordinateSystem( 1358 preserveAspectRatio=false, extent={{-100,-100},{100,100}}, 1358 preserveAspectRatio=false, extent={{-100,-100},{100,100}}, 1359 1359 grid={1,1}), graphics={ 1360 1360 Line( … … 1966 1966 Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 1967 1967 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}), 1976 1976 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}, 1980 1980 fillPattern=FillPattern.Solid)}), 1981 1981 Documentation(info="<HTML> … … 2031 2031 2032 2032 import SI = Modelica.SIunits; 2033 import Modelica.Mechanics.MultiBody.Types; 2034 2035 extends Modelica.Mechanics.MultiBody.Interfaces.PartialCutForceSensor; 2033 2036 2034 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" 2038 2036 annotation (Placement(transformation( 2039 2037 origin={-80,-110}, … … 2045 2043 parameter Boolean positiveSign=true 2046 2044 "= 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 2049 2046 input Real N_to_m(unit="N/m") = 1000 2050 2047 " Force arrow scaling (length = force/N_to_m)" … … 2059 2056 annotation (Dialog(group="if animation = true", enable=animation)); 2060 2057 2058 extends Modelica.Mechanics.MultiBody.Sensors.Internal.PartialCutForceSensor; 2059 2061 2060 annotation ( 2062 preferedView="info",2063 2061 Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, 2064 2062 100}}), graphics={Text( 2065 2063 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},{ 2069 2068 100,100}}), 2070 2069 graphics), 2071 2070 Documentation(info="<HTML> 2072 2071 <p> 2073 The cut-force acting at the component to which frame_bis2074 connectedis determined and provided at the output signal connector2072 The cut-force acting between the two frames to which this 2073 model is connected, is determined and provided at the output signal connector 2075 2074 <b>force</b> (= frame_a.f). If parameter <b>positiveSign</b> = 2076 2075 <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> 2078 Via parameter <b>resolveInFrame</b> it is defined, in which frame 2079 the 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> 2098 If resolveInFrame = Types.ResolveInFrame2.frame_resolve, the conditional connector 2099 \"frame_resolve\" is enabled and output force is resolved in the frame, to 2100 which frame_resolve is connected. Note, if this connector is enabled, it must 2101 be connected. 2102 </p> 2103 2086 2104 <p> 2087 2105 In the following figure the animation of a CutForce … … 2095 2113 </HTML>")); 2096 2114 protected 2097 outer Modelica.Mechanics.MultiBody.World world;2098 2115 SI.Position f_in_m[3]=frame_a.f*(if positiveSign then +1 else -1)/N_to_m 2099 2116 "Force mapped from N to m for animation"; … … 2106 2123 r_tail=f_in_m, 2107 2124 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}}))); 2108 2132 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)); 2118 2158 end CutForce; 2119 2159 … … 2121 2161 2122 2162 import SI = Modelica.SIunits; 2123 import Modelica.Mechanics.MultiBody.Types; 2124 2125 extends Modelica.Mechanics.MultiBody.Interfaces.PartialCutForceSensor; 2163 2126 2164 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" 2128 2166 annotation (Placement(transformation( 2129 2167 origin={-80,-110}, … … 2135 2173 parameter Boolean positiveSign=true 2136 2174 "= true, if torque with positive sign is returned (= frame_a.t), otherwise with negative sign (= frame_b.t)"; 2137 parameter Boolean resolveInFrame_a=true2138 "= 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)";2139 2175 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)" 2141 2177 annotation (Dialog(group="if animation = true", enable=animation)); 2142 2178 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)); 2144 2180 input Types.Color torqueColor=Modelica.Mechanics.MultiBody.Types.Defaults.TorqueColor 2145 " Color of torque arrow"2181 "Color of torque arrow" 2146 2182 annotation (Dialog(group="if animation = true", enable=animation)); 2147 2183 input Types.SpecularCoefficient specularCoefficient = world.defaultSpecularCoefficient … … 2149 2185 annotation (Dialog(group="if animation = true", enable=animation)); 2150 2186 2187 extends Modelica.Mechanics.MultiBody.Sensors.Internal.PartialCutForceSensor; 2188 2151 2189 annotation ( 2152 preferedView="info", 2153 Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, 2190 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 2154 2191 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), 2159 2199 Documentation(info="<HTML> 2160 2200 <p> 2161 The cut-torque acting at the component to which frame_bis2162 connectedis determined and provided at the output signal connector2201 The cut-torque acting between the two frames to which this 2202 model is connected, is determined and provided at the output signal connector 2163 2203 <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> 2208 Via parameter <b>resolveInFrame</b> it is defined, in which frame 2209 the 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> 2228 If resolveInFrame = Types.ResolveInFrame2.frame_resolve, the conditional connector 2229 \"frame_resolve\" is enabled and output torque is resolved in the frame, to 2230 which frame_resolve is connected. Note, if this connector is enabled, it must 2231 be connected. 2232 </p> 2233 2234 2174 2235 <p> 2175 2236 In the following figure the animation of a CutTorque … … 2183 2244 </HTML>")); 2184 2245 protected 2185 outer Modelica.Mechanics.MultiBody.World world;2186 2246 SI.Position t_in_m[3]=frame_a.t*(if positiveSign then +1 else -1)/Nm_to_m 2187 2247 "Torque mapped from Nm to m for animation"; … … 2194 2254 r_tail=t_in_m, 2195 2255 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}}))); 2196 2262 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)); 2206 2287 end CutTorque; 2207 2288 … … 2211 2292 import Modelica.Mechanics.MultiBody.Types; 2212 2293 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" 2216 2296 annotation (Placement(transformation( 2217 2297 origin={-80,-110}, 2218 2298 extent={{10,-10},{-10,10}}, 2219 2299 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))); 2220 2306 2221 2307 parameter Boolean animation=true … … 2223 2309 parameter Boolean positiveSign=true 2224 2310 "= 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=true2226 "= 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)";2227 2311 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)" 2229 2313 annotation (Dialog(group="if animation = true", enable=animation)); 2230 2314 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)" 2232 2316 annotation (Dialog(group="if animation = true", enable=animation)); 2233 2317 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)); 2235 2319 input SI.Diameter torqueDiameter=forceDiameter " Diameter of torque arrow" 2236 2320 annotation (Dialog(group="if animation = true", enable=animation)); 2237 2321 input Types.Color forceColor=Modelica.Mechanics.MultiBody.Types.Defaults.ForceColor 2238 " Color of force arrow"2322 "Color of force arrow" 2239 2323 annotation (Dialog(group="if animation = true", enable=animation)); 2240 2324 input Types.Color torqueColor=Modelica.Mechanics.MultiBody.Types.Defaults.TorqueColor 2241 " Color of torque arrow"2325 "Color of torque arrow" 2242 2326 annotation (Dialog(group="if animation = true", enable=animation)); 2243 2327 input Types.SpecularCoefficient specularCoefficient = world.defaultSpecularCoefficient … … 2245 2329 annotation (Dialog(group="if animation = true", enable=animation)); 2246 2330 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 2251 2333 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), 2257 2349 Documentation(info="<HTML> 2258 2350 <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> 2351 The cut-force and cut-torque acting between the two frames to which this 2352 model 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). 2268 2354 If 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> 2359 Via parameter <b>resolveInFrame</b> it is defined, in which frame 2360 the 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> 2379 If 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 2381 which frame_resolve is connected. Note, if this connector is enabled, it must 2382 be connected. 2383 </p> 2384 2385 2280 2386 <p> 2281 2387 In the following figure the animation of a CutForceAndTorque … … 2290 2396 </HTML>")); 2291 2397 protected 2292 outer Modelica.Mechanics.MultiBody.World world;2293 2398 parameter Integer csign=if positiveSign then +1 else -1; 2294 2399 SI.Position f_in_m[3]=frame_a.f*csign/N_to_m … … 2312 2417 r_tail=t_in_m, 2313 2418 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}}))); 2314 2428 equation 2315 if cardinality(frame_resolve) == 1 then 2316 force = Frames.resolve2(frame_resolve.R, Frames.resolve1(frame_a.R,
