test_hingedRigidBodyPIDMotor

test_hingedRigidBodyPIDMotor.test_hingedRigidBodyPIDMotor(show_plots, thetaR, thetaDotR, theta, thetaDot, K, P, I, accuracy)[source]

Validation Test Description

This unit test verifies the correctness of the output motor torque Module: hingedRigidBodyPIDMotor. The inputs provided are reference angle and angle rate, current angle and angle rate, proportional, derivative, and integral gain.

Test Parameters

Parameters
  • thetaR (double) – reference angle;

  • thetaDotR (double) – reference angle rate;

  • theta (double) – current angle;

  • thetaDot (double) – current angle rate;

  • K (double) – proportional gain;

  • P (double) – derivative gain;

  • I (double) – integral gain;

  • accuracy (float) – absolute accuracy value used in the validation tests.

Description of Variables Being Tested

This unit test checks the correctness of the output motor torque

  • motorTorqueOutMsg

where in this case the output is one dimensional, since the spinning body is one dimensional. The unit test only checks the output at the first time step, for which the integral term does not contribute.