gdbaldw / BlenderAndMBDyn

Combines Blender's graphical interface and rendering capabilities with MBDyn's multi-body dynamics, aerodynamics, and aeroelastics simulation and analysis, for rapid modeling and realistic rendering of physics based multi-body simulations.
GNU General Public License v3.0
25 stars 13 forks source link

reference frame used for angular velocity #15

Closed timgow closed 8 years ago

timgow commented 8 years ago

I'm having difficulty in making the MBDyn node use a new reference frame. The model is a crank arm rotating at a constant angular velocity. Gravity is also included to aid debugging, the resulting motion is only the free swing due to gravity and not the required constant rotation.

screenshot 01 screenshot 02 screenshot 03 screenshot 04 screenshot 05 screenshot 06 screenshot 07

The MBDyn input file by BAM:

# MBDyn v1.6 input file generated using BlenderAndMBDyn v2.0

# Frame names:
set: const integer Reference_frame = 0;

# Node names:
set: const integer Node_Ground = 0;
set: const integer Node_MainBrg = 1;

# Element names:
set: const integer Body = 0;
set: const integer Clamp = 1;
set: const integer Gravity = 2;
set: const integer Revolute_hinge = 3;
set: const integer Rigid_offset = 4;
set: const integer Rigid_offset_001 = 5;

# Drive names:
set: const integer Meter_drive = 0;
set: const integer Unit_drive = 1;

# Constitutive names: None

# Parameters: None

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

begin: initial value;
    initial time: 0;
    final time: 10;
    strategy: no change;
    time step: 0.001;
    tolerance: 1e-06;
    max iterations: 10;
    derivatives tolerance: 2;
    derivatives max iterations: 1;
    derivatives coefficient: 0.001;
end: initial value;

begin: control data;
    select timeout: forever;
    default orientation: orientation matrix;
    output meter: meter, 0, forever, steps, 1;
    output precision: 6;
    default output:
        reference frames,
        abstract nodes,
        electric nodes,
        hydraulic nodes,
        structural nodes,
        accelerations,
        aerodynamic elements,
        air properties,
        beams,
        electric elements,
        forces,
        genels,
        gravity,
        hydraulic elements,
        joints,
        rigid bodies,
        induced velocity elements;
    structural nodes: 2;
    joints: 2;
    rigid bodies: 1;
    gravity;
end: control data;

reference: Reference_frame,
    reference, global, 0, 0, 0,
    reference, global, matr,
        1, 0, 0,
        0, 1, 0,
        0, 0, 1,
    reference, global, 0, 0, 0,
    reference, global, 0, 0, 6.28;

begin: nodes;
    structural: Node_Ground, static,
        reference, global, 0, 0, 0,
        reference, global, matr,
            1, 0, 0,
            0, 1, 0,
            0, 0, 1,
        reference, global, null,
        reference, global, null;
    structural: Node_MainBrg, dynamic,
        reference, global, 0, 0, 0,
        reference, global, matr,
            1, 0, 0,
            0, 1, 0,
            0, 0, 1,
        reference, global, null,
        reference, global, null;
end: nodes;

# Drives:
drive caller: Unit_drive, unit;
drive caller: Meter_drive, meter, 0, forever, steps, 1;

begin: elements;
    body: Body,
        Node_MainBrg,
            1,
            0.5, 0, 0, 
            eye,
            inertial, matr,
                1, 0, 0,
                0, 1, 0,
                0, 0, 1;
    joint: Clamp, clamp,
        Node_Ground, node, node;
    joint: Revolute_hinge, revolute hinge,
        Node_MainBrg, 0, 0, 0,
            hinge, matr,
                1, 0, 0,
                0, 1, 0,
                0, 0, 1, 
        Node_Ground, 0, 0, 0,
            hinge, matr,
                1, 0, 0,
                0, 1, 0,
                0, 0, 1;
    gravity: 
            0, -1, -2.23517e-08, scale, 9.81, reference, Unit_drive;
end: elements;

Please let me know whether I missed a vital step or made incorrect assumptions. Tim

gdbaldw commented 8 years ago

Delete the reference frame; replace Revolute hinge joint with Angular velocity joint. Reference frame sets up the initial condition only. Angular velocity drives the rotational rate of the joint throughtout the simulation.

timgow commented 8 years ago

Doug, Thank you so much for redirecting me, away from ref frame, I was blinkered and should have read the manual further. Tim