4.7.3 Simulation Results

Since the hardware in the loop simulation uses the actual vehicle on board operations software, and replaces the actual vehicle dynamics and estimator with a dynamic model, it becomes a simple matter to determine the simulated response of the controllers presented in Section 4.4. Simulated step and tracking results are described below.
Figure 4-12 shows the simulated response of Ranger NBV to a 45° yaw step using the quaternion based PD controller.

Figure 4-12 Simulated PD 45° Yaw Step Response

The lower half of the graph shows the angular error. Since the error quaternion represents the difference between the desired and estimated attitudes as a single angle about a single axis of rotation, this angle becomes a natural choice when observing the overall convergence properties of a controller. This angle is the Euler angle (4.6) of the error quaternion from (4.34) given by


.

(4.68)

The upper half of the graph in Figure 4-12 indicates the magnitude of the desired and commanded moment vectors. The output is normalized so that the maximum moment about any of the vehicle axes is 1. Since the maximum thrust vector must be contained within a cube of defined by [-1,+1] along each of the vehicle axes, the maximum thrust occurs in each of the corners of the cube where a maximum moment is commanded about each of the vehicle axes. Here the thrust is


If at any time the desired moment about any of the vehicle axes is greater than 1, the moment vector is scaled (4.57) so that its tip lies on the surface of the cube. This is illustrated in the first 4.75 seconds of the simulated step response. Initially, the controller requests five times the maximum commandable yaw moment. The commanded moment is shown by the hatched line in the upper half of the graph.
Figure 4-13 shows the yaw tracking response of the quaternion based PD controller, and the quaternion based PD + nonlinear compensation controller.

Figure 4-13 Simulated PD and PD+NL Yaw Sinusoidal Tracking Response

For the first 20 seconds, the PD controller tracks the sinusoid. The maximum error is about 6°. The controller is able to track the trajectory without exceeding the maximum thrust about any of the vehicle axes (thruster saturation). In the last two thirds of Figure 4-13, the controller is PD+NL compensation. Initially, the controller requests a very large moment causing the simulated thruster system to saturate. After a few seconds, the error is reduced to the point where the thrusters can supply the moment requested by the controller. Notice that the error in the last half of the graph is essentially zero because the parameters of the dynamic simulation exactly match the values used in the controller dynamic model. The moment computed by the controller precisely matches the amount required for the system to track the specified trajectory. In reality, the physical parameters can not be precisely known, the model does not exactly match reality, and the thrusters can not supply precisely the requested torque. However comparing the actual tracking results of the PD controller and the PD+NL compensation controller in Section 5.3.2 will show that a reasonably accurate model for compensation dynamics produces significant improvement over a PD only controller.