Skip to main content

Register

Enum Register 

Source
#[non_exhaustive]
#[repr(u16)]
pub enum Register {
Show 120 variants Mode = 0, Position = 1, Velocity = 2, Torque = 3, QCurrent = 4, DCurrent = 5, AbsPosition = 6, Power = 7, MotorTemperature = 10, TrajectoryComplete = 11, HomeState = 12, Voltage = 13, Temperature = 14, Fault = 15, PwmPhaseA = 16, PwmPhaseB = 17, PwmPhaseC = 18, VoltagePhaseA = 20, VoltagePhaseB = 21, VoltagePhaseC = 22, VFocTheta = 24, VFocVoltage = 25, VoltageDqD = 26, VoltageDqQ = 27, CommandQCurrent = 28, CommandDCurrent = 29, VFocThetaRate = 30, CommandPosition = 32, CommandVelocity = 33, CommandFeedforwardTorque = 34, CommandKpScale = 35, CommandKdScale = 36, CommandPositionMaxTorque = 37, CommandStopPosition = 38, CommandTimeout = 39, CommandVelocityLimit = 40, CommandAccelLimit = 41, CommandFixedVoltageOverride = 42, CommandIlimitScale = 43, CommandFixedCurrentOverride = 44, CommandIgnorePositionBounds = 45, PositionKp = 48, PositionKi = 49, PositionKd = 50, PositionFeedforward = 51, PositionCommand = 52, ControlPosition = 56, ControlVelocity = 57, ControlTorque = 58, ControlPositionError = 59, ControlVelocityError = 60, ControlTorqueError = 61, CommandStayWithinLowerBound = 64, CommandStayWithinUpperBound = 65, CommandStayWithinFeedforwardTorque = 66, CommandStayWithinKpScale = 67, CommandStayWithinKdScale = 68, CommandStayWithinPositionMaxTorque = 69, CommandStayWithinTimeout = 70, CommandStayWithinIlimitScale = 71, CommandStayWithinIgnorePositionBounds = 72, Encoder0Position = 80, Encoder0Velocity = 81, Encoder1Position = 82, Encoder1Velocity = 83, Encoder2Position = 84, Encoder2Velocity = 85, EncoderValidity = 88, Aux1GpioCommand = 92, Aux2GpioCommand = 93, Aux1GpioStatus = 94, Aux2GpioStatus = 95, Aux1AnalogIn1 = 96, Aux1AnalogIn2 = 97, Aux1AnalogIn3 = 98, Aux1AnalogIn4 = 99, Aux1AnalogIn5 = 100, Aux2AnalogIn1 = 104, Aux2AnalogIn2 = 105, Aux2AnalogIn3 = 106, Aux2AnalogIn4 = 107, Aux2AnalogIn5 = 108, MillisecondCounter = 112, ClockTrim = 113, Aux1PwmInputPeriod = 114, Aux1PwmInputDutyCycle = 115, Aux2PwmInputPeriod = 116, Aux2PwmInputDutyCycle = 117, Aux1Pwm1 = 118, Aux1Pwm2 = 119, Aux1Pwm3 = 120, Aux1Pwm4 = 121, Aux1Pwm5 = 122, Aux2Pwm1 = 123, Aux2Pwm2 = 124, Aux2Pwm3 = 125, Aux2Pwm4 = 126, Aux2Pwm5 = 127, ModelNumber = 256, FirmwareVersion = 257, RegisterMapVersion = 258, MultiplexId = 272, SerialNumber1 = 288, SerialNumber2 = 289, SerialNumber3 = 290, SetOutputNearest = 304, SetOutputExact = 305, RequireReindex = 306, RecapturePositionVelocity = 307, DriverFault1 = 320, DriverFault2 = 321, Uuid1 = 336, Uuid2 = 337, Uuid3 = 338, Uuid4 = 339, UuidMask1 = 340, UuidMask2 = 341, UuidMask3 = 342, UuidMask4 = 343, UuidMaskCapable = 344,
}
Expand description

Registers exposed for reading or writing from a moteus controller.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Mode = 0

Current mode of operation

§

Position = 1

Output shaft position in revolutions

§

Velocity = 2

