The models exist in two variants: as complete models or as rudimental joint models.
The complete models, represent the wheel or marble as complete object with mass and potential movement joints. They also contain all parameters for initialization.
The rudimental joint models just model the movement constraints of the ideal rolling. They have to be connected to body and joint models.
Name | Description |
---|---|
![]() | models the joint characteristics of a wheel |
![]() | models the joint characteristics of a marble |
![]() | complete model of a wheel |
![]() | complete model of a marble |
The rolling plane can be specified by the vector n (pointing upwards) and the distance of the plane from the origin d.
The parameter animation toggles the visualization
Type | Name | Default | Description |
---|---|---|---|
Boolean | animation | true | animate wheel |
Radius | r | 1 | radius of wheel [m] |
Real | n[3] | {0,1,0} | vector normal to rolling plane, pointing upwards |
Distance | d | 0 | distance of rolling plane o origin [m] |
Animation | |||
Radius | rRim | 0.9*r | radius of rim [m] |
Diameter | wWheel | 0.1*r | width of the wheel [m] |
Color | tireColor[3] | {64,64,64} | Color of the tire |
Color | rodColor[3] | {128,0,0} | Color of the rods |
Color | contactColor[3] | {128,128,128} | Color of the contactpoint |
Type | Name | Description |
---|---|---|
Frame_b | frame_b |
model WheelJoint "models the joint characteristics of a wheel" import SI = Modelica.SIunits; import MB = Modelica.Mechanics.MultiBody; parameter Boolean animation = true "animate wheel"; parameter SI.Radius r=1 "radius of wheel"; parameter Real n[3] = {0,1,0} "vector normal to rolling plane, pointing upwards"; parameter SI.Distance d=0 "distance of rolling plane o origin"; parameter SI.Radius rRim = 0.9*r "|Animation|| radius of rim"; parameter SI.Diameter wWheel = 0.1*r "|Animation|| width of the wheel"; parameter MB.Types.Color tireColor= {64,64,64} "|Animation|| Color of the tire"; parameter MB.Types.Color rodColor= {128,0,0} "|Animation|| Color of the rods"; parameter MB.Types.Color contactColor= {128,128,128} "|Animation|| Color of the contactpoint"; final parameter Real eN[3] = n/sqrt(n*n) "normalization of n"; final parameter Real notN[3] = if abs(eN[1]) > 0.1 then {0,1,0} else (if abs(eN[2]) > 0.1 then {0,0,1} else {1,0,0}) "Arbitrary vector that is not aligned with eN"; final parameter Real vec_a[3] = cross(eN,notN) "vector in rolling plane"; final parameter Real eA[3] = {1,0,0} "normalized vector in rolling plane"; final parameter Real eB[3] = cross(eA,eN) "normalized vector in rolling plane orthogonal to eA"; SI.AngularVelocity w[3] "angular velocity"; SI.AngularAcceleration z[3] "angular acceleration"; SI.Position x[3] "Position of the frame"; SI.Velocity v[3] "Velocity"; SI.Acceleration a[3] "Acceleration"; Real d_cp[3] "vector pointing in direction of the contact point from wheel center res. in inertial frame"; SI.Force fN; protected Real eAxis[3] "unit vector aligned to wheel Axis in inertial frame"; SI.Position r_cp[3] "Vector from wheel center to contact point res. in inertial frame"; public Interfaces.Frame_b frame_b; protected Interfaces.MBG2Mech MBG2Mech1; inner Defaults MBG_defaults(n=3); Junctions.J0 J0_1; Bonds.MultiBond MultiBond2; Bonds.MultiBond MultiBond5; Bonds.MultiBond MultiBond13; Bonds.MultiBond MultiBond14; Bonds.Utilities.MultiBondTail MultiBondTail2; Bonds.Utilities.MultiBondTail MultiBondTail3; Bonds.Utilities.MultiBondTail MultiBondTail4; Passive.mTF_effort mTF_effort1; protected outer World3D world3D; parameter Integer ndim=if world3D.enableAnimation and animation then 1 else 0; MB.Visualizers.Advanced.Shape tirePipe[ndim]( each shapeType="pipe", each color=tireColor, each length= wWheel, each width=2*r, each height=2*r, each lengthDirection={0,0,1}, each widthDirection={0,1,0}, each extra=rRim/r, each r_shape=-{0,0,1}*(2*r/40), each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); MB.Visualizers.Advanced.Shape cylindery[ndim]( each shapeType="cylinder", each color=rodColor, each length= 2*rRim, each width=wWheel, each height=wWheel, each lengthDirection={0,1,0}, each widthDirection={0,0,1}, each r_shape=-{0,1,0}*rRim, each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); MB.Visualizers.Advanced.Shape cylinderx[ndim]( each shapeType="cylinder", each color=rodColor, each length= 2*rRim, each width=wWheel, each height=wWheel, each lengthDirection={1,0,0}, each widthDirection={0,0,1}, each r_shape=-{1,0,0}*rRim, each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); MB.Visualizers.Advanced.Shape cylinderxy[ndim]( each shapeType="cylinder", each color=rodColor, each length= 2*rRim, each width=wWheel, each height=wWheel, each lengthDirection={1,1,0}, each widthDirection={0,0,1}, each r_shape=-{0.706,0.706,0}*rRim, each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); MB.Visualizers.Advanced.Shape cylinderyx[ndim]( each shapeType="cylinder", each color=rodColor, each length= 2*rRim, each width=wWheel, each height=wWheel, each lengthDirection={1,-1,0}, each widthDirection={0,0,1}, each r_shape=-{0.706,-0.706,0}*rRim, each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); MB.Visualizers.Advanced.Shape contactPoint[ndim]( each shapeType="cylinder", each color=contactColor, each length= r/20, each width=wWheel*3, each height=wWheel*3, each lengthDirection=eN, each widthDirection=eA, each r=MBG2Mech1.x, each r_shape=r_cp, each specularCoefficient = 0.1); AdditionalMBG.translational_mTF2 translational_mTF2_1; Bonds.Utilities.MultiBondTail MultiBondTail5; Bonds.MultiBond MultiBond4(n=1); Bonds.MultiBond MultiBond6; public Sources.mSe mSe1(n=1); Passive.TF2_effort projectiveTF( nA=3, nB=1, M={eN}); equation w = MBG2Mech1.MultiBondConRot.f; z = der(w); x = MBG2Mech1.x; v = MBG2Mech1.MultiBondConTrans.f; a = der(v); // holonomic constraint x*eN = (d - r_cp*eN); fN = mSe1.s[1]; // contact point computation eAxis = transpose(MBG2Mech1.R)*{0,0,1}; d_cp = (-eN) - ((-eN)*eAxis)*eAxis; r_cp = r* d_cp/sqrt(d_cp*d_cp); translational_mTF2_1.r = r_cp; connect(MBG2Mech1.frame_b,frame_b); connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConTrans); connect(MultiBond13.MultiBondCon1, J0_1.MultiBondCon3); connect(mTF_effort1.MultiBondCon2, MultiBond5.MultiBondCon1); connect(mTF_effort1.MultiBondCon1, MultiBond14.MultiBondCon2); connect(translational_mTF2_1.MultiBondCon1, MultiBond14.MultiBondCon1); connect(translational_mTF2_1.MultiBondCon2, MultiBond13.MultiBondCon2); connect(mTF_effort1.M, MBG2Mech1.R); connect(MultiBond5.MultiBondCon2, MBG2Mech1.MultiBondConRot); connect(MultiBond2.MultiBondCon1, J0_1.MultiBondCon2); connect(MultiBond6.MultiBondCon2, J0_1.MultiBondCon4); connect(mSe1.MultiBondCon1, MultiBond4.MultiBondCon1); connect(projectiveTF.MultiBondConB, MultiBond4.MultiBondCon2); connect(projectiveTF.MultiBondConA, MultiBond6.MultiBondCon1); end WheelJoint;
The rolling plane can be specified by the vector n (pointing upwards) and the distance of the plane from the origin d.
The parameter animation toggles the visualization
Type | Name | Default | Description |
---|---|---|---|
Boolean | animation | true | animate marble |
Radius | r | 1 | radius of marble [m] |
Real | n[3] | {0,1,0} | vector normal to rolling plane, pointing upwards |
Distance | d | 0 | distance of rolling plane o origin [m] |
Type | Name | Description |
---|---|---|
Frame_b | frame_b |
model MarbleJoint "models the joint characteristics of a marble" import SI = Modelica.SIunits; import MB = Modelica.Mechanics.MultiBody; parameter Boolean animation = true "animate marble"; parameter SI.Radius r=1 "radius of marble"; parameter Real n[3] = {0,1,0} "vector normal to rolling plane, pointing upwards"; parameter SI.Distance d=0 "distance of rolling plane o origin"; final parameter Real eN[3] = n/sqrt(n*n) "normalization of n"; final parameter Real notN[3] = if abs(eN[1]) > 0.1 then {0,1,0} else (if abs(eN[2]) > 0.1 then {0,0,1} else {1,0,0}) "Arbitrary vector that is not aligned with eN"; final parameter Real vec_a[3] = cross(eN,notN) "vector in rolling plane"; final parameter Real eA[3] = {1,0,0} "normalized vector in rolling plane"; final parameter Real eB[3] = cross(eA,eN) "normalized vector in rolling plane orthogonal to eA"; SI.AngularVelocity w[3] "angular velocity"; SI.AngularAcceleration z[3] "angular acceleration"; SI.Position x[3] "Position of the frame"; SI.Velocity v[3] "Velocity"; SI.Acceleration a[3] "Acceleration"; SI.Force fN; public Interfaces.Frame_b frame_b; protected Interfaces.MBG2Mech MBG2Mech1; inner Defaults MBG_defaults(n=3); Junctions.J0 J0_1; Bonds.MultiBond MultiBond2; Bonds.MultiBond MultiBond5; Bonds.MultiBond MultiBond13; Bonds.MultiBond MultiBond14; Bonds.Utilities.MultiBondTail MultiBondTail2; Bonds.Utilities.MultiBondTail MultiBondTail3; Bonds.Utilities.MultiBondTail MultiBondTail4; Passive.mTF_effort mTF_effort1; protected outer World3D world3D; parameter Integer ndim=if world3D.enableAnimation and animation then 1 else 0; MB.Visualizers.Advanced.Shape cylinderz[ndim]( each shapeType="cylinder", each color={192,0,192}, each length= 2*r/10, each width=2*r, each height=2*r, each lengthDirection={0,0,1}, each widthDirection={0,1,0}, each r_shape=-{0,0,1}*(2*r/20), each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); MB.Visualizers.Advanced.Shape cylindery[ndim]( each shapeType="cylinder", each color={192,0,192}, each length= 2*r/10, each width=2*r, each height=2*r, each lengthDirection={0,1,0}, each widthDirection={0,0,1}, each r_shape=-{0,1,0}*(2*r/20), each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); MB.Visualizers.Advanced.Shape cylinderx[ndim]( each shapeType="cylinder", each color={192,0,192}, each length= 2*r/10, each width=2*r, each height=2*r, each lengthDirection={1,0,0}, each widthDirection={0,1,0}, each r_shape=-{1,0,0}*(2*r/20), each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); MB.Visualizers.Advanced.Shape sphere[ndim]( each shapeType="sphere", each color={0,0,255}, each length=1.8*r, each width=1.8*r, each height=1.8*r, each lengthDirection={1,0,0}, each widthDirection={0,1,0}, each r_shape=-{1,0,0}*1.8*r/2, each r=MBG2Mech1.x, each R=MB.Frames.Orientation(T=MBG2Mech1.R,w=zeros(3))); Bonds.Utilities.MultiBondTail MultiBondTail5; Bonds.MultiBond MultiBond4(n=1); Bonds.MultiBond MultiBond6; public Sources.mSe mSe1(n=1); protected AdditionalMBG.translationalTF translationalTF1(r=-r*eN); public Passive.TF2_effort projectiveTF( nA=3, nB=1, M={eN}); equation w = MBG2Mech1.MultiBondConRot.f; z = der(w); x = MBG2Mech1.x; v = MBG2Mech1.MultiBondConTrans.f; a = der(v); // holonomic constraint -x*eN = (d - r); fN = mSe1.s[1]; connect(MBG2Mech1.frame_b,frame_b); connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConTrans); connect(MultiBond13.MultiBondCon1, J0_1.MultiBondCon3); connect(mTF_effort1.MultiBondCon2, MultiBond5.MultiBondCon1); connect(mTF_effort1.MultiBondCon1, MultiBond14.MultiBondCon2); connect(mTF_effort1.M, MBG2Mech1.R); connect(MultiBond5.MultiBondCon2, MBG2Mech1.MultiBondConRot); connect(MultiBond2.MultiBondCon1, J0_1.MultiBondCon2); connect(MultiBond6.MultiBondCon2, J0_1.MultiBondCon4); connect(mSe1.MultiBondCon1, MultiBond4.MultiBondCon1); connect(translationalTF1.MultiBondCon1, MultiBond14.MultiBondCon1); connect(translationalTF1.MultiBondCon2, MultiBond13.MultiBondCon2); connect(projectiveTF.MultiBondConB, MultiBond4.MultiBondCon2); connect(projectiveTF.MultiBondConA, MultiBond6.MultiBondCon1); end MarbleJoint;
The inertia tensor of the wheel is a symmetric 3x3 matrix and can be specified by the parameters I11, I12, ...
The radius of the wheel can be defined by the parameter r.
The rolling plane can be specified by the vector n (pointing upwards) and the distance of the plane from the origin d.
The parameter animation toggles the visualization
The ideal rolling restricts the wheel's position on the plane and the statement of the initial position is overdetermined. Therefore the initial position is automatically projected on the rolling plane.
The ideal rolling restricts the wheel's movement. The initial velocities and angular velocities form an overdetermined initial statement.
By the activation of useTransVelocity, all velocities are defined by the translational movement on the plane and the rotation around the plane's normal vector.
Otherwise all initial angular velocities are taken to define the initial movement.
The orientation can either be expressed by the three cardan angles or by quaternions.
Which of these two variants is used, can be specified by the parameter useQuaternions.
Type | Name | Default | Description |
---|---|---|---|
Boolean | animation | true | animate wheel |
Radius | r | 1 | radius of wheel [m] |
Real | n[3] | {0,1,0} | vector normal to rolling plane, pointing upwards |
Distance | d | 0 | distance of rolling plane o origin [m] |
Mass | m | 1 | mass of body [kg] |
Inertia tensor (resolved in center of mass, parallel to frame_a) | |||
Inertia | I_11 | 0.001 | (1,1) element of inertia tensor [kg.m2] |
Inertia | I_22 | 0.001 | (2,2) element of inertia tensor [kg.m2] |
Inertia | I_33 | 0.001 | (3,3) element of inertia tensor [kg.m2] |
Inertia | I_21 | 0 | (2,1) element of inertia tensor [kg.m2] |
Inertia | I_31 | 0 | (3,1) element of inertia tensor [kg.m2] |
Inertia | I_32 | 0 | (3,2) element of inertia tensor [kg.m2] |
Initialization | |||
Temp | initType | MB.Types.Init.Free | Type of initialization (defines usage of start values below) |
Boolean | useTransVelocities | false | use the translational velocities (defines usage of start values below) |
Angle_deg | phi_start[3] | {0,0,0} | initial cardan angles in degree [deg] |
AngularVelocity_deg | w_start[3] | {0,0,0} | initial angular velocity in deg/s [deg/s] |
AngularAcceleration_deg | z_start[3] | {0,0,0} | initial angular acceleration in deg/s2 [deg/s2] |
Position | x_start[3] | {0,0,0} | initial position [m] |
Velocity | v_start[3] | {0,0,0} | initial velocity [m/s] |
Acceleration | a_start[3] | {0,0,0} | initial acceleration [m/s2] |
Animation | |||
Radius | rRim | 0.9*r | radius of rim [m] |
Diameter | wWheel | 0.1*r | width of the wheel [m] |
Color | tireColor[3] | {64,64,64} | Color of the tire |
Color | rodColor[3] | {128,0,0} | Color of the rods |
Color | contactColor[3] | {128,128,128} | Color of the contactpoint |
Advanced | |||
Boolean | enforceStates | false | enforce Quaternions or cardan angles and w as states |
Boolean | useQuaternions | false | use Quaternions instead of cardan angles |
Type | Name | Description |
---|---|---|
Frame_b | frame_b |
model Wheel "complete model of a wheel" import SI = Modelica.SIunits; import MB = Modelica.Mechanics.MultiBody; import Cv = Modelica.SIunits.Conversions; parameter Boolean animation = true "animate wheel"; parameter SI.Radius r=1 "radius of wheel"; parameter Real n[3] = {0,1,0} "vector normal to rolling plane, pointing upwards"; parameter SI.Distance d=0 "distance of rolling plane o origin"; parameter SI.Mass m = 1 "mass of body"; parameter SI.Inertia I_11=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (1,1) element of inertia tensor"; parameter SI.Inertia I_22=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (2,2) element of inertia tensor"; parameter SI.Inertia I_33=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,3) element of inertia tensor"; parameter SI.Inertia I_21=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (2,1) element of inertia tensor"; parameter SI.Inertia I_31=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,1) element of inertia tensor"; parameter SI.Inertia I_32=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,2) element of inertia tensor"; final parameter SI.Inertia Inert[3, 3]=[I_11, I_21, I_31; I_21, I_22, I_32; I_31, I_32, I_33] "inertia tensor"; parameter MB.Types.Init.Temp initType=MB.Types.Init.Free "|Initialization|| Type of initialization (defines usage of start values below)"; parameter Boolean useTransVelocities = false "|Initialization|| use the translational velocities (defines usage of start values below)"; parameter Cv.NonSIunits.Angle_deg phi_start[3] = {0,0,0} "|Initialization||initial cardan angles in degree"; parameter Types.AngularVelocity_deg w_start[3] = {0,0,0} "|Initialization||initial angular velocity in deg/s"; parameter Types.AngularAcceleration_deg z_start[3] = {0,0,0} "|Initialization||initial angular acceleration in deg/s2"; parameter SI.Position x_start[3] = {0,0,0} "|Initialization||initial position"; parameter SI.Velocity v_start[3] = {0,0,0} "|Initialization||initial velocity"; parameter SI.Acceleration a_start[3] = {0,0,0} "|Initialization||initial acceleration"; final parameter SI.Angle phi_start_rad[3] = Cv.from_deg(phi_start) "initial cardan angles"; final parameter SI.AngularVelocity w_start_rad[3] = Cv.from_deg(w_start) "initial angular velocity"; final parameter SI.AngularAcceleration z_start_rad[3] = Cv.from_deg(z_start) "initial angular acceleration"; parameter SI.Radius rRim = 0.9*r "|Animation|| radius of rim"; parameter SI.Diameter wWheel = 0.1*r "|Animation|| width of the wheel"; parameter MB.Types.Color tireColor= {64,64,64} "|Animation|| Color of the tire"; parameter MB.Types.Color rodColor= {128,0,0} "|Animation|| Color of the rods"; parameter MB.Types.Color contactColor= {128,128,128} "|Animation|| Color of the contactpoint"; parameter Boolean enforceStates = false "|Advanced||enforce Quaternions or cardan angles and w as states"; parameter Boolean useQuaternions = false "|Advanced||use Quaternions instead of cardan angles"; final parameter Types.RotationSequence sequence_angles = {2,1,3} "|Advanced||sequence of the cardan angles"; final parameter Types.Quaternion Q_start = Utilities.AxesRotQ(phi_start_rad,sequence_angles); SI.Position xA(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) "Position in direction of eA"; SI.Position xB(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) "Position in direction of eB"; SI.Position x[3] "Position of the frame"; SI.Velocity v[3] "Velocity"; Types.Quaternion Q(stateSelect=if useQuaternions then StateSelect.prefer else StateSelect.never,start = Q_start, fixed = false) "quaternions"; SI.Angle phi[3](stateSelect=if not useQuaternions then (if enforceStates then StateSelect.always else StateSelect.prefer) else StateSelect.never) "cardan angles"; SI.Angle phi_d[3](stateSelect=if not useQuaternions then (if enforceStates then StateSelect.always else StateSelect.prefer) else StateSelect.never) "cardan angles derivatives"; SI.AngularVelocity w[3](stateSelect=if useQuaternions then (if enforceStates then StateSelect.always else StateSelect.prefer) else StateSelect.default) "angular velocity"; SI.Acceleration a[3] "Acceleration"; SI.AngularAcceleration z[3] "angular acceleration"; public Interfaces.Frame_b frame_b; WheelJoint WheelJoint1( animation=animation, r=r, n=n, d=d, rRim=rRim, wWheel=wWheel, tireColor=tireColor, rodColor=rodColor, contactColor=contactColor); Parts.Body WheelBody( animation=false, m=m, I_11=I_11, I_22=I_22, I_33=I_33, I_21=I_21, I_31=I_31, I_32=I_32, initType=Modelica.Mechanics.MultiBody.Types.Init.Free, enforceStates=false, useQuaternions=useQuaternions, sequence_angles={2,1,3}); initial equation if initType == MB.Types.Init.Position or initType == MB.Types.Init. PositionVelocity or initType == MB.Types.Init.PositionVelocityAcceleration then // Initialize positional variables xA = x_start*WheelJoint1.eA; xB = x_start*WheelJoint1.eB; if useQuaternions then Q[1:3] = Q_start[1:3]; else phi = phi_start_rad; end if; end if; if initType == MB.Types.Init.PositionVelocity or initType == MB.Types.Init. PositionVelocityAcceleration or initType == MB.Types.Init.Velocity or initType == MB.Types.Init.VelocityAcceleration then // Initialize velocity variables if useTransVelocities then v*WheelJoint1.eA = v_start*WheelJoint1.eA; v*WheelJoint1.eB = v_start*WheelJoint1.eB; w*WheelJoint1.eN = w_start_rad*WheelJoint1.eN; else w = w_start_rad; end if; end if; if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init. PositionVelocityAcceleration then // Initialize acceleration variables if useTransVelocities then a*WheelJoint1.eA = a_start*WheelJoint1.eA; a*WheelJoint1.eB = a_start*WheelJoint1.eB; z*WheelJoint1.eN = z_start_rad*WheelJoint1.eN; else z = z_start_rad; end if; end if; if initType == MB.Types.Init.SteadyState then w = zeros(3); z = zeros(3); end if; equation x = WheelBody.PotentialFBM1.x; v = WheelBody.PotentialFBM1.v; a = WheelBody.PotentialFBM1.a; phi = WheelBody.PotentialFBM1.phi; phi_d = WheelBody.PotentialFBM1.phi_d; Q = WheelBody.PotentialFBM1.Q; w = WheelBody.PotentialFBM1.w; z = WheelBody.PotentialFBM1.z; xA = x*WheelJoint1.eA; xB = x*WheelJoint1.eB; connect(WheelBody.frame_a, frame_b); connect(WheelJoint1.frame_b, frame_b); end Wheel;
The inertia tensor of the marble is a symmetric 3x3 matrix and can be specified by the parameters I11, I12, ...
The radius of the marble can be defined by the parameter r.
The rolling plane can be specified by the vector n (pointing upwards) and the distance of the plane from the origin d.
The parameter animation toggles the visualization
The ideal rolling restricts the marble's position on the plane and the statement of the initial position is overdetermined. Therefore the initial position is automatically projected on the rolling plane.
The ideal rolling restricts the marble's movement. The initial velocities and angular velocities form an overdetermined initial statement.
By the activation of useTransVelocity, all velocities are defined by the translational movement on the plane and the rotation around the plane's normal vector.
Otherwise all initial angular velocities are taken to define the initial movement.
The orientation can either be expressed by the three cardan angles or by quaternions.
Which of these two variants is used, can be specified by the parameter useQuaternions.
Type | Name | Default | Description |
---|---|---|---|
Boolean | animation | true | animate marble |
Radius | r | 1 | radius of wheel [m] |
Real | n[3] | {0,1,0} | vector normal to rolling plane, pointing upwards |
Distance | d | 0 | distance of rolling plane o origin [m] |
Mass | m | 1 | mass of body [kg] |
Inertia tensor (resolved in center of mass, parallel to frame_a) | |||
Inertia | I_11 | 0.001 | (1,1) element of inertia tensor [kg.m2] |
Inertia | I_22 | 0.001 | (2,2) element of inertia tensor [kg.m2] |
Inertia | I_33 | 0.001 | (3,3) element of inertia tensor [kg.m2] |
Inertia | I_21 | 0 | (2,1) element of inertia tensor [kg.m2] |
Inertia | I_31 | 0 | (3,1) element of inertia tensor [kg.m2] |
Inertia | I_32 | 0 | (3,2) element of inertia tensor [kg.m2] |
Initialization | |||
Temp | initType | MB.Types.Init.Free | Type of initialization (defines usage of start values below) |
Boolean | useTransVelocities | false | use the translational velocities (defines usage of start values below) |
Angle_deg | phi_start[3] | {0,0,0} | initial cardan angles in degree [deg] |
AngularVelocity_deg | w_start[3] | {0,0,0} | initial angular velocity in deg/s [deg/s] |
AngularAcceleration_deg | z_start[3] | {0,0,0} | initial angular acceleration in deg/s2 [deg/s2] |
Position | x_start[3] | {0,0,0} | initial position [m] |
Velocity | v_start[3] | {0,0,0} | initial velocity [m/s] |
Acceleration | a_start[3] | {0,0,0} | initial acceleration [m/s2] |
Advanced | |||
Boolean | enforceStates | false | enforce Quaternions or cardan angles and w as states |
Boolean | useQuaternions | false | use Quaternions instead of cardan angles |
Type | Name | Description |
---|---|---|
Frame_b | frame_b |
model Marble "complete model of a marble" import SI = Modelica.SIunits; import MB = Modelica.Mechanics.MultiBody; import Cv = Modelica.SIunits.Conversions; parameter Boolean animation = true "animate marble"; parameter SI.Radius r=1 "radius of wheel"; parameter Real n[3] = {0,1,0} "vector normal to rolling plane, pointing upwards"; parameter SI.Distance d=0 "distance of rolling plane o origin"; parameter SI.Mass m = 1 "mass of body"; parameter SI.Inertia I_11=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (1,1) element of inertia tensor"; parameter SI.Inertia I_22=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (2,2) element of inertia tensor"; parameter SI.Inertia I_33=0.001 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,3) element of inertia tensor"; parameter SI.Inertia I_21=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (2,1) element of inertia tensor"; parameter SI.Inertia I_31=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,1) element of inertia tensor"; parameter SI.Inertia I_32=0 "|Inertia tensor (resolved in center of mass, parallel to frame_a)| (3,2) element of inertia tensor"; final parameter SI.Inertia Inert[3, 3]=[I_11, I_21, I_31; I_21, I_22, I_32; I_31, I_32, I_33] "inertia tensor"; parameter MB.Types.Init.Temp initType=MB.Types.Init.Free "|Initialization|| Type of initialization (defines usage of start values below)"; parameter Boolean useTransVelocities = false "|Initialization|| use the translational velocities (defines usage of start values below)"; parameter Cv.NonSIunits.Angle_deg phi_start[3] = {0,0,0} "|Initialization||initial cardan angles in degree"; parameter Types.AngularVelocity_deg w_start[3] = {0,0,0} "|Initialization||initial angular velocity in deg/s"; parameter Types.AngularAcceleration_deg z_start[3] = {0,0,0} "|Initialization||initial angular acceleration in deg/s2"; parameter SI.Position x_start[3] = {0,0,0} "|Initialization||initial position"; parameter SI.Velocity v_start[3] = {0,0,0} "|Initialization||initial velocity"; parameter SI.Acceleration a_start[3] = {0,0,0} "|Initialization||initial acceleration"; final parameter SI.Angle phi_start_rad[3] = Cv.from_deg(phi_start) "initial cardan angles"; final parameter SI.AngularVelocity w_start_rad[3] = Cv.from_deg(w_start) "initial angular velocity"; final parameter SI.AngularAcceleration z_start_rad[3] = Cv.from_deg(z_start) "initial angular acceleration"; parameter Boolean enforceStates = false "|Advanced||enforce Quaternions or cardan angles and w as states"; parameter Boolean useQuaternions = false "|Advanced||use Quaternions instead of cardan angles"; final parameter Types.RotationSequence sequence_angles = {2,1,3} "|Advanced||sequence of the cardan angles"; final parameter Types.Quaternion Q_start = Utilities.AxesRotQ(phi_start_rad,sequence_angles); SI.Position xA(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) "Position in direction of eA"; SI.Position xB(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) "Position in direction of eB"; SI.Position x[3] "Position of the frame"; SI.Velocity v[3] "Velocity"; Types.Quaternion Q(stateSelect=if useQuaternions then StateSelect.prefer else StateSelect.never,start = Q_start, fixed = false) "quaternions"; SI.Angle phi[3](stateSelect=if not useQuaternions then (if enforceStates then StateSelect.always else StateSelect.prefer) else StateSelect.never) "cardan angles"; SI.Angle phi_d[3](stateSelect=if not useQuaternions then (if enforceStates then StateSelect.always else StateSelect.prefer) else StateSelect.never) "cardan angles derivatives"; SI.AngularVelocity w[3](stateSelect=if useQuaternions then (if enforceStates then StateSelect.always else StateSelect.prefer) else StateSelect.default) "angular velocity"; SI.Acceleration a[3] "Acceleration"; SI.AngularAcceleration z[3] "angular acceleration"; public Interfaces.Frame_b frame_b; Parts.Body WheelBody( animation=false, m=m, I_11=I_11, I_22=I_22, I_33=I_33, I_21=I_21, I_31=I_31, I_32=I_32, initType=Modelica.Mechanics.MultiBody.Types.Init.Free, enforceStates=false, useQuaternions=useQuaternions, sequence_angles={2,1,3}); MarbleJoint MarbleJoint1; initial equation if initType == MB.Types.Init.Position or initType == MB.Types.Init. PositionVelocity or initType == MB.Types.Init.PositionVelocityAcceleration then // Initialize positional variables xA = x_start*MarbleJoint1.eA; xB = x_start*MarbleJoint1.eB; if useQuaternions then Q[1:3] = Q_start[1:3]; else phi = phi_start_rad; end if; end if; if initType == MB.Types.Init.PositionVelocity or initType == MB.Types.Init. PositionVelocityAcceleration or initType == MB.Types.Init.Velocity or initType == MB.Types.Init.VelocityAcceleration then // Initialize velocity variables if useTransVelocities then v*MarbleJoint1.eA = v_start*MarbleJoint1.eA; v*MarbleJoint1.eB = v_start*MarbleJoint1.eB; w*MarbleJoint1.eN = w_start_rad*MarbleJoint1.eN; else w = w_start_rad; end if; end if; if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init. PositionVelocityAcceleration then // Initialize acceleration variables if useTransVelocities then a*MarbleJoint1.eA = a_start*MarbleJoint1.eA; a*MarbleJoint1.eB = a_start*MarbleJoint1.eB; z*MarbleJoint1.eN = z_start_rad*MarbleJoint1.eN; else z = z_start_rad; end if; end if; if initType == MB.Types.Init.SteadyState then w = zeros(3); z = zeros(3); end if; equation x = WheelBody.PotentialFBM1.x; v = WheelBody.PotentialFBM1.v; a = WheelBody.PotentialFBM1.a; phi = WheelBody.PotentialFBM1.phi; phi_d = WheelBody.PotentialFBM1.phi_d; Q = WheelBody.PotentialFBM1.Q; w = WheelBody.PotentialFBM1.w; z = WheelBody.PotentialFBM1.z; xA = x*MarbleJoint1.eA; xB = x*MarbleJoint1.eB; connect(WheelBody.frame_a, frame_b); connect(MarbleJoint1.frame_b, frame_b); end Marble;