test_hingedRigidBodyMotor

test_hingedRigidBodyMotor.make_reset_ready_module()[source]

Return a module with both required input messages connected.

test_hingedRigidBodyMotor.run_motor_case(K, P, sensedTheta, sensedThetaDot, refTheta, refThetaDot, uMax)[source]

Run one controller configuration and return its torque output.

test_hingedRigidBodyMotor.test_hingedRigidBodyMotor(K, P, sensedTheta, sensedThetaDot, refTheta, refThetaDot, uMax, expectedTorque)[source]

Validation Test Description

Verify that the module output matches the PD control law with torque saturation disabled and with a configured symmetric torque limit. The cases exercise positive and negative saturation, a command inside the limit, and a zero limit.

Test Parameter Discussion

K and P are nonnegative controller gains, including proportional-only, rate-only, and zero-gain cases. The sensed and reference hinge states produce both signs of raw torque command. uMax is either left at its negative default, set above or below the raw command magnitude, or set to zero.

Description of Variables Being Tested

The first element of motorTorqueOutMsg.motorTorque is compared with the independently evaluated and clamped controller torque.

test_hingedRigidBodyMotor.test_hingedRigidBodyMotor_rejects_invalid_gains(K, P)[source]

Verify that Reset() rejects negative and non-finite controller gains.

test_hingedRigidBodyMotor.test_hingedRigidBodyMotor_rejects_nonfinite_torque_limit(uMax)[source]

Verify that Reset() rejects a non-finite motor-torque limit.