# Control of DC Motors to Guide Unmanned Underwater Vehicles
## 2 Materials and Methods
### Deterministic A.I.: Self-Awareness Statements Using Analytic Trajectory and Optimal Learning  
Shift Equation (2) to isolate \(u(t)\), establishing the form of the relationship embodying self-awareness assertion (Equations (3)-(6)). Restrict the system to only respond in accordance with the self-awareness statement--i.e., formulate \(u(t)\)) in accordance with Equation (7), defining it as \(u^{*}(t)\), which may be expressed in regression form as the product of a matrix of knowns and a vector of unknowns, thus completing the first step: modeling. The second step (estimation) uses nominal algorithms based on recursive least squares algorithms, where the presence of the innovations or residuals indicate augmentation of recursive least squares as extended least squares. Equation (3) shifts the time index of Equation (2) to emphasis the calculation of the control--u at time --after a few mathematical steps. This leads to Equation (8): the optimal control in feedforward form, annotated by the asterisk, i.e., \(u^{*}\), which is defined by a regression form of a matrix of knowns, \([\Phi_{d}]\) multiplied by a vector of unknowns, \(\{\hat{\theta}\}\), where the vector of unknowns is initialized in Equation (9), with rough estimates known a priori.  
\[0.09842u(t)+0.09842u(t-1)=y(t+1)-1.607y(t)+0.6065y(t-1) \tag{3}\]  
\[\frac{0.09842}{0.09842}u(t)+\frac{0.09842}{0.09842}u(t-1)=\frac{1}{0.09842}y(t+ 1)-\frac{1.607}{0.09842}y(t)+\frac{0.6065}{0.09842}y(t-1) \tag{4}\]  
\[u(t)+u(t-1)=\frac{1}{0.09842}y(t+1)-\frac{1.607}{0.09842}y(t)+\frac{0.6065}{0. 09842}y(t-1) \tag{5}\]  
\[u(t)=\frac{1}{0.09842}y(t+1)-\frac{1.607}{0.09842}y(t)+\frac{0.6065}{0.09842}y( t-1)-u(t-1) \tag{6}\]  
\[u^{*}(t)\equiv\hat{a}_{1}y_{d}(t+1)-\hat{a}_{2}y_{d}(t)+\hat{a}_{3}y_{d}(t-1) -\hat{b}_{1}u_{d}(t-1) \tag{7}\]  
Figure 3: Indirect self-tuner without process zero cancellation (minimum phase plant). (**a**) command and actual output (top); and control (bottom) versus number of timesteps, revealing nominal performance following the square wave. (**b**) Gain \(\beta\) versus timesteps revealing brief oscillation, and then convergence towards a steady-state value.  
\[u^{*}(t)\equiv\left[\begin{array}{cc}y_{d}(t+1)&-y_{d}(t)&y_{d}(t-1)&-u_{d}(t-1) \end{array}\right]\left\{\begin{array}{c}\hat{a}_{1}\\ \hat{a}_{2}\\ \hat{a}_{3}\\ \hat{b}_{1}\end{array}\right\}=\left[\Phi_{d}\right]\{\hat{\theta}\} \tag{8}\]  
\[\{\hat{\theta}(0)\}=\left\{\begin{array}{c}\hat{a}_{1}\\ \hat{a}_{2}\\ \hat{a}_{3}\\ \hat{b}_{1}\end{array}\right\}=\left\{\begin{array}{c}10\\ 16\\ 6\\ 1\end{array}\right\}\text{rough estimates of }\left\{\begin{array}{c}a_{1}\\ a_{2}\\ a_{3}\\ b_{1}\end{array}\right\}=\left\{\begin{array}{c}\frac{0.0842}{1.0802}\\ \frac{0.0802}{1.0802}\\ \frac{0.08042}{0.09842}\\ 1\end{array}\right\}\approx\left\{\begin{array}{c}10.16\\ 16.33\\ 6.16\\ 1\end{array}\right\} \tag{9}\]  
Isolate \(y(t+1)\) to apply control using dynamic Equation (3):  
\[0.09842u(t)+0.09842u(t-1)=y(t+1)-1.607y(t)+0.6065y(t-1) \tag{10}\]  
\[y(t+1)=1.607y(t)-0.6065y(t-1)+0.09842u^{*}(t)+0.09842u^{*}(t-1) \tag{11}\]  
Procedure:  
1. Initialize the vector of unknowns per Equation (9) to assert self-awareness Equation (7) or Equation (8) as the control, where \([\Phi_{d}]\) is formulated using the desired (analytic) trajectory.
2. Propagate state to \(y(t+1)\) in Equation (11).
3. Use values of \(y\) (not \(y_{d}\)) and \(u^{*}\) in RLS (not presented here) to optimally estimate/learn/update \(\hat{\theta}\), to propagate errors projected on system matrix \([\Phi]\) (not \([\Phi_{d}]\)).
4. Apply \(u^{*}(t)\) in Equation (7) or Equation (8) with the optimally learned estimates \(\hat{\theta}\).  
Section 3 presents the results of direct comparison of the deterministic artificial intelligence (D.A.I) method described in Section 2 to the nonlinear adaptive methods presented in [8] and compared in [11]. In all cases, square wave trajectories will be used as commanded trajectories.