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

EOM 6DOF Simple Variable Mass ECEF Quaternion — Robotics/Equations Of Motion

Robotics/Equations_Of_Motion/EOM_6DOF_Simple_Variable_Mass_ECEF_Quaternion · 3 input / 13 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 Simple Variable Mass ECEF Quaternion

Robotics / Equations Of Motion

The six-degree-of-freedom equations of motion of a rigid body with a fuel tank between an empty and a full 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 − (dI/dt)ωb) − ωb × (Iωb)) divided on the RIGHT by I, which applies I−T
  • I(m) = Ie(1 − λ) + Ifλ with λ the tank's fill fraction, and dI/dt = ((If − Ie)/(mf − me))·dm/dt – the rate is NOT gated at the limits
  • m' = dm/dt, zero while the mass sits at the limit the flow is heading for
  • 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].
  • m_dot – dm/dt, the fuel flow, a scalar; negative drains the tank.
  • 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].
  • Fuel – the tank status, [1,1]: +1 at the full mass, −1 at the empty one and 0 between.

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].
  • Initial Mass – the tank's starting mass, a scalar > 0. Defaults to 1.
  • Empty Mass – the lower limit. Defaults to 0.5.
  • Full Mass – the upper limit. Defaults to 2.
  • Empty Inertia – the inertia tensor at the empty mass, a [3,3]; applied TRANSPOSED, as the Simulink mask applies it. Defaults to eye(3).
  • Full Inertia – the inertia tensor at the full mass, a [3,3]. Defaults to 2*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 fifteen 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 planet constants, the two tensors and the interpolation slope are folded to constants; the inertia's inverse comes from the adjugate at every derivative evaluation, because the tensor follows the tank.

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/Simple Variable Mass 6DOF ECEF (Quaternion) (the library name carries an embedded newline): 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, Initial Mass → mass_0, Empty Mass → mass_e, Full Mass → mass_f, Empty Inertia → inertia_e, Full Inertia → inertia_f, Equatorial Radius → R, Flattening → F, Planet Rotation Rate → w_E and Celestial Longitude of Greenwich → LPM0. Always emitted with mtype = Simple Variable, 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: fifteen continuous states – the twelve of the rigid body, the celestial longitude of Greenwich (which only positions DCM_bi) and the tank's mass, which is clamped to its limits after every substep.
  • 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_Simple_Variable_Mass_ECEF_Quaternion
familyRobotics/Equations_Of_Motion
solver environment classICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Simple_Variable_Mass_ECEF_Quaternion
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Equations_Of_Motion/EOM_6DOF_Simple_Variable_Mass_ECEF_Quaternion/ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Simple_Variable_Mass_ECEF_Quaternion.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Equations_Of_Motion/EOM_6DOF_Simple_Variable_Mass_ECEF_Quaternion/ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Simple_Variable_Mass_ECEF_Quaternion.h
default size on canvas165 × 210 px
ports at insert3 in, 13 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

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

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
Initial Mass1.0mass_0
Empty Mass0.5mass_e
Full Mass2.0mass_f
Empty Inertia[1 0 0; 0 1 0; 0 0 1]inertia_e
Full Inertia[2 0 0; 0 2 0; 0 0 2]inertia_f
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/Simple Variable Mass 6DOF\nECEF (Quaternion)
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
deliberately not crossedIntegration Substeps
always setmtype = Simple Variable, 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
Initial Massmass_0passes through
Empty Massmass_epasses through
Full Massmass_fpasses through
Empty Inertiainertia_epasses through
Full Inertiainertia_fpasses through
Equatorial RadiusRpasses through
FlatteningFpasses through
Planet Rotation Ratew_Epasses through
Celestial Longitude of GreenwichLPM0passes through

Caveat (shown to the user): aerolib6dof2/Simple Variable Mass 6DOF\nECEF (Quaternion) (an embedded newline in the library name) 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 checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:

  • B0 every stimulus in the sample errored — cross-checks skipped

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).

Simple Variable Mass 6DOF ECEF (Quaternion) -- a fuel tank between an empty and a full mass 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 and the fuel flow dm/dt on a third port. The mass is a LIMITED state between the empty and the full mass, the inertia is interpolated between the two tensors and its rate is the per-unit-mass difference times the flow. With w_e the planet's rotation vector and DCM_bf the quaternion's direction cosines:

Vb' = F/m - Vb x (omega_b + DCM_bf w_e) - DCM_bf (w_e x (w_e x Xf)) omega_b' = ((M - dI/dt omega_b) - omega_b x (I omega_b)) as a ROW, divided on the right by I I(m) = I_e (1 - lambda) + I_f lambda, lambda = clip((m - m_e)/(m_f - m_e), 0, 1) dI/dt = ((I_f - I_e)/(m_f - m_e)) dm/dt, m' = the flow, gated at the limits 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 MASS IS A SIMULINK LIMITED INTEGRATOR, not the compiled body-axes blocks' own rule:

the mask wires a plain Integrator with limits m_e..m_f and takes its SATURATION PORT out as the thirteenth output (+1 at the full limit, -1 at the empty one, 0 between). The gate rule this block runs is the one that reproduced the block through a crossing -- see the row's note on the board.

  • THE INERTIA RATE IS NOT GATED: it is the slope times the RAW flow, so it keeps moving after

the tank has stopped.

  • 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/

Sample results#

No stimulus produced a sampled output in this rig — Invalid input size at EOM 6DOF Simple Variable Mass ECEF Quaternion block: ICore Blocks/Home/EOM 6DOF Simple Variable Mass ECEF Quaternion. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.

Category unsampled · 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

Sample data: docs/generated/samples/Robotics__Equations_Of_Motion__EOM_6DOF_Simple_Variable_Mass_ECEF_Quaternion.json