Generated reference › Three Axis Accelerometer — Robotics/Navigation Sensors
kind: generated#block#robotics-navigation-sensors

Three Axis Accelerometer — Robotics/Navigation Sensors

Robotics/Navigation_Sensors/Three_Axis_Accelerometer · 5 input / 1 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.

Three-axis Accelerometer

Robotics / Navigation Sensors

What a three-axis accelerometer mounted away from the centre of gravity reads: the specific force at the sensor, passed through a scale-factor and cross-coupling matrix, a bias, an optional second-order sensor response and output limits.

d = [1 −1 1] · (CG − location) – the lever arm in body axes
A = (Ab − g) + ω × (ω × d) + ω̇ × d – the specific force at the sensor
Ameas = sat( H( SFCC · A + bias ) ), with H(s) = ωn² / (s² + 2ζωns + ωn²) on each axis

Ports

  • Ab – Ab, the acceleration of the CG in body axes, a [3,1] column.
  • w – ω, the body angular rates p, q, r in rad/s, a [3,1] column.
  • dw/dt – ω̇, the body angular accelerations in rad/s², a [3,1] column.
  • CG – the centre of gravity, a [3,1] column in the same axes and units as the Accelerometer Location: station (positive aft), buttline (positive right), waterline (positive up).
  • g – the gravity vector in body axes, a [3,1] column; it is subtracted, so feed zeros to measure the kinematic acceleration alone.
  • A_meas – Ameas, the measured acceleration, always a [3,1] column.

The port order is the Simulink block's own. Every input must be a [3,1] column.

Parameters

  • Accelerometer Location – where the sensor sits, three numbers in the station/buttline/waterline axes the CG port uses. Default [0 0 0].
  • Second-order Dynamics – whether the sensor has a response:
    • on – each axis passes through H(s) above (default).
    • off – the sensor is instantaneous: Ameas = sat(SFCC · A + bias).
  • Natural Frequency (rad/s) – ωn, a scalar greater than zero. Default 190.
  • Damping Ratio – ζ, a scalar of zero or more. Default 0.707.
  • Scale Factors and Cross-coupling – the [3,3] matrix SFCC. The identity (default) is a perfect sensor; the diagonal holds the scale factors and the off-diagonal entries the cross-axis sensitivities.
  • Measurement Bias – three numbers added after the matrix and before the dynamics, so a step in the bias is filtered like any other input. Default [0 0 0].
  • Update Rate (s) – how the dynamics are realized, and the Simulink block's own "Update rate":
    • 0 (default) – continuous. Under a continuous solver the response is integrated as it stands; when the block is stepped – the discrete solver, and every code export – it is the exact zero-order-hold discretization at the block's period, which is what the continuous sensor computes from inputs that hold across each sample.
    • greater than 0 – a discrete sensor updating every that many seconds, with the Tustin (bilinear, unwarped) discretization of H(s) – exactly what the Simulink block builds for a positive rate. The block then runs at its own period, which must be this same value: set Sampling Time (s) to it, or leave that at zero with the model's sampling time equal to it. A mismatch is reported and stops the run.
  • Lower and Upper Output Limits – six numbers, the three lower limits then the three upper ones, applied last. -inf and inf (default on all six) mean no limit. Each lower limit must not exceed its upper one.
  • 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. Every parameter is baked in at export time, and so is the discretization: the section coefficients are computed for the block's period (or its update rate) and printed at full precision. All ten are rendered from the one description of the arithmetic the block's own simulation runs, so they perform the same operations in the same order.

The three HDL targets are simulation-only: they carry the whole model in real arithmetic and quantize only at the ports. At a period short against the sensor's response the section's poles sit close to z = 1, where Q16.16 coefficients lose the filter's DC gain, and the default limits are infinite, which fixed point cannot hold. VHDL keeps the arithmetic in a function of its own, called once per value it returns.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolibnav/Three-axis Accelerometer. Accelerometer Location ↔ acc, Second-order Dynamics ↔ dtype_a (on/off, 1:1), Natural Frequency (rad/s) ↔ w_a, Damping Ratio ↔ z_a, Scale Factors and Cross-coupling ↔ a_sf_cc, Measurement Bias ↔ a_bias, Update Rate (s) ↔ a_Ts, Lower and Upper Output Limits ↔ a_sat, all passing their values through unchanged.

Two settings are fixed: gtype ("Subtract gravity") is always on, because turning it off deletes Simulink's g port and the port lists would no longer line up – a zero on g gives the same answer; and a_rand ("Noise on") is always off (see Notes). A model importing either at another value is reported rather than silently changed. units does not cross: on this block it changes no number (measured), only the labels. The block has no SampleTime, so Sampling Time (s) stays on the ICore side and its rate crosses as a_Ts instead – which is not the same thing: a rate of −1 in a_Ts makes the Simulink block's filter diverge.

