SOL—OSI SIMPLIFIED Overview · 0%
Real-time hybrid simulation · stability assessment

Online Stability Indicator (OSI) During RTHS

A concise guide to how SOL-OSI estimates online stability during real-time hybrid simulation using frequency-domain evidence.

Eight-stage formulationestimator derivation and implementation
7k → 5kexperimentally identified column models
Frequency-domain analysiscoherent and residual evidence
Proceed to system formulation ↓
SECTION 01 / 09

Experimental Inner-Loop System Formulation

The inner loop comprises a PID controller, an experimentally identified plant, adaptive gain scaling, and negative feedback.

Course notationUse u and y
command displacement$d_d \equiv u$
measured displacement$d_m \equiv y$
Experimental Inner Displacement-Control Loopclosed-loop signal topology
+− PID, C(s)adaptive factor α H(s, k)column + actuator uvy

We call the experimentally identified plant $H(s,k)$. It maps the internal PID output $v$ to the measured response $y$, while $k$ identifies the current stiffness condition between 7k and 5k.

\[H(s,k)=\frac{Y(s)}{V(s)}\] The plant seen by the PID. Frequency enters through $s=j\omega$; stiffness enters through $k$.

The PID and plant multiply to form the open-loop transfer function. The adaptive factor $\alpha\in[0.02,1]$ scales the controller’s influence; $\alpha=1.00$ means full PID gain.

\[L(s,\alpha,k)=\alpha\,C(s)\,H(s,k)\] In the code, the healthy full-gain loop corresponds to $L_0(s)=C(s)H(s,7\mathrm{k})$.

Closing the negative-feedback loop gives the command → measurement response:

\[T(s,\alpha,k)=\frac{Y(s)}{U(s)}=\frac{L(s,\alpha,k)}{1+L(s,\alpha,k)}\] Both $\alpha$ and $k$ affect $T$ through the open loop $L$.
Parametric Frequency Response of the 7k–1k Inner Loop7k and 5k identified · 5k to 1k extrapolated · PID parameters: P = 0.15, I = 20, D = 0.0015
−180°
Continuous-Time Pole–Zero Mapopen loop
× poles ○ zeros dashed line: stability boundary

Read all three plots together.GM is the extra gain available when phase reaches $-180^\circ$. PM is the extra phase available when magnitude reaches 0 dB. The pole–zero map uses fixed six-pole, five-zero fits to the Bode data, so its order never changes. Open-loop poles can remain in the LHS even when a negative GM predicts closed-loop instability; switch to Closed to see the corresponding RHP poles in red. The identified family ends at 5k, and the 5k–1k range is a linear extrapolation. The live Bode curve turns from black to red; the light-gray 7k, $\alpha=1$ reference stays fixed.

SECTION 02 / 09

Short-Time Spectral Estimation of Interface Response

OSI updates at 0.125 s intervals using the most recent 0.5 s window of command and measured displacement data.

01append 0.125 s
02keep 0.5 s
03apply Hann window
04take FFT

Let $u[n]$ be command displacement and $y[n]$ be measured displacement. A Hann window $w[n]$ reduces edge discontinuities before the FFT:

\[U[k]=\operatorname{FFT}\{w[n]u[n]\},\qquad Y[k]=\operatorname{FFT}\{w[n]y[n]\}\]

At time step $n$, the instantaneous input-power, output-power, and cross-power terms are

\[p_u[n]=|U|^2,\qquad p_y[n]=|Y|^2,\qquad c_{yu}[n]=Y\,U^*\] $^*$ means complex conjugate.

One window is noisy, so each spectrum is . An overbar denotes a smoothed power or cross-power estimate; $S$ is reserved for the feedback sensitivity function.

Exponential smoothing combines the newest value with the previous estimate. It is a compact memory: recent windows matter most, but older windows do not disappear instantly.
\[\bar p_{uu}[n]=\bigl(1-\eta_s\bigr)\bar p_{uu}[n-1]+\eta_s p_u[n]\] \[\bar p_{yy}[n]=\bigl(1-\eta_s\bigr)\bar p_{yy}[n-1]+\eta_s p_y[n]\] \[\bar p_{yu}[n]=\bigl(1-\eta_s\bigr)\bar p_{yu}[n-1]+\eta_s c_{yu}[n]\] $n$ is the current time step and $n-1$ is the previous step. The spectral smoothing factor is $\eta_s=0.39$. In MATLAB, $\bar p_{uu}$, $\bar p_{yy}$, and $\bar p_{yu}$ are stored as state.Suu, state.Syy, and state.Syu.
Measured Command-Power Transition and Exponential Spectral Smoothing
|U|²
more memoryless memory

