Skip to main content

SimDrive

Struct SimDrive 

Source
pub struct SimDrive { /* private fields */ }
Expand description

A simulated CiA-402 Profile Position drive.

Commands arrive through the AxisView setters; step advances the state machine and integrates motion; the AxisView getters report the simulated feedback. Raw drive units throughout (encoder counts, counts/s) — the same units a real PDO carries.

Implementations§

Source§

impl SimDrive

Source

pub fn new() -> Self

New sim drive in Switch On Disabled, ready to be enabled.

Source

pub fn set_halt_blocks_setpoint_ack(&mut self, v: bool)

Enable emulation of a drive that won’t acknowledge a set-point while halted (AKD / Inovance). Lets tests exercise the halt cancel handshake against the awkward case. Default off.

Source

pub fn step(&mut self, dt: f64)

Advance the simulation by dt seconds: run the CiA-402 state machine, the PP set-point handshake, and integrate motion. Call once per control cycle before the axis reads feedback.

Trait Implementations§

Source§

impl AxisView for SimDrive

Source§

fn control_word(&self) -> u16

Read the current control word.
Source§

fn set_control_word(&mut self, word: u16)

Write the control word.
Source§

fn set_target_position(&mut self, pos: i32)

Set the target position in encoder counts.
Source§

fn set_profile_velocity(&mut self, vel: u32)

Set the profile velocity in counts/s.
Source§

fn set_profile_acceleration(&mut self, accel: u32)

Set the profile acceleration in counts/s².
Source§

fn set_profile_deceleration(&mut self, decel: u32)

Set the profile deceleration in counts/s².
Source§

fn set_modes_of_operation(&mut self, mode: i8)

Write the modes of operation register (0x6060).
Source§

fn modes_of_operation_display(&self) -> i8

Read the modes of operation display (0x6061).
Source§

fn status_word(&self) -> u16

Read the status word.
Source§

fn position_actual(&self) -> i32

Read the actual position in encoder counts.
Source§

fn velocity_actual(&self) -> i32

Read the actual velocity in counts/s.
Source§

fn error_code(&self) -> u16

Read the drive error code. Returns 0 if not mapped.
Source§

fn positive_limit_active(&self) -> bool

True when the positive-direction hardware limit switch is active. Read more
Source§

fn negative_limit_active(&self) -> bool

True when the negative-direction hardware limit switch is active.
Source§

fn home_sensor_active(&self) -> bool

True when the home reference sensor is active.
Source§

fn dynamic_max_position_limit(&self) -> Option<f64>

Current maximum software position limit in user units, or None if no dynamic limit is configured. When Some, the axis rejects moves whose target exceeds this value, and quick-stops if the actual position passes it while moving in the positive direction. Read more
Source§

fn dynamic_min_position_limit(&self) -> Option<f64>

Current minimum software position limit in user units, or None if no dynamic limit is configured. See dynamic_max_position_limit.
Source§

impl Clone for SimDrive

Source§

fn clone(&self) -> SimDrive

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 SimDrive

Source§

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

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

impl Default for SimDrive

Source§

fn default() -> Self

Returns the “default value” for a type. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V