Dynamics

From CSP

Table of contents

CSP Dynamics System

  • coordinate frames
  • integration
  • corner cases (landing...)
  • tests
Definitions
r position
v linear velocity
a linear acceleration
q orientation (expressed as a quaternion)
alpha angular acceleration
omega/w angular velocity
I tensor of inertia
Iinv inverted tensor of inertia
F force
tau/T torque
p linear impulse
h angular impulse

Some math for integration in the inertial frame as pdf (https://www.zerobar.net/csp/mirror/doc/dynamics/WorldIntegrationMath.pdf)


Coordinate frames

Two different frames are used: the local, semi-inertial frame that represents the world in a flat, non-rotating earth approximation. The frame is called the local frame. The second frame is tied to the CG of the airplane and is moved and translated with the plane. The frame is called the body frame.

The body frame is used because the inertia tensor for the plane, which is assumed to be a rigid body, is constant. Thus, in body frame, this is given:

alpha_body(t) = Iinv_body*T_body(t)

Using OpenOffice Math:

 {bar %alpha}_{body}(t) = I^{-1}_{body} * {bar %tau}_{body}(t)


Current state

PhysicsSystemClassOverview.jpg

The key of the current dynamics system is coded in class AircraftPhysicsModel:

 void AircraftPhysicsModel::doSimStep(double dt)
 Vectord const &AircraftPhysicsModel::f(double x, Vectord &y)

AircraftPhysicsModel::doSimStep()

Defines the coord frame and performs the outer integration loop, calling the ODE solver as often as needed to span the given dt.

AircraftPhysicsModel::f()

Called back by the ODE solver. General task: for each element in the y-vector, return its d/dt.

f() could be divided into 2 tasks. One is bridging between ODE solving and kinematics, the other is calculating all forces/torques.

bridging ODE solving and kinematics

The y-vector already contains values and their resp. differentials (e.g. r and v). So d/dt(r) can be easily determined by just taking over v. The same works the rotational state and its differential with the small problem that omega has to be transformed in a d/dt(q).

bridging kinematics and dynamics

f() calculates all forces/torques in the body frame and converts them to accelerations which then are returned for d/dt(v) and d/dt(omega) (second order derivations).


Software design

Here is a proposal for a dynamics pipeline. Can it be done?

DynamicsPipelineProposal.jpg


Tests

  • F_body==0, T_body==0, omega!=0, v!=0: how is the plane expected to move?
    • in a straight line (following v), spinning. v_local is constant
    • in a circle, bc. v_body is constant in the rotating frame

Of course, if no forces are applied, the body should move in a straight line, thereby rotating. This test may serve as a good experiment whether the d/dt+wx operator is applied correctly.

  • wanted: test showing that inertia tensor is applied in a correct way in the body system, so that no I' terms have to be considered. In local frame: h = I(t)w(t) => h' = I'w + Iw'
  • wanted: test showing the effects of products of inertia


Open questions

  • when is the inertia tensor recalculated (e.g. due to burning of fuel)
  • how is change of CG handled?
  • how are rotating subsystems handled?

Links

[http://www.cs.cmu.edu/~baraff/sigcourse/notesd1.pdf An Introduction to Physically Based Modeling: Rigid Body Simulation I—Unconstrained Rigid Body Dynamics, David Baraff]


Dynamics in other sims

  • JSBSim
    •  :pserver:anonymous@jsbsim.cvs.sourceforge.net:/cvsroot/jsbsim
    • class FGPropagate deals with inertial transformation
  • BattleOfBritain
    • MODEL.CPP class Model, e.g. Model::CalcAcc