[][src]Enum odrive_rs::enumerations::AxisState

#[repr(u8)]
pub enum AxisState {
    Undefined,
    Idle,
    StartupSequence,
    FullCalibrationSequence,
    MotorCalibration,
    SensorlessControl,
    EncoderIndexSearch,
    EncoderOffsetCalibration,
    ClosedLoopControl,
}

State Machine

From the official docs:

The current state of an axis is indicated by <axis>.current_state. The user can request a new state by assigning a new value to <axis>.requested_state. The default state after startup is Idle.

  1. Idle
  2. StartupSequence
  3. FullCalibrationSequence
  4. MotorCalibration
  5. SensorlessControl
  6. EncoderIndexSearch
  7. EncoderOffsetCalibration
  8. ClosedLoopControl

Variants

Undefined

Used for

Idle

Disable motor PWM and do nothing

StartupSequence

Run the startup procedure.

FullCalibrationSequence

Run motor calibration and then encoder offset calibration (or encoder index search if <axis>.encoder.config.use_index is true).

MotorCalibration

Measure phase resistance and phase inductance of the motor.

To store the results set <axis>.motor.config.pre_calibrated to true and save the configuration. After that you don’t have to run the motor calibration on the next start up. This modifies the variables <axis>.motor.config.phase_resistance and <axis>.motor.config.phase_inductance.

SensorlessControl

Run sensorless control.

The motor must be calibrated (<axis>.motor.is_calibrated). <axis>.controller.control_mode must be true.

EncoderIndexSearch

Turn the motor in one direction until the encoder index is traversed.

This state can only be entered if <axis>.encoder.config.use_index is true.

EncoderOffsetCalibration

Turn the motor in one direction for a few seconds and then back to measure the offset between the encoder position and the electrical phase.

Can only be entered if the motor is calibrated (<axis>.motor.is_calibrated). A successful encoder calibration will make the <axis>.encoder.is_ready go to true.

ClosedLoopControl

Run closed loop control.

The action depends on the control mode. Can only be entered if the motor is calibrated (<axis>.motor.is_calibrated) and the encoder is ready (<axis>.encoder.is_ready).

Trait Implementations

impl Clone for AxisState[src]

impl Copy for AxisState[src]

impl Eq for AxisState[src]

impl Ord for AxisState[src]

impl PartialEq<AxisState> for AxisState[src]

impl PartialOrd<AxisState> for AxisState[src]

impl Debug for AxisState[src]

impl StructuralPartialEq for AxisState[src]

impl StructuralEq for AxisState[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]