Struct ramp_maker::flat::Flat [−][src]
Flat motion profile
This is the simplest possible motion profile, as it produces just a constant velocity. Please note that this is of limited use, and should probably be restricted to testing.
Theoretically, this profile produces infinite acceleration/deceleration at the beginning and end of the movement. In practice, you might get away with this, if the velocity and the load on the motor are low enough. Otherwise, this will definitely produce missed steps.
Create an instance of this struct using Flat::new
, then use the API
defined by MotionProfile
(which this struct implements) to generate the
acceleration ramp.
Unit of Time
This code is agnostic on which unit of time is used. If you provide the target velocity in steps per second, the unit of the delay returned will be seconds.
This allows you to pass the target velocity in steps per number of timer counts for the timer you’re using, completely eliminating any conversion overhead for the delay.
Type Parameter
The type parameter Num
defines the type that is used to represent the
target velocity and the delay per step. It is set to a 32-bit fixed-point
number type by default.
This default is appropriate for 32-bit microcontrollers, but it might not
be ideal for 8- or 16-bit microcontrollers, or target platforms where
hardware support for floating point numbers is available. You can override
it with other types from the fixed
crate, or f32
/f64
, for example.
Implementations
impl<Num> Flat<Num>
[src]
Trait Implementations
impl Default for Flat<f32>
[src]
impl<Num> MotionProfile for Flat<Num> where
Num: Copy + Zero + Inv<Output = Num>,
[src]
Num: Copy + Zero + Inv<Output = Num>,
type Velocity = Num
The type used for representing velocities
type Delay = Num
The type used for representing delay values
fn enter_position_mode(&mut self, max_velocity: Self::Velocity, num_steps: u32)
[src]
fn next_delay(&mut self) -> Option<Self::Delay>
[src]
fn delays(&mut self) -> Delays<'_, Self>ⓘ
[src]
fn velocities(&mut self) -> Velocities<'_, Self>ⓘNotable traits for Velocities<'r, Profile>
impl<'r, Profile> Iterator for Velocities<'r, Profile> where
Profile: MotionProfile,
Profile::Delay: Inv<Output = Profile::Velocity>, type Item = Profile::Velocity;
[src]
Notable traits for Velocities<'r, Profile>
impl<'r, Profile> Iterator for Velocities<'r, Profile> where
Profile: MotionProfile,
Profile::Delay: Inv<Output = Profile::Velocity>, type Item = Profile::Velocity;
fn accelerations<Accel>(&mut self) -> Accelerations<'_, Self, Accel>ⓘNotable traits for Accelerations<'r, Profile, Accel>
impl<'r, Profile, Accel> Iterator for Accelerations<'r, Profile, Accel> where
Profile: MotionProfile,
Profile::Delay: Copy + One + Inv<Output = Profile::Velocity> + Add<Output = Profile::Delay> + Div<Output = Profile::Delay>,
Profile::Velocity: Sub<Output = Profile::Velocity> + Div<Profile::Delay, Output = Accel>, type Item = Accel;
[src]
Notable traits for Accelerations<'r, Profile, Accel>
impl<'r, Profile, Accel> Iterator for Accelerations<'r, Profile, Accel> where
Profile: MotionProfile,
Profile::Delay: Copy + One + Inv<Output = Profile::Velocity> + Add<Output = Profile::Delay> + Div<Output = Profile::Delay>,
Profile::Velocity: Sub<Output = Profile::Velocity> + Div<Profile::Delay, Output = Accel>, type Item = Accel;
Auto Trait Implementations
impl<Num> Send for Flat<Num> where
Num: Send,
Num: Send,
impl<Num> Sync for Flat<Num> where
Num: Sync,
Num: Sync,
impl<Num> Unpin for Flat<Num> where
Num: Unpin,
Num: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Az for T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedAs for T
[src]
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]
T: CheckedCast<Dst>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
Dst: LosslessTryFrom<Src>,
pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,
pub fn lossy_into(self) -> Dst
[src]
impl<T> OverflowingAs for T
[src]
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]
T: OverflowingCast<Dst>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> SaturatingAs for T
[src]
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]
T: SaturatingCast<Dst>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnwrappedAs for T
[src]
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]
T: UnwrappedCast<Dst>,
impl<T> WrappingAs for T
[src]
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]
T: WrappingCast<Dst>,