test_prescribedRotation1DOF

test_prescribedRotation1DOF.test_prescribedRotation1DOF(show_plots, coastOptionBangDuration, smoothingDuration, thetaInit, thetaRef1, thetaRef2, thetaDDotMax, accuracy)[source]

Validation Test Description

The unit test for this module ensures that the profiled 1 DOF rotation for a secondary rigid body relative to the spacecraft hub is properly computed for several different simulation configurations. The unit test profiles two successive rotations to ensure the module is correctly configured. The initial spinning body angle relative to the spacecraft hub is varied, along with the two final reference angles and the maximum angular acceleration for the rotation.

This unit test also tests four different methods of profiling the rotation. Two profilers prescribe a pure bang-bang or bang-coast-bang angular acceleration profile for the rotation. The bang-bang option results in the fastest possible rotation; while the bang-coast-bang option includes a coast period with zero acceleration between the acceleration segments. The other two profilers apply smoothing to the bang-bang and bang-coast-bang acceleration profiles so that the spinning body hub-relative rates start and end at zero.

Test Parameters

Parameters:
  • show_plots (bool) – Variable for choosing whether plots should be displayed

  • coastOptionBangDuration – (float): [s] Time the acceleration is applied during the bang segments

  • option) ((Variable must be nonzero to select the bang-coast-bang)

  • smoothingDuration (float)

  • options) ((Variable must be nonzero to toggle the smoothed profiler)

  • thetaInit (float) – [rad] Initial spinning body angle relative to the mount frame

  • thetaRef1 (float) – [rad] First spinning body reference angle relative to the mount frame

  • thetaRef2 (float) – [rad] Second spinning body reference angle relative to the mount frame

  • thetaDDotMax (float) – [rad/s^2] Maximum angular acceleration for the rotation

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

Description of Variables Being Tested

To verify the module functionality, the final angle at the end of each rotation is checked to match the specified reference angle (thetaRef1 and thetaRef2). Additionally, for the smoothed profiler options, the numerical derivative of the profiled angles and their rates is determined across the entire simulation in this test script. These numerical derivatives are checked with the profiled angular accelerations and angle rates to ensure the profiled acceleration is correctly integrated in the module to obtain the angles and their rates.