Notes

  • Stateful with the dynamics on: two states per axis, starting at zero. With Update Rate (s) at 0 the output has no direct feedthrough (it reads the response state); with a positive rate, or with the dynamics off, it does.
  • No sensor noise. The Simulink block can add white noise from its own random number generator; no generated code can reproduce that sequence, so no test could confirm a noisy export, and the option is not offered. To model noise, add a Band-Limited White Noise per axis after this block – it lands after the output limits rather than before them.
  • Nonlinear – the lever-arm terms are products of the rates, and the limits clamp – so the block carries no state space and model reduction reports it as unmergeable.
  • The lever arm uses the [1 −1 1] sign flip because station and waterline run opposite to body x and z; a sensor at the CG sees neither lever-arm term.

Code facts#

FactValue
registered typeRobotics/Navigation_Sensors/Three_Axis_Accelerometer
familyRobotics/Navigation_Sensors
solver environment classICoreBlock_0_Robotics_1_Navigation_Sensors_2_Three_Axis_Accelerometer
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Navigation_Sensors/Three_Axis_Accelerometer/ICoreBlock_0_Robotics_1_Navigation_Sensors_2_Three_Axis_Accelerometer.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Navigation_Sensors/Three_Axis_Accelerometer/ICoreBlock_0_Robotics_1_Navigation_Sensors_2_Three_Axis_Accelerometer.h
default size on canvas150 × 130 px
ports at insert5 in, 1 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoubleAb
2inICoreDoublew
3inICoreDoubledw/dt
4inICoreDoubleCG
5inICoreDoubleg
6outICoreDoubleA_meas

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
Accelerometer Location[0 0 0]acc
Second-order Dynamicson%~%off~~ondtype_a
Natural Frequency (rad/s)190w_a
Damping Ratio0.707z_a
Scale Factors and Cross-coupling[1 0 0; 0 1 0; 0 0 1]a_sf_cc
Measurement Bias[0 0 0]a_bias
Update Rate (s)0a_Ts
Lower and Upper Output Limits[-inf -inf -inf inf inf inf]a_sat

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 pathaerolibnav/Three-axis Accelerometer
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
always setgtype = on, a_rand = off
ICore configSimulink parameterValue translation
Accelerometer Locationaccpasses through
Second-order Dynamicsdtype_aon → on, off → off
Natural Frequency (rad/s)w_apasses through
Damping Ratioz_apasses through
Scale Factors and Cross-couplinga_sf_ccpasses through
Measurement Biasa_biaspasses through
Update Rate (s)a_Tspasses through
Lower and Upper Output Limitsa_satpasses through

Caveat (shown to the user): the noise is not modelled, so 'Noise on' (a_rand) is pinned off and its seeds and powers do not cross; 'Subtract gravity' (gtype) is pinned on, because off deletes the g port -- a zero on g is the same answer; 'units' does not cross, changing no number on this block (measured). The block has no SampleTime: its rate crosses as a_Ts, where 0 is continuous and a positive value is a Tustin update rate

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

Three-axis Accelerometer -- the specific force at an off-CG sensor, through an error model d = [1 -1 1] .* (CG - location) lever arm, body axes A = ((Ab - g) + w x (w x d)) + dw/dt x d specific force at the sensor out = saturate( H( SFCC * A + bias ) )

MEASURED AGAINST R2026a, by reading the masked subsystem's wiring (find_system) and then simulating the real block against a reference built from that reading: 2.7e-14 over 300 samples with the dynamics on, EXACTLY 0 with them off, and a reference with the location negated is out by 46 -- so the lever arm is being exercised, not merely tolerated.

What the wiring says that no dialog prompt does:

  • The bias is added BEFORE the second-order dynamics and the saturation comes AFTER them.
  • "Update rate" 0 is a continuous Second-Order Integrator; a positive rate puts a

zero-order hold on every input and replaces the integrator with a Discrete Transfer Fcn whose coefficients are the TUSTIN transform at that rate. A rate of -1 -- the value an "inherited" SampleTime is written as -- gives that filter K = 2/T = -2 and it DIVERGES (4.9e9 in 300 samples, measured), so the rate is a config of its own here and never the block's Sampling Time.

  • "Units" moves no number at all: English and Metric are byte-identical on this block.
  • "Subtract gravity" OFF deletes the g port -- the ports then no longer line up with a

fixed ICore port list, so the choice is pinned ON and a zero on g recovers it exactly.

The noise is not modelled: see the description.

Sample results#

Three Axis Accelerometer — Sine Wave, [3,1]: amplitudes 1/2/3 at 2 rad/s (tried only because every scalar stimulus was refused)Three Axis Accelerometer — Sine Wave, [3,1]: amplitudes 1/2/3 at 2 rad/s (tried only because every scalar stimulus was refused)05e2131e2141.5e214012345t (s)in ICoreDouble-Out-0 [3x1] entry 0in ICoreDouble-Out-0 [3x1] entry 0in ICoreDouble-Out-0 [3x1] entry 0out ICoreDouble-Out-0 [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 6280f52f3 · produced by docsSample --out <folder> --blocks Rational_Resample,Three_Axis_Accelerometer,Three_Axis_Gyroscope,Three_Axis_Inertial_Measurement_Unit,Eclipse_Shadow_Model,To_String,String_To_ASCII,ASCII_To_String,Substring,String_Constant,String_Concatenate,String_Compare,String_Length --steps 60 · data docs/generated/samples/Robotics__Navigation_Sensors__Three_Axis_Accelerometer.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).