bam.testbench ============= .. py:module:: bam.testbench Classes ------- .. autoapisummary:: bam.testbench.Testbench bam.testbench.Pendulum Module Contents --------------- .. py:class:: Testbench Abstract base class for identification testbenches. A testbench defines the rigid-body dynamics of the physical setup: .. math:: \tau_m + \tau_e(q) = M(q)\ddot{q} where :math:`\tau_m` is the motor torque, :math:`\tau_e` the external (bias) torque, and :math:`M(q)` the effective inertia. .. py:method:: compute_mass(q: float, dq: float) -> float :abstractmethod: Return the effective inertia at the current state [kg·m²]. :param q: Joint angle [rad]. :param dq: Joint velocity [rad/s]. .. py:method:: compute_bias(q: float, dq: float) -> float :abstractmethod: Return the external (bias) torque at the current state [Nm]. :param q: Joint angle [rad]. :param dq: Joint velocity [rad/s]. .. py:class:: Pendulum(log: dict) Bases: :py:obj:`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. :param log: Log dict containing ``"mass"`` [kg], ``"arm_mass"`` [kg], and ``"length"`` [m] keys. .. py:attribute:: mass .. py:attribute:: arm_mass .. py:attribute:: length .. py:method:: compute_mass(q: float, dq: float) -> float Return the pendulum's rotational inertia about the pivot [kg·m²]. :param q: Joint angle [rad] (unused — inertia is constant here). :param dq: Joint velocity [rad/s] (unused). .. py:method:: compute_bias(q: float, dq: float) -> float Return the gravity torque at the current angle [Nm]. :param q: Joint angle [rad]. :param dq: Joint velocity [rad/s] (unused).