pub struct Flat<Num = FixedU32<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>> { /* private fields */ }
Expand description

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

Create a new instance of Flat

Trait Implementations

Returns the “default value” for a type. Read more

The type used for representing velocities

The type used for representing delay values

Enter position mode Read more

Return the next step delay Read more

Return an iterator over delay values of each step Read more

Return an iterator over velocity values of each step Read more

Return an iterator over the acceleration values between steps Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Casts the value.

Casts the value.

Returns the argument unchanged.

Calls U::from(self).

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

Performs the conversion.

Performs the conversion.

Casts the value.

Casts the value.

Should always be Self

Casts the value.

Casts the value.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.

Casts the value.

Casts the value.