rebot_control.calib.ripple

Torque ripple that repeats with the joint angle, identified from slow constant-velocity sweeps.

Geared BLDC actuators need a torque that varies periodically with the rotor angle to turn evenly (cogging, one period per electrical cycle: pole pairs x gear ratio periods per turn of the joint). At low speed the position loop cannot reject it and the joint visibly speeds up and slows down; at high speed the inertia filters it out.

The sweeps are the ones of the friction calibration (collect_sweeps()), run slowly. In the constant-velocity part of each pass the motor torque is:

tau_meas - gravity(q) = offset(direction, speed) + ripple(q_j)
ripple(q) = a1 sin(N q) + b1 cos(N q) + a2 sin(2 N q) + b2 cos(2 N q)

The reported torque is the position loop’s reaction to the ripple, so it lags the ripple a little. Seen over the angle, that lag has opposite signs in the two directions of travel: the model is the mean of the two directions’ coefficients, which cancels it. N is the integer that explains most of the torque when it is not given.

Module Contents

Classes

Functions

fit_joint_ripple

Fit the ripple of one joint from collect_sweeps() data.

to_ripple_params

Ripple model with the fitted joints replaced (the others keep base, or zero).

API

class rebot_control.calib.ripple.JointRippleFit
joint: int = None
cycles: int = None
a1: float = None
b1: float = None
a2: float = None
b2: float = None
amplitude: float = None
amplitude_dir: tuple[float, float] = None
phase_dir: tuple[float, float] = None
explained: float = None
explained_dir: float = None
rms_before: float = None
rms_after: float = None
samples: int = None
rebot_control.calib.ripple.fit_joint_ripple(model: rebot_control.model.RobotModel, data: dict[str, numpy.ndarray], cycles: int | None = None, search: tuple[int, int] = (40, 300), vel_tol: float = 0.5) → rebot_control.calib.ripple.JointRippleFit

Fit the ripple of one joint from collect_sweeps() data.

rebot_control.calib.ripple.to_ripple_params(fits: list[rebot_control.calib.ripple.JointRippleFit], n: int, base: rebot_control.config.RippleParams | None = None) → rebot_control.config.RippleParams

Ripple model with the fitted joints replaced (the others keep base, or zero).