Generated reference › EOM 6DOF ECEF Quaternion — Robotics/Equations Of Motion
kind: generated#block#robotics-equations-of-motion

EOM 6DOF ECEF Quaternion — Robotics/Equations Of Motion

Robotics/Equations_Of_Motion/EOM_6DOF_ECEF_Quaternion · 2 input / 12 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Description#

The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.

EOM 6DOF ECEF Quaternion

Robotics / Equations Of Motion

The six-degree-of-freedom equations of motion of a rigid body of fixed mass over a rotating ellipsoidal planet, carried in the planet-fixed (ECEF) frame with the attitude as a quaternion. With the body velocity Vb relative to the planet, the body rates ωb relative to the inertial frame, the planet rate ωe and the planet-fixed position Xf:

  • Vb' = F/m − Vb × (ωb + DCMbfωe) − DCMbf(ωe × (ωe × Xf)) – the Coriolis and centripetal terms of the rotating frame
  • ωb' = (M − ωb × (Iωb)) divided on the RIGHT by I, which applies I−T
  • q' = ½Ω(ωb − DCMbfωe)q – the attitude is relative to the PLANET, and the unit quaternion drives it
  • Xf' = DCMbfTVb

The geodetic latitude, longitude and altitude come from the planet-fixed position by thirty-two passes of Bowring's recursion, exactly as Robotics / Axes Transformations / ECEF Position To LLA runs it.

Ports

  • F – the applied force in body axes, [3,1].
  • M – the applied moment about the centre of gravity in body axes, [3,1].
  • V_ECEF – the velocity relative to the planet, in planet-fixed axes, DCMbfTVb, [3,1].
  • X_ECEF – the planet-fixed position Xf, [3,1].
  • LLA – geodetic latitude and longitude in degrees and the altitude in the position's own unit, [3,1].
  • Euler – the Euler angles [φ; θ; ψ] relative to north-east-down, in radians, read back from DCMbe, [3,1].
  • DCM_bi – the direction cosine matrix from the inertial frame to body axes, [3,3].
  • DCM_be – from north-east-down to body axes, [3,3].
  • DCM_ef – from the planet-fixed frame to north-east-down, [3,3].
  • Vb – the body velocity relative to the planet [u; v; w], [3,1].
  • wb_rel – the body rates relative to north-east-down, [3,1].
  • wb – the body rates relative to the inertial frame, [3,1].
  • dwb – their derivative, [3,1].
  • Ab – the body acceleration relative to the planet, Vb', [3,1].

Parameters

  • Units – Metric (MKS) (the default) or English (Velocity in ft/s). The two are the same arithmetic, so the choice only says which units the numbers are in.
  • Initial Location [mu l h] – the geodetic latitude and longitude in degrees and the altitude, three values. Defaults to [0 0 0].
  • Initial Velocity [U V W] – the initial body velocity relative to the planet, three values. Defaults to [0 0 0].
  • Initial Euler Angles [phi theta psi] – relative to north-east-down, in radians, three values. Defaults to [0 0 0].
  • Initial Body Rates [p q r] – relative to north-east-down, in rad/s, three values; the inertial rates the block carries are seeded from them and from the planet and transport rates at the initial state. Defaults to [0 0 0].
  • Mass – m, a scalar > 0. Defaults to 1.
  • Inertia – the inertia tensor I, a [3,3] with a nonzero determinant; applied TRANSPOSED, as the Simulink mask applies it. Defaults to eye(3).
  • Equatorial Radius – R, the planet's equatorial radius. Defaults to the WGS84 value 6378137.
  • Flattening – f, in [0, 1). Defaults to the WGS84 value 0.0033528106647474805.
  • Planet Rotation Rate – ωe in rad/s about the polar axis. Defaults to the WGS84 value 7.292115e-05.
  • Celestial Longitude of Greenwich – the angle in degrees between the inertial frame's x axis and the prime meridian at t = 0; it grows at the rotation rate and positions DCM_bi. Defaults to 0.
  • Integration Substeps – M, how many fourth-order Runge-Kutta steps a sample is integrated with on the discrete solver and in exported code, a whole number of 1 or more. Defaults to 100. No Simulink counterpart.
  • Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.

Code export

All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text (which has no atan2, so the angle read-back rebuilds it from ATAN). A core holds the fourteen states, publishes the twelve outputs from them and from the inputs, and integrates one sample with the inputs held and M Runge-Kutta substeps – with M = 100, the same computation as Simulink's fixed-step ode4 at one hundredth of the sample time. The mass, the inertia's transposed inverse and the planet constants are folded to constants.

The three HDL targets are simulation-only real arithmetic, quantized at the port: a square root, an arctangent and a thirty-two pass recursion have no Q16.16 form. ⚠ Their ports also carry Q16.16, which holds nothing past about 32767, so a planet-fixed position in metres on an Earth-sized planet (6.4×106) saturates there – the HDL cores are exercised on a small planet, and a full-size one belongs in the seven software targets.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolib6dof2/6DOF ECEF (Quaternion): Units → units (the two offered values 1:1), Initial Location [mu l h] → xg_0, Initial Velocity [U V W] → Vm_0, Initial Euler Angles [phi theta psi] → eul_0, Initial Body Rates [p q r] → pm_0, Mass → mass_0, Inertia → inertia, Equatorial Radius → R, Flattening → F, Planet Rotation Rate → w_E and Celestial Longitude of Greenwich → LPM0. Always emitted with mtype = Fixed, ptype = Custom (a block left on Earth (WGS84) accepts a written radius and discards it), angle_in = Internal and vre_flag and abi_flag off: each of those moves that block's port list, and this block has the one it is drawn with. The knots unit system is not offered, and an imported one is reported. "Sampling Time (s)" does not cross: the Simulink block is continuous and defines no SampleTime.

Notes

  • Stateful, continuous and nonlinear: fourteen continuous states, the last of them the celestial longitude of Greenwich, which only positions DCM_bi.
  • The two acceleration outputs are functions of the inputs at the same instant, so the block HAS direct feedthrough and a loop closed around it is an algebraic loop.
  • No gimbal lock: the quaternion kinematics are regular at every attitude. The Euler-angle OUTPUT is still a read-back, so φ and ψ wrap at ±π and θ is clamped to the arcsine's domain at ±90°.
  • The latitude recursion runs a fixed thirty-two passes rather than to a tolerance: a loop that stops when it likes cannot be written identically in ten languages.

Code facts#

FactValue
registered typeRobotics/Equations_Of_Motion/EOM_6DOF_ECEF_Quaternion
familyRobotics/Equations_Of_Motion
solver environment classICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_ECEF_Quaternion
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Equations_Of_Motion/EOM_6DOF_ECEF_Quaternion/ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_ECEF_Quaternion.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Equations_Of_Motion/EOM_6DOF_ECEF_Quaternion/ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_ECEF_Quaternion.h
default size on canvas165 × 210 px
ports at insert2 in, 12 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleF
2inICoreDoubleM
3outICoreDoubleV_ECEF
4outICoreDoubleX_ECEF
5outICoreDoubleLLA
6outICoreDoubleEuler
7outICoreDoubleDCM_bi
8outICoreDoubleDCM_be
9outICoreDoubleDCM_ef
10outICoreDoubleVb
11outICoreDoublewb_rel
12outICoreDoublewb
13outICoreDoubledwb
14outICoreDoubleAb

Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.

Configuration variables#

Config variableDefaultSimulink parameter
UnitsMetric (MKS)%~%English (Velocity in ft/s)~~Metric (MKS)units
Initial Location [mu l h][0 0 0]xg_0
Initial Velocity [U V W][0 0 0]Vm_0
Initial Euler Angles [phi theta psi][0 0 0]eul_0
Initial Body Rates [p q r][0 0 0]pm_0
Mass1.0mass_0
Inertia[1 0 0; 0 1 0; 0 0 1]inertia
Equatorial Radius6378137R
Flattening0.0033528106647474805F
Planet Rotation Rate7.292115e-05w_E
Celestial Longitude of Greenwich0LPM0
Integration Substeps100not crossed

Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.

supportSupport::Both
Simulink pathaerolib6dof2/6DOF ECEF (Quaternion)
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
deliberately not crossedIntegration Substeps
always setmtype = Fixed, ptype = Custom, angle_in = Internal, vre_flag = off, abi_flag = off
ICore configSimulink parameterValue translation
UnitsunitsMetric (MKS) → Metric (MKS), English (Velocity in ft/s) → English (Velocity in ft/s)
Initial Location [mu l h]xg_0passes through
Initial Velocity [U V W]Vm_0passes through
Initial Euler Angles [phi theta psi]eul_0passes through
Initial Body Rates [p q r]pm_0passes through
Massmass_0passes through
Inertiainertiapasses through
Equatorial RadiusRpasses through
FlatteningFpasses through
Planet Rotation Ratew_Epasses through
Celestial Longitude of GreenwichLPM0passes through

Caveat (shown to the user): aerolib6dof2/6DOF ECEF (Quaternion) is continuous and has NO SampleTime parameter (verified against the R2026a block dialog). ptype is always written as Custom, because a block left on Earth (WGS84) accepts a written radius, flattening or rotation rate and discards it; mtype, angle_in, vre_flag and abi_flag are pinned because each moves that block's port list; the kts unit system is not offered because it converts velocities inside the integration; "Integration Substeps" is how this block integrates a sample and has no counterpart

Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h

Description vs code#

