| 1981 | | inertia (so called <i>rotor</i>) on its 3-dim. carrier body. Gyroscopic torques |
| 1982 | | appear, if the vector of the carrier body's angular velocity is not parallel |
| 1983 | | to the vector of the rotor's. The axis of rotation of the rotor is defined by |
| 1984 | | the parameter <tt>n</tt>, which has to be given in the local coordinate system |
| 1985 | | of <tt>frame_a</tt>. The default animation of this component is |
| 1986 | | shown in the figure below. </p> |
| 1987 | | <IMG SRC=\"../Images/MultiBody/Parts/Rotor1D.png\" ALT=\"model Parts.Rotor1D\"> |
| 1988 | | <p>This component is a replacement for |
| 1989 | | <a href=\"Modelica://Modelica.Mechanics.Rotational.Inertia\">Modelica.Mechanics.Rotational.Inertia</a> |
| 1990 | | for the case, that a 1-dim.-rotational mechanical system should be attached with a 3-dim. |
| 1991 | | carrier body.</p> |
| 1992 | | <p>The Boolean parameter <tt>exact</tt> was introduced due to performance |
| 1993 | | reasons. If <tt>exact</tt> is set to true, the influence of the carrier body |
| 1994 | | motion on the angular velocity of the rotor is neglected. This influence is usually |
| 1995 | | negligible if the 1-dim.-rotational mechanical system accelerates much faster as the base body (this is, |
| 1996 | | e.g., the case in vehicle powertrains). The essential advantage is |
| 1997 | | that an algebraic loop is removed since then there is only an |
| 1998 | | action on acceleration level from the powertrain to the base body |
| 1999 | | but not vice versa.</p> |
| 2000 | | <p><b>Reference</b><br> |
| 2001 | | <span style=\"font-variant:small-caps\">Schweiger</span>, Christian ; |
| 2002 | | <span style=\"font-variant:small-caps\">Otter</span>, Martin: |
| 2003 | | <a href=\"http://www.modelica.org/Conference2003/papers/h06_Schweiger_powertrains_v5.pdf\">Modelling |
| 2004 | | 3D Mechanical Effects of 1-dim. Powertrains</a>. In: <i>Proceedings of the 3rd International |
| 2005 | | Modelica Conference</i>. Linköping : The Modelica Association and Linköping University, |
| 2006 | | November 3-4, 2003, pp. 149-158</p> |
| 2007 | | </HTML> |
| 2008 | | "), Icon( |
| 2009 | | Line(points=[-80, -25; -60, -25], style(color=0)), |
| 2010 | | Line(points=[60, -25; 80, -25], style(color=0)), |
| 2011 | | Line(points=[-70, -25; -70, -70], style(color=0)), |
| 2012 | | Line(points=[70, -25; 70, -70], style(color=0)), |
| 2013 | | Line(points=[-80, 25; -60, 25], style(color=0)), |
| 2014 | | Line(points=[60, 25; 80, 25], style(color=0)), |
| 2015 | | Line(points=[-70, 45; -70, 25], style(color=0)), |
| 2016 | | Line(points=[70, 45; 70, 25], style(color=0)), |
| 2017 | | Line(points=[-70, -70; 70, -70], style(color=0)), |
| 2018 | | Rectangle(extent=[-50, 50; 50, -50], style( |
| 2019 | | color=0, |
| 2020 | | gradient=2, |
| 2021 | | fillColor=8)), |
| 2022 | | Rectangle(extent=[-100,10; -50,-10], style( |
| 2023 | | color=0, |
| 2024 | | gradient=2, |
| 2025 | | fillColor=8)), |
| 2026 | | Rectangle(extent=[50,10; 100,-10], style( |
| 2027 | | color=0, |
| 2028 | | gradient=2, |
| 2029 | | fillColor=8)), |
| 2030 | | Text(extent=[-148,112; 152,72], string="%name=%J"), |
| 2031 | | Line(points=[0, -70; 0, -100], style(color=0))), |
| 2032 | | Diagram); |
| 2033 | | |
| 2034 | | protected |
| 2035 | | outer Modelica.Mechanics.MultiBody.World world; |
| 2036 | | parameter Real e[3]=Frames.normalize(n) |
| 2037 | | "Unit vector in direction of rotor axis, resolved in frame_a"; |
| 2038 | | Visualizers.Advanced.Shape cylinder( |
| 2039 | | shapeType="cylinder", |
| 2040 | | color=cylinderColor, |
| 2041 | | specularCoefficient=specularCoefficient, |
| 2042 | | length=cylinderLength, |
| 2043 | | width=cylinderDiameter, |
| 2044 | | height=cylinderDiameter, |
| 2045 | | lengthDirection=n, |
| 2046 | | widthDirection={0,1,0}, |
| 2047 | | extra=1, |
| 2048 | | r_shape=r_center - e*(cylinderLength/2), |
| 2049 | | r=zeros(3), |
| 2050 | | R=Frames.planarRotation(e, phi, 0)) if world.enableAnimation and animation and not world.driveTrainMechanics3D; |
| 2051 | | |
| 2052 | | public |
| 2053 | | encapsulated model RotorWith3DEffects |
| 2054 | | "1D inertia attachable on 3-dim. bodies (3D dynamic effects are taken into account)" |
| 2055 | | |
| 2056 | | import Modelica; |
| 2057 | | import Modelica.Mechanics.MultiBody.Frames; |
| 2058 | | import Modelica.Mechanics.MultiBody.Types; |
| 2059 | | import SI = Modelica.SIunits; |
| 2060 | | import Cv = Modelica.SIunits.Conversions; |
| 2061 | | |
| 2062 | | parameter Boolean animation=true |
| 2063 | | "= true, if animation shall be enabled (show rotor as cylinder)"; |
| 2064 | | parameter SI.Inertia J(min=0)=1 |
| 2065 | | "Moment of inertia of rotor around its axis of rotation"; |
| 2066 | | parameter Types.Axis n={1,0,0} "Axis of rotation resolved in frame_a"; |
| 2067 | | parameter Types.Init.Temp initType=Modelica.Mechanics.MultiBody.Types.Init.Free |
| 2068 | | "Type of initialization (defines usage of start values below)" |
| 2069 | | annotation (Dialog(group="Initialization")); |
| 2070 | | parameter Cv.NonSIunits.Angle_deg phi_start=0 |
| 2071 | | "Initial value of rotor rotation angle phi (fixed or guess value)" |
| 2072 | | annotation (Evaluate=false, Dialog(group="Initialization")); |
| 2073 | | parameter Types.AngularVelocity_degs w_start=0 |
| 2074 | | "Initial value of relative angular velocity w = der(phi)" |
| 2075 | | annotation (Evaluate=false, Dialog(group="Initialization")); |
| 2076 | | parameter Types.AngularAcceleration_degs2 a_start= |
| 2077 | | 0 "Initial value of relative angular acceleration a = der(w)" |
| 2078 | | annotation (Evaluate=false, Dialog(group="Initialization")); |
| 2079 | | parameter SI.Position r_center[3]=zeros(3) |
| 2080 | | "Position vector from origin of frame_a to center of cylinder" |
| 2081 | | annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); |
| 2082 | | parameter SI.Distance cylinderLength=2*world.defaultJointLength |
| 2083 | | "Length of cylinder representing the rotor" |
| 2084 | | annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); |
| 2085 | | parameter SI.Distance cylinderDiameter=2*world.defaultJointWidth |
| 2086 | | "Diameter of cylinder representing the rotor" |
| 2087 | | annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); |
| 2088 | | input Types.Color cylinderColor=Modelica.Mechanics.MultiBody.Types.Defaults.RodColor |
| 2089 | | "Color of cylinder representing the rotor" |
| 2090 | | annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); |
| 2091 | | input Types.SpecularCoefficient specularCoefficient = world.defaultSpecularCoefficient |
| 2092 | | "Reflection of ambient light (= 0: light is completely absorbed)" |
| 2093 | | annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); |
| 2094 | | parameter Boolean enforceStates=false |
| 2095 | | "= true, if rotor angle (phi) and rotor speed (w) shall be used as states" |
| 2096 | | annotation (Dialog(tab="Advanced")); |
| 2097 | | parameter Boolean exact=true |
| 2098 | | "= true, if exact calculations; false if influence of bearing on rotor acceleration is neglected to avoid an algebraic loop" |
| 2099 | | annotation (Dialog(tab="Advanced")); |
| 2100 | | SI.AngularVelocity w_a[3] |
| 2101 | | "Angular velocity of frame_a, resolved in frame_a"; |
| 2102 | | SI.Angle phi(start=Cv.from_deg(phi_start), stateSelect=if enforceStates then |
| 2103 | | StateSelect.always else StateSelect.default) |
| 2104 | | "Rotation angle of rotor with respect to frame_a (= flange_a.phi = flange_b.phi)"; |
| 2105 | | SI.AngularVelocity w(stateSelect=if enforceStates then StateSelect.always else |
| 2106 | | StateSelect.default) |
| 2107 | | "Angular velocity of rotor with respect to frame_a"; |
| 2108 | | SI.AngularAcceleration a |
| 2109 | | "Angular acceleration of rotor with respect to frame_a"; |
| 2110 | | |
| 2111 | | Modelica.Mechanics.Rotational.Interfaces.Flange_a flange_a |
| 2112 | | "(left) driving flange (flange axis directed INTO cut plane)" |
| 2113 | | annotation (extent=[-110, -10; -90, 10]); |
| 2114 | | Modelica.Mechanics.Rotational.Interfaces.Flange_b flange_b |
| 2115 | | "(right) driven flange (flange axis directed OUT OF cut plane)" |
| 2116 | | annotation (extent=[90, -10; 110, 10]); |
| 2117 | | Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a |
| 2118 | | "Frame in which rotor housing is fixed" |
| 2119 | | annotation (extent=[-20, -120; 20, -80], rotation=90); |
| 2120 | | annotation ( |
| 2121 | | Documentation(info="<html> |
| 2122 | | <p> |
| 2123 | | This component is used to model the gyroscopic torques exerted by a 1-dim. |
| 2260 | | |
| 2261 | | frame_a.f = zeros(3); |
| 2262 | | frame_a.t = nJ*a + cross(w_a, nJ*w); |
| 2263 | | end RotorWith3DEffects; |
| 2264 | | |
| 2265 | | protected |
| 2266 | | Rotational.Inertia inertia( |
| 2267 | | J=J, |
| 2268 | | initType=initType, |
| 2269 | | phi_start=phi_start*Modelica.Constants.D2R, |
| 2270 | | w_start=w_start*Modelica.Constants.D2R, |
| 2271 | | a_start=a_start*Modelica.Constants.D2R) if not world.driveTrainMechanics3D |
| 2272 | | annotation (extent=[-20,-20; 20,20]); |
| 2273 | | RotorWith3DEffects rotorWith3DEffects( |
| 2274 | | animation=animation, |
| 2275 | | J=J, |
| 2276 | | n=n, |
| 2277 | | initType=initType, |
| 2278 | | phi_start=phi_start, |
| 2279 | | w_start=w_start, |
| 2280 | | a_start=a_start, |
| 2281 | | r_center=r_center, |
| 2282 | | cylinderLength=cylinderLength, |
| 2283 | | cylinderDiameter=cylinderDiameter, |
| 2284 | | cylinderColor=cylinderColor, |
| 2285 | | specularCoefficient=specularCoefficient, |
| 2286 | | exact=exact) if world.driveTrainMechanics3D annotation (extent=[-20,-80; 20,-40]); |
| 2287 | | equation |
| 2288 | | phi = flange_a.phi; |
| 2289 | | w = der(phi); |
| 2290 | | a = der(w); |
| 2291 | | |
| 2292 | | connect(inertia.flange_a, flange_a) annotation (points=[-20,0; -100,0], style( |
| 2293 | | color=0, |
| 2294 | | rgbcolor={0,0,0}, |
| 2295 | | smooth=0)); |
| 2296 | | connect(inertia.flange_b, flange_b) annotation (points=[20,0; 100,0], style( |
| 2297 | | color=0, |
| 2298 | | rgbcolor={0,0,0}, |
| 2299 | | smooth=0)); |
| 2300 | | connect(rotorWith3DEffects.flange_b, flange_b) annotation (points=[20,-60; 60, |
| 2301 | | -60; 60,0; 100,0], style( |
| 2302 | | color=0, |
| 2303 | | rgbcolor={0,0,0}, |
| 2304 | | smooth=0)); |
| 2305 | | connect(rotorWith3DEffects.flange_a, flange_a) annotation (points=[-20,-60; |
| 2306 | | -60,-60; -60,0; -100,0], style( |
| 2307 | | color=0, |
| 2308 | | rgbcolor={0,0,0}, |
| 2309 | | smooth=0)); |
| 2310 | | connect(rotorWith3DEffects.frame_a, frame_a) annotation (points=[0,-80; 0, |
| 2311 | | -100], style( |
| 2312 | | color=10, |
| 2313 | | rgbcolor={95,95,95}, |
| 2314 | | thickness=2, |
| 2315 | | smooth=0)); |
| | 2127 | |
| | 2128 | if not world.driveTrainMechanics3D then |
| | 2129 | r_0 = zeros(3); |
| | 2130 | R.T = identity(3); |
| | 2131 | R.w = zeros(3); |
| | 2132 | end if; |