MultiBondLib.Mechanics3D.Joints

joint elements

MultiBondLib.Mechanics3D.Joints.Prismatic MultiBondLib.Mechanics3D.Joints.Revolute MultiBondLib.Mechanics3D.Joints.Spherical MultiBondLib.Mechanics3D.Joints.FreeTranslationalMovement MultiBondLib.Mechanics3D.Joints.FreeBodyMovement MultiBondLib.Mechanics3D.Joints.PotentialFBM MultiBondLib.Mechanics3D.Joints.CloseLoop MultiBondLib.Mechanics3D.Joints.CutJoints

Information


This package contains models of joints.

Joints are massles objects, that define the relative movement between two rigid elements. The number of degrees of freedom specifies how many variables are minimally needed to describe the relative position. An object in 3D-space can have up to 6 degrees of freedom.

Joints usually define integrators and the joint variables on positional and velocity level become state variables of the system. Anyhow the integrators might be removed by the Pantelides algorithm, if the joint is placed in a kinematic loop.
The number of degrees of freedom equals the number of potential state variables.

It is possible and common to create complex joints out of simple joints. However, one has to pay attention that no singularities occur if two or more joints are connected (directly or through massless elements).

NameDescription
Prismatic prismatic joint with 1 degree of freedom
Revolute revolute joint with 1 degree of freedom
Spherical spherical joint with all 3 rotational degrees of freedom
FreeTranslationalMovement joint with all 3 translational degrees of freedom
FreeBodyMovement joint with all 6 degrees of freedom
PotentialFBM potential joint with all 6 degrees of freedom
CloseLoop element to close kinematik loops manualy
CutJoints elements to handle kinamitk loops


MultiBondLib.Mechanics3D.Joints.Prismatic MultiBondLib.Mechanics3D.Joints.Prismatic

prismatic joint with 1 degree of freedom

MultiBondLib.Mechanics3D.Joints.Prismatic

Information


This is a prismatic joint. The two connected frames are allowed to shift in direction of the joint axis.
This joint defines one degree of freedom. 

General parameter

The joint axis can be defined by the parameter n. n can be of arbitrary length, but it must not be zero.

The parameter s_offset defines an offset value for the joint length s.

The parameter animation toggles the visualization of the element.

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element is visualized by box. The settings for width, height and color can be specified by the animation parameters.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

Parameters

NameDefaultDescription
animationtrueanimate prismatic joint as box
n[3]{1,0,0}direction of the joint axis [m]
s_offset0Relative distance offset (distance between frame_a and frame_b = s_offset + s) [m]
Initialization
initTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
s_start0initial length [m]
v_start0initial velocity [m/s]
a_start0initial acceleration [m/s2]
Animation
if animation = true
boxWidthworld3D.defaultJointWidth Width of prismatic joint box [m]
boxHeightboxWidth Height of prismatic joint box [m]
boxColorworld3D.defaultJointColor Color of prismatic joint box
Advanced
enforceStatesfalseenforce s and v as states
frame_aredeclare Interfaces.Frame_a...replaceable Interface for further extensions
frame_bredeclare Interfaces.Frame_b...replaceable Interface for further extensions

Modelica definition