The lists agree. check_block_descriptions.py finds no disagreement between the description's Ports, Parameters, Code export and Simulink bridge lists and the code's.

The verdict above is tools/docs/check_block_descriptions.py (P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.

File banner (developer view)#

The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).

6DOF ECEF (Quaternion) -- equations of motion over a ROTATING ellipsoidal planet State [Vb (u v w), omega_b (p q r, relative to the inertial frame), quaternion (body relative to the PLANET frame), Xf (planet-fixed position), celestial longitude], inputs F and M in body axes. With w_e the planet's rotation vector, DCM_bf the quaternion's direction cosines and m the mass:

Vb' = F/m - Vb x (omega_b + DCM_bf w_e) - DCM_bf (w_e x (w_e x Xf)) omega_b' = (M - omega_b x (I omega_b)) as a ROW, divided on the right by I q' = 1/2 Omega(omega_b - DCM_bf w_e) q, from the UNIT quaternion Xf' = DCM_bf' Vb, celestial longitude' = w_e

⚠ MEASURED AGAINST R2026a, mask read block by block (find_system under the mask, every Sum's sign list and every Product's mode), then reimplemented and run against the block: all TWELVE outputs agree to 1.8e-12 over 200 samples at Ts = 0.01 (positions of 2.3e3 m, so ~5 units in the last place of a double). What the measurement settled, and a reader would otherwise guess wrong:

  • THE INERTIA IS APPLIED TRANSPOSED. The mask reshapes the moment balance into a ROW vector

and divides it on the right by I, which is I^-T, not I^-1. With the asymmetric tensor the rigs use, the two differ by 4.8e-3 -- a body-axes 6DOF block's I^-1 is simply wrong here.

  • THE QUATERNION IS RELATIVE TO THE PLANET and is driven by omega_b - DCM_bf w_e, while the

inertia's rate term and the outputs' omega_b are relative to the INERTIAL frame. The dialog's initial rates are relative to NED instead, and are seeded as omega_b(0) = pm_0 + DCM_bf w_e + DCM_be w_ned evaluated at the initial state.

  • THE VELOCITY DERIVATIVE PASSES A DEAD ZONE of [-eps, eps] (Simulink's own, on the mask's

integrator input), so a derivative under one unit in the last place of 1 is exactly zero.

  • THE ECI POSITION IS A STATE THAT NOTHING READS -- the mask integrates it and terminates

it. This block does not carry it.

  • The geodetic read-back is the same ECEF2LLA block as Robotics/Axes_Transformations/

ECEF_Position_To_LLA, so it runs that block's fixed 32 passes of Bowring's recursion rather than a convergence test, for the reason stated there.

  • "English (Velocity in ft/s)" is BYTE-IDENTICAL to "Metric (MKS)" on this block (measured

over the same 200 samples); "English (Velocity in kts)" converts velocities inside the integration and is not offered.

The export is the mask's own integrator: Simulink's fixed-step ode4 at Ts/100 with the inputs held, which is what the shared Equations of Motion emitter writes in all ten targets.

Sample results#

EOM 6DOF ECEF Quaternion — Sine Wave, [3,1]: amplitudes 1/2/3 at 2 rad/s (tried only because every scalar stimulus was refused)EOM 6DOF ECEF Quaternion — Sine Wave, [3,1]: amplitudes 1/2/3 at 2 rad/s (tried only because every scalar stimulus was refused)02e64e66e6012345t (s)in ICoreDouble-Out-0 [3x1] entry 0in ICoreDouble-Out-0 [3x1] entry 0out ICoreDouble-Out-0 [3x1] entry 0out ICoreDouble-Out-1 [3x1] entry 0out ICoreDouble-Out-2 [3x1] entry 0

Plotted: vector — Sine Wave, [3,1]: amplitudes 1/2/3 at 2 rad/s (tried only because every scalar stimulus was refused)

Category dynamic · sample time 0.1 · 60 steps · commit 875fdbf564cf31a145283edf6a75dc1d64d1090a · produced by docsSample --out <folder> --blocks Wigner_Ville_Distribution Cross_Wigner_Ville_Distribution Inverse_STFT Fourier_Synchrosqueezed_Transform Time_Frequency_Ridges Frequency_Domain_Filter_Identification Fill_Gaps EOM_6DOF_ECEF_Quaternion EOM_6DOF_Custom_Variable_Mass_ECEF_Quaternion EOM_6DOF_Simple_Variable_Mass_ECEF_Quaternion ECI_To_ECEF_Rotation_Matrix ECI_Position_To_LLA LLA_To_ECI_Position ECI_Position_To_AER --steps 60 · data docs/generated/samples/Robotics__Equations_Of_Motion__EOM_6DOF_ECEF_Quaternion.json · the SVG is generated from those numbers by tools/docs/plot_svg.py, so it is a run and not a drawing (R-D10).