rebot_control.calib.friction

Joint friction identification from constant-velocity sweeps.

One joint at a time moves back and forth over [center - amplitude, center + amplitude] at a list of speeds while the other joints hold. In the constant-velocity part of each sweep (ddq = 0):

tau_meas - rnea(q, dq, 0) = fc * tanh(v / vs) + fv * v + residual(q_j)

The rigid-body term uses the current model (gravity + Coriolis); its error along the sweep (only q_j varies) is absorbed by a sin q_j + b cos q_j + c so that a not-yet-perfect gravity model does not bias the friction. Forward and backward passes over the same angles make Coulomb friction and the gravity error separable.

Module Contents

Classes

Functions

sweep_trajectory

Joint angle samples of one sweep q0-A -> q0+A -> q0-A with trapezoidal velocity; returns (q, v_nominal).

collect_sweeps

Run the sweeps of one joint (rad, rad/s) and return the recorded servo samples plus the nominal velocity.

fit_joint_friction

Fit Coulomb (per direction) + viscous friction of one joint from collect_sweeps() data.

to_friction_params

Data

API

rebot_control.calib.friction.DEFAULT_SPEEDS_DEG = (5.0, 10.0, 20.0, 40.0, 60.0)
rebot_control.calib.friction.DEFAULT_AMPLITUDE_DEG = 'array(...)'
rebot_control.calib.friction.sweep_trajectory(q0: float, amplitude: float, speed: float, dt: float, accel: float) → tuple[numpy.ndarray, numpy.ndarray]

Joint angle samples of one sweep q0-A -> q0+A -> q0-A with trapezoidal velocity; returns (q, v_nominal).

rebot_control.calib.friction.collect_sweeps(arm, joint: int, center: numpy.ndarray, amplitude: float, speeds: tuple[float, ...], accel: float = np.radians(200.0), progress: collections.abc.Callable[[str], None] = print) → dict[str, numpy.ndarray]

Run the sweeps of one joint (rad, rad/s) and return the recorded servo samples plus the nominal velocity.

class rebot_control.calib.friction.JointFrictionFit
joint: int = None
fc_pos: float = None
fc_neg: float = None
fv: float = None
rms: float = None
samples: int = None
rebot_control.calib.friction.fit_joint_friction(model: rebot_control.model.RobotModel, data: dict[str, numpy.ndarray], vs: float = 0.02, vel_tol: float = 0.2) → rebot_control.calib.friction.JointFrictionFit

Fit Coulomb (per direction) + viscous friction of one joint from collect_sweeps() data.

rebot_control.calib.friction.to_friction_params(fits: list[rebot_control.calib.friction.JointFrictionFit], n: int, base: rebot_control.config.FrictionParams | None = None, vs: float = 0.02) → rebot_control.config.FrictionParams