model Prismatic "prismatic joint with 1 degree of freedom" 
  import SI = Modelica.SIunits;
  import MB = Modelica.Mechanics.MultiBody;
  
  parameter Boolean animation = true "animate prismatic joint as box";
  
  parameter SI.Position n[3] = {1,0,0} "direction of the joint axis";
  parameter SI.Position s_offset=0 
    "Relative distance offset (distance between frame_a and frame_b = s_offset + s)";
  final parameter SI.Position eN[3] = n/sqrt(n*n);
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  parameter SI.Distance s_start = 0 "|Initialization|initial length";
  parameter SI.Velocity v_start = 0 "|Initialization|initial velocity";
  parameter SI.Acceleration a_start = 0 "|Initialization|initial acceleration";
  
  parameter SI.Distance boxWidth=world3D.defaultJointWidth 
    "|Animation|if animation = true| Width of prismatic joint box";
  parameter SI.Distance boxHeight=boxWidth 
    "|Animation|if animation = true| Height of prismatic joint box";
  parameter Modelica.Mechanics.MultiBody.Types.Color boxColor=world3D.defaultJointColor 
    "|Animation|if animation = true| Color of prismatic joint box";
  
  parameter Boolean enforceStates =  false 
    "|Advanced||enforce s and v as states";
  
  SI.Position s(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "length of prismatic joint";
  SI.Velocity v(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "velocity of prismatic joint";
  SI.Acceleration a "acceleration of prismatic joint";
  
  replaceable Interfaces.Frame_a frame_a 
    "|Advanced||replaceable Interface for further extensions";
  replaceable Interfaces.Frame_b frame_b 
    "|Advanced||replaceable Interface for further extensions";
  
protected 
  outer World3D world3D;
  inner Defaults MBG_defaults(n=3);
  replaceable Interfaces.Mech2MBG Mech2MBG1;
  replaceable Interfaces.MBG2Mech MBG2Mech1;
  Junctions.J1 J1_1(n=1);
  Sources.Se Se1(e0={0}, n=1);
  Sensors.Dq Dq1(stateInitialCondition=false,q(stateSelect = StateSelect.never), n=1);
  Passive.mTF_effort mTF_effort1;
  Bonds.Utilities.MultiBondTail MultiBondTail2;
  Junctions.J0 J0_1;
  Junctions.J1 J1_2;
  AdditionalMBG.translational_mTF translational_mTF1(r=eN);
  Passive.mTF_effort mTF_effort2;
  Bonds.MultiBond MultiBond2;
  Bonds.MultiBond MultiBond11;
  Bonds.MultiBond MultiBond8;
  Bonds.MultiBond MultiBond1;
  Bonds.MultiBond MultiBond3;
  Bonds.MultiBond MultiBond5(n=1);
  Bonds.MultiBond MultiBond6;
  Bonds.MultiBond MultiBond7(n=1);
  Bonds.MultiBond MultiBond9;
  Bonds.MultiBond MultiBond10;
  Bonds.MultiBond MultiBond4(n=1);
  Bonds.MultiBond MultiBond12;
  Bonds.Utilities.MultiBondTail MultiBondTail1;
  Bonds.Utilities.MultiBondTail MultiBondTail3;
  Bonds.Utilities.MultiBondTail MultiBondTail4;
  Bonds.Utilities.MultiBondTail MultiBondTail5;
  Bonds.Utilities.MultiBondTail MultiBondTail6;
  Utilities.Translation Translation1(r=eN);
  
  parameter Integer ndim=if world3D.enableAnimation and animation then 1 else 0;
  MB.Visualizers.Advanced.Shape box[ndim](
    each shapeType="box",
    each color=boxColor,
    each length=Dq1.q[1],
    each width=boxWidth,
    each height=boxHeight,
    each lengthDirection=eN,
    each widthDirection={0,0,1},
    each r_shape={0,0,0},
    each r=Mech2MBG1.x,
    each R=MB.Frames.Orientation(T=Mech2MBG1.R,w=zeros(3)));
  
public 
  Passive.TF2_effort projectiveTF(
    nA=3,
    nB=1,
    M={eN});
initial equation 
  if initType == MB.Types.Init.Position or initType == MB.Types.Init.
      PositionVelocity or initType == MB.Types.Init.PositionVelocityAcceleration then
    // Initialize positional variables
    s = s_start;
  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
    v = v_start;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    a = a_start;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    v = 0;
    a = 0;
  end if;
  
equation 
  defineBranch(frame_a.P,frame_b.P);
  
  s = Dq1.q[1]-s_offset;
  v = J1_1.MultiBondCon1.f[1];
  a = der(v);
  connect(Mech2MBG1.frame_a, frame_a);
  connect(MBG2Mech1.frame_b, frame_b);
  connect(MultiBond7.MultiBondCon1, J1_1.MultiBondCon1);
  connect(MultiBond7.MultiBondCon2, Dq1.MultiBondCon1);
  connect(Mech2MBG1.x, Translation1.x1);
  connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
  connect(MultiBond1.MultiBondCon1, J0_1.MultiBondCon2);
  connect(MultiBond3.MultiBondCon2, J0_1.MultiBondCon1);
  connect(MultiBond3.MultiBondCon1, Mech2MBG1.MultiBondConTrans);
  connect(MultiBond2.MultiBondCon2, J1_2.MultiBondCon1);
  connect(MultiBond2.MultiBondCon1, Mech2MBG1.MultiBondConRot);
  connect(MultiBond11.MultiBondCon2, MBG2Mech1.MultiBondConRot);
  connect(Translation1.x2, MBG2Mech1.x);
  connect(Mech2MBG1.R, MBG2Mech1.R);
  connect(Translation1.R, Mech2MBG1.R);
  connect(mTF_effort1.M, Mech2MBG1.R);
  connect(mTF_effort1.MultiBondCon1, MultiBond10.MultiBondCon1);
  connect(MultiBond9.MultiBondCon2, mTF_effort1.MultiBondCon2);
  connect(MultiBond8.MultiBondCon1, J1_2.MultiBondCon4);
  connect(J1_2.MultiBondCon2, MultiBond11.MultiBondCon1);
  connect(J0_1.MultiBondCon3, MultiBond10.MultiBondCon2);
  connect(MultiBond6.MultiBondCon2, J0_1.MultiBondCon4);
  connect(MultiBond5.MultiBondCon1, J1_1.MultiBondCon2);
  connect(MultiBond4.MultiBondCon2, J1_1.MultiBondCon3);
  connect(Se1.MultiBondCon1, MultiBond4.MultiBondCon1);
  connect(Translation1.ampl, Dq1.q[1]);
  connect(translational_mTF1.MultiBondCon1, MultiBond8.MultiBondCon2);
  connect(translational_mTF1.MultiBondCon2, MultiBond9.MultiBondCon1);
  connect(translational_mTF1.ampl, Dq1.q[1]);
  connect(mTF_effort2.MultiBondCon2, MultiBond12.MultiBondCon2);
  connect(mTF_effort2.MultiBondCon1, MultiBond6.MultiBondCon1);
  connect(mTF_effort2.M, MBG2Mech1.R);
  connect(projectiveTF.MultiBondConB, MultiBond5.MultiBondCon2);
  connect(projectiveTF.MultiBondConA, MultiBond12.MultiBondCon1);
end Prismatic;

MultiBondLib.Mechanics3D.Joints.Revolute MultiBondLib.Mechanics3D.Joints.Revolute

revolute joint with 1 degree of freedom

MultiBondLib.Mechanics3D.Joints.Revolute

Information


This is a revolute joint. The two connected frames are allowed to rotate around the joint axis.
This joint defines one degree of freedom. 

General parameter

The rotation axis of the revolute joint can be defined by the parameter n. n can be of arbitrary length, but it must not be zero.

The parameter phi_offset defines an offset value for the revolute angle phi.

The parameter animation toggles the visualization of the element.

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element is visualized by cylinder along the rotation axis. The settings for length, diameter and color can be specified by the animation parameters.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

Parameters

NameDefaultDescription
animationtrueanimate revolute joint as cylinder
n[3]{0,0,1}direction of revolute axis [m]
phi_offset0phi + phi_offset = angle between frames [rad]
Initialization
initTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
phi_start0initial angle [rad]
w_start0initial angular velocity [rad/s]
z_start0initial angular acceleration [rad/s2]
Animation
if animation = true
cylinderLengthworld3D.defaultJointLength Length of cylinder representing the joint axis [m]
cylinderDiameterworld3D.defaultJointWidth Diameter of cylinder representing the joint axis [m]
cylinderColorworld3D.defaultJointColor Color of cylinder representing the joint axis
Advanced
enforceStatesfalseenforce phi and w as states
frame_aredeclare Interfaces.Frame_a...replaceable Interface for further extensions
frame_bredeclare Interfaces.Frame_b...replaceable Interface for further extensions

Modelica definition

model Revolute "revolute joint with 1 degree of freedom" 
  import SI = Modelica.SIunits;
  import MB = Modelica.Mechanics.MultiBody;
  
  parameter Boolean animation = true "animate revolute joint as cylinder";
  parameter SI.Position n[3] = {0,0,1} "direction of revolute axis";
  final parameter SI.Position eN[3] = n/sqrt(n*n);
  parameter SI.Angle phi_offset = 0 "phi + phi_offset = angle between frames";
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  parameter SI.Angle phi_start = 0 "|Initialization|initial angle";
  parameter SI.AngularVelocity w_start = 0 
    "|Initialization|initial angular velocity";
  parameter SI.AngularAcceleration z_start = 0 
    "|Initialization|initial angular acceleration";
  
  parameter SI.Distance cylinderLength=world3D.defaultJointLength 
    "|Animation|if animation = true| Length of cylinder representing the joint axis";
  parameter SI.Distance cylinderDiameter=world3D.defaultJointWidth 
    "|Animation|if animation = true| Diameter of cylinder representing the joint axis";
  parameter Modelica.Mechanics.MultiBody.Types.Color cylinderColor=world3D.defaultJointColor 
    "|Animation|if animation = true| Color of cylinder representing the joint axis";
  
  parameter Boolean enforceStates =  false 
    "|Advanced||enforce phi and w as states";
  
  SI.Angle phi(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "revolute angle";
  SI.AngularVelocity w(stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "revolute angular velocity";
  SI.AngularAcceleration z "revolute angular acceleration";
  
  replaceable Interfaces.Frame_a frame_a 
    "|Advanced||replaceable Interface for further extensions";
  replaceable Interfaces.Frame_b frame_b 
    "|Advanced||replaceable Interface for further extensions";
  
protected 
  outer World3D world3D;
  inner Defaults MBG_defaults(n=3);
  replaceable Interfaces.Mech2MBG Mech2MBG1;
  replaceable Interfaces.MBG2Mech MBG2Mech1;
  Junctions.J1 J1_1(n=1);
  Sources.Se Se1(n=1, e0={0});
  Sensors.Dq Dq_phi(stateInitialCondition=false, n=1);
  Junctions.J0 J0_1;
  AdditionalMBG.mTF mTF1;
  Bonds.MultiBond MultiBond7;
  Bonds.MultiBond MultiBond8;
  Bonds.MultiBond MultiBond6(n=1);
   Bonds.MultiBond MultiBond1;
  Bonds.MultiBond MultiBond2;
  Bonds.MultiBond MultiBond3;
  Bonds.MultiBond MultiBond5(n=1);
  Bonds.MultiBond MultiBond9(n=1);
  Bonds.Utilities.MultiBondTail MultiBondTail1;
  Bonds.Utilities.MultiBondTail MultiBondTail2;
  Bonds.Utilities.MultiBondTail MultiBondTail3;
  Utilities.Rotation Rotation1;
  Utilities.planarRotation planarRotation1(n=eN);
  
  parameter Integer ndim=if world3D.enableAnimation and animation then 1 else 0;
  MB.Visualizers.Advanced.Shape cylinder[ndim](
    each shapeType="cylinder",
    each color=cylinderColor,
    each length=cylinderLength,
    each width=cylinderDiameter,
    each height=cylinderDiameter,
    each lengthDirection=eN,
    each widthDirection={0,1,0},
    each r_shape=-eN*cylinderLength/2,
    each r=Mech2MBG1.x,
    each R=MB.Frames.Orientation(T=Mech2MBG1.R,w=zeros(3)));
  
public 
  Passive.TF2_effort projectiveTF(
    nA=3,
    nB=1,
    M={eN});
initial equation 
  if initType == MB.Types.Init.Position or initType == MB.Types.Init.
      PositionVelocity or initType == MB.Types.Init.PositionVelocityAcceleration then
    // Initialize positional variables
    phi = phi_start;
  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
    w = w_start;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    z = z_start;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    w = 0;
    z = 0;
  end if;
  
equation 
  defineBranch(frame_a.P,frame_b.P);
  
  if rooted(frame_a.P) then
    Rotation1.dirForward = true;
    mTF1.transformFlow = true;
  else
    Rotation1.dirForward = false;
    mTF1.transformFlow = false;
  end if;
  
  phi = Dq_phi.q[1]-phi_offset;
  w = J1_1.MultiBondCon1.f[1];
  z = der(w);
  connect(MBG2Mech1.frame_b, frame_b);
  connect(Mech2MBG1.frame_a, frame_a);
  connect(Mech2MBG1.x, MBG2Mech1.x);
  connect(Mech2MBG1.R, Rotation1.R1);
  connect(Rotation1.R2, MBG2Mech1.R);
  connect(planarRotation1.phi, Dq_phi.q[1]);
  connect(planarRotation1.Rrel, Rotation1.Rrel);
  connect(MultiBond5.MultiBondCon1, J1_1.MultiBondCon4);
  connect(MultiBond8.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
  connect(MultiBond8.MultiBondCon1, Mech2MBG1.MultiBondConTrans);
  connect(MultiBond7.MultiBondCon2, MBG2Mech1.MultiBondConRot);
  connect(MultiBond2.MultiBondCon1, Mech2MBG1.MultiBondConRot);
  connect(J0_1.MultiBondCon2, MultiBond7.MultiBondCon1);
  connect(MultiBond1.MultiBondCon2, J0_1.MultiBondCon1);
  connect(MultiBond3.MultiBondCon2, J0_1.MultiBondCon3);
  connect(MultiBond9.MultiBondCon2, J1_1.MultiBondCon2);
  connect(Se1.MultiBondCon1, MultiBond9.MultiBondCon1);
  connect(MultiBond6.MultiBondCon1, J1_1.MultiBondCon1);
  connect(Dq_phi.MultiBondCon1, MultiBond6.MultiBondCon2);
  connect(mTF1.MultiBondCon1, MultiBond2.MultiBondCon2);
  connect(mTF1.MultiBondCon2, MultiBond1.MultiBondCon1);
  connect(mTF1.M, planarRotation1.Rrel);
  connect(projectiveTF.MultiBondConA, MultiBond3.MultiBondCon1);
  connect(projectiveTF.MultiBondConB, MultiBond5.MultiBondCon2);
end Revolute;

MultiBondLib.Mechanics3D.Joints.Spherical MultiBondLib.Mechanics3D.Joints.Spherical

spherical joint with all 3 rotational degrees of freedom

MultiBondLib.Mechanics3D.Joints.Spherical

Information


This is an spherical joint. The two connected frames are allowed to rotate freely.
This joint defines three degrees of freedom. 

General parameter

The parameter animation toggles the visualization of the element

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element is visualized by a sphere.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

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. If cardan angles are chosen to be used, you can specify the sequence of rotation axis by the parameter sequence_angles.


Parameters

NameDefaultDescription
animationtrueanimate spherical joint as sphere
Initialization
initTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
phi_start[3]{0,0,0}initial cardan angles in degree [deg]
w_start[3]{0,0,0}initial angular velocity in deg/s [deg/s]
z_start[3]{0,0,0}initial angular acceleration in deg/s2 [deg/s2]
if animation = true
sphereDiameterworld3D.defaultJointLength Diameter of sphere representing the spherical joint [m]
sphereColorworld3D.defaultJointColor Color of sphere representing the spherical joint
Advanced
enforceStatesfalseenforce Quaternions or cardan angles and w as states
useQuaternionstrueuse Quaternions instead of cardan angles
sequence_angles{1,2,3}sequence of the cardan angles
frame_aredeclare Interfaces.Frame_a...replaceable Interface for further extensions
frame_bredeclare Interfaces.Frame_b...replaceable Interface for further extensions

Modelica definition

model Spherical 
  "spherical joint with all 3 rotational degrees of freedom" 
  import SI = Modelica.SIunits;
  import Cv = Modelica.SIunits.Conversions;
  
  import MB = Modelica.Mechanics.MultiBody;
  import MultiBondLib;
  
  parameter Boolean animation = true "animate spherical joint as sphere";
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (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";
  
  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.Distance sphereDiameter=world3D.defaultJointLength 
    "|if animation = true| Diameter of sphere representing the spherical joint";
  parameter MB.Types.Color sphereColor=world3D.defaultJointColor 
    "|if animation = true| Color of sphere representing the spherical joint";
  
  parameter Boolean enforceStates =  false 
    "|Advanced||enforce Quaternions or cardan angles and w as states";
  parameter Boolean useQuaternions =  true 
    "|Advanced||use Quaternions instead of cardan angles";
  parameter Types.RotationSequence sequence_angles = {1,2,3} 
    "|Advanced||sequence of the cardan angles";
  
  final parameter Types.Quaternion Q_start = Utilities.AxesRotQ(phi_start_rad,sequence_angles);
  
  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.AngularAcceleration z[3] "angular acceleration";
  
  replaceable Interfaces.Frame_a frame_a 
    "|Advanced||replaceable Interface for further extensions";
  replaceable Interfaces.Frame_b frame_b 
    "|Advanced||replaceable Interface for further extensions";
  
protected 
  outer World3D world3D;
  inner Defaults MBG_defaults(n=3);
  replaceable Interfaces.Mech2MBG Mech2MBG1;
  replaceable Interfaces.MBG2Mech MBG2Mech1;
  Junctions.J1 J1_1(n=3);
  Sources.Se Se1(     e0={0}, n=3);
  Sensors.Df Df1(n=3);
  MultiBondLib.Junctions.J0 J0_1;
  AdditionalMBG.mTF mTF1;
  Bonds.MultiBond MultiBond1;
  Bonds.MultiBond MultiBond2;
  Bonds.MultiBond MultiBond3;
  Bonds.MultiBond MultiBond4;
  Bonds.MultiBond MultiBond7;
  Bonds.MultiBond MultiBond5;
  Bonds.MultiBond MultiBond6;
  Bonds.Utilities.MultiBondTail MultiBondTail1;
  Bonds.Utilities.MultiBondTail MultiBondTail2;
  Bonds.Utilities.MultiBondTail MultiBondTail3;
  
  Utilities.Rotation Rotation1;
  Utilities.toQuaternions toQuaternions1 if useQuaternions;
  Utilities.quaternionRotation quaternionRotation1 if useQuaternions;
  Utilities.cardanRotation cardanRotation1(
      sequence_angles=sequence_angles) if                                   not useQuaternions;
  Utilities.toCardanAngles toCardanAngles1(sequence_angles=sequence_angles) if 
                                                  not useQuaternions;
  MultiBondLib.Interfaces.RealSignal S_Q[4];
  MultiBondLib.Interfaces.RealSignal S_phi[ 3];
  
  parameter Integer ndim=if world3D.enableAnimation and animation then 1 else 0;
  MB.Visualizers.Advanced.Shape sphere[ndim](
    each shapeType="sphere",
    each color=sphereColor,
    each length=sphereDiameter,
    each width=sphereDiameter,
    each height=sphereDiameter,
    each lengthDirection={0,0,1},
    each widthDirection={0,1,0},
    each r_shape=-{0,0,1}*sphereDiameter/2,
    each r=Mech2MBG1.x,
    each R=MB.Frames.Orientation(T=Mech2MBG1.R,w=zeros(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
    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
    w = w_start_rad;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    z = z_start_rad;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    w = zeros(3);
    z = zeros(3);
  end if;
  
equation 
  defineBranch(frame_a.P,frame_b.P);
  
  if rooted(frame_a.P) then
    Rotation1.dirForward = true;
    mTF1.transformFlow = true;
  else
    Rotation1.dirForward = false;
    mTF1.transformFlow = false;
  end if;
  
  Q = S_Q;
  phi = S_phi;
  w = Df1.f_out;
  
  if useQuaternions then
    phi = zeros(3); //dummy
    phi_d = zeros(3);
  else
    Q = {0,0,0,1}; //dummy
    phi_d = der(phi);
  end if;
  z = der(w);
  connect(MBG2Mech1.frame_b, frame_b);
  connect(Mech2MBG1.frame_a, frame_a);
  connect(Mech2MBG1.x, MBG2Mech1.x);
  connect(Mech2MBG1.R, Rotation1.R1);
  connect(Rotation1.R2, MBG2Mech1.R);
  connect(toQuaternions1.Q, quaternionRotation1.Q);
  connect(quaternionRotation1.Rrel, Rotation1.Rrel);
  connect(toQuaternions1.w, Df1.f_out);
  connect(J1_1.MultiBondCon4, MultiBond3.MultiBondCon1);
  connect(MultiBond5.MultiBondCon1, J1_1.MultiBondCon3);
  connect(Df1.MultiBondCon1, MultiBond5.MultiBondCon2);
  connect(MultiBond4.MultiBondCon2, J1_1.MultiBondCon1);
  connect(Se1.MultiBondCon1, MultiBond4.MultiBondCon1);
  connect(MultiBond6.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
  connect(MultiBond6.MultiBondCon1, Mech2MBG1.MultiBondConTrans);
  connect(J0_1.MultiBondCon1, MultiBond1.MultiBondCon2);
  connect(J0_1.MultiBondCon2, MultiBond7.MultiBondCon1);
  connect(J0_1.MultiBondCon3, MultiBond3.MultiBondCon2);
  connect(MultiBond2.MultiBondCon1, Mech2MBG1.MultiBondConRot);
  connect(MultiBond7.MultiBondCon2, MBG2Mech1.MultiBondConRot);
  connect(mTF1.MultiBondCon2, MultiBond1.MultiBondCon1);
  connect(mTF1.MultiBondCon1, MultiBond2.MultiBondCon2);
  connect(quaternionRotation1.Rrel, mTF1.M);
  connect(toCardanAngles1.phi, cardanRotation1.phi);
  connect(toCardanAngles1.w, Df1.f_out);
  connect(cardanRotation1.Rrel, mTF1.M);
  connect(cardanRotation1.Rrel, Rotation1.Rrel);
  connect(toQuaternions1.Q, S_Q);
  connect(toCardanAngles1.phi, S_phi);
end Spherical;

MultiBondLib.Mechanics3D.Joints.FreeTranslationalMovement MultiBondLib.Mechanics3D.Joints.FreeTranslationalMovement

joint with all 3 translational degrees of freedom

MultiBondLib.Mechanics3D.Joints.FreeTranslationalMovement

Information


This is an untypical joint. The translational movement of its connected element is not restricted
and all 3 translational degrees of freedom are defined. The orientation is fixated.

General parameter

The parameter r defines a positional offset.

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element isn't visualized.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

Parameters

NameDefaultDescription
r[3]{0,0,0}positional shift to inertial frame [m]
Initialization
initTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
x_start[3]{0,0,0}initial position [m]
v_start[3]{0,0,0}initial velocity [m/s]
a_start[3]{0,0,0}initial acceleration [m/s2]
Advanced
enforceStatesfalseenforce position and velocity as states
frame_bredeclare Interfaces.Frame_b...replaceable Interface for further extensions

Modelica definition

model FreeTranslationalMovement 
  "joint with all 3 translational degrees of freedom" 
  import SI = Modelica.SIunits;
  import MB = Modelica.Mechanics.MultiBody;
  
  parameter SI.Position r[3] = {0,0,0} "positional shift to inertial frame";
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  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";
  
  parameter Boolean enforceStates =  false 
    "|Advanced||enforce position and velocity as states";
  
  SI.Position x[3](stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "Position of the frame";
  SI.Velocity v[3](stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "Velocity";
  SI.Acceleration a[3] "Acceleration";
  
  replaceable Interfaces.Frame_b frame_b 
    "|Advanced||replaceable Interface for further extensions";
  
protected 
  inner Defaults MBG_defaults(n=3);
  replaceable Interfaces.MBG2Mech MBG2Mech1;
  Sources.Sf Sf1(     f0={0}, n=3);
  Junctions.J1 J1_1(n=3);
  Sources.Se Se1(n=3, e0={0});
  Sensors.Dq Dq1(
    n=3,
    stateInitialCondition=false,
    q_start=zeros(3));
  Bonds.MultiBond MultiBond2;
  Bonds.MultiBond MultiBond3;
  Bonds.MultiBond MultiBond4;
  Bonds.MultiBond MultiBond5;
  Bonds.Utilities.MultiBondTail MultiBondTail2;
  Modelica.Blocks.Sources.Constant R0[3,3](k=identity(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
    x = x_start;
  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
    v = v_start;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    a = a_start;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    v = zeros(3);
    a = zeros(3);
  end if;
  
equation 
  x+r = Dq1.q;
  v = J1_1.MultiBondCon2.f;
  a = der(v);
  defineRoot(frame_b.P);
  
  connect(MBG2Mech1.frame_b, frame_b);
  connect(Sf1.MultiBondCon1, MultiBond3.MultiBondCon1);
  connect(J1_1.MultiBondCon2, MultiBond2.MultiBondCon1);
  connect(MultiBond3.MultiBondCon2, MBG2Mech1.MultiBondConRot);
  connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
  connect(MultiBond4.MultiBondCon1, J1_1.MultiBondCon1);
  connect(Dq1.MultiBondCon1, MultiBond4.MultiBondCon2);
  connect(Dq1.q, MBG2Mech1.x);
  connect(MultiBond5.MultiBondCon1, Se1.MultiBondCon1);
  connect(MultiBond5.MultiBondCon2, J1_1.MultiBondCon4);
  connect(MBG2Mech1.R, R0.y);
end FreeTranslationalMovement;

MultiBondLib.Mechanics3D.Joints.FreeBodyMovement MultiBondLib.Mechanics3D.Joints.FreeBodyMovement

joint with all 6 degrees of freedom

MultiBondLib.Mechanics3D.Joints.FreeBodyMovement

Information


This is an untypical joint, that does not restrict the movement of its connected element
and defines all 6 degrees of freedom. The usage of this joint is hardly necessary, because it is potentially avaiable in each body element.

General parameter

There are no general parameters

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element isn't visualized.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

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. If cardan angles are chosen to be used, you can specify the sequence of rotation axis by the parameter sequence_angles.


Parameters

NameDefaultDescription
Initialization
initTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
x_start[3]{0,0,0}initial position [m]
v_start[3]{0,0,0}initial velocity [m/s]
a_start[3]{0,0,0}initial acceleration [m/s2]
phi_start[3]{0,0,0}initial cardan angles in degree [deg]
w_start[3]{0,0,0}initial angular velocity in deg/s [deg/s]
z_start[3]{0,0,0}initial angular acceleration in deg/s2 [deg/s2]
Advanced
enforceStatesfalseenforce Quaternions or cardan angles and w as states
useQuaternionstrueuse Quaternions instead of cardan angles
sequence_angles{1,2,3}sequence of the cardan angles
frame_bredeclare Interfaces.Frame_b...replaceable Interface for further extensions

Modelica definition

model FreeBodyMovement "joint with all 6 degrees of freedom" 
  import SI = Modelica.SIunits;
  import Cv = Modelica.SIunits.Conversions;
  
  import MB = Modelica.Mechanics.MultiBody;
  import MultiBondLib;
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  
  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";
  
  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";
  
  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 =  true 
    "|Advanced||use Quaternions instead of cardan angles";
  parameter Types.RotationSequence sequence_angles = {1,2,3} 
    "|Advanced||sequence of the cardan angles";
  final parameter Types.Quaternion Q_start = Utilities.AxesRotQ(phi_start_rad,sequence_angles);
  
  SI.Position x[3](stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "Position of the frame";
  SI.Velocity v[3](stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "Velocity";
  SI.Acceleration a[3] "Acceleration";
  SI.Force f[3] "force";
  
  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.AngularAcceleration z[3] "angular acceleration";
  SI.Torque t[3] "torque";
  
  replaceable Interfaces.Frame_b frame_b 
    "|Advanced||replaceable Interface for further extensions";
  
protected 
  outer World3D world3D;
  inner Defaults MBG_defaults(n=3);
  replaceable Interfaces.MBG2Mech MBG2Mech1;
  Junctions.J1 J1_1(n=3);
  Sources.Se Se1(     e0={0}, n=3);
  Bonds.MultiBond MultiBond4;
  Bonds.MultiBond MultiBond7;
  Bonds.MultiBond MultiBond5;
  
  Utilities.toQuaternions toQuaternions1 if useQuaternions;
  Utilities.quaternionRotation quaternionRotation1 if useQuaternions;
  Utilities.cardanRotation cardanRotation1(
      sequence_angles=sequence_angles) if                                   not useQuaternions;
  Utilities.toCardanAngles toCardanAngles1(sequence_angles=sequence_angles) if 
                                                  not useQuaternions;
  MultiBondLib.Interfaces.RealSignal S_Q[4];
  MultiBondLib.Interfaces.RealSignal S_phi[3];
  Junctions.J1 J1_2(n=3);
  Sources.Se Se2(n=3, e0={0});
  Sensors.Dq Dq1(
    n=3,
    stateInitialCondition=false,
    q_start=zeros(3));
  Bonds.MultiBond MultiBond2;
  Bonds.MultiBond MultiBond1;
  Bonds.MultiBond MultiBond3;
  Bonds.Utilities.MultiBondTail MultiBondTail2;
  Sensors.Df Df1(n=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
    x = x_start;
    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
    v = v_start;
    w = w_start_rad;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    a = a_start;
    z = z_start_rad;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    v = zeros(3);
    a = zeros(3);
    w = zeros(3);
    z = zeros(3);
  end if;
  
equation 
  defineRoot(frame_b.P);
  
  x = Dq1.q;
  v = Dq1.MultiBondCon1.f;
  a = der(v);
  
  Q = S_Q;
  phi = S_phi;
  w = Df1.f_out;
  z = der(w);
  
  if useQuaternions then
    phi = zeros(3); //dummy
    phi_d = zeros(3);
  else
    Q = {0,0,0,1}; //dummy
    phi_d = der(phi);
  end if;
  
  f = MBG2Mech1.MultiBondConTrans.e;
  t = MBG2Mech1.MultiBondConRot.e;
  
  connect(MBG2Mech1.frame_b, frame_b);
  connect(toQuaternions1.Q, quaternionRotation1.Q);
  connect(MultiBond5.MultiBondCon1, J1_1.MultiBondCon3);
  connect(MultiBond4.MultiBondCon2, J1_1.MultiBondCon1);
  connect(Se1.MultiBondCon1, MultiBond4.MultiBondCon1);
  connect(MultiBond7.MultiBondCon2, MBG2Mech1.MultiBondConRot);
  connect(toCardanAngles1.phi, cardanRotation1.phi);
  connect(toQuaternions1.Q, S_Q);
  connect(toCardanAngles1.phi, S_phi);
  connect(J1_1.MultiBondCon2, MultiBond7.MultiBondCon1);
  connect(cardanRotation1.Rrel, MBG2Mech1.R);
  connect(quaternionRotation1.Rrel, MBG2Mech1.R);
  connect(J1_2.MultiBondCon2,MultiBond2. MultiBondCon1);
  connect(MultiBond1.MultiBondCon1,J1_2. MultiBondCon1);
  connect(Dq1.MultiBondCon1,MultiBond1. MultiBondCon2);
  connect(MultiBond3.MultiBondCon1,Se2. MultiBondCon1);
  connect(MultiBond3.MultiBondCon2,J1_2. MultiBondCon4);
  connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
  connect(Dq1.q, MBG2Mech1.x);
  connect(Df1.MultiBondCon1, MultiBond5.MultiBondCon2);
  connect(Df1.f_out, toQuaternions1.w);
  connect(Df1.f_out, toCardanAngles1.w);
end FreeBodyMovement;

MultiBondLib.Mechanics3D.Joints.PotentialFBM MultiBondLib.Mechanics3D.Joints.PotentialFBM

potential joint with all 6 degrees of freedom

MultiBondLib.Mechanics3D.Joints.PotentialFBM

Information


This is a potential joint. It is in principle equal to the free body movement joint, but the differential
equations are only stated if necessary (i. e.: if the body movement can't be derived out of other joints).
This joint is part of every body element. There is actually no further usage of this element. 

General parameter

There are no general parameters

Initialization

In general, you can specify... Which of these variables do effectively appear in the inital equations can be defined by the parameter initType.

Visualization

This element isn't visualized.

Advanced settings

The activation of enforceStates enforces the joint to explicitely define integrators. This parameter is useful to choose the state variables in a kinematic loop.

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. If cardan angles are chosen to be used, you can specify the sequence of rotation axis by the parameter sequence_angles.


Parameters

NameDefaultDescription
Initialization
initTypeMB.Types.Init.Free Type of initialization (defines usage of start values below)
x_start[3]{0,0,0}initial position [m]
v_start[3]{0,0,0}initial velocity [m/s]
a_start[3]{0,0,0}initial acceleration [m/s2]
phi_start[3]{0,0,0}initial cardan angles in degree [deg]
w_start[3]{0,0,0}initial angular velocity in deg/s [deg/s]
z_start[3]{0,0,0}initial angular acceleration in deg/s2 [deg/s2]
Advanced
enforceStatesfalseenforce Quaternions or cardan angles and w as states
useQuaternionstrueuse Quaternions instead of cardan angles
sequence_angles{1,2,3}sequence of the cardan angles
frame_bredeclare Interfaces.Frame_b...replaceable Interface for further extensions

Modelica definition

model PotentialFBM "potential joint with all 6 degrees of freedom" 
  import SI = Modelica.SIunits;
  import Cv = Modelica.SIunits.Conversions;
  
  import MB = Modelica.Mechanics.MultiBody;
  import MultiBondLib;
  
  parameter MB.Types.Init.Temp initType=MB.Types.Init.Free 
    "|Initialization| Type of initialization (defines usage of start values below)";
  
  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";
  
  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";
  
  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 =  true 
    "|Advanced||use Quaternions instead of cardan angles";
  parameter Types.RotationSequence sequence_angles = {1,2,3} 
    "|Advanced||sequence of the cardan angles";
  final parameter Types.Quaternion Q_start = Utilities.AxesRotQ(phi_start_rad,sequence_angles);
  
  SI.Position x[3](stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "Position of the frame";
  SI.Velocity v[3](stateSelect=if enforceStates then StateSelect.always else StateSelect.prefer) 
    "Velocity";
  SI.Acceleration a[3] "Acceleration";
  SI.Force f[3] "force";
  
  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.AngularAcceleration z[3] "angular acceleration";
  SI.Torque t[3] "torque";
  
  replaceable Interfaces.Frame_b frame_b 
    "|Advanced||replaceable Interface for further extensions";
  
protected 
  outer World3D world3D;
protected 
  inner Defaults MBG_defaults(n=3);
  replaceable Interfaces.MBG2Mech MBG2Mech1;
  Junctions.J1 J1_1(n=3);
  Sources.Se Se1(     e0={0}, n=3);
  Bonds.MultiBond MultiBond4;
  Bonds.MultiBond MultiBond7;
  Bonds.MultiBond MultiBond5;
  
protected 
  Utilities.toQuaternions toQuaternions1 if useQuaternions;
  Utilities.quaternionRotation quaternionRotation1 if useQuaternions;
  Utilities.cardanRotation cardanRotation1(
      sequence_angles=sequence_angles) if                                   not useQuaternions;
  Utilities.toCardanAngles toCardanAngles1(sequence_angles=sequence_angles) if 
                                                  not useQuaternions;
  MultiBondLib.Interfaces.RealSignal S_Q[4];
  MultiBondLib.Interfaces.RealSignal S_phi[ 3];
  
protected 
  MultiBondLib.Junctions.J1 J1_2(
                    n=3);
  MultiBondLib.Sources.Se Se2(
                 n=3, e0={0});
  MultiBondLib.Bonds.MultiBond MultiBond2;
  MultiBondLib.Bonds.MultiBond MultiBond1;
  MultiBondLib.Bonds.MultiBond MultiBond3;
  MultiBondLib.Bonds.Utilities.MultiBondTail MultiBondTail2;
  MultiBondLib.Interfaces.RealSignal Rrel[3,3];
  MultiBondLib.Interfaces.RealSignal S_w[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
    x = x_start;
    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
    v = v_start;
    w = w_start_rad;
  end if;
  
  if initType == MB.Types.Init.VelocityAcceleration or initType == MB.Types.Init.
      PositionVelocityAcceleration then
    // Initialize acceleration variables
    a = a_start;
    z = z_start_rad;
  end if;
  
  if initType == MB.Types.Init.SteadyState then
    v = zeros(3);
    a = zeros(3);
    w = zeros(3);
    z = zeros(3);
  end if;
  
equation 
  if enforceStates then
    defineRoot(frame_b.P);
  else
    definePotentialRoot(frame_b.P);
  end if;
  
  x = MBG2Mech1.x;
  v = MBG2Mech1.MultiBondConTrans.f;
  a = der(v);
  
  Q = S_Q;
  phi = S_phi;
  w = MBG2Mech1.MultiBondConRot.f;
  z = der(w);
  
  f = MBG2Mech1.MultiBondConTrans.e;
  t = MBG2Mech1.MultiBondConRot.e;
  MultiBond1.MultiBondCon2.e = zeros(3);
  MultiBond5.MultiBondCon2.e = zeros(3);
  
  if not isRoot(frame_b.P) then
    phi = zeros(3); //dummy or fixation
    phi_d = zeros(3);
    if useQuaternions then
      Q[1:3] = Q_start[1:3]; //fixation
    else
      Q = {0,0,0,1}; //dummy
    end if;
    
  else
    der(x) = MultiBond1.MultiBondCon2.f;
    S_w = MultiBond5.MultiBondCon2.f;
    
    if useQuaternions then
      phi = zeros(3); //dummy
      phi_d = zeros(3);
      Rrel = MBG2Mech1.R;
     else
      Rrel = MBG2Mech1.R;
       Q = {0,0,0,1}; //dummy
      phi_d = der(phi);
    end if;
    
  end if;
  
  connect(MBG2Mech1.frame_b, frame_b);
  connect(toQuaternions1.Q, quaternionRotation1.Q);
  connect(MultiBond5.MultiBondCon1, J1_1.MultiBondCon3);
  connect(MultiBond4.MultiBondCon2, J1_1.MultiBondCon1);
  connect(Se1.MultiBondCon1, MultiBond4.MultiBondCon1);
  connect(toCardanAngles1.phi, cardanRotation1.phi);
  connect(toQuaternions1.Q, S_Q);
  connect(toCardanAngles1.phi, S_phi);
  connect(J1_1.MultiBondCon2, MultiBond7.MultiBondCon1);
  connect(J1_2.MultiBondCon2,MultiBond2. MultiBondCon1);
  connect(MultiBond1.MultiBondCon1,J1_2. MultiBondCon1);
  connect(MultiBond3.MultiBondCon1,Se2. MultiBondCon1);
  connect(MultiBond3.MultiBondCon2,J1_2. MultiBondCon4);
  connect(quaternionRotation1.Rrel, Rrel);
  connect(cardanRotation1.Rrel, Rrel);
  connect(MultiBond7.MultiBondCon2, MBG2Mech1.MultiBondConRot);
  connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
  connect(toQuaternions1.w, S_w);
  connect(toCardanAngles1.w, S_w);
end PotentialFBM;

MultiBondLib.Mechanics3D.Joints.CloseLoop MultiBondLib.Mechanics3D.Joints.CloseLoop

element to close kinematik loops manualy

MultiBondLib.Mechanics3D.Joints.CloseLoop

Information


This is the CloseLoop element.

With this element you can cut a kinematic loop manually. Just insert the element into the loop at the point where you'd like to cut it.

This element connects its two connectors in a non-redundant way. It must not be used outside a kinematik loop.


Parameters

NameDefaultDescription
Advanced
frame_aredeclare Interfaces.Frame_a...replaceable Interface for further extensions
frame_bredeclare Interfaces.Frame_b...replaceable Interface for further extensions

Modelica definition

model CloseLoop "element to close kinematik loops manualy" 
  replaceable Interfaces.Frame_a frame_a 
    "|Advanced||replaceable Interface for further extensions";
  replaceable Interfaces.Frame_b frame_b 
    "|Advanced||replaceable Interface for further extensions";
equation 
  frame_a.P.x = frame_b.P.x;
  
  cross(frame_a.P.R[1, :], frame_a.P.R[2, :])*frame_b.P.R[2, :] = 0;
  cross(frame_a.P.R[1, :], frame_a.P.R[2, :])*frame_b.P.R[1, :] = 0;
  frame_a.P.R[2, :]*frame_b.P.R[1, :] = 0;
  
  frame_a.f = frame_b.f;
  frame_a.t = frame_b.t;
  
end CloseLoop;

HTML-documentation generated by Dymola Thu Feb 23 12:19:50 2006.