feathersdk.robot.actuators.ezmotion.ezmotion Module

feathersdk.robot.actuators.ezmotion.ezmotion.EC_PER_ROT = 65536

The number of encoder counts per rotation of the motor.

class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionError(value)

Bases: UniqueIntEnum

EZMotion error codes.

OCP = 0
ULVO = 1
LOCK = 2
VIN_LIMIT = 3
OVERLOAD = 4
POS_LIMIT = 5
SENSOR_ERR = 6
OVER_VOLTAGE = 9
static get_errors(error_status)

Get the errors from the error status word.

Parameters:

error_status (int)

Return type:

List[EZMotionError]

class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionMotorConfig(*, name, id, endpoint='', shares_endpoint_with=None, requires_calibration, calibration_timeout=60.0, feedback_delay_threshold=0.1, feedback_delay_warning_interval=10.0, urdf_joint_name='', urdf_link_name='', telemetry_size=16384, teensy_telemetry_max_size=300, target_velocity=131072, target_acceleration=3276800, target_deceleration=3276800, homing_torque=750, homing_offset=131072, homing_speed=327680, homing_acceleration=3276800, homing_timeout=60, message_block_timeout=0.3, message_send_attempts=2)

Bases: MotorConfig

The config for the EZMotion motor.

Parameters:
calibration_timeout: float

The timeout for the calibration process in seconds.

telemetry_size: int

The size of the telemetry buffer for the motor.

teensy_telemetry_max_size: int

Cap sent to the Teensy for each parameter ring. Actual size might be smaller.

target_velocity: int

The target velocity for the motor in encoder counts per second.

target_acceleration: int

The target acceleration for the motor in encoder counts per second squared.

target_deceleration: int

The target deceleration for the motor in encoder counts per second squared.

homing_torque: int

The torque to trigger homing detection in per-mil of rated torque.

homing_offset: int

After finding homing position, move this many encoder counts away from homing position to set zero position.

homing_speed: int

The speed to use for homing in encoder counts per second.

homing_acceleration: int

The acceleration to use for homing in encoder counts per second squared.

homing_timeout: float

The timeout in seconds to wait for the motor to reach the homing position.

message_block_timeout: float

The timeout in seconds to wait for a Teensy ACK or a telemetry update when blocking.

message_send_attempts: int

The number of attempts to send a message to the motor when awaiting a response.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionCalibrationState(*, calibrated=True, calibration_time=<factory>)

Bases: PyDFrozenBaseModel

The calibration state of an EZMotion motor.

Parameters:
calibrated: bool

Whether the motor is calibrated.

calibration_time: float

The system time when the calibration was performed.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionMotorTelemetry(actuator)

Bases: ActuatorTelemetry[EZMotionParamCode]

Telemetry for an EZMotion motor.

Parameters:

actuator (EZMotionMotor)

PARAMS

The telemetry and write_param()/read_param() parameter codes for an EZMotion motor.

alias of EZMotionParamCode

class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionMotor(config, *args, **kwargs)

Bases: Motor[EZMotionMotorConfig, EZMotionMotorTelemetry, EZMotionParamCode]

Ezmotion motor.

Parameters:
calibration_state = EZMotionCalibrationState(calibrated=False, calibration_time=6781.012178447)

The calibration state of the motor.

go_to(position, velocity=None, acceleration=None)

Go to the given position in encoder counts.

Parameters:
  • position (int) – The position to go to in encoder counts.

  • velocity (int | None) – The velocity to go to in encoder counts per second. If None, the velocity will be set to the target velocity of the motor.

  • acceleration (int | None) – The acceleration to go to in encoder counts per second squared. If None, the acceleration will be set to the target acceleration of the motor.

Return type:

None

write_param(param, value)

Write a parameter value to the motor.

Parameters:
  • param (EZMotionParamCode)

  • value (int)

Return type:

None

read_param(param, block=True)

Send a request to read a parameter value from the motor.

Parameters:
  • param (EZMotionParamCode) – The parameter to read.

  • block (bool) – Whether to block until we get a response from the motor.

Return type:

int | None

enable()

Enable the motor.

Return type:

None

disable()

Disable the motor.

Return type:

None

reset_faults()

Reset the faults for the motor and disable it.

Return type:

None

set_operation_mode(operation_mode)

Set the operation mode for the motor.

Parameters:

operation_mode (EZMotionControlMode)

Return type:

None

set_target_position(target_position, transition_now=True)

Set the target position for this motor in encoder counts.

Parameters:
  • target_position (int) – The target position to set in encoder counts.

  • transition_now (bool) – Whether to tell the motor to begin transitioning to the new position immediately.

Return type:

None

set_target_velocity(target_velocity)

Set the target velocity for this motor in encoder counts per second.

Parameters:

target_velocity (int)

Return type:

None

set_target_acceleration(target_acceleration)

Set the target acceleration for this motor in encoder counts per second squared.

Parameters:

target_acceleration (int)

Return type:

None

set_target_deceleration(target_deceleration)

Set the target deceleration for this motor in encoder counts per second squared.

Parameters:

target_deceleration (int)

Return type:

None

read_state()

Read all of the important state parameters from the motor.

Return type:

None

has_error()

Check if the motor has any errors.

Return type:

bool

get_errors()

Get the errors from the motor.

Return type:

List[EZMotionError]