Generated reference › Tustin Pilot Model — Robotics/Pilot Models
kind: generated#block#robotics-pilot-models

Tustin Pilot Model — Robotics/Pilot Models

PI

Robotics/Pilot_Models/Tustin_Pilot_Model · 2 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.

Tustin Pilot Model

Robotics / Pilot Models

A human pilot closing one control loop, after A. Tustin (1947): a proportional-plus-integral operator acting on the tracking error after a reaction delay,

u = Kp·(T·s + 1)/s · e−sτ · (xcom − x)

that is, with w the error delayed by τ, u = Kp·(T·w + ∫w dt). The name is the author's, not the discretization rule's: nothing here is bilinear.

Ports

  • x com – the commanded value of the controlled quantity, a scalar.
  • x – the controlled element's actual output, a scalar. The error is x com − x, so the two inputs are not interchangeable: swapping them negates the output.
  • u – the pilot's control input to the controlled element, a scalar.

Parameters

  • Pilot Gain – Kp, a scalar. Defaults to 1.
  • Pilot Time Delay (s) – τ, a scalar, and it must be greater than zero. Defaults to 0.1. It need not be a whole number of samples: a fractional delay is realized exactly, not rounded (see Notes).
  • Pilot Lead Constant – T in seconds, a scalar. Defaults to 5.
  • 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 one emits the same recursion the simulation runs: a delay line of past errors and the exactly discretized filter, with every coefficient computed at export time from the parameters and the sampling time and printed at 17 significant digits. The parameters are therefore inlined, not tunable: retuning the pilot means re-exporting.

The three hardware targets are genuine Q16.16 fixed point – a shift register for the delay and one multiply-accumulate row per state – and round rather than truncate at every shift back, because the integrator accumulates every sample.

Simulink bridge

Import and export, mapped to Aerospace Blockset's aerolibpilot/Tustin Pilot Model: Pilot Gain → Kp, Pilot Time Delay (s) → time_delay, Pilot Lead Constant → T. The mask's pade field has no counterpart and is left at its default: it is the delay's Padé order for linearization only and changes nothing a simulation computes.

The Simulink block defines no SampleTime parameter, measured with set_param, so the rate stays on the ICore side.

Notes

  • Stateful: one integrator state and a line of past errors as long as the delay. Both start at zero, as Simulink's do.
  • Sampled: the block runs at its sampling time, and its filter is the exact zero-order-hold discretization of the continuous model for an error held between samples – so at the sample instants it equals the continuous model. A fractional delay is realized exactly too: the held error then changes part-way through an interval, and the recursion integrates both parts.
  • No state space: a pure delay has no finite A/B/C/D, so model reduction correctly refuses the block rather than merging it with its delay dropped. The output never depends on the input at the same instant, so a loop closed through the pilot is not algebraic.
  • When the delay is a whole number of samples, Simulink's continuous delay still emits its initial output at exactly t = τ, where a sampled line already emits the first error; the two differ on that one sample by Kp·T times the first error, and agree everywhere else.

Code facts#

FactValue
registered typeRobotics/Pilot_Models/Tustin_Pilot_Model
familyRobotics/Pilot_Models
solver environment classICoreBlock_0_Robotics_1_Pilot_Models_2_Tustin_Pilot_Model
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Pilot_Models/Tustin_Pilot_Model/ICoreBlock_0_Robotics_1_Pilot_Models_2_Tustin_Pilot_Model.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Robotics/Pilot_Models/Tustin_Pilot_Model/ICoreBlock_0_Robotics_1_Pilot_Models_2_Tustin_Pilot_Model.h
default size on canvas120 × 80 px
ports at insert2 in, 1 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoublex com
2inICoreDoublex
3outICoreDoubleu

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
Pilot Gain1Kp
Pilot Time Delay (s)0.1time_delay
Pilot Lead Constant5T

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 pathaerolibpilot/Tustin Pilot Model
port-count rulePortsParam::None
SampleTime parameterno — the counterpart defines none; the rate stays on the ICore side
ICore configSimulink parameterValue translation
Pilot GainKppasses through
Pilot Time Delay (s)time_delaypasses through
Pilot Lead ConstantTpasses through

