pub struct MotorConfig {
pub name: String<32>,
pub steps_per_revolution: u16,
pub microsteps: Microsteps,
pub gear_ratio: f32,
pub max_velocity: DegreesPerSec,
pub max_acceleration: DegreesPerSecSquared,
pub invert_direction: bool,
pub limits: Option<SoftLimits>,
pub backlash_compensation: Option<Degrees>,
}Expand description
Complete motor configuration from TOML.
Fields§
§name: String<32>Human-readable name (max 32 chars).
steps_per_revolution: u16Base steps per revolution (typically 200 for 1.8° motors).
microsteps: MicrostepsMicrostep setting (1, 2, 4, 8, 16, 32, etc.).
gear_ratio: f32Gear ratio (output:input, e.g., 5.0 means 5:1 reduction).
max_velocity: DegreesPerSecMaximum angular velocity in degrees per second.
max_acceleration: DegreesPerSecSquaredMaximum angular acceleration in degrees per second squared.
invert_direction: boolInvert direction pin logic.
limits: Option<SoftLimits>Optional soft limits.
backlash_compensation: Option<Degrees>Optional backlash compensation in degrees.
Implementations§
Source§impl MotorConfig
impl MotorConfig
Sourcepub fn total_steps_per_revolution(&self) -> u32
pub fn total_steps_per_revolution(&self) -> u32
Calculate total steps per output shaft revolution.
Sourcepub fn steps_per_degree(&self) -> f32
pub fn steps_per_degree(&self) -> f32
Calculate steps per degree of output rotation.
Trait Implementations§
Source§impl Clone for MotorConfig
impl Clone for MotorConfig
Source§fn clone(&self) -> MotorConfig
fn clone(&self) -> MotorConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MotorConfig
impl Debug for MotorConfig
Source§impl<'de> Deserialize<'de> for MotorConfig
impl<'de> Deserialize<'de> for MotorConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MotorConfig
impl RefUnwindSafe for MotorConfig
impl Send for MotorConfig
impl Sync for MotorConfig
impl Unpin for MotorConfig
impl UnwindSafe for MotorConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more