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.EZMotionControlMode(value)¶
Bases:
UniqueIntEnumEZMotion motor control modes.
- AutoTuning = -4¶
- INLCalibration = -3¶
- RotorAlignment = -2¶
- Position = 1¶
- Velocity = 3¶
- Torque = 4¶
- Homing = 6¶
- CSP = 8¶
- CSV = 9¶
- CST = 10¶
- class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionHomingMethod(value)¶
Bases:
UniqueIntEnumEZMotion homing methods.
- TorqueUp = -3¶
- TorqueDown = -2¶
- Reserved = -1¶
- NoHoming = 0¶
- IndexPulseEarlier = 33¶
- IndexPulseLater = 34¶
- class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionError(value)¶
Bases:
UniqueIntEnumEZMotion error codes.
- OCP = 0¶
- ULVO = 1¶
- LOCK = 2¶
- VIN_LIMIT = 3¶
- OVERLOAD = 4¶
- POS_LIMIT = 5¶
- SENSOR_ERR = 6¶
- OVER_VOLTAGE = 9¶
- class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionParam(*, mode, dtype, telem_capacity=10, name='', itemsize=0, idx, range=None, default)¶
Bases:
TelemetryParameter[~TEZMotionParamVal],Generic[TEZMotionParamVal]- Parameters:
- idx: <lambda>, json_schema_input_type=PydanticUndefined)]¶
The canopen register index and subindex. Can be Tuple[idx, subidx] or int for 0 subindex.
- default: TEZMotionParamVal¶
The default value for the parameter.
- is_within_range(value)¶
Checks if value is within the acceptible range for the parameter
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'frozen': False}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionParamSet¶
Bases:
TelemetryParameterSet[EZMotionParam,TEZMotionParamVal]EZMotion motor parameters
There are 65536 encoder counts per revolution of the motor, see
ENCODER_COUNTS_PER_REVOLUTION.- control_word: EZMotionParam[int] = EZMotionParam.control_word¶
Used to send setup/control commands to the motor via bit flags.
Bits | Name | Description ------|----------------|------------ 15:11 | Op-specific | Depends on the operation mode. See below. 10 | Reserved | Unused 9 | Op-specific | Depends on the operation mode. See below. 8 | Halt | Enable halt 7 | Fault Reset | Change from 0 to 1 to reset internal fault registers 6:4 | Op-specific | Depends on the operation mode. See below. 3 | Enable Op | Enable operation mode 2 | Quick Stop | Enable quick stop mode 1 | Enable Voltage | Enable voltage to the motor (don't listen to the docs, this does have an effect) 0 | Switch On | Enable the power stage switch
Operation-specific bits:
Position (PP) Mode: * 15-9, 5: Unused * 6: 0 = absolute position mode, 1 = relative position mode * 4: Set new target position. On rising edge, new target position/profile parameters are applied.
Homing Mode: * 15-9, 6-5: Unused * 4: 0 = no homing, 1 = homing enabled
- status_word: EZMotionParam[int] = EZMotionParam.status_word¶
Shows current state of the motor.
Bits | Name | Description ------|-----------------------|------------ 15:12 | Op-specific | Depends on the operation mode. See below. 11 | Internal Limit Active | 1 if in position mode and the position limit is reached 10 | Op-specific | Depends on the operation mode. See below. 9 | Remote | If set, parameters may be modified by communication. (Not sure what that means...) 8 | Op-specific | Depends on the operation mode. See below. 7 | Warning | If set, a warning condition is present 6 | Switch On Disabled | If set, the driver is in the switch on disabled state 5 | Quick Stop | 1 = quick stop is able to perform, 0 = quick stop is active (or unable to perform) 4 | Voltage Enabled | Always set to 1 3 | Fault | If a fault ocurrs, this bit is set 2 | Operation Enabled | Indicates whether the current operation mode is active/enabled 1 | Switch On | If set, the driver is in the switch on state 0 | Ready to Switch On | If set, the driver is ready to switch on
Operation-specific bits:
Position (PP) Mode: * 15-14, 8: Unused * 13: 1 = a new set point is allowed, 0 = previous set point is still in progress * 12: following error - 1 if position following error is too large * 10: target reached - 1 if the target position has been reached
Homing Mode: * 15-14, 8: Unused * 13: homing error - 1 if homing error is present, 0 if no error * 12: homing complete - 1 if homing is complete, 0 if not complete (not started or in progress) * 10: target reached - 1 if the set point is reached
- operation_mode: EZMotionParam[EZMotionControlMode] = EZMotionParam.operation_mode¶
The current operation mode of the motor.
- position: EZMotionParam[int] = EZMotionParam.position¶
The current position of the motor in encoder counts.
- target_position: EZMotionParam[int] = EZMotionParam.target_position¶
The target position of the motor in encoder counts.
- min_position_limit: EZMotionParam[int] = EZMotionParam.min_position_limit¶
The minimum position limit of the motor in encoder counts.
- max_position_limit: EZMotionParam[int] = EZMotionParam.max_position_limit¶
The maximum position limit of the motor in encoder counts.
- profile_velocity: EZMotionParam[int] = EZMotionParam.profile_velocity¶
The target velocity of the motor in encoder counts per second.
- profile_acceleration: EZMotionParam[int] = EZMotionParam.profile_acceleration¶
The target acceleration of the motor in encoder counts per second squared.
- profile_deceleration: EZMotionParam[int] = EZMotionParam.profile_deceleration¶
The target deceleration of the motor in encoder counts per second squared.
- homing_torque: EZMotionParam[int] = EZMotionParam.homing_torque¶
The torque to trigger homing detection in per-mil of rated torque.
- homing_offset: EZMotionParam[int] = EZMotionParam.homing_offset¶
After finding homing position, move this many encoder counts away from homing position to set zero position.
- homing_method: EZMotionParam[EZMotionHomingMethod] = EZMotionParam.homing_method¶
The method to use for homing.
- homing_speed_other: EZMotionParam[int] = EZMotionParam.homing_speed_other¶
Other spede thing
- homing_speed_zero: EZMotionParam[int] = EZMotionParam.homing_speed_zero¶
torque homing, not switch homing).
- Type:
The speed to use for homing when detecting the zero position (IE
- homing_acceleration: EZMotionParam[int] = EZMotionParam.homing_acceleration¶
The acceleration to use for homing.
- error_status: EZMotionParam[int] = EZMotionParam.error_status¶
Current error status of the motor.
- velocity: EZMotionParam[int] = EZMotionParam.velocity¶
The current velocity of the motor in encoder counts per second.
- torque: EZMotionParam[int] = EZMotionParam.torque¶
The current torque of the motor in per-mil of rated torque.
- current: EZMotionParam[int] = EZMotionParam.current¶
The current of the motor in per-mil of rated current.
- temperature: EZMotionParam[int] = EZMotionParam.temperature¶
The temperature of the motor in degrees Celsius.
- feathersdk.robot.actuators.ezmotion.ezmotion.build_control_word(enable_op=False, quick_stop=True, fault_reset=False, switch_on=False, disable_power=False, new_position=False)¶
Create a control work value from a set of parameters.
- feathersdk.robot.actuators.ezmotion.ezmotion.EZPS = <feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionParamSet object>¶
EZMotion parameter set.
- class feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionMotorConfig(*, name, id, endpoint='', shares_endpoint_with=None, requires_calibration, calibration_timeout=10.0, 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_retry_delay=0.03, message_send_attempts=10)¶
Bases:
MotorConfigThe config for the EZMotion motor.
- Parameters:
name (Annotated[str, MinLen(min_length=1), MaxLen(max_length=255)])
id (int)
endpoint (str)
requires_calibration (bool)
calibration_timeout (Annotated[float, Gt(gt=0), Le(le=120.0)])
target_acceleration (Annotated[int, Ge(ge=1), Le(le=6553600)])
target_deceleration (Annotated[int, Ge(ge=1), Le(le=6553600)])
homing_acceleration (Annotated[int, Ge(ge=1), Le(le=6553600)])
message_retry_delay (Annotated[float, Gt(gt=0.0), Le(le=1.0)])
- 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_offset: int¶
After finding homing position, move this many encoder counts away from homing position to set zero position.
- 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:
PyDFrozenBaseModelThe calibration state of an EZMotion motor.
- 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.EZMotionMotor(config, *args, **kwargs)¶
Bases:
Motor[EZMotionMotorConfig,EZMotionParamSet,EZMotionParam,TEZMotionParamVal]Ezmotion motor.
- Parameters:
config (EZMotionMotorConfig)
system (ActuatorSystem | None)
- calibration_state = EZMotionCalibrationState(calibrated=False, calibration_time=2678321.301822307)¶
The calibration state of the motor.
- PARAM_SET: EZMotionParamSet = <feathersdk.robot.actuators.ezmotion.ezmotion.EZMotionParamSet object>¶
The parameter set for EZMotion motors.
- 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 (EZMotionParam)
value (TEZMotionParamVal)
- Return type:
None
- read_param(param)¶
Read a parameter value from the motor.
- Parameters:
param (EZMotionParam)
- Return type:
TEZMotionParamVal
- 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.
- 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
- get_errors()¶
Get the errors from the motor.
- Return type: