Skip to main content

LoopMargins

Struct LoopMargins 

Source
pub struct LoopMargins {
    pub crossover_hz: f64,
    pub phase_margin_deg: f64,
    pub gain_margin_db: f64,
    pub valid: bool,
    pub peak_sensitivity: f64,
    pub peak_frequency_hz: f64,
    pub hammering: Option<Hammering>,
    pub play_margin_db: f64,
}
Expand description

What an open-loop response says about the stability of the loop.

Fields§

§crossover_hz: f64

The gain crossover (|L| = 1) with the smallest phase margin; NaN without one.

§phase_margin_deg: f64

The angle between L and -1 at that crossover (180 degrees plus the phase of L, the phase unwrapped along the frequency axis and taken between -270 and 90 degrees at the first point, by whole turns to between -180 and 180, either sign), the smallest over the crossovers; NaN without a crossover in the measured band (not measurable, not infinite: nothing is known beyond the band). Negative where L encircles -1 (gain_margin_db negative): the loop is unstable.

§gain_margin_db: f64

By how much the gain may rise before L reaches -1, in dB, at the worst crossing of the negative real axis where the phase falls through -180 degrees and that a later rising crossing beyond -1 does not undo; infinite without one. Negative where |L| > 1 there: the loop encircles -1 and is unstable. A falling crossing beyond -1 that a rising one undoes (the integrators turn the phase past -180 degrees below the crossover and it comes back) is the conditionally stable kind: a gain that falls would be the danger there.

§valid: bool

False when a point of the measurement was not valid (LoopPoint with NaN: the torque limit was hit or the loop moved on its own); the margins are then NaN, and a check fails.

§peak_sensitivity: f64

The highest sensitivity |S| measured, and where. 1 / |S| is the shortest distance of L from -1: |S| <= 2 guarantees a gain margin of at least 6 dB and a phase margin of at least 29 degrees.

§peak_frequency_hz: f64§hammering: Option<Hammering>

The loop hammers across its gearbox’s play (backlash_hammering), which the response does not show; None from loop_margins alone, velocity_loop_margins runs the check.

§play_margin_db: f64

With a gearbox’s play in the loop: by how much the gain may rise before the loop hammers across it, in dB, the describing function’s margin (play_margin). NaN without play acting on the loop and from loop_margins alone; negative: the loop crosses -1 at some amplitude of the swing across the play.

Implementations§

Source§

impl LoopMargins

Source

pub fn stable(&self) -> bool

A valid measurement, both margins positive (a phase margin that is NaN has no crossover to judge), and no hammering across a play: stable. The margin across the play (play_margin_db) is told, not judged: the time run is the verdict.

Trait Implementations§

Source§

impl Clone for LoopMargins

Source§

fn clone(&self) -> LoopMargins

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LoopMargins

Source§

impl Debug for LoopMargins

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for LoopMargins

Source§

fn eq(&self, other: &LoopMargins) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LoopMargins

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.