Caveat (shown to the user): The mask's pade field is the delay's Pade order for LINEARIZATION only and has no counterpart here: this block realizes the true delay, so an imported pade value changes nothing a simulation computes. This block is sampled: at its sampling time it equals the continuous Simulink model for an input held between samples, and with a delay that is a whole number of samples the two differ on the one sample at t = delay, where Simulink's continuous Transport Delay still emits its initial output

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

Tustin Pilot Model — a proportional-plus-integral pilot behind a reaction delay u = Kp * (T*s + 1)/s * e^(-s*tau) * (x_com - x)

MEASURED IN R2026a, reading the masked subsystem aerolibpilot/Tustin Pilot Model block by block (the mask's callback is a .p file, so the subsystem is the only readable source):

x com, x -> Sum |-+ (x com minus x) -> Transport Delay (DelayTime = time_delay, InitialOutput 0, PadeOrder = pade) -> Gain Kp -> Lead Lag Filter (num1 = T, num2 = 1, den1 = 1, den2 = 0) -> u

⚠ THE LEAD LAG FILTER'S den2 IS ZERO, which is what makes this a PI and not a lead-lag: its "D" gain den2/num2 vanishes, so the inner integrator is a pure one and the filter is (T*s + 1)/s = T + 1/s. The name is Arnold Tustin's (1947), not the bilinear transform's -- nothing in the block is discretized by Tustin's rule.

⚠ THE PADE ORDER IS NOT A MODEL PARAMETER. It is the Transport Delay's "Pade order (for linearization)", which touches linmod and nothing a simulation computes; this block realizes the true delay, so it has no config for it.

Checked against a real sim of the block at Kp 1.3, T 3.7, tau 0.13 before a line of C++ existed: the exact-ZOH recursion ICorePilotModelBlockBase realizes matched it everywhere except the ONE sample at t = tau, where Simulink's continuous delay still emits its initial output (|error| 0.367 = Kp*T*e(0), exactly the direct term's share). A delay that is not a whole number of samples has no such sample.

Everything but the filter lives in ICorePilotModelBlockBase -- read that header first.

Sample results#

Tustin Pilot Model — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sampleTustin Pilot Model — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample-202012345t (s)in ICoreDouble-Out-0in ICoreDouble-Out-0out ICoreDouble-Out-0
tin ICoreDouble-Out-0in ICoreDouble-Out-0out ICoreDouble-Out-0
0-2-20
0.40.50.50
0.8-2-20
1.20.50.50
1.6-2-20
20.50.50
2.4-2-20
2.80.50.50
3.2-2-20
3.60.50.50
4-2-20
4.40.50.50
4.8-2-20
5.20.50.50

Every 4th of 60 samples, from the table stimulus.

The same rig also ran:

StimulusWhat it isOutput range
impulseImpulse: one sample of 1 at k = 5, 0 elsewhere (Repeating Sequence Stair)0 … 0
rampRamp: slope 1 from t = 00 … 0
sineSine Wave: amplitude 1, 2 rad/s, no phase, no bias0 … 0
stepStep: 0 -> 1 at t = 1 s0 … 0

Plotted: table — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample

Category static · sample time 0.1 · 60 steps · commit 383c0ecf1501cf1d43d89b8f688fc2fcad5e9b52 · produced by docsSample --out <folder> --blocks Ideal_Airspeed_Correction WGS84_Gravity_Model Linear_Regression_Predictor Linear_Classifier_Predictor Crossover_Pilot_Model Precision_Pilot_Model Tustin_Pilot_Model FIR_Least_Squares_Design FIR_Equiripple_Design Cartesian_To_Keplerian_Elements Keplerian_Elements_To_Cartesian --steps 60 · data docs/generated/samples/Robotics__Pilot_Models__Tustin_Pilot_Model.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).