Output shaft velocity in revolutions/second

§

Torque = 3

Motor torque in Nm

§

QCurrent = 4

Q-axis current in A

§

DCurrent = 5

D-axis current in A

§

AbsPosition = 6

Absolute encoder position (if configured)

§

Power = 7

Electrical power in W

§

MotorTemperature = 10

Motor temperature in C

§

TrajectoryComplete = 11

1 if trajectory is complete

§

HomeState = 12

Home/rezero state

§

Voltage = 13

Input voltage in V

§

Temperature = 14

Board temperature in C

§

Fault = 15

Fault code (0 = no fault)

§

PwmPhaseA = 16

PWM duty cycle for phase A

§

PwmPhaseB = 17

PWM duty cycle for phase B

§

PwmPhaseC = 18

PWM duty cycle for phase C

§

VoltagePhaseA = 20

Phase A voltage in V

§

VoltagePhaseB = 21

Phase B voltage in V

§

VoltagePhaseC = 22

Phase C voltage in V

§

VFocTheta = 24

Voltage FOC theta angle

§

VFocVoltage = 25

Voltage FOC voltage

§

VoltageDqD = 26

Voltage DQ D component

§

VoltageDqQ = 27

Voltage DQ Q component

§

CommandQCurrent = 28

Command Q current for current mode

§

CommandDCurrent = 29

Command D current for current mode

§

VFocThetaRate = 30

Voltage FOC theta rate

§

CommandPosition = 32

Target position in revolutions

§

CommandVelocity = 33

Target velocity in revolutions/second

§

CommandFeedforwardTorque = 34

Feedforward torque in Nm

§

CommandKpScale = 35

Kp scale (0-1)

§

CommandKdScale = 36

Kd scale (0-1)

§

CommandPositionMaxTorque = 37

Maximum torque in Nm

§

CommandStopPosition = 38

Stop position (for trajectories)

§

CommandTimeout = 39

Watchdog timeout in seconds

§

CommandVelocityLimit = 40

Velocity limit in revolutions/second

§

CommandAccelLimit = 41

Acceleration limit in revolutions/second^2

§

CommandFixedVoltageOverride = 42

Fixed voltage override

§

CommandIlimitScale = 43

Current limit scale

§

CommandFixedCurrentOverride = 44

Fixed current override

§

CommandIgnorePositionBounds = 45

Ignore position bounds flag

§

PositionKp = 48

Position Kp torque

§

PositionKi = 49

Position Ki torque

§

PositionKd = 50

Position Kd torque

§

PositionFeedforward = 51

Position feedforward torque

§

PositionCommand = 52

Position total torque

§

ControlPosition = 56

Control position target

§

ControlVelocity = 57

Control velocity target

§

ControlTorque = 58

Control torque target

§

ControlPositionError = 59

Position error

§

ControlVelocityError = 60

Velocity error

§

ControlTorqueError = 61

Torque error

§

CommandStayWithinLowerBound = 64

Lower position bound

§

CommandStayWithinUpperBound = 65

Upper position bound

§

CommandStayWithinFeedforwardTorque = 66

Stay-within feedforward torque

§

CommandStayWithinKpScale = 67

Stay-within Kp scale

§

CommandStayWithinKdScale = 68

Stay-within Kd scale

§

CommandStayWithinPositionMaxTorque = 69

Stay-within maximum torque

§

CommandStayWithinTimeout = 70

Stay-within timeout

§

CommandStayWithinIlimitScale = 71

Stay-within current limit scale

§

CommandStayWithinIgnorePositionBounds = 72

Stay-within ignore position bounds

§

Encoder0Position = 80

Encoder 0 position

§

Encoder0Velocity = 81

Encoder 0 velocity

§

Encoder1Position = 82

Encoder 1 position

§

Encoder1Velocity = 83

Encoder 1 velocity

§

Encoder2Position = 84

Encoder 2 position

§

Encoder2Velocity = 85

Encoder 2 velocity

§

EncoderValidity = 88

Encoder validity flags

§

Aux1GpioCommand = 92

Aux1 GPIO command

§

Aux2GpioCommand = 93

Aux2 GPIO command

§

Aux1GpioStatus = 94