Recorded source. saved_results/tests/gpt5_6_tests/20260710_1845_plNew_authON_oscillations_unstableAtEnd.mat · command $d_d\equiv u$ · 12 Hz FFT bin · record time 24.625–29.625 s · 0.5 s Hann window updated every 0.125 s. The 41 circles are computed from the recorded command samples, not generated examples.

SECTION 03 / 09

Confidence-Weighted Coherent Identification of Closed-Loop Dynamics

The coherent branch estimates the closed-loop response from the command–measurement relationship. It then blends that estimate with the known healthy model.

asks: “At this frequency, how consistently does the input explain the output?”

Coherence ranges from 0 to 1. A value near 1 means the input and output have a strong, repeatable linear relationship at that frequency. A value near 0 means the ratio (Y/U) should not be trusted.
\[\gamma^2(\omega)=\frac{|\bar p_{yu}(\omega)|^2}{\bar p_{uu}(\omega)\bar p_{yy}(\omega)},\qquad 0\le \gamma^2\le1\]

Coherence alone is insufficient, so OSI gates it with input leverage for two reasons:

  1. Feedback-created coherence. At frequencies with high loop gain, measurement noise can drive the feedback loop and create high coherence between feedback-related signals even when the intended external excitation is absent. The resulting relationship is driven mainly by noise and can produce a misleading transfer-function estimate.
  2. Division by weak input power. Forming a transfer-function ratio requires division by the input spectrum. When $\bar p_{uu}$ is very small, numerical roundoff, measurement noise, spectral leakage, and ordinary estimation fluctuations can be greatly magnified.

The leverage factor therefore reduces confidence in frequency bins that do not contain meaningful input power. It cannot by itself distinguish strong feedback-correlated noise from intentional excitation.

First define the relative input power $p_{rel}(\omega)$: the power in the current frequency bin divided by the power in the strongest bin.

\[p_{rel}(\omega)=\frac{\bar p_{uu}(\omega)}{\max_{\nu}\bar p_{uu}(\nu)}\] $p_{rel}=1$ at the strongest input frequency and approaches 0 where input power is weak.

Next, $p_{floor}$ is a small positive floor ($10^{-3}$ here) that prevents tiny input values from receiving high trust. The input leverage $\ell(\omega)$ maps relative power to a number between 0 and 1:

\[\ell(\omega)=\frac{p_{rel}(\omega)}{p_{rel}(\omega)+p_{floor}}\]

Finally, $A$ is one activity score for the entire time window: $A=0$ means the command is quiet and $A=1$ means it is strongly driven. Stage 06 gives its exact RMS-based definition. The per-frequency confidence $c(\omega)$ combines activity, coherence, and leverage:

\[c(\omega)=\underbrace{A}_{\text{activity}}\;\underbrace{\gamma^2(\omega)}_{\text{coherence}}\;\underbrace{\ell(\omega)}_{\text{input leverage}}\]

The spectra now provide the raw measured closed-loop estimate $\widehat T(\omega)$:

\[\widehat T(\omega)=\frac{\bar p_{yu}(\omega)}{\bar p_{uu}(\omega)}\]

OSI also forms a model prior. It scales the healthy loop $L_0(\omega)$ by the currently applied adaptive gain $\alpha$, then converts that loop to its closed-loop response $T_{prior}(\omega)$. Here $\alpha$ is the applied a_cmd value: $\alpha=1.00$ means full PID gain, and it changes only if the separate adaptive-gain controller changes a_cmd. The estimator clamps the received value to $0.02\le\alpha\le1$:

\[L_{prior}(\omega)=\alpha L_0(\omega),\qquad T_{prior}(\omega)=\frac{L_{prior}(\omega)}{1+L_{prior}(\omega)}\]

