Home > リソース > MBDynモデル集 > 13. 板カム
MBDynモデル集

13. 板カム

アニメーション



入力ファイル

plate_cam.mbd
# plate_cam.mbd

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

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

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

begin: initial value;
   initial time:   0.;
   final time:     5.;
   time step:      1.e-4;
   max iterations: 10;
   tolerance:      1.e-7;
end: initial value;

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

begin: control data;
   output frequency: 100;
   structural nodes: 3;
   rigid bodies:     2;
   joints:           5;
   forces:           1;
   gravity;
end: control data;

#-----------------------------------------------------------------------------
# Design Variables
set: real M_Cam      = 0.1;  #[kg] Mass of Cam
set: real M_Follower = 0.1;  #[kg] Mass of Follower
set: real I_Cam      = 5e-4; #[kgm^2] Moment of Inertia of Cam

set: real K_Cam_Follower = 100000.; # Stiffness Coefficient of Contact

#-----------------------------------------------------------------------------
# Node Labels
set: integer Node_Ground   = 1;
set: integer Node_Cam      = 2;
set: integer Node_Follower = 3;

# Body Labels
set: integer Body_Cam      = 1;
set: integer Body_Follower = 2;

# Joint Labels
set: integer JoClamp_Ground          = 1;
set: integer JoRevp_Cam              = 2;
set: integer JoInlin_Ground_Follower = 3;
set: integer JoPrism_Ground_Follower = 4;
set: integer JoTotp_Cam_Input        = 5;

# Force Labels
set: integer FoStrin_Follower_Cam = 1;

#-----------------------------------------------------------------------------
# Scalar Functions 
scalar function: "Fun_Cam_Shape",
   cubicspline,
   -3.1416,    0.1500,
   -2.9805,    0.1481,
   -2.8194,    0.1427,
   -2.6583,    0.1346,
   -2.4972,    0.1249,
   -2.3361,    0.1147,
   -2.1749,    0.1048,
   -2.0138,    0.0955,
   -1.8527,    0.0871,
   -1.6916,    0.0798,
   -1.5305,    0.0735,
   -1.3694,    0.0682,
   -1.2083,    0.0637,
   -1.0472,    0.0600,
   -0.8861,    0.0570,
   -0.7250,    0.0546,
   -0.5639,    0.0527,
   -0.4028,    0.0514,
   -0.2417,    0.0505,
   -0.0806,    0.0501,
    0.0806,    0.0501,
    0.2417,    0.0505,
    0.4028,    0.0514,
    0.5639,    0.0527,
    0.7250,    0.0546,
    0.8861,    0.0570,
    1.0472,    0.0600,
    1.2083,    0.0637,
    1.3694,    0.0682,
    1.5305,    0.0735,
    1.6916,    0.0798,
    1.8527,    0.0871,
    2.0138,    0.0955,
    2.1749,    0.1048,
    2.3361,    0.1147,
    2.4972,    0.1249,
    2.6583,    0.1346,
    2.8194,    0.1427,
    2.9805,    0.1481,
    3.1416,    0.1500;

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

begin: nodes;

   #-----------------------------------------------------------------------------
   # Nodes
   structural: Node_Ground, static,
      null, # absolute position
      eye,  # absolute orientation
      null, # absolute velocity
      null; # absolute angular velocity
      
   structural: Node_Cam, dynamic,
      null,                 # absolute position
      euler, pi/2., 0., 0., # absolute orientation
      null,                 # absolute velocity
      null;                 # absolute angular velocity
      
   structural: Node_Follower, dynamic,
      0., 0., 0.075, # absolute position
      eye,           # absolute orientation
      null,          # absolute velocity
      null;          # absolute angular velocity
      
end: nodes;

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

begin: elements;

   #-----------------------------------------------------------------------------
   # Bodies
   body: Body_Cam, Node_Cam,
      M_Cam,               # mass
      null,                # relative center of mass
      diag, 1., 1., I_Cam; # inertia matrix
      
   body: Body_Follower, Node_Follower,
      M_Follower,       # mass
      null,             # relative center of mass
      diag, 1., 1., 1.; # inertia matrix  
   
   #-----------------------------------------------------------------------------
   # Joints   
   joint: JoClamp_Ground,
      clamp,
         Node_Ground,
            null, # absolute position
            eye;  # absolute orientation
              
   joint: JoRevp_Cam, 
      revolute pin, 
         Node_Cam,
            null,                        # relative offset
            hinge, eye,                  # relative orientation
            null,                        # absolute pin position
            hinge, euler, pi/2., 0., 0.; # absolute pin orientation
            
   joint: JoInlin_Ground_Follower, 
      in line,
         Node_Ground,
            null, # relative line position
            eye,  # relative orientation
         Node_Follower;
      
   joint: JoPrism_Ground_Follower,
      prismatic,
         Node_Ground,
         Node_Follower;
         
   joint: JoTotp_Cam_Input,
      total pin joint,
         Node_Cam,
            position, null,                             # relative offset
            position, null,                             # absolute position
            rotation orientation, euler, pi/2., 0., 0., # absolute rotation orientation
         position constraint,
            inactive, inactive, inactive,
            null,
         orientation constraint,
            inactive, inactive, active,
         single, 0., 0., 1., string, "2*pi*Time";
   
   #-----------------------------------------------------------------------------         
   # Plugin Variables
   set: [element, AZ_Cam, JoRevp_Cam, joint, string="rz"];
   set: [node, Z_Follower, Node_Follower, structural, string="X[3]"];

   #-----------------------------------------------------------------------------
   # Forces      
   force: FoStrin_Follower_Cam,
      follower internal,
         Node_Follower,
            position, null, # relative arm
         Node_Cam,
            position, null, # relative arm
         single, 0., 0., 1., string, "-K_Cam_Follower*(Z_Follower\
            -model::sf::Fun_Cam_Shape(atan2(sin(pi/2.-AZ_Cam),cos(pi/2.-AZ_Cam))))";
   
   #-----------------------------------------------------------------------------
   # Gravity      
   gravity: 0., 0., -1., const, 9.81;
                 
end: elements;
スポンサーリンク