Aux1 GPIO status

§

Aux2GpioStatus = 95

Aux2 GPIO status

§

Aux1AnalogIn1 = 96

Aux1 analog input 1

§

Aux1AnalogIn2 = 97

Aux1 analog input 2

§

Aux1AnalogIn3 = 98

Aux1 analog input 3

§

Aux1AnalogIn4 = 99

Aux1 analog input 4

§

Aux1AnalogIn5 = 100

Aux1 analog input 5

§

Aux2AnalogIn1 = 104

Aux2 analog input 1

§

Aux2AnalogIn2 = 105

Aux2 analog input 2

§

Aux2AnalogIn3 = 106

Aux2 analog input 3

§

Aux2AnalogIn4 = 107

Aux2 analog input 4

§

Aux2AnalogIn5 = 108

Aux2 analog input 5

§

MillisecondCounter = 112

Millisecond counter

§

ClockTrim = 113

Clock trim value

§

Aux1PwmInputPeriod = 114

Aux1 PWM input period in microseconds

§

Aux1PwmInputDutyCycle = 115

Aux1 PWM input duty cycle (0-1)

§

Aux2PwmInputPeriod = 116

Aux2 PWM input period in microseconds

§

Aux2PwmInputDutyCycle = 117

Aux2 PWM input duty cycle (0-1)

§

Aux1Pwm1 = 118

Aux1 PWM output 1

§

Aux1Pwm2 = 119

Aux1 PWM output 2

§

Aux1Pwm3 = 120

Aux1 PWM output 3

§

Aux1Pwm4 = 121

Aux1 PWM output 4

§

Aux1Pwm5 = 122

Aux1 PWM output 5

§

Aux2Pwm1 = 123

Aux2 PWM output 1

§

Aux2Pwm2 = 124

Aux2 PWM output 2

§

Aux2Pwm3 = 125

Aux2 PWM output 3

§

Aux2Pwm4 = 126

Aux2 PWM output 4

§

Aux2Pwm5 = 127

Aux2 PWM output 5

§

ModelNumber = 256

Model number

§

FirmwareVersion = 257

Firmware version

§

RegisterMapVersion = 258

Register map version

§

MultiplexId = 272

Multiplex CAN ID

§

SerialNumber1 = 288

Serial number part 1

§

SerialNumber2 = 289

Serial number part 2

§

SerialNumber3 = 290

Serial number part 3

§

SetOutputNearest = 304

Set output position to nearest (alias: Rezero)

§

SetOutputExact = 305

Set output position to exact value

§

RequireReindex = 306

Require reindex before motion

§

RecapturePositionVelocity = 307

Recapture position and velocity

§

DriverFault1 = 320

Driver fault register 1

§

DriverFault2 = 321

Driver fault register 2

§

Uuid1 = 336

UUID part 1

§

Uuid2 = 337

UUID part 2

§

Uuid3 = 338

UUID part 3

§

Uuid4 = 339

UUID part 4

§

UuidMask1 = 340

UUID mask part 1

§

UuidMask2 = 341

UUID mask part 2

§

UuidMask3 = 342

UUID mask part 3

§

UuidMask4 = 343

UUID mask part 4

§

UuidMaskCapable = 344

UUID mask capability flag

Implementations§

Source§

impl Register

Source

pub const fn address(self) -> u16

Returns the register address as a u16.

Source

pub fn from_address(addr: u16) -> Option<Register>

Creates a Register from a raw address.

Returns None if the address doesn’t correspond to a known register.

Trait Implementations§

Source§

impl Clone for Register

Source§

fn clone(&self) -> Register

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 Copy for Register

Source§

impl Debug for Register

Source§

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

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

impl Display for Register

Source§

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

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

impl Eq for Register

Source§

impl From<Register> for u16

Source§

fn from(enum_value: Register) -> Self

Converts to this type from the input type.
Source§

impl Hash for Register

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Register

Source§

fn eq(&self, other: &Register) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Register

Source§

impl TryFrom<u16> for Register

Source§

type Error = TryFromPrimitiveError<Register>

The type returned in the event of a conversion error.
Source§

fn try_from(number: u16) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for Register

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<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> 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, 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.