EOM 6DOF Custom Variable Mass Wind Quaternion — Robotics/Equations Of Motion
Robotics/Equations_Of_Motion/EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion · 5 input / 10 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 Custom Variable Mass Wind Quaternion
Robotics / Equations Of Motion
The six-degree-of-freedom equations of motion of a rigid body whose mass, inertia tensor and inertia rate arrive on wires, with the translation carried in wind axes as the airspeed V, the angle of attack α and the sideslip angle β, and the attitude as a body quaternion q, so there is no gimbal lock. With the force Fw = [Fx; Fy; Fz] in wind axes, the moment M in body axes, the body rates ω = [p; q; r], and m, dI/dt and I read off the inputs every sample:
- V' = Fx/m
- α' = q − (p·cos α + r·sin α)·tan β + Fz/(m·V·cos β)
- β' = p·sin α − r·cos α + Fy/(m·V)
- ω' = I−T(M − dI/dt·ω − ω × (Iω)) – the transpose of the inverse, as the Simulink block divides a row vector by I; the two are the same for a symmetric tensor
- q' = ½Ω(ω)·q/|q| – the kinematics are evaluated on the normalized quaternion
- Xe' = DCMweT·[V; 0; 0], with DCMwe = DCMwb(α, β)·DCMbe(q)
Ports
- Fw – the applied force in wind axes, [3,1].
- M – the applied moment about the centre of gravity in body axes, [3,1].
- m – the mass, a scalar [1,1] > 0.
- I_dot – the rate of change of the inertia tensor, [3,3].
- I – the inertia tensor, an invertible [3,3]. The block does not check that I_dot is its derivative.
- Ve – the velocity in the flat-earth frame, DCMweT·Vw, [3,1].
- Xe – the position in the flat-earth frame, [3,1].
- Wind – the wind angles [μ; γ; χ] (bank, flight path and heading) in radians, read back from DCMwe: μ = atan2(D23, D33), γ = asin(−D13), χ = atan2(D12, D11), [3,1].
- DCMwe – the direction cosine matrix from the flat-earth frame to wind axes, [3,3].
- Vw – the velocity in wind axes, [V; 0; 0], [3,1].
- alpha_beta – [α; β] in radians, [2,1].
- alpha_beta_dot – [α'; β'] in rad/s, [2,1]. Reads Fw and m at the same instant.
- wb – the body rates [p; q; r] in rad/s, [3,1].
- dwb – the body angular accelerations ω' in rad/s2, [3,1]. Reads M, I_dot and I at the same instant.
- Ab – the body-axes acceleration Vb × ω + DCMwbT·Fw/m, with Vb = DCMwbT·[V; 0; 0], [3,1]. Reads Fw at the same instant.
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 Position [Xe Ye Ze] – three values. Defaults to [0 0 0].
- Initial Airspeed and Angles [V alpha beta] – the initial airspeed, angle of attack and sideslip (radians), three values. V must be nonzero, since it divides, and β inside (−π/2, π/2). Defaults to [100 0 0]: the Simulink dialog's own default, [0 0 0], divides by zero at the first step.
- Initial Wind Angles [mu gamma chi] – the initial bank, flight-path and heading angles in radians, three values; the initial body quaternion is the half-angle product of the Euler angles of DCMwbT·DCMwe. Defaults to [0 0 0].
- Initial Body Rates [p q r] – in rad/s, three values. Defaults to [0 0 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 wind-angle read-back rebuilds it from ATAN). A core holds the thirteen states, publishes the ten outputs from them and the inputs of the same sample, 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 inertia is inverted in closed form at every derivative evaluation.
The three HDL targets are simulation-only real arithmetic,
quantized at the port: a tangent and a square root of a state have no Q16.16 form. The cores
simulate correctly and are not offered as synthesizable.
Simulink bridge
Import and export, mapped to Aerospace Blockset's
aerolib6dof2/Custom Variable Mass 6DOF Wind (Quaternion): Units → units (the two
offered values 1:1), Initial Position [Xe Ye Ze] → xme_0, Initial
Airspeed and Angles [V alpha beta] → Vm_0, Initial Wind Angles [mu gamma
chi] → wind_0, Initial Body Rates [p q r] → pm_0.
Always emitted with mtype = Custom Variable, rep = Quaternion
and vre_flag and abi_flag off: the mass type and the two flags each move
that block's port list, the representation selects a different block, and this block has one
port list. The knots unit system is not offered – it converts velocities inside the
integration – and an imported one is reported. mass_0, inertia and
the empty/full values are not read at this mass type and are not offered. "Sampling Time (s)" does not cross: the
Simulink block is continuous and defines no SampleTime.
Notes
- Stateful, continuous and nonlinear: thirteen continuous states. Unlike the body-axes equations of motion, the block has direct feedthrough: alpha_beta_dot, dwb and Ab read the inputs of the same instant, so a loop from those outputs back to Fw or M is an algebraic loop.
- V divides and β = ±90° is singular (tan β and 1/cos β): a run that takes the airspeed through zero or the sideslip to ±90° is outside the model, as it is in the Simulink block.
- No gimbal lock in the state. The wind-angle OUTPUT is a read-back, so μ and χ wrap at ±π and γ is clamped to the arcsine's domain at ±90°.
Code facts#
| Fact | Value |
|---|---|
| registered type | Robotics/Equations_Of_Motion/EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion |
| family | Robotics/Equations_Of_Motion |
| solver environment class | ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Equations_Of_Motion/EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion/ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Equations_Of_Motion/EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion/ICoreBlock_0_Robotics_1_Equations_Of_Motion_2_EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion.h |
| default size on canvas | 170 × 190 px |
| ports at insert | 5 in, 10 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text |
Ports#
| # | Direction | Signal type | Description label |
|---|---|---|---|
| 1 | in | ICoreDouble | Fw |
| 2 | in | ICoreDouble | M |
| 3 | in | ICoreDouble | m |
| 4 | in | ICoreDouble | I_dot |
| 5 | in | ICoreDouble | I |
| 6 | out | ICoreDouble | Ve |
| 7 | out | ICoreDouble | Xe |
| 8 | out | ICoreDouble | Wind |
| 9 | out | ICoreDouble | DCMwe |
| 10 | out | ICoreDouble | Vw |
| 11 | out | ICoreDouble | alpha_beta |
| 12 | out | ICoreDouble | alpha_beta_dot |
| 13 | out | ICoreDouble | wb |
| 14 | out | ICoreDouble | dwb |
| 15 | out | ICoreDouble | Ab |
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 variable | Default | Simulink parameter |
|---|---|---|
Units | Metric (MKS)%~%English (Velocity in ft/s)~~Metric (MKS) | units |
Initial Position [Xe Ye Ze] | [0 0 0] | xme_0 |
Initial Airspeed and Angles [V alpha beta] | [100 0 0] | Vm_0 |
Initial Wind Angles [mu gamma chi] | [0 0 0] | wind_0 |
Initial Body Rates [p q r] | [0 0 0] | pm_0 |
Integration Substeps | 100 | not 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.
Simulink bridge#
| support | Support::Both |
| Simulink path | aerolib6dof2/Custom Variable Mass 6DOF Wind (Quaternion) |
| port-count rule | PortsParam::None |
SampleTime parameter | no — the counterpart defines none; the rate stays on the ICore side |
| deliberately not crossed | Integration Substeps |
| always set | mtype = Custom Variable, rep = Quaternion, vre_flag = off, abi_flag = off |
| ICore config | Simulink parameter | Value translation |
|---|---|---|
Units | units | Metric (MKS) → Metric (MKS), English (Velocity in ft/s) → English (Velocity in ft/s) |
Initial Position [Xe Ye Ze] | xme_0 | passes through |
Initial Airspeed and Angles [V alpha beta] | Vm_0 | passes through |
Initial Wind Angles [mu gamma chi] | wind_0 | passes through |
Initial Body Rates [p q r] | pm_0 | passes through |
Caveat (shown to the user): aerolib6dof2/Custom Variable Mass 6DOF Wind (Quaternion) is a continuous masked subsystem with NO SampleTime parameter (verified against the R2026a block dialog). mtype, vre_flag and abi_flag are pinned because each moves that block's port list (measured), and rep because Wind Angles is a different block; the kts unit system is not offered because it converts velocities inside the integration; mass_0, inertia and the empty/full values are not read at this mass type; "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:
B0every 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).
Custom Variable Mass 6DOF Wind (Quaternion) -- wind-axes equations of motion, custom variable mass State [V alpha beta, p q r, q0 q1 q2 q3, xe ye ze], inputs Fw (WIND axes), M (body axes), m, dI/dt [3,3] and I [3,3] -- the mask's own inport order. The equations, and the R2026a measurement that fixed each of them, are in ../ICoreEomWindQuatSupport.cpp -- this block is that arithmetic at the Custom Variable mass type.
What is particular to this block, measured on the masked subsystem: omega' carries the Idot omega term (dropping it is out by 0.35 in Ab); there is no dm/dt input and no mass-flow term while vre_flag is off; mass_0, inertia and the empty/full values are not read. The inertia arrives on a wire, so its inverse is the adjugate formed at every derivative evaluation.
Sample results#
No stimulus produced a sampled output in this rig — Invalid input size at EOM 6DOF Custom Variable Mass Wind Quaternion block: ICore Blocks/Home/EOM 6DOF Custom Variable Mass Wind 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 845b82ae2e6ecfb4f8001612ef1259301958b745 · produced by docsSample --out <folder> --blocks EOM_6DOF_Wind_Quaternion EOM_6DOF_Simple_Variable_Mass_Wind_Quaternion EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion --steps 60
Sample data: docs/generated/samples/Robotics__Equations_Of_Motion__EOM_6DOF_Custom_Variable_Mass_Wind_Quaternion.json