Home > リソース > MBDynモデル集 > 6. ジャイロモーメント実験装置
MBDynモデル集

## 6. ジャイロモーメント実験装置

### 入力ファイル

```# gyro_moment.mbd

#-----------------------------------------------------------------------------
# [Data Block]

begin: data;
problem: initial value;
end: data;

#-----------------------------------------------------------------------------
# [<Problem> Block]

begin: initial value;
initial time:   0.;
final time:     8.5;
time step:      1.e-3;
max iterations: 10;
tolerance:      1.e-6;
end: initial value;

#-----------------------------------------------------------------------------
# [Control Data Block]

begin: control data;
output frequency: 10;
structural nodes: 3;
rigid bodies:     3;
joints:           4;
end: control data;

#-----------------------------------------------------------------------------
# Design Variables

set: real I_Stage = 0.1;   #[kg m^2]  Moment of Inertia of Stage
set: real M_Wheel = 3.;    #[kg] Mass of Wheel
set: real R_Wheel = 0.4;   #[m] Radius of Wheel
set: real H_Arm   = 1.;    #[m] Height of Arm
set: real L_Arm   = 0.6;   #[m] Length of Arm
set: real W_Wheel = 10*pi; #[rad/s] Angular Velocity of Wheel

#-----------------------------------------------------------------------------
# Reference Labels
set: integer Ref_Wheel_Spindle = 1;

# Node Labels
set: integer Node_Stage = 1;
set: integer Node_Arm   = 2;
set: integer Node_Wheel = 3;

# Body Labels
set: integer Body_Stage = 1;
set: integer Body_Arm   = 2;
set: integer Body_Wheel = 3;

# Joint Labels
set: integer JoRevp_Stage      = 1;
set: integer JoSphh_Stage_Arm  = 2;
set: integer JoDrivh_Stage_Arm = 3;
set: integer JoRevh_Arm_Wheel  = 4;

#-----------------------------------------------------------------------------
# Intermediate Variables
set: real Ixx_Wheel = M_Wheel*R_Wheel^2./4.;
set: real Iyy_Wheel = M_Wheel*R_Wheel^2./4.;
set: real Izz_Wheel = M_Wheel*R_Wheel^2./2.;

#-----------------------------------------------------------------------------
# References
reference: Ref_Wheel_Spindle,
0., L_Arm, H_Arm,     # absolute position
euler, 0., pi/2., 0., # absolute orientation
null,                 # absolute velocity
null;                 # absolute angular velocity

#-----------------------------------------------------------------------------
# [Nodes Block]

begin: nodes;

#-----------------------------------------------------------------------------
# Nodes
structural: Node_Stage, dynamic,
null, # absolute position
eye,  # absolute orientation
null, # absolute velocity
null; # absolute angular velocity

structural: Node_Arm, dynamic,
0., 0., H_Arm,         # absolute position
euler, -pi/2., 0., 0., # absolute orientation
null,                  # absolute velocity
null;                  # absolute angular velocity

structural: Node_Wheel, dynamic,
reference, Ref_Wheel_Spindle, null,             # absolute position
reference, Ref_Wheel_Spindle, eye,              # absolute orientation
reference, Ref_Wheel_Spindle, null,             # absolute velocity
reference, Ref_Wheel_Spindle, 0., 0., -W_Wheel; # absolute angular velocity

end: nodes;

#-----------------------------------------------------------------------------
# [Elements Block]

begin: elements;

#-----------------------------------------------------------------------------
# Bodies
body: Body_Stage, Node_Stage,
1.,                    # mass
null,                  # relative center of mass
diag, 1., 1., I_Stage; # inertia matrix

body: Body_Arm, Node_Arm,
1.,                        # mass
null,                      # relative center of mass
diag, 1.e-6, 1.e-6, 1.e-6; # inertia matrix

body: Body_Wheel, Node_Wheel,
M_Wheel,                               # mass
null,                                  # relative center of mass
diag, Ixx_Wheel, Iyy_Wheel, Izz_Wheel; # inertia matrix

#-----------------------------------------------------------------------------
# Joints
joint: JoRevp_Stage,
revolute pin,
Node_Stage,
null, # relative offset
null; # absolute pin position

joint: JoSphh_Stage_Arm,
spherical hinge,
Node_Stage,
0., 0., H_Arm, # relative offset
Node_Arm,
null;          # relative offset

joint: JoDrivh_Stage_Arm,
drive hinge,
Node_Stage,
hinge, euler, -pi/2., 0., 0.,                      # relative axis orientation
Node_Arm,
hinge, eye,                                        # relative axis orientation
single, 0., 0., 1., scalar function, "Fun_Arm_Input", # position
multilinear,
0.0, 0.,
0.5, 0.,
1.0, pi/4.,
1.5, pi/4.,
2.0, pi/2.,
2.5, pi/2.,
3.0, pi/4.,
3.5, pi/4.,
4.0, 0,
4.5, 0,
5.0, -pi/4.,
5.5, -pi/4.,
6.0, -pi/2.,
6.5, -pi/2.,
7.0, -pi/4.,
7.5, -pi/4.,
8.0, 0.,
8.5, 0.;

joint: JoRevh_Arm_Wheel,
revolute hinge,
Node_Arm,
reference, Ref_Wheel_Spindle, null,        # relative offset
hinge, reference, Ref_Wheel_Spindle, eye,  # relative axis orientation
Node_Wheel,
reference, Ref_Wheel_Spindle, null,        # relative offset
hinge, reference, Ref_Wheel_Spindle, eye;  # relative axis orientation

end: elements;
```
スポンサーリンク