Skip to main content

ShaftFriction

Struct ShaftFriction 

Source
pub struct ShaftFriction {
    pub coulomb: f64,
    pub viscous: f64,
    pub smoothing: f64,
    pub stiction: f64,
    pub stribeck: f64,
    pub drag: GearDrag,
    pub oil: f64,
    pub seal_exponent: f64,
    pub presliding: f64,
    pub anchor: [f64; 2],
}
Expand description

Motor and bearing friction on the shaft, with what the gearbox’s input adds to it: a Coulomb level that breaks away from a higher stiction level along a Stribeck curve (effects.motor_stiction), viscous friction, and the gearbox’s no-load running torque (GearDrag). The Coulomb step is smoothed with tanh so a shaft at rest sees no chattering torque.

The Coulomb and stiction levels are those of the seals and bearings: on a geared motor the shaft’s seal is the gearbox’s input seal and runs in its lubricant, so with effects.thermal_feedback both follow the gearbox’s lubricant (oil, nu / nu_ref) to the power seal_exponent, as the drag follows it by its own law.

Fields§

§coulomb: f64§viscous: f64§smoothing: f64§stiction: f64

The breakaway level at rest; one below coulomb counts as coulomb (so with effects.motor_stiction off).

§stribeck: f64

The speed over which the level falls from stiction to Coulomb, rad/s.

§drag: GearDrag§oil: f64

nu / nu_ref of the gearbox’s lubricant (1 at the reference temperature; ThermalFeedback sets it).

§seal_exponent: f64

The exponent of the seals’ levels on oil (0 without effects.thermal_feedback).

§presliding: f64

With a stiffness above 0 (a slide’s effects.slide_presliding), the level is a presliding state of its own in place of the tanh: Dahl’s law, the force over the travel since the last step’s end (presliding_force). 0: none.

§anchor: [f64; 2]

Where the last step ended, travel and friction force (commit); NaN before the first: then no force.

Implementations§

Source§

impl ShaftFriction

Source

pub const NONE: Self

No friction: a bearing friction of a joint or slide (coulomb, viscous, smoothing) has none of the rest.

Source

pub fn from_config(cfg: &Config) -> Result<Self, ConfigError>

Source

pub fn set_oil(&mut self, oil: f64)

With effects.thermal_feedback: the gearbox’s lubricant at nu / nu_ref = oil (ThermalFeedback::viscosity_factor of the gearbox’s rise).

Source

pub fn level(&self, speed: f64) -> f64

The sliding level at speed: Fc + (Fs - Fc) exp(-(w / ws)^2), times the seals’ temperature factor.

Source

pub fn torque(&self, speed: f64) -> f64

Torque opposing a positive speed. The gearbox’s drag acts on the rotor with the seals’ friction (every machine has this one call on its rotor), but its loss is the gearbox’s: the machines book drag_power in the gearbox’s loss, which warms the gearbox.

Source

pub fn drag_power(&self, speed: f64) -> f64

The power the gearbox’s drag (effects.gearbox_drag) takes at a rotor speed, W: the gearbox’s loss, not the motor’s.

Source

pub fn presliding_force(&self, x: f64, speed: f64) -> f64

With presliding: the friction force at travel x and speed speed, Dahl’s law solved from the anchor [x0, z0] along a travel that ran one way, z = s g - (s g - z0) exp(-sigma |x - x0| / g), g the level at the speed (level: Coulomb, or stiction falling to it along the Stribeck curve), s the sign of x - x0 (of the speed at the anchor itself). It holds any force within ±g at rest without creeping (the travel, not the time, moves it), turns over a presliding travel of about g / sigma at a reversal, and slides at ±g. 0 before the first step and without a level.

Source

pub fn torque_at(&self, x: f64, speed: f64) -> f64

The torque (force) opposing a positive speed at travel x: torque, with presliding the Dahl force in place of the smoothed level.

Source

pub fn commit(&mut self, x: f64, speed: f64)

Ends a step: with presliding, the anchor moves to where the step ended (Machine::after_step).

Trait Implementations§

Source§

impl Clone for ShaftFriction

Source§

fn clone(&self) -> ShaftFriction

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 Debug for ShaftFriction

Source§

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

Formats the value using the given formatter. Read more

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.