Development of a High-Resolution Virtual Terrain for use
Download
Report
Transcript Development of a High-Resolution Virtual Terrain for use
Realtime Technologies, Inc.
Multi-Body Dynamics Training
March 2005
Purpose
Introduce multi-body dynamics concepts. Train
users how to develop multi-body models.
Coordinate Systems
Local velocities and accelerations follow the
SAE coordinate system: Z down, X forward, and
Y out the right side of the vehicle.
Global velocities and accelerations follow SAE:
X north, Y east, Z down
Roll, pitch, and yaw velocities and accelerations
are defined as right hand rule about the X, Y,
and Z axes respectively.
Coordinate Systems
Surge, X
Roll
Pitch
Lateral, Y
Yaw
Heave, Z
Units
Displacements
Meters
Velocities
Meter/Second
Accelerations
Meter/Second2
Angles
Radians
Angular Rate
Radians/Second
Angular Acceleration
Radians/Second2
Force
Newton
Torque
Newton-meter
Mass
Kilogram
Time
Second
Multi-Body Introduction
SimCreator is based on recursive multi-body methods.
Multi-body dynamics is based on classical mechanics. The
multi-body method utilizes a finite set of elements including rigid
bodies, joints, springs, dampers, and actuators. The following
assumptions have been made:
•
•
•
A multi-body system consists of rigid bodies and ideal joints. A
body may degenerate to a particle or to a body without inertia.
The topology of the multi-body system is arbitrary. Chains, trees
and closed loops are admitted.
Bodies, joints and actuators are summarized in libraries of
standard elements.
Multi-Body Introduction
Kecskemethy developed a formalization of
representing multi-body elements using a modular
dataflow representation. Below are a Rigid Link,
Joint, Mass, and Spring.
Multi-Body Introduction
By calculating inside each joint a joint torque as the dot product
between the generalized force Q acting on the joint and the joint
axis, the set of joint torques required to generate a particular
mechanism acceleration, position and velocity can be
determined.
This solves the inverse dynamics problem: what joint torques are
required to yield a particular set of positions, velocities, and
accelerations of a mechanism.
Introducing a set of generalized coordinates: , that represent
joint angles and position, in general the set of joint torques
required will take the following form:
where M is defined as the mass matrix, V represents centrifugal
and coriolis effects, and G represents gravity and external force
effects.
Multi-Body Introduction
Need to solve the forward dynamics problem: solve for the joint
accelerations given the joint positions, velocities, and joint torques
Using the joint positions and velocities from the previous step
calculate a torque bias vector b that is the torque at each joint required
for zero joint acceleration:
With the joint velocities and gravity set to zero (i.e. with the torque bias
vector set to zero), calculate the joint torque vector for a unit joint
acceleration for each joint separately (i.e. all other joint accelerations
set to zero). The joint torques calculated are essentially a column of
the mass matrix. Once all the columns of the mass matrix have been
computed, and given the actual torques acting at each joint, the
acceleration of the joints can be calculated as:
The joint accelerations can then be integrated to yield the joint
positions and velocities for the next step.
SimCreator Implementation
Offset
SimCreator Implements Components
Similar to Kecskemethy
LinAccel, LinVel, LinPos, AngAccel,
AngVel, TM are equivalent to q.
Force and Moment are equivalent to Q
LinkNumber is for book keeping in the
mass matrix
Light red LinAccel is an input, dark red
LinAccel is an output
LinAccel1
LinVel1
LinPos1
AngAccel1
AngVel1
T M1
Force1
Moment1
LinkNumber1
LinAccel3
LinVel3
LinPos3
AngAccel3
AngVel3
T M3
Force3
Moment3
LinkNumber3
OffsetMB
LocalJointAxis
LinAccel1
LinVel1
LinPos1
AngAccel1
AngVel1
T M1
Force1
Moment1
LinkNumber1
LinAccel3
LinVel3
LinPos3
AngAccel3
AngVel3
T M3
Force3
Moment3
LinkNumber3
Revolute
JointAng
JointAngRate
ExternalJointT orque
SimCreator Implementation
Force, Moment, Accel, and AngAccel are 60 length vectors.
The multibody components in SimCreator calculate the internal
forces and accelerations acting on the system due to gravity,
external forces, and velocity with the joint accelerations set to zero
and store this in the first three elements of the 60 length vectors in
the order X, Y, and Z.
For each degree of freedom in the chain between the base body and
the current body they calculate the internal forces and acceleration
acting on the system due to a unit (1.0) acceleration of that degree
of freedom. The corresponding element in the LinkNumber
connector defines the appropriate link in the system. The results of
these calculations are stored in the 60 Length Vectors.
IMPORTANT Force, Moment, Accel, and AngAccel are due to a unit
acceleration not the actual forces and accelerations.
SimCreator Implementation
60 Length vectors allow 19 links (19 rows in the
mass matrix) to be modeled:
19 links x 3 DOFs (X, Y, Z) + 3 external forces
The link number has 20 inputs. These are the
actual row numbers in the mass matrix.
Each branch in the tree can have up to 19 links
Can have a maximum of 80 rows in the mass
matrix
SimCreator Implementation
Vector Storage:
All linear three vectors (LinPos, LinVel) store their values
as [X, Y, Z]. All angular three vectors (AngVel) store their
values as [Roll, Pitch, Yaw]. The transformation matrix
TM is stored:
Pre-multiplying a local vector by the TM will generate the
vector in global coordinates.
SimCreator Implementation
For recursive methods you need a base body and
multiple bodies that hang off the base body with a set
of relative coordinates.
Four component types:
•
•
•
•
Base Body
Mechanism
Joint
Cut Joint
Base Bodies
All models must start with a base body
Earth
Models a base body for multibody simulations
with no degrees of freedom.
SixDOFMB
Models a base body with six degrees of
freedom.
Mechanisms and Joints
Prismatic models a
prismatic mechanism
MassMB models a
mass
PrismaticJoint models a
prismatic mechanism
and mass together
Similar for screw,
spherical, and revolute
mechanisms
Prismatic
MassMB
PrismaticJoint
Cut Joints
• Cut joints allow two
chains to be connected.
Notice that both sides
are light red.
• Select the correct joint
to cut to reduce the total
number of rows in the
mass matrix
Joint Type
#
of Equations
Revolute
1
Prismatic
1
Cylindrical
2
Universal
2
Screw
1
Spherical
3
Cut Spherical
3
Distance
Constraint
1
CutSpherical
DistCont
Double Pendulum Example
0
ZeroForce
Rev oluteJoint1
Of f setMB1
Pos1Gain
PosGain
Sum1
Rate1Gain
Rev oluteJoint
Of f setMB
Sum
RateGain
Earth
Zero Force and Earth Setup
Need DIMA to be 60 and DIMB to be 20 to
connect ZeroForce and Earth
Double Pendulum Data
BEGIN_INPUTS
;
COMPONENT RevoluteJoint
LocalJointAxis [0][0] = 0 [ND] Local Joint Axis
LocalJointAxis [0][1] = 1 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.5 [kg-m-m] Inertia of Body
Inertia [0][1] = 1.5 [kg-m-m] Inertia of Body
Inertia [0][2] = 1.5 [kg-m-m] Inertia of Body
Mass [0][0] = 10 [kg] Mass of Body
CGOffset [0][0] = 1 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT OffsetMB
Offset [0][0] = 2 [m] Offset in Local Coordinates
Offset [0][1] = 0 [m] Offset in Local Coordinates
Offset [0][2] = 0 [m] Offset in Local Coordinates
COMPONENT RevoluteJoint1
LocalJointAxis [0][0] = 0 [ND] Local Joint Axis
LocalJointAxis [0][1] = 1 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 1.5 [kg-m-m] Inertia of Body
Inertia [0][1] = 2.5 [kg-m-m] Inertia of Body
Inertia [0][2] = 2.5 [kg-m-m] Inertia of Body
Mass [0][0] = 20 [kg] Mass of Body
CGOffset [0][0] = 1 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT OffsetMB1
Offset [0][0] = 1 [m] Offset in Local Coordinates
Offset [0][1] = 0 [m] Offset in Local Coordinates
Offset [0][2] = 0 [m] Offset in Local Coordinates
COMPONENT Pos1Gain
Gain [0][0] = 0 [ND] Gain
COMPONENT Rate1Gain
Gain [0][0] = 0 [ND] Gain
COMPONENT PosGain
Gain [0][0] = 0 [ND] Gain
COMPONENT RateGain
Gain [0][0] = 0 [ND] Gain
COMPONENT Earth
InitPos [0][0] = 0 [m] Initial Position
InitPos [0][1] = 0 [m] Initial Position
InitPos [0][2] = 0 [m] Initial Position
BEGIN_STATES
;
COMPONENT RevoluteJoint_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = -0.523598775598299 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT RevoluteJoint1_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = 0.523598775598299 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
Run Dialog Double Pendulum
Double Pendulum Results
OffsetMB1_OffsetMBPos-LinVel1[0][2] (m/s)
4
Z in SimCreator is
–Y in DADS
OffsetMB1_OffsetMBPos-LinVel1[0][2] (m/s)
3
2
1
0
-1
-2
-3
-4
0
0.5
1
1.5
2
2.5
3
Time (seconds)
3.5
4
4.5
5
4 Bar Example
Of f setMB1
Univ ersalJoint
Of f setMB
ScrewJoint
Earth2
ScrewRateGain
ScrewSum
ScrewPosGain
CutSpherical
Of f setMB2
Rev oluteJoint
Earth1
Rev RateGain
Rev PosGain
Sum1
Cut Joint Parameters
SimRealVar ErrorA - Constraint Error Reduction of q dot (ND)
SimRealVar ErrorB - Constraint Error Reduction of q (ND)
ErrorA is 1.6
ErrorB is 2
The error feedback gain is based on the maximum frequency of the model.
Typically the stiffness of the error must be higher than any stiffness in the
model but want it as low as possible to minimize the integrator step size
requirements.
Trial and error looking at the position error in the joint is usually best.
CutSpherical-PosError[0][0] (m)
1
CutSpherical-PosError[0][0] (m)
CutSpherical-PosError[0][1] (m)
CutSpherical-PosError[0][2] (m)
0.5
0
-0.5
-1
0
1
2
3
Time (seconds)
4
5
4 Bar Data
BEGIN_INPUTS
;
COMPONENT ScrewJoint
LocalJointAxis [0][0] = 0 [ND] Local Joint Axis
LocalJointAxis [0][1] = 1 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.5 [kg-m-m] Inertia of Body
Inertia [0][1] = 1.5 [kg-m-m] Inertia of Body
Inertia [0][2] = 1.5 [kg-m-m] Inertia of Body
Mass [0][0] = 10 [kg] Mass of Body
CGOffset [0][0] = 1 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
GearRatio [0][0] = 0 [m/rad] Gear Ratio
COMPONENT OffsetMB
Offset [0][0] = 2 [m] Offset in Local Coordinates
Offset [0][1] = 0 [m] Offset in Local Coordinates
Offset [0][2] = 0 [m] Offset in Local Coordinates
COMPONENT UniversalJoint
LocalJointAxis [0][0] = 1 [ND] Local Joint Axis
LocalJointAxis [0][1] = 0 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.5 [kg-m-m] Inertia of Body
Inertia [0][1] = 1.5 [kg-m-m] Inertia of Body
Inertia [0][2] = 1.5 [kg-m-m] Inertia of Body
Mass [0][0] = 10 [kg] Mass of Body
CGOffset [0][0] = 1 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT OffsetMB1
Offset [0][0] = 2 [m] Offset in Local Coordinates
Offset [0][1] = 0 [m] Offset in Local Coordinates
Offset [0][2] = 0 [m] Offset in Local Coordinates
COMPONENT Earth1
InitPos [0][0] = 2 [m] Initial Position
InitPos [0][1] = 0 [m] Initial Position
InitPos [0][2] = 0 [m] Initial Position
COMPONENT Earth2
InitPos [0][0] = 0 [m] Initial Position
InitPos [0][1] = 0 [m] Initial Position
InitPos [0][2] = 0 [m] Initial Position
COMPONENT ScrewRateGain
Gain [0][0] = -8 [ND] Gain
COMPONENT RevoluteJoint
LocalJointAxis [0][0] = 0 [ND] Local Joint Axis
LocalJointAxis [0][1] = 1 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.5 [kg-m-m] Inertia of Body
Inertia [0][1] = 1.5 [kg-m-m] Inertia of Body
Inertia [0][2] = 1.5 [kg-m-m] Inertia of Body
Mass [0][0] = 10 [kg] Mass of Body
CGOffset [0][0] = 1 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT OffsetMB2
Offset [0][0] = 2 [m] Offset in Local Coordinates
Offset [0][1] = 0 [m] Offset in Local Coordinates
Offset [0][2] = 0 [m] Offset in Local Coordinates
COMPONENT CutSpherical
ErrorA [0][0] = 1.6 [ND] Constraint Error Reduction of q dot
ErrorB [0][0] = 2 [ND] Constraint Error Reduction of q
COMPONENT ScrewPosGain
Gain [0][0] = -10 [ND] Gain
COMPONENT RevPosGain
Gain [0][0] = -8 [ND] Gain
COMPONENT RevRateGain
Gain [0][0] = -10 [ND] Gain
COMPONENT UniversalJoint_RevoluteJoint
ExternalJointTorque [0][0] = 0 [Nm] External Joint Torque
COMPONENT UniversalJoint_Revolute
ExternalJointTorque [0][0] = 0 [Nm] External Joint Torque
BEGIN_STATES
;
COMPONENT ScrewJoint_ScrewJoint_ScrewVelPos
SJointAng [0][0] = 0.523598775598299 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT UniversalJoint_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = 0.523598775598299 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT UniversalJoint_Revolute_RevoluteJointPos
SJointAng [0][0] = 0 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT RevoluteJoint_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = 0.523598775598299 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
4 Bar Run Dialog
4 Bar Results
1
RevoluteJoint_RevoluteJoint_RevoluteJointPos-JointAng[0][0] (rad)
ScrewJoint_ScrewJoint_ScrewVelPos-JointAng[0][0] (rad)
0.5
0
-0.5
-1
-1.5
-2
-2.5
-3
0
1
2
3
Time (seconds)
4
5
Stanford Arm
Stanford Arm
Rev oluteJoint4
Rev oluteJoint3
Body Of f set2
Rev oluteJoint2
COS
SineWav e
Gain
Cos
Gain1
T3
T5
Gain16
Sum6
T4
Gain17
Clock1
Rev oluteJoint
T1
Body Of f set1
Clock
LookupTable
Rev oluteJoint1
Sum8
Gain8
PrismaticJoint1
Sigma
Gain9
COS
Gain6
Cos3
Gain7
Sum
Sum4
Gain13
Gain12
Sum2
T2
Stanford Arm
A2 0.200000E-01 moment of inertia of A (kg-m2)
AROT 1.04720 target rotation of A (rad)
B1 0.600000E-01 moment of inertia of B (kg-m2)
B2 0.100000E-01 moment of inertia of B (kg-m2)
B3 0.500000E-01 moment of inertia of B (kg-m2)
BROT 1.04720 target rotation of B (rad)
C1 .400000 moment of inertia of C (kg-m2)
C2 0.100000E-01 moment of inertia of C (kg-m2)
C3 .400000 moment of inertia of C (kg-m2)
CDISP .100000 target displacement of C (m)
D1 0.500000E-03 moment of inertia of D (kg-m2)
D2 0.100000E-02 moment of inertia of D (kg-m2)
D3 0.100000E-02 moment of inertia of D (kg-m2)
DROT 1.04720 target rotation of D (rad)
E1 0.500000E-03 moment of inertia of E (kg-m2)
E2 0.200000E-03 moment of inertia of E (kg-m2)
E3 0.500000E-03 moment of inertia of E (kg-m2)
EROT 1.04720 target rotation of E (rad)
F1 0.100000E-02 moment of inertia of F (kg-m2)
F2 0.200000E-02 moment of inertia of F (kg-m2)
F3 0.300000E-02 moment of inertia of F (kg-m2)
FROT 1.04720 target rotation of F (rad)
K1 3.00000 stiffness coefficient (N-m)
K2 5.00000 damping coefficient (N-m-s)
K3 1.00000 stiffness coefficient (N-m)
K4 3.00000 damping coefficient (N-m-s)
K5 .300000 stiffness coefficient (N-m)
K6 .600000 damping coefficient (N-m-s)
K7 .300000 stiffness coefficient (N-m)
K8 .600000 damping coefficient (N-m-s)
K9 .250000 stiffness coefficient (N-m)
K10 .250000 damping coefficient (N-m-s)
K11 30.0000 stiffness coefficient (N/m)
K12 41.0000 damping coefficient (N-s/m)
L1 .100000 coordinate of center of mass of B in dir 1 (m)
L2 .600000 coord. of attachment pt. for E in dir 2 (m)
L3 .200000 coordinate of center of mass of F in dir 2 (m)
L5 .700000 coordinate of center of mass of D in dir 2 (m)
L6 0.600000E-01 coordinate of center of mass of E in dir 2 (m)
MA 9.00000 mass of A (kg)
MB 6.00000 mass of B (kg)
MC 4.00000 mass of C (kg)
MD 1.00000 mass of D (kg)
ME .600000 mass of E (kg)
MF .500000 mass of F (kg)
STOPT 10.0000 simulation stop time (sec)
Stanford Arm
BEGIN_INPUTS
;
COMPONENT RevoluteJoint
LocalJointAxis [0][0] = 0 [ND] Local Joint Axis
LocalJointAxis [0][1] = 1 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.01 [kg-m-m] Inertia of Body
Inertia [0][1] = 0.02 [kg-m-m] Inertia of Body
Inertia [0][2] = 0.01 [kg-m-m] Inertia of Body
Mass [0][0] = 9 [kg] Mass of Body
CGOffset [0][0] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT RevoluteJoint1
LocalJointAxis [0][0] = 1 [ND] Local Joint Axis
LocalJointAxis [0][1] = 0 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.06 [kg-m-m] Inertia of Body
Inertia [0][1] = 0.01 [kg-m-m] Inertia of Body
Inertia [0][2] = 0.05 [kg-m-m] Inertia of Body
Mass [0][0] = 6 [kg] Mass of Body
CGOffset [0][0] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT RevoluteJoint2
LocalJointAxis [0][0] = 0 [ND] Local Joint Axis
LocalJointAxis [0][1] = 1 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.0005 [kg-m-m] Inertia of Body
Inertia [0][1] = 0.001 [kg-m-m] Inertia of Body
Inertia [0][2] = 0.001 [kg-m-m] Inertia of Body
Mass [0][0] = 1 [kg] Mass of Body
CGOffset [0][0] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0.7 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT RevoluteJoint3
LocalJointAxis [0][0] = 1 [ND] Local Joint Axis
LocalJointAxis [0][1] = 0 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.0005 [kg-m-m] Inertia of Body
Inertia [0][1] = 0.0002 [kg-m-m] Inertia of Body
Inertia [0][2] = 0.0005 [kg-m-m] Inertia of Body
Mass [0][0] = 0.6 [kg] Mass of Body
CGOffset [0][0] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0.06 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT RevoluteJoint4
LocalJointAxis [0][0] = 0 [ND] Local Joint Axis
LocalJointAxis [0][1] = 1 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
Inertia [0][0] = 0.001 [kg-m-m] Inertia of Body
Inertia [0][1] = 0.002 [kg-m-m] Inertia of Body
Inertia [0][2] = 0.003 [kg-m-m] Inertia of Body
Mass [0][0] = 0.5 [kg] Mass of Body
CGOffset [0][0] = 0 [m] CG Offset in Body Coordinates
CGOffset [0][1] = 0.2 [m] CG Offset in Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset in Body Coordinates
COMPONENT PrismaticJoint1
Inertia [0][0] = 0.4 [kg-m-m] Inertia of Body
Inertia [0][1] = 0.01 [kg-m-m] Inertia of Body
Inertia [0][2] = 0.4 [kg-m-m] Inertia of Body
Mass [0][0] = 4 [kg] Mass of Body
CGOffset [0][0] = 0 [m] CG Offset In Body Coordinates
CGOffset [0][1] = 0 [m] CG Offset In Body Coordinates
CGOffset [0][2] = 0 [m] CG Offset In Body Coordinates
LocalJointAxis [0][0] = 0 [ND] Local Joint Axis
LocalJointAxis [0][1] = 1 [ND] Local Joint Axis
LocalJointAxis [0][2] = 0 [ND] Local Joint Axis
COMPONENT BodyOffset1
Offset [0][0] = 0.1 [m] Offset in Local Coordinates
Offset [0][1] = 0.1 [m] Offset in Local Coordinates
Offset [0][2] = 0 [m] Offset in Local Coordinates
Stanford Arm
COMPONENT BodyOffset2
Offset [0][0] = 0 [m] Offset in Local Coordinates
Offset [0][1] = 0.6 [m] Offset in Local Coordinates
Offset [0][2] = 0 [m] Offset in Local Coordinates
COMPONENT T1
Amp [0][0] = -0.12 [ND] Amplitude
Freq [0][0] = 0.628318530717959 [rad/sec] Frequency
Phase [0][0] = 0 [rad] Phase Angle
COMPONENT T3
SigIn2 [0][0] = 0.4 [ND] Input Signal 2
COMPONENT Gain
Gain [0][0] = 0.314159265358979 [ND] Gain
COMPONENT Gain1
Gain [0][0] = -0.4 [ND] Gain
COMPONENT SineWave
Amp [0][0] = 0.00022 [ND] Amplitude
Freq [0][0] = 0.628318530717959 [rad/sec] Frequency
Phase [0][0] = 0 [rad] Phase Angle
COMPONENT T5
SigIn2 [0][0] = 0 [ND] Input Signal 2
COMPONENT Gain6
Gain [0][0] = 0.314159265358979 [ND] Gain
COMPONENT Gain7
Gain [0][0] = -0.26 [ND] Gain
COMPONENT Gain8
Gain [0][0] = -4000 [ND] Gain
COMPONENT Gain9
Gain [0][0] = -1800 [ND] Gain
COMPONENT Gain12
Gain [0][0] = -150 [ND] Gain
COMPONENT Gain13
Gain [0][0] = -50 [ND] Gain
COMPONENT T2
SigIn2 [0][0] = -14.678 [ND] Input Signal 2
COMPONENT Gain16
Gain [0][0] = -1 [ND] Gain
COMPONENT Gain17
Gain [0][0] = -1 [ND] Gain
COMPONENT Sum
SigIn2 [0][0] = -1.3107963267949 [ND] Input Signal 2
COMPONENT LookupTable
IndexVector [0][0] = 0 [ND] Index Vector
IndexVector [0][1] = 0.5 [ND] Index Vector
IndexVector [0][2] = 0.75 [ND] Index Vector
IndexVector [0][3] = 1 [ND] Index Vector
IndexVector [0][4] = 2 [ND] Index Vector
ValueVector [0][0] = 0 [ND] Value Vector
ValueVector [0][1] = -0.06 [ND] Value Vector
ValueVector [0][2] = -0.09 [ND] Value Vector
ValueVector [0][3] = -0.1 [ND] Value Vector
ValueVector [0][4] = -0.1 [ND] Value Vector
Extrapolate [0][0] = 0 [1-No] Extrapolation Flag
COMPONENT T4
SigIn2 [0][0] = 0 [ND] Input Signal 2
COMPONENT Earth
InitPos [0][0] = 0 [m] Initial Position
InitPos [0][1] = 0 [m] Initial Position
InitPos [0][2] = 0 [m] Initial Position
BEGIN_STATES
;
COMPONENT RevoluteJoint_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = 0 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT RevoluteJoint1_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = 1.5707963267949 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT RevoluteJoint2_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = 0 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT RevoluteJoint3_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = 0 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT RevoluteJoint4_RevoluteJoint_RevoluteJointPos
SJointAng [0][0] = 0 [rad] Joint Angle
SJointAngRate [0][0] = 0 [rad/sec] Joint Angular Rate
COMPONENT PrismaticJoint1_PrismaticJoint_PrismaticJointPos
SJointPos [0][0] = 0 [m] Joint Position
SJointVel [0][0] = 0 [m/s] Joint Velocity
Stanford Arm: AutoSim vs. SimCreator
1.6
RevoluteJoint1_RevoluteJoint_RevoluteJointPos-JointAng[0][0] (rad)
1.5
1.4
1.3
1.2
1.1
1
0
2
4
6
Time (seconds)
8
10
12
Must develop a standard side interface for
connecting your external force to other
multi-body components (light red side)
Calculate global forces and moments acting
on the upstream component
Can’t use acceleration or angular
acceleration to calculate the force and
moment
Assign the negative of the force and
moment to the first three elements of the
Force1 and Moment1 vector outputs
FrontalArea
FrontalCd
LiftCl
SideCd
Developing Force Elements
LinAccel3
LinVel1
LinPos1
AngAccel1
AngVel1
T M1
Force1
Moment1
SimpAero
Developing Force Elements
TYPE(ALGEBRAIC)
NAME(SimpAero)
SIDES(42,42,LRED,NONE,NONE,NONE)
BEGIN_DEFINITIONS
/* SIDE 1 */
DEFINE_CINPUTV(SimRealVar,LinAccel3,"Global Linear Acceleration","m/s/s",SIDE1,LOCATION1,DIMA)
DEFINE_INPUTV(SimRealVar,LinVel1,"Global Linear Velocity","m/s",SIDE1,LOCATION2,3)
DEFINE_INPUTV(SimRealVar,LinPos1,"Global Linear Position","m",SIDE1,LOCATION3,3)
DEFINE_CINPUTV(SimRealVar,AngAccel1,"Global Angular Acceleration","rad/s/s",SIDE1,LOCATION4,DIMA)
DEFINE_INPUTV(SimRealVar,AngVel1,"Global Angular Velocity","rad/sec",SIDE1,LOCATION5,3)
DEFINE_INPUTV(SimRealVar,TM1,"Transformation Matrix","ND",SIDE1,LOCATION6,9)
DEFINE_OUTPUTV(SimRealVar,Force1,"Global Force","N",SIDE1,LOCATION7,DIMA)
DEFINE_OUTPUTV(SimRealVar,Moment1,"Global Moment","Nm",SIDE1,LOCATION8,DIMA)
/* SIDE 2*/
DEFINE_INPUT(SimRealVar,FrontalArea,"Frontal Area","m2",SIDE2,LOCATION1)
DEFINE_INPUT(SimRealVar,FrontalCd,"Frontal Cd","ND",SIDE2,LOCATION2)
DEFINE_INPUT(SimRealVar,LiftCl,"Lift Versus Forward Speed","ND",SIDE2,LOCATION3)
DEFINE_INPUT(SimRealVar,SideCd,"Side Cd","ND",SIDE2,LOCATION4)
END_DEFINITIONS
BEGIN_INIT
int i;
for(i=0;i<DIMA;i++){
OUTPUT(Force1)[i]=0.0;
OUTPUT(Moment1)[i]=0.0;
}
END_INIT
BEGIN_STOP
END_STOP
BEGIN_RATES
END_RATES
BEGIN_OUTPUTS
SimRealVar lForce[3],lVel[3];
/* forces are purely on a static and dynamic component */
simTransGL(INPUTV(LinVel1),
(const SimRealVar (*)[3])INPUTV(TM1),lVel);
/** Note this is really the force the system is applying so
negated */
lForce[XCOORD]=0.5f*1.225f*INPUT(FrontalArea)
*INPUT(FrontalCd)*lVel[XCOORD]
*fabs(lVel[XCOORD]);
lForce[YCOORD]=0.5f*1.225f*INPUT(FrontalArea)
*INPUT(SideCd)*lVel[YCOORD]
*fabs(lVel[YCOORD]);
lForce[ZCOORD]=0.5f*1.225f*INPUT(FrontalArea)
*INPUT(LiftCl)*lVel[XCOORD]
*lVel[XCOORD];
/* Now Convert to Global Coords */
simTransLG(OUTPUT(Force1),
(const SimRealVar (*)[3])INPUTV(TM1),lForce);
OUTPUT(Moment1)[ROLL]=0.0f;
OUTPUT(Moment1)[PITCH]=0.0f;
OUTPUT(Moment1)[YAW]=0.0f;
END_OUTPUTS
BEGIN_STATE_OVERRIDE
END_STATE_OVERRIDE
18 DOF Vehicle Model
Steering
I
I
InertiaRR
InertiaFR
Of f setMBRR
VehCornerFR
VehCornerRR
Of f setMBFR
0
ZeroForce
ForcesMergeMB
SixDOFMB
I
I
Inertia
InertiaRL
VehCornerFL
Of f setMBFL
Of f setMBRL
VehCornerRL
Set Values
Set All Angular
Inertias to 5
Set Offsets to
(1.4,.7,0.5): watch
out the signs must
match for each
corner.
Set Values 6 DOF Body
Set Initial Height and Euler Parameters
Set initial height to -0.5
Set Euler Parameters to 1,0,0,0
Set Relaxation Length
Set Longitudinal Stiffness
Set Camber Stiffness and Magic
Formula
Set Collision Mass and Inertia
Set Compile Flags
Add /DVALIDATION to turn off terrain query (flat
ground)
Run The Model
View the Vehicle Settling
-0.5
SixDOFMB_SixDOFMBVelPos-LinPos[0][2] (m)
-0.502
-0.504
-0.506
-0.508
-0.51
-0.512
-0.514
-0.516
-0.518
-0.52
0
2
4
6
Time (seconds)
8
10
12
Load the Output Data File and Resettle
SixDOFMB_SixDOFMBVelPos-LinPos[0][2] (m)
-0.517258
SixDOFMB_SixDOFMBVelPos-LinPos[0][2] (m)
-0.517259
-0.51726
-0.517261
-0.517262
-0.517263
-0.517264
-0.517265
-0.517266
-0.517267
0
2
4
6
Time (seconds)
8
10
12
Set Up High Speed with Steering
Set 6DOF
Velocity
Angular
Velocities
on each
Angular
Inertia
Set the
sinewave
inputs
Plot Results
200
SixDOFMB_SixDOFMBVelPos-LinPos[0][0] (m)
180
160
140
120
100
80
60
40
20
0
-20
-2
0
2
4
6
8
SixDOFMB_SixDOFMBVelPos-LinPos[0][1] (m)
10
12