The confidence $c(\omega)$ chooses how far the usable response $\widehat T_{use}(\omega)$ moves from the model prior toward the measured estimate. The final symbol $\widehat L(\omega)$ is the reconstructed open loop:

\[\widehat T_{use}(\omega)=c(\omega)\widehat T(\omega)+[1-c(\omega)]T_{prior}(\omega)\] \[\widehat L(\omega)=\frac{\widehat T_{use}(\omega)}{1-\widehat T_{use}(\omega)}\] The second equation is simply $T=L/(1+L)$ solved for $L$.
SECTION 04 / 09

Chordal-Distance Formulation of the Online Stability Indicator

At each frequency, OSI evaluates the separation between the estimated loop and the critical feedback condition; the minimum separation defines the reported margin.

The closed-loop denominator is $1+L$. Instability becomes possible when $L(j\omega)$ approaches $-1$, because then $1+L\to0$.

Define $b(\omega,\alpha,k)$ as the normalized distance from that critical condition at frequency $\omega$, adaptive gain $\alpha$, and plant condition $k$:

\[b(\omega,\alpha,k)=\min\!\left(\frac{|1+L(j\omega,\alpha,k)|}{\sqrt{2\left(1+|L(j\omega,\alpha,k)|^2\right)}},\;\frac{1}{\sqrt2}\right)\] This normalized chordal margin stays between 0 and $1/\sqrt2\approx0.707$.

Let $\Omega$ be the usable 2–100 Hz band after excluding the 58–62 Hz line-noise bins. The operator $\operatorname{median}_3$ is a three-bin median filter that suppresses isolated spikes. The identification branch keeps its margin as a curve over $\Omega$:

\[b_{st}(\omega)=\operatorname{median}_3\{b(\omega)\},\qquad\omega\in\Omega\] The reduction $\min_{\omega\in\Omega}$ is deferred to Section 06, after both branches have been fused bin by bin.
Chordal-Margin Sensitivity Across the 7k–5k Plant Familyexperimentally identified $H(s,k)$ models
worst margin0.589
binding frequency34 Hz
conditionhealthy reference
Read the number in the right directionA large (b) means more separation from the critical condition. A small (b) means less robustness. In these sampled project models, the 7k minimum is about 0.589 and the 5k minimum is about 0.345.
SECTION 05 / 09

Residual Output-Energy Inference under Weak Excitation

When command excitation is insufficient for coherent identification, OSI evaluates changes in measured output spectra relative to a healthy reference.

Let $r=1,2,3$ index the first three non-overlapping 0.5 s reference windows, which are assumed to represent the healthy loop. For window $r$, $y_r[n]\equiv d_{m,r}[n]$ is its measured-displacement segment and $Y_r(\omega)$ is the FFT of that segment after applying the estimator window $w[n]$. The median reference power is denoted by $p_{yy,\mathrm{ref}}(\omega)$:

\[Y_r(\omega)=\mathcal{F}\!\left\{w[n]\,y_r[n]\right\},\qquad y_r[n]\equiv d_{m,r}[n]\] \[p_{yy,\mathrm{ref}}(\omega)=\operatorname{median}_{r=1,2,3}\left\{|Y_r(\omega)|^2\right\}\]

For every later window, the observed ratio $q_{obs}(\omega)$ divides the current smoothed output power by that fixed healthy-reference power:

\[q_{obs}(\omega)=\frac{\bar p_{yy}(\omega)}{p_{yy,\mathrm{ref}}(\omega)}\] A value near 1 resembles the healthy reference. Persistent growth suggests changed loop dynamics.

OSI represents damage-like loop growth with a frequency-dependent scale $g(\omega)$. For each of 25 candidate values between 0.5 and 6, the modeled output power $p_{yy,\mathrm{model}}(\omega,g)$ is normalized by the same healthy-reference power used in $q_{obs}(\omega)$. The resulting modeled ratio is $q_{model}(\omega,g)$:

\[q_{model}(\omega,g)=\frac{p_{yy,\mathrm{model}}(\omega,g)}{p_{yy,\mathrm{ref}}(\omega)} =\left|\frac{1+L_0(\omega)}{1+\alpha g L_0(\omega)}\right|^2\] \[\Omega=\left\{\omega=2\pi f:\;2\,\mathrm{Hz}\le f\le100\,\mathrm{Hz},\quad f\notin[58,62]\,\mathrm{Hz}\right\}\] \[g_{best}(\omega)=\arg\min_g \left|\log q_{obs}(\omega)-\log q_{model}(\omega,g)\right|, \qquad\omega\in\Omega\] Every usable frequency in $\Omega$ independently selects its best candidate $g$.

The remembered fitted curve is updated in log space. The same recurrence is used for damage-evidence accumulation and recovery, with a different update gain for each case:

\[\log \bar g[n]=\log \bar g[n-1]+\eta_g\log g_i[n]\] \[\eta_{g,\mathrm{dmg}}=0.12, \qquad \eta_{g,\mathrm{rec}}=0.27\] $g_i$ is the multiplicative correction toward $g_{best}(\omega)$ during damage-evidence accumulation and toward $g=1$ during recovery.

The residual margin $b_{res}(\omega)$ is the chordal margin predicted by the frequency-dependent loop-growth hypothesis, kept as a curve just as $b_{st}(\omega)$ is. A three-bin moving median is applied across adjacent frequency bins:

\[b_{res}(\omega)=\operatorname{median}_3 \left\{b\!\left(\alpha g(\omega)L_0(\omega)\right)\right\},\qquad\omega\in\Omega\] $\operatorname{median}_3$ means three adjacent frequency bins, not three time windows.
SECTION 06 / 09

Per-Frequency Fusion of Stability Evidence

Neither branch is trusted everywhere. Both are kept as curves over frequency, every bin is charged for the evidence it actually has, and only then is one isolated low bin trimmed so the second-smallest bin governs.

The 0.5 s command RMS defines the binary activity $A$ directly. The approved threshold is $\eta_A=0.0575$, approximately $4.54\sigma_{\mathrm{noise},u}$ based on the clean quiet-record estimate:

\[A=\begin{cases} 1,&\operatorname{RMS}_{0.5\,\mathrm{s}}(u)>\eta_A\\[6pt] 0,&\text{otherwise} \end{cases}\] \[\eta_A=0.0575\approx4.54\sigma_{\mathrm{noise},u}\]

Activity is no longer a regime switch that selects one scalar margin or the other. It enters only where it belongs: inside the confidence $c(\omega)$ of the identification branch, and in the fast drive-ratio detector of the residual branch.

Why the fusion is per frequencyA chordal margin is defined at a frequency. Collapsing each branch first and then combining two scalars mixes margins taken at different frequencies, which is not a quantity with a meaning. The final order-statistic reduction therefore runs last, after each bin has formed its own estimate.

Two independent kinds of evidence exist at every bin, and each one has to pay for the claim it makes. The first is the confidence $c(\omega)$ already built in Section 03: command energy and coherence say the loop is directly visible at this frequency, so the identified margin $b_{st}(\omega)$ is worth believing.

\[w_{st}(\omega)=c(\omega)=A\,\gamma^2(\omega)\,\ell(\omega)\]

The second is a detection weight $d(\omega)$. The fitted loop growth $g(\omega)$ only means something once it clears the resolution of the $g$ fit itself; below the threshold $g_{det}=1.75$ the deviation carries little residual evidence. Where $g$ does clear it, the residual model $b_{res}(\omega)$ is worth believing to the extent the loop is not directly visible:

\[d(\omega)=\operatorname{clamp}\!\left(\frac{g(\omega)-1}{g_{det}-1},0,1\right), \qquad g_{det}=1.75\] \[w_{res}(\omega)=\big(1-c(\omega)\big)\,d(\omega)\]

The two evidence weights never sum to more than one. Whatever is left over is the prior weight $w_{prior}$: the share of the bin that neither branch can account for, and which therefore falls back on the current authority-scaled commissioning prior $b_{prior}(\omega)$.

\[w_{prior}(\omega)=1-w_{st}(\omega)-w_{res}(\omega)\] The three weights partition the bin: $w_{st}+w_{res}+w_{prior}=1$, each in $[0,1]$.

