Skip to main content

Crate dsmc

Crate dsmc 

Source
Expand description

Digitalservo Motion Control Library: building blocks for the design and analysis of motion control systems.

Modules§

discretize
Continuous-time to discrete-time conversion.
feedforward
Feedforward control.
fft
Spectrum analysis by FFT.
laplace_transform
Laplace transform: inverse transforms and signals given in the Laplace domain.
logger
CSV logging of Serialize values.
signal
Discrete-time signal processing elements, updated once per sample, and excitation signals.
status
Motion state of an axis.
system_identification
System identification from time-domain or frequency-domain data.
trajectory
Rest-to-rest motion profiles (trajectories).

Macros§

tf
Write a transfer function as a string. The time domain is detected from the variable at compile time: s gives Continuous, z gives Discrete.

Structs§

BodeDiagramPlotter
Bode diagram over [freq_from, freq_to) with step dfreq, all given in U (Hz by default).
Continuous
Marker for continuous-time systems (polynomials in s, dx/dt = Ax + Bu).
Discrete
Marker for discrete-time systems (polynomials in z, x[k+1] = Ax[k] + Bu[k]).
DiscreteSystem
A discrete-time system running one sample at a time, e.g. a simulated plant or the implementation of a digital controller or filter: a copy of the model with its state, so that StateSpace and TransferFunction stay plain representations. It starts at rest.
FrequencyCharacteristics
Gain and phase [rad] at frequency, whose unit is U (Hz or RadPerSec).
FrequencyResponse
Complex frequency response value = G(jω) at angular frequency omega [rad/s].
FrequencyTransferFunction
Frequency transfer function ω [rad/s] -> G(jω). Built from a TransferFunction (s = jω / z = e^{jωTs}) or from any closure, so that elements without a rational form (e.g. dead time e^{-jωL}) can also be handled.
Hz
Marker for frequencies in hertz.
Mimo
Marker for a DiscreteSystem with any number of inputs and outputs: update(&[T]) -> Result<Vec<T>>.
NyquistPlotter
Nyquist plot over [freq_from, freq_to) with step dfreq, all given in U (Hz by default).
PartialFraction
X(s) = direct(s) + Σ terms.
PoleTerm
Terms of one (possibly repeated) pole.
Polynomial
Coefficients of a decending polynomial
PzMap
Poles and zeros of a TransferFunction (see TransferFunction::pz_map).
RadPerSec
Marker for angular frequencies in rad/s.
Siso
Marker for a single-input single-output DiscreteSystem: update(T) -> T.
StateSpace
D tells whether this is a continuous-time system (dx/dt = Ax + Bu, Continuous, the default) or a discrete-time one (x[k+1] = Ax[k] + Bu[k], Discrete).
StateSpaceOrder
Dimensions of a StateSpace.
Statistics
Running statistics of a data stream, updated by add. Sums are accumulated relative to offset (a value close to the data) to reduce cancellation in the variance.
TransferFunction
Descending-order numerator / denominator polynomials. D tells whether they are in s (Continuous, the default) or in z (Discrete), so the two cannot be mixed up.
TransferFunctionWithDelay
G(s) = e^(-delay s) tf(s): a rational transfer function with a time shift (dead time for delay > 0, time advance for delay < 0), e.g. a plant with a transport or computation delay, or a model identified with an input delay (srivc::SrivcResult::model).

Enums§

SimulationError
Errors of TransferFunctionWithDelay::simulate.
StateSpaceError
Errors of building or converting a StateSpace.
TransferFunctionParseError
Errors of parsing a transfer function from a string (FromStr, tf!).

Traits§

Domain
Time domain of a TransferFunction / PzMap / StateSpace: Continuous or Discrete.
FrequencyUnit
Unit of a frequency axis: Hz or RadPerSec.

Functions§

binomial_coefficient
n Choose k
binomial_coefficients
Returns [C(n,0), …, C(n,n)]
dka_method
All roots of a descending-order complex polynomial, by the Durand-Kerner-Aberth method (Aberth iteration from initial values on circles given by the Newton polygon). Leading zero coefficients are ignored; returns None for a constant polynomial.
factorial
Return n!
permutation
Return nPr = n! / (n-r)!
vieta_formula
if roots = [r0, r1, r2,…, rn] is given, that is, p(x) = (x - r0)(x - r1)(x - r2)…(x-rn) = x^(n+1) + an * x^n + an-1 * x^(n-1) + … + a0, this function returns the coefficient array of p(x) (highest degree first) [1, an, an-1, …, a0]