feathersdk.robot.actuators.robstride.calibrate Module

exception feathersdk.robot.actuators.robstride.calibrate.RobstrideCalibrationError

Bases: Exception

Raised when a calibration error occurs.

class feathersdk.robot.actuators.robstride.calibrate.RobstrideCalibrationState(*, calibrated=True, calibrated_angle_range=NumericRange(min=-6.283185307179586, max=6.283185307179586), homing_offset=0, calibration_time=<factory>)

Bases: PyDFrozenBaseModel

The calibration state of a robstride motor.

Parameters:
  • calibrated (bool)

  • calibrated_angle_range (NumericRange)

  • homing_offset (float)

  • calibration_time (float)

calibrated: bool

Whether the motor is calibrated.

calibrated_angle_range: NumericRange

The true calibrated angle range of the motor. Accounts for slight variations in hard stop distances.

homing_offset: float

if the motor is physically at homing_offset radians, then we consider it to be at 0 radians.

Type:

The offset to add to our position commands when sending to the motor. IE

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.robstride.calibrate.RobstrideCalibrationConfig(*, speed, torque_threshold, num_tries=2, torque_limit_timeout=30.0, step_time=0.02, fast_find_speed_mult=1.0, abs_range_tolerance=0.03490658503988659, homing_tolerance_rads=0.01, operating_frequency=100.0, manual_offset=0, freeze_on_failed_calibration=False, allow_load_calibration=False)

Bases: PyDFrozenBaseModel

Config for finding the limits of a actuator.

Parameters:
  • speed (float)

  • torque_threshold (float)

  • num_tries (int)

  • torque_limit_timeout (float)

  • step_time (float)

  • fast_find_speed_mult (float)

  • abs_range_tolerance (float)

  • homing_tolerance_rads (float)

  • operating_frequency (float)

  • manual_offset (float)

  • freeze_on_failed_calibration (bool)

  • allow_load_calibration (bool)

speed: float

The speed in radians per second to move the actuators while exploring the limits.

torque_threshold: float

We assume the limit is reached when the torque is greater than this value.

num_tries: int

Number of times to attempt calibration if the range is not valid.

torque_limit_timeout: float

The timeout in seconds to wait for the motor to reach the torque limit.

step_time: float

Every this much time in seconds, we read the torque and angle and check if the limit is reached.

fast_find_speed_mult: float

After finding the first limit, we can move faster for most of the expected distance until other limit to speed up calibration. We start at speed * fast_find_speed_mult then decrease to speed by 80% of expected distance

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

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

abs_range_tolerance: float

Max absolute difference between the expected range and the found range to be considered valid.

homing_tolerance_rads: float

Tolerance for the motor to be considered homed. Radians above and below to allow

operating_frequency: float

How often to check motor state while calibrating in Hz.

manual_offset: float

A manual offset to add to the homing position in radians. This can be used if the hard stops asymmetric enough that we need to manually shift the offset to be in the desired position.

freeze_on_failed_calibration: bool

Whether to freeze the motor in the current position if the calibration fails. Otherwise disable.

allow_load_calibration: bool

Whether to allow loading calibration state from file.

validate_max_target_distance_and_fast_speed_mult()
Return type:

Self

feathersdk.robot.actuators.robstride.calibrate.calibrate_robstride_motor(motor, home=True)

Calibrate a robstride motor.

Parameters:
Return type:

None