Carrying the unsupported share on the prior, rather than on the ceiling, is what makes the reported value an estimate of the loop margin instead of treating “unknown” as the largest possible margin.

\[b(\omega)=w_{st}(\omega)\,b_{st}(\omega) +w_{res}(\omega)\,b_{res}(\omega) +w_{prior}(\omega)\,b_{prior}(\omega)\] Each frequency bin forms its own convex combination of the three margins.
Where Each Bin's Answer Comes Fromthe mixture $w_{st}:w_{res}:w_{prior}$ over the whole $(d,c)$ plane

Every frequency bin of every update lands somewhere on this square. Its position fixes the mixture completely, because the three weights are determined by $c$ and $d$ alone: $w_{st}=c$, $w_{res}=(1-c)d$, $w_{prior}=(1-c)(1-d)$. The colour is those three weights blended in linear light, so a corner shows its pure colour and the interior shows the true proportions.

cursor $(d,\,c)$—
$w_{st}$ / $w_{res}$ / $w_{prior}$—
dominant term—

After forming $b(\omega)$ at every retained frequency, the estimator trims the single smallest value and selects the second-smallest bin at $\omega_*$. That selected value is the scalar instantaneous margin $b_i[n]$:

\[b_i[n]=b(\omega_*)=b_{(2)}\!\left(\left\{b(\omega):\omega\in\Omega\right\}\right)\] The frequency reduction occurs before smoothing in time.

For the configured sampling rate $f_s=2048\,\mathrm{Hz}$ and 0.5 s moving window, each FFT uses 1024 samples and has frequency spacing $\Delta f=f_s/1024=2\,\mathrm{Hz}$. The 2–100 Hz band therefore contains 50 bins; rejecting 58, 60, and 62 Hz leaves 47 retained bins. Thus $b_{(2)}$ is the second of 47 sorted margins, with empirical cumulative rank $2/47\approx4.3\%$—approximately the 4th percentile—and only the single lowest margin across the retained frequency bins is discarded.

The reported scalar margin is a first-order lag on $b_i[n]$, with $\eta_b$ the fraction of the new reading admitted at each update:

\[b[n]=(1-\eta_b)\,b[n-1]+\eta_b\,b_i[n]\]

Recovery

Recovery uses the median observed power ratio over $\Omega$:

\[r_{\Omega}=\operatorname{median}_{\omega\in\Omega}q_{obs}(\omega)\] $q_{obs}$ compares the current output power with the healthy-reference power.

When $r_{\Omega}<1$, the remembered growth $g$ decays toward the healthy value $g=1$ using the recovery gain:

\[\eta_{g,\mathrm{rec}}=0.27\]

Each qualifying update applies the log-domain recurrence of Section 05 with the recovery correction toward $g=1$; otherwise the remembered value remains unchanged.

SECTION 07 / 09

Separation of Stability Estimation and Adaptive-Gain Control

OSI estimates the stability margin $b$, while a separate adaptive-gain law determines the controller response.

Important separationThe estimator does not directly choose PID gains. It receives the currently applied adaptive factor $\alpha$ (stored as a_cmd), evaluates the corresponding loop, and returns evidence for a separate adaptive-gain controller.

The adaptive factor uniformly scales the inner open loop:

\[L(j\omega,\alpha,k)=\alpha L(j\omega,1,k)\]

Because a positive scale changes magnitude but not phase, the $-180^\circ$ crossover frequency stays approximately fixed. The gain margin changes in closed form:

\[GM_{dB}(\alpha,k)=GM_{dB}(1,k)-20\log_{10}(\alpha)\]

Let $GM_{target}$ be the desired gain margin. The scale required to meet that target is $\alpha_{required}(k)$:

\[\alpha_{required}(k)=10^{\left(GM_{dB}(1,k)-GM_{target}\right)/20}\]

The adaptive law keeps $\alpha$ between the permitted minimum $\alpha_{min}$ and 1. When damage raises loop gain and $b$ falls, reducing $\alpha$ can restore separation from the critical condition. Recovery should be slower and evidence-based so one optimistic window cannot rush the adaptive factor upward.

Closed-Loop Adaptive-Gain Architecturebidirectional coupling between stability estimation and loop-gain adaptation
experimentu, y OSImargin b adaptive-gain lawα ∈ [αmin, 1] scale PID and report αcmd back to estimator
SECTION 08 / 09

