bam.testbench#

Classes#

Testbench

Abstract base class for identification testbenches.

Pendulum

Single-axis pendulum testbench.

Module Contents#

class bam.testbench.Testbench#

Abstract base class for identification testbenches.

A testbench defines the rigid-body dynamics of the physical setup:

\[\tau_m + \tau_e(q) = M(q)\ddot{q}\]

where \(\tau_m\) is the motor torque, \(\tau_e\) the external (bias) torque, and \(M(q)\) the effective inertia.

abstractmethod compute_mass(q: float, dq: float) float#

Return the effective inertia at the current state [kg·m²].

Parameters:
  • q – Joint angle [rad].

  • dq – Joint velocity [rad/s].

abstractmethod compute_bias(q: float, dq: float) float#

Return the external (bias) torque at the current state [Nm].

Parameters:
  • q – Joint angle [rad].

  • dq – Joint velocity [rad/s].

class bam.testbench.Pendulum(log: dict)#

Bases: Testbench

Single-axis pendulum testbench.

A point mass at the tip of a uniform rod driven by the actuator output shaft. The zero angle is the arm pointing downward; positive angles are counter-clockwise.

Parameters:

log – Log dict containing "mass" [kg], "arm_mass" [kg], and "length" [m] keys.

mass#
arm_mass#
length#
compute_mass(q: float, dq: float) float#

Return the pendulum’s rotational inertia about the pivot [kg·m²].

Parameters:
  • q – Joint angle [rad] (unused — inertia is constant here).

  • dq – Joint velocity [rad/s] (unused).

compute_bias(q: float, dq: float) float#

Return the gravity torque at the current angle [Nm].

Parameters:
  • q – Joint angle [rad].

  • dq – Joint velocity [rad/s] (unused).