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
Serializevalues. - 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:
sgivesContinuous,zgivesDiscrete.
Structs§
- Bode
Diagram Plotter - Bode diagram over
[freq_from, freq_to)with stepdfreq, all given inU(Hzby 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]). - Discrete
System - 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
StateSpaceandTransferFunctionstay plain representations. It starts at rest. - Frequency
Characteristics - Gain and phase [rad] at
frequency, whose unit isU(HzorRadPerSec). - Frequency
Response - Complex frequency response
value = G(jω)at angular frequencyomega[rad/s]. - Frequency
Transfer Function - Frequency transfer function
ω [rad/s] -> G(jω). Built from aTransferFunction(s = jω/z = e^{jωTs}) or from any closure, so that elements without a rational form (e.g. dead timee^{-jωL}) can also be handled. - Hz
- Marker for frequencies in hertz.
- Mimo
- Marker for a
DiscreteSystemwith any number of inputs and outputs:update(&[T]) -> Result<Vec<T>>. - Nyquist
Plotter - Nyquist plot over
[freq_from, freq_to)with stepdfreq, all given inU(Hzby default). - Partial
Fraction X(s) = direct(s) + Σ terms.- Pole
Term - Terms of one (possibly repeated) pole.
- Polynomial
- Coefficients of a decending polynomial
- PzMap
- Poles and zeros of a
TransferFunction(seeTransferFunction::pz_map). - RadPer
Sec - Marker for angular frequencies in rad/s.
- Siso
- Marker for a single-input single-output
DiscreteSystem:update(T) -> T. - State
Space Dtells 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).- State
Space Order - Dimensions of a
StateSpace. - Statistics
- Running statistics of a data stream, updated by
add. Sums are accumulated relative tooffset(a value close to the data) to reduce cancellation in the variance. - Transfer
Function - Descending-order numerator / denominator polynomials.
Dtells whether they are ins(Continuous, the default) or inz(Discrete), so the two cannot be mixed up. - Transfer
Function With Delay G(s) = e^(-delay s) tf(s): a rational transfer function with a time shift (dead time fordelay > 0, time advance fordelay < 0), e.g. a plant with a transport or computation delay, or a model identified with an input delay (srivc::SrivcResult::model).
Enums§
- Simulation
Error - Errors of
TransferFunctionWithDelay::simulate. - State
Space Error - Errors of building or converting a
StateSpace. - Transfer
Function Parse Error - Errors of parsing a transfer function from a string (
FromStr,tf!).
Traits§
- Domain
- Time domain of a
TransferFunction/PzMap/StateSpace:ContinuousorDiscrete. - Frequency
Unit - Unit of a frequency axis:
HzorRadPerSec.
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
Nonefor 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]