Integrated Mathematical Formulation of the OSI Estimator

The complete OSI update is summarized as an eight-stage computational sequence.

01What moved?Append $u,y$ and measure command activity.
02At which frequencies?Window, FFT, and smooth $\bar p_{uu},\bar p_{yy},\bar p_{yu}$.
03Is the ratio believable?Combine activity, coherence, and leverage into confidence.
04What loop produced it?Blend $\widehat T$ with $T_{prior}$, then invert to $\widehat L$.
05How close is critical?Evaluate the chordal curve and take its minimum.
06What if input is quiet?Fit $g$ from output power relative to a fixed healthy reference.
07What can each bin support?Weight $b_{st}(\omega)$ by $w_{st}=c$, $b_{res}(\omega)$ by $w_{res}=(1-c)d$, and $b_{prior}(\omega)$ by the remaining $w_{prior}$; trim one isolated low bin and take the second-smallest.
08What should be reported?Smooth and clamp $b$, then report the direct, inferred, and prior shares at the governing frequency.
\[\boxed{\;(u,y,L_0,\alpha)\;\longrightarrow\;\widehat L\;\text{and}\;g\;\longrightarrow\;b_{st}(\omega),b_{res}(\omega)\;\longrightarrow\;b_{(2)}\{b(\omega)\}\;\longrightarrow\;b\;}\]

Correspondence Between Mathematical Formulation and Implementation

Read makeConfig as the mathematical constants, makeState as estimator memory, and stepEstimator as the eight-stage pipeline above. This formulation corresponds to research/sol_osi_simplified/sol_osi_simplified.m; it remains separate from the production SOL-OSI implementation.

The accepted simplified method keeps the complete V5 estimator and changes only the final reducer: after the per-frequency evidence mixture is formed, it selects the second-smallest retained value instead of the minimum. That one-bin trim prevents a single isolated residual from governing the full estimate while leaving all evidence weights, filters, detector settings, and authority logic unchanged.

In Fabby Bench 2, with synthetic target 0.55 and experimental target 0.30, the simplified method passes all seven gates. It scores 92.94 on Fabby 1, 62.48 on Fabby 2, 60.00 on detection, 87.73 on smoothness, and 100 on GDB recovery, for a composite of 80.63. Indicator jitter is 1.95, unstable time is zero, and tail authority is 0.503.

Fabby Bench 2 Comparison

The detection score counts the five known diagnostic-gain increases—three in the live experimental scenario and two in GDB—and awards one fifth for each event reflected in the reading or authority response within two seconds. The simplified method detects 3 of 5, so its detection score is $100(3/5)=60$.

The implemented estimator has the strongest raw detection score, but it fails the zero-unstable-time and end-hold gates. The simplified estimator passes every gate. Section 09 replays every test for these two maintained methods and tabulates the scorecard.

SECTION 09 / 09

Fabby Bench 2: Implemented and Simplified

Every test of the benchmark, replayed for the implemented estimator and the accepted second-smallest-bin simplified estimator, with the reported margin and applied authority side by side.

Test Replayselect a test

The measured displacement is drawn once per implementation, because in every closed-loop test the authority factor scales the command that drives the plant: where the two traces separate, the implementations have driven the specimen differently. Dashed vertical marks give the plant blend used by the synthetic scenarios, where $\lambda=0$ is the identified 7k model and $\lambda=1$ the 5k model. Where a test provides ground truth, the true chordal margin is drawn dashed in each implementation's own colour, since it depends on the authority that implementation applied. The diagnostic gain, where the record carries one, is drawn against the right-hand axis of the authority panel. Click any legend entry to hide or restore that trace; the vertical scales follow what is left visible, so a single implementation can be read out of a crowded plot.

Scorecard

Read directly from the saved Fabby Bench 2 results, so this table cannot disagree with the benchmark that produced it. A raw composite is reported only when all seven gates pass; the failing implemented method is shown for reference and marked as gated out. Hover or tab onto any metric name for what it measures, whether high or low is the good direction, and which test in the dropdown above to look at.

Metricimplementedsimplified