The quaternion based PD plus adaptive nonlinear dynamics
controller uses the same basic control law as in the previous
section. However, this controller is augmented by an equation which
refines the estimates of the physical system parameters based on its
response to control inputs. Although simulation and other methods
help to produce estimates of the values of the physical parameters,
it is clearly unrealistic to assume that all of the parameters of
such a complex system could be known precisely. Additionally, since
ranger is reconfigurable, both in manipulator configuration and
payloads, it is impossible to know all of the possible parameter sets
for all configurations. These facts make an adaptive method
desirable, where the controller refines its parameter estimates based
on the response of the vehicle to its commands.
The parameters to be estimated are the 3 diagonal elements of the
inertia matrix, 3 off diagonal elements of the inertia matrix (the
inertia matrix is symmetric), the three diagonal elements of the drag
matrix (off diagonal drag elements are currently not included in the
controller), and three buoyancy offset parameters. Given this
parameterization of the system physical properties, the system
dynamics from (4.43) become linear with respect to these parameters,
and may be written as

_{} 
(4.47) 
where _{ } is the estimate of the 12 system parameters.

_{} 
(4.48) 
Nominally, the parameter values are initialized to the values used in the dynamic flight simulator. These values model the vehicle in the stowed configuration and were determined by observing the motion of the vehicle.

_{} 
(4.49) 
The system dynamics may now be expressed as elements of a 12x3 matrix _{ }.

_{}, 
(4.50) 
where _{ }
is the gravity vector expressed in the vehicle reference frame.
Using this new expression for the system dynamics allows the
quaternion based PD plus nonlinear controller to be simply expressed
as

_{}, 
(4.51) 
where _{ }
is the quaternion based PD portion of the controller, and _{
}
represents the nonlinear computed torque using estimates _{
},
of the true vehicle parameters _{ }.
It is unrealistic to assume that the parameters of the system are
precisely known. The controller may improve its performance by
observing the response of the vehicle to its commands, and refining
the parameter estimates in response. The equation describing the rule
for refining the parameter estimates based on the error metric _{
}
is

_{}. 
(4.52) 
_{}
is a constant specifying the rate of adaptation.
When the control law from (4.51) is used to generate the input to the
vehicle system dynamics and the adaptation law from (4.52) is used to
refine the estimates of the system parameters, the closed loop
equations of motion can be written as

_{}, 
(4.53) 
where

_{} 
(4.54) 
represents the difference between the actual and estimated system parameters. This is a stable nonlinear differential equation. It can be shown from (4.53) and (4.45) that the closed loop dynamics produced by the coupled control and adaptation laws are stable, and guarantee that as _{ }, _{ } and _{ }. [4]