Enlighten Engineering [image]
Home Contact Us OMD For Simulink SCOOTA Driving Game PyOMD2 PyOMD Bug Walk

OMD For Simulink Users Guide


Introduction

OMD is partially written in Python and definning models is done using a python script. This document describes how each element is defined and includes a set of python commands that defines a model.


Body

Description

Defines a body to be included in the simulation. Bodies have mass and inertia and move in space in response to forces and interactions with other bodies to which they are joined through joints.
The following parameters need to be defined:

Syntax

OMDPYTHONBODY = Body("name", Bool specifiying if body is fixed, mass, inertia)

Example

b1 = Body("body1",False,5,[[1,0,0],[0,1,0],[0,0,1]])
Instantiates a body b1, with the name "body1" (often the same string), which is not fixed, has a mass of 5 and the inertia isthe identity matrix.
The units are left to the user, just be consistent.


Joints

Revolute Joint

Description

Defines a kinematic connection between 2 bodies which only allows those two bodies to rotate relative to each other about a single axis.

Syntax

OMDREVJOINT = JointRev("name",Parent,Child,p2j,j2c,a,theta,omega)
where:

Example

p2j = [0.,0,0]
j2c = [1,0,0.]
a = [0,1,0]
j1rev = JointRev("j1rev",irf,b1,p2j,j2c,a,0,0)

Translational Joint

Description

Defines a kinematic connection between 2 bodies which only allows those two bodies to translate relative to each other along a single axis.

Syntax

OMDTRANSJOINT = JointTrans("name",Parent,Child,p2j,j2c,a,x,xdot)
where:

Example

p2j = [0.,0,0]
j2c = [1,0,0.]
a = [0,1,0]
j1trans = JointRev("j1trans",irf,b1,p2j,j2c,a,0,0)

6DOF Joint

Planer Joint

Spherical Joint

U Joint


Forces

1 Body Force

Description

A force and or torque on a body whose line of action and offset are both definable.

Syntax

f1 = Force1Body("f1",b1,fv,tv,coord)
where:

Example

fv = [0.0,0.0,-9.81]
tv = [0,0,0]
coord = [0,0,0]
f1 = Force1Body("f1",b1,fv,tv,coord)

Revolute Joint Force

Description

Applies torque to a revolute joint, this joint is applied by the parent on the child. The Vector defining the force is applied to a child.
An equal and opposite force is applied to the parent.

Syntax

f3 = ForceRevJnt("f3",j1rev,torque)
where:

OMD For Simulink Users Guide