[MBDyn-users] Help with simulating a magnetic gear

Richard Crozier r.crozier at ed.ac.uk
Mon Mar 5 23:11:41 CET 2018



On 09/02/18 16:33, Pierangelo Masarati wrote:
> On 02/09/2018 12:48 PM, Richard Crozier wrote:
>> I've had a look in the sources under mbdyn-1.7.3/modules, but I don't 
>> see any module-fab-* folders?
> 
> Correct, not distributed yet.  As far as I remember, we're waiting for 
> the green light from Eduardo, who wanted to apply some last minute 
> changes/cleanup.  Please correct me if I'm wrong.
> 
> 
> Sincerely, p.
> 


Following up on this, I decided to try first with standard mbdyn 
elements, namely the revolute hinge, deformable axial joint, and axial 
rotation. I assume that the deformable axial joint does contribute to 
the Jacobian appropriately and therefore will be fairly stable? I have 
got reasonable results so far.

The only problem was the lack of an appropriate scalar differentiable 
sin function. One of Eduardo's files has such a function, so I modified 
MBDyn to include it, I also added cos while I was at it. I didn't test 
cos much yet.

I attach two patch files with the modifications to mbdyn to add sin and 
cos functions. I couldn't figure out a quick way to make a diff of only 
two specific files, I'm not that familiar with the tool). Are these 
patches likely to make it into MBDyn? It seems to me that additional 
scalar functions would be generally useful.

I have attached an example gear file using the elements as well. I am 
generating my mbdyn files using Matlab/Octave, I could provide the 
m-file code to anyone interested as well.

Best regards,

Richard



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

-------------- next part --------------
begin: data;
    problem: initial value;
end: data;

# initial value problem
begin: initial value;
    initial time: 0.0;
    final time: 30.0;
    time step: 0.100000000000000006;
    tolerance: 0.0000001;
    max iterations: 20;
end: initial value;


begin: control data;
    structural nodes: 3;
    rigid bodies: 2;
    joints: 5;
    forces: 1;
    gravity;
    default orientation: euler123;
end: control data;

begin: nodes;

    # 6 DOF structural node
    structural : 1, dynamic, # label, type
        position, 0.0, 0.0, 0.0, # absolute position
        orientation,
        matr,
        1.0, 0.0, 0.0,
        0.0, 1.0, 0.0,
        0.0, 0.0, 1.0, # absolute orientation
        velocity, 0.0, 0.0, 0.0, # absolute velocity
        angular velocity, 0.0, 0.0, 0.0 # absolute angular velocity
    ; # end structural node

    # 6 DOF structural node
    structural : 2, dynamic, # label, type
        position, 0.0, 0.0, 0.0, # absolute position
        orientation,
        matr,
        1.0, 0.0, 0.0,
        0.0, 1.0, 0.0,
        0.0, 0.0, 1.0, # absolute orientation
        velocity, 0.0, 0.0, 0.0, # absolute velocity
        angular velocity, 0.0, 0.0, 0.0 # absolute angular velocity
    ; # end structural node

    # 6 DOF structural node
    structural : 3, dynamic, # label, type
        position, 0.0, 0.0, 0.0, # absolute position
        orientation,
        matr,
        1.0, 0.0, 0.0,
        0.0, 1.0, 0.0,
        0.0, 0.0, 1.0, # absolute orientation
        velocity, 0.0, 0.0, 0.0, # absolute velocity
        angular velocity, 0.0, 0.0, 0.0 # absolute angular velocity
    ; # end structural node

end: nodes;

begin: elements;

    # -----------------------  first section is the actual gear  elements ----------------------- #
    joint : 4, revolute hinge,
        1, # node 1 label
            position, reference, node, 0.0, 0.0, 0.0,
            orientation, reference, node, matr,
            0.0, 0.0, 1.0,
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
        2, # node 2 label
            position, reference, other node, 0.0, 0.0, 0.0,
            orientation, reference, other node, matr,
            0.0, 0.0, 1.0,
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
            friction, 0.01, # friction radius
                preload, 1.0, # friction preload
                discrete coulomb,
                    "constant roller bearing inner", const, 0.0018, # friction model
                simple # friction shape function
    ; # end revolute hinge

    joint : 5, deformable axial joint,
        1, # node 1 label
            position, reference, node, 0.0, 0.0, 0.0,
            orientation, reference, node, matr,
            0.0, 0.0, 1.0,
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
        2, # node 2 label
            position, reference, other node, 0.0, 0.0, 0.0,
            orientation, reference, other node, matr,
            0.0, 0.0, 1.0,
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
        scalar function elastic isotropic, "sin wave", sin, 11111.111111111111313221, 32.0, 0.0
    ; # end deformable axial joint

    joint : 6, axial rotation,
        2, # node 1 label
            position, reference, node, 0.0, 0.0, 0.0,
            orientation, reference, node, matr,
            0.0, 0.0, 1.0,
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
        3, # node 2 label
            position, reference, other node, 0.0, 0.0, 0.0,
            orientation, reference, other node, matr,
            0.0, 0.0, 1.0,
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0,
        mult,
            node, 2, structural, string, "omega[1]", direct,
            const, 8.0
    ; # end axial rotation

    # one-mass body
    body : 7, 1, # label, node label
        28.899254466411971265, # mass
        0.0, 0.0, 0.0, # relative centre of mass
        matr,
        0.332283627854804864, 0.0, 0.0,
        0.0, 0.559210207009893878, 0.0,
        0.0, 0.0, 0.559210207009893878 # inertia matrix
    ; # end one-mass body

    # one-mass body
    body : 8, 3, # label, node label
        45.374530377170245288, # mass
        0.0, 0.0, 0.0, # relative centre of mass
        matr,
        1.744741442062950343, 0.0, 0.0,
        0.0, 1.489524833534827009, 0.0,
        0.0, 0.0, 1.489524833534827009 # inertia matrix
    ; # end one-mass body


    # -----------------------  next section is for testing ----------------------- #
    joint : 9, revolute pin,
        1, # node label
            position, reference, global, 0.0, 0.0, 0.0, # node relative position
            orientation, reference, global, matr,
            0.0, 0.0, 1.0,
            1.0, 0.0, 0.0,
            0.0, 1.0, 0.0, # node relative orientation
        position, 0.0, 0.0, 0.0, # pin absolute position
        orientation, matr,
        0.0, 0.0, 1.0,
        1.0, 0.0, 0.0,
        0.0, 1.0, 0.0 # pin absolute orientation
    ; # end revolute pin

    joint : 10, angular velocity,
        1, # node label
        1.0, 0.0, 0.0, # rotation axis
        ramp,
            0.069813170079773182, 0.0, 7.5, 0.0
    ; # end angular velocity

    couple : 11,
        follower,
        3,
        component,
            ramp,
                -1629.629629629630017007, 22.5, 30.0, 0.0,
            inactive,
            inactive
    ; # end structural couple

    gravity : uniform, single, 0.0, 0.0, -1.0, const, 9.810000000000000497;

end: elements;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScalarFunctionsImpl.h.patch
Type: text/x-patch
Size: 1294 bytes
Desc: not available
URL: <http://mail.mbdyn.org/pipermail/mbdyn-users/attachments/20180305/8fe630b0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScalarFunctionsImpl.cc.patch
Type: text/x-patch
Size: 3023 bytes
Desc: not available
URL: <http://mail.mbdyn.org/pipermail/mbdyn-users/attachments/20180305/8fe630b0/attachment-0001.bin>


More information about the MBDyn-users mailing list