Skip to main content

PlanLimits

Struct PlanLimits 

Source
pub struct PlanLimits {
    pub reserve: f64,
    pub tension: [f64; 3],
    pub gearbox: Vec<Option<[f64; 4]>>,
    pub guide: f64,
    pub friction: Vec<[f64; 5]>,
    pub ratings: Vec<[f64; 3]>,
    pub margin: f64,
    pub hermite: bool,
    pub speed_kept: f64,
    pub loops: Vec<LoopKeep>,
}
Expand description

What a time-optimal plan keeps within beside each motor’s torque-speed curve, its rated speed and the axes’ jerk limits (see plan_time_optimal).

Fields§

§reserve: f64

The share of each torque limit the plan may use (profile.torque_reserve): of the motor’s torque-speed curve, of the torque of the drive’s maximum current, and of the gearbox’s and the pulley’s torque rating.

§tension: [f64; 3]

The lowest and the highest tension a belt section may have and the share of the room to them the plan may use.

§gearbox: Vec<Option<[f64; 4]>>

Per motor (in the order of Machine::motors) its gearbox: the ratio, the inertia that turns at its input (rotor and gearbox, kg m^2), the most torque at its output (N m), ratings.gearbox_max_torque_nm (M2max) or pulley_max_torque_nm where that is lower (infinite where the config rates neither), and its efficiency (gearbox.efficiency with effects.gearbox_efficiency, else 1). None (or no entry) where the machine reports no gearbox output torque, or the gearbox is neither rated nor lossy.

§guide: f64

The most load a guide may carry, ratings.guide_max_load_n (N); infinite without. The plan keeps reserve of it.

§friction: Vec<[f64; 5]>

Per motor (in the order of Machine::motors) the friction on its shaft as the motor and its gearbox have it: [Coulomb level, viscous, smoothing speed, gearbox drag at its reference speed, that speed] in N m and rad/s (mech::ShaftFriction, mech::GearDrag), all 0 with effects.motor_friction and gearbox_drag off. No entry: none.

§ratings: Vec<[f64; 3]>

Per motor (in the order of Machine::motors) the drive’s and the gearbox’s ratings that bound the plan beside the motor: [the drive’s maximum current ratings.drive_max_current_a (A, whether or not effects.drive_current_limit holds the drive to it), the gearbox’s maximum input speed ratings.gearbox_max_input_speed_rpm (rad/s), the most power the braking resistor takes ratings.braking_resistor_peak_w (W, shared out evenly over the motors of a line-up that brakes through one module)], each infinite without. No entry: none.

§margin: f64

profile.time_optimal_margin: the share of every limit the plan may use, on top of the reserves (1: all).

§hermite: bool

The controller interpolates the plan’s points with the Hermite cubic (profile.trajectory_spline = "hermite"); false: with the C2 spline, as shipped. It sets what piece_limits keeps back for the cubics’ overshoot.

§speed_kept: f64

The share of every speed rating the plan keeps back for the velocity loops’ following (speed_kept_of, the largest over the motors); at least SPEED_KEPT.

§loops: Vec<LoopKeep>

Per motor (in the order of Machine::motors) what the keep-back at a place takes from the motor’s loop and drive (LoopKeep, PlanLimits::kept_at): with it the share kept back is that of the place’s own pose (its drive trains, rigid inertias and jerks) and speed_kept is the least of them. No entry: speed_kept everywhere.

Implementations§

Source§

impl PlanLimits

Source

pub fn new(reserve: f64, tension: [f64; 3]) -> Self

The torque share and the belt only, with no gearbox or guide rating and no friction.

Source

pub fn kept_at(&self, machine: &dyn Machine, pose: &[f64]) -> f64

The share of every speed rating kept back at the tool pose pose, speed_kept_of of each motor with the train, the rigid inertia and the jerk it has there (the most over the motors, at least SPEED_KEPT); speed_kept where no loops are given.

Source

pub fn shaft_friction(&self, m: usize, speed: f64) -> f64

The steady friction on motor m’s shaft at the speed speed (rad/s, at least 0): c tanh(w / smoothing) + b w + T0 (w / n0)^(2/3), as mech::ShaftFriction::torque has it at the reference temperature, without the breakaway’s Stribeck rise near a standstill.

Trait Implementations§

Source§

impl Clone for PlanLimits

Source§

fn clone(&self) -> PlanLimits

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 PlanLimits

Source§

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

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

impl<'de> Deserialize<'de> for PlanLimits

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PlanLimits

Source§

fn eq(&self, other: &PlanLimits) -> 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 Serialize for PlanLimits

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PlanLimits

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.