Pular para conteúdo

API reference

This page documents the public API of pyncbt.

The library provides a unified interface for Non-iterative Correlation-based Tuning (NCbT) using both open-loop and closed-loop data.
The distinction between open-loop and closed-loop operation lies solely in how the data are collected, not in how the estimator is configured or used.

For usage examples, refer to the tutorials:

  • Tutorial → Open-loop NCbT
  • Tutorial → Closed-loop NCbT

NCbT estimators

Two estimator classes are provided:

  • NCbT_open: for data collected in open loop
  • NCbT_closed: for data collected in closed loop

Both classes have similar the interface, parameters, and execution flow.


Common interface

NCbT_open(u, y, num_M, den_M, Ts, t, l, beta)

NCbT_closed(u, y, r, num_M, den_M, Ts, t, l, beta)

Parameters

  • u : Input signal applied to the plant.
  • y : Measured plant output.
  • r : Reference signal
  • num_M, den_M : Numerator and denominator coefficients of the discrete-time reference model.
  • Ts : Sampling time of the discrete-time system.
  • t : Time vector
  • l : Length of the instrumental-variable window. Controls the bias–variance trade-off in finite data.
  • beta : Controller basis functions defining the fixed controller structure. All basis elements must be stable.

Execution

rho = estimator.run()

Executes the NCbT algorithm and computes the controller parameter vector.

Assumptions and remarks

  • The system is discrete-time, SISO, and LTI.
  • Input data must be sufficiently exciting.
  • Proper selection of l is required to balance bias and variance.
  • In the closed-loop case, the data must be colected from a stable feedback controller.