3.1. Observer Design
For using EKF to construct a disturbance observer to compensate for the unpredictable uncertainties, the disturbance term is considered as system states along with the position and velocity .
In real-world scenarios, it is common for the system being modeled to exhibit continuous-time dynamics, while measurements are obtained at discrete time intervals. To address this problem, the continuous–discrete EKF (CD-EKF) is employed for constructing the EAOB. The CD-EKF incorporates both continuous and discrete dynamics into the estimation process, operating similarly to the standard EKF but with the additional capability of handling discrete dynamics. The continuous dynamics are typically described using differential equations, while the discrete dynamics are represented by difference equations. During the prediction step of the CD-EKF, the continuous dynamics are discretized by integrating forward in time using numerical integration techniques, effectively capturing the system’s continuous evolution between measurement updates. In the update step, the CD-EKF incorporates the discrete-time measurements to correct and refine the state estimate. By seamlessly combining both continuous and discrete dynamics within the estimation process, the CD-EKF offers improved accuracy and robustness in estimating the state variables of systems with mixed dynamics. Therefore, the system process is represented as a continuous-time model, while the discrete-time measurements are taken. The system process model can be reconstructed as:
where system state
,
refers to the process noise that is assumed to be zero mean Gaussian noise with covariance
,
refers to the nonlinear system process model, and
t represents time in continuous form. Therefore, all the functions in the system process model are defined in continuous time.
Therefore, the system process model can be formulated based on the UUV’s model in Equation (
22):
The measurement states contain the position
, velocity
, and propulsion forces and moments
, thus the discrete-time measurement model is formulated as:
where measurement states
,
is the measurement noise which is assumed to be zero mean Gaussian noise with covariance
,
refers to the nonlinear measurement model that relates the system states to the measurements obtained from sensors, and
k denotes time in discrete form. Thus, all the functions in the measurement model are defined in discrete time. The first 12 terms of the measurement model are identity to the system process model, and the
can be calculated based on disturbance term
as:
The accurate estimation of solutions heavily relies on the design of the noise covariance matrices for the system process
and measurements
. One approach to constructing
is by utilizing the piecewise white noise model (PWNN). This stochastic model allows for the representation of varying noise characteristics across different time intervals or regions. By incorporating PWNN, the time-varying dynamics of the system can be more precisely captured in the EKF. This is particularly beneficial when dealing with systems that exhibit nonstationary or changing noise characteristics. The equation for calculating the system process noise covariance
based on PWNN is as follows:
where
is the noise gain of the system,
is the sampling time step, and
represents the variance of the white noise process. The covariance of the measurement noise
is also dependent on the sampling time step
, which is defined as:
The matrix
is used to model the uncertainty and variability in the system dynamics. By adjusting the Q(t), it can control the level of confidence the observer has in the predicted state estimates. Meanwhile, the matrix
captures the uncertainty associated with the sensor measurements. Consequently, the tuning of
and
determines the weighting between the system model and the measurements. As the current work is being conducted in simulation, where higher measurement accuracy is present, further adjusting
allows for greater reliance on measurements:
To adapt the real-world implementation, the matrix
can be further fine-tuned according to the specific sensors employed. For instance, the accelerometer and gyroscope are commonly employed for state measurement, but they often introduce unavoidable noise into the measurements. Consequently, in such cases, it is crucial to carefully determine the measurement noise matrix
. Numerous studies have been conducted in this area. In 2021, an experimental approach was proposed to analyze the impact of different weightings of matrix
and
on state estimation derived from the accelerometer and gyroscope [
33]. In addition, a study also developed a dynamic noise model for adaptive filtering of the gyroscope [
34]. This work introduced the dynamic Allan variance, which utilized a novel truncation window based on entropy features to construct the noise model. Additionally, an adaptive Kalman filter was designed to accommodate practical system and computational environments. Furthermore, a disturbance observer with adaptation laws has been developed based on the generalized super-twisting algorithm [
21]. This allows the observer to be auto-tuned, improving robustness to both external disturbances and model uncertainties.
The system process model
and the measurement model
can be linearized by taking the partial derivatives of each to evaluate the state transition matrix
and the measurement matrix
at each operating point with Jacobian matrix. Equation (
32) provides the state transition matrix
that captures the connection between the current state and the subsequent predicted state in a dynamic system. This matrix is derived using continuous-time
t as a basis. The measurement matrix, denoted as
, establishes the connection between sensor measurements and the predicted system state, as expressed in Equation (
33), with consideration for discrete-time
k.
Denote the three elements in the second row of matrix
as
,
, and
. Therefore
The CD-EKF is a recursive estimation algorithm, where the main procedure can be divided into prediction and update parts. Before starting the recursion, an initialization step is performed based on the first measurement:
In the prediction part, it predicts the state estimate
based on the previous state estimate and the system dynamics. Then the error covariance matrix
can be calculated based on the state transition matrix
. The prediction part is shown as follows:
The prediction step consists of both continuous-time and discrete-time components. The first equation, , represents the continuous-time dynamics of the system. It describes how the estimated state evolves over time based on the current estimated state and the total propulsion force and moments . The second equation, , represents the continuous-time evolution of the error covariance matrix . It captures how the uncertainty in the estimated state evolves over time, taking into account the system’s dynamics represented by the matrix and the process noise covariance matrix . The discretization occurs implicitly between the time steps and . The initial conditions for the discrete-time updates are set based on the estimated state and error covariance matrix at time , denoted by and , respectively. These initial values are then used to compute the updated estimates and at time .
Therefore, in Equation (
36), a numerical integration method should be applied for the discretization of a continuous-time system process model. Various ways of discretization in EKF have been discussed [
35]. In this work, the continuous dynamics of the system are approximated using a deterministic integration scheme. This scheme yields a deterministic estimation of the system’s behavior between measurement updates, assuming no uncertainty or stochasticity in the system dynamics. Deterministic integration methods are preferred due to their computational efficiency, avoiding the computational burden associated with simulating random processes. Specifically, the fourth-order Runge–Kutta (RK4) method [
36] is selected for its superior accuracy and stability compared to lower-order integration methods like Euler’s method or the second-order Runge–Kutta method. The RK4 method achieves this by evaluating the system dynamics at multiple intermediate points during each integration step, resulting in a more precise estimation of the state variables.
In the update part, it calculates the measurement residual
with current measurements
and measurement model. Then the Kalman Gain
at time
k can be determined based in the predicted error covariance matrix
and linearized measurement matrix
. Finally, it updates the state estimate
based on the predicted state estimate
and the Kalman Gain
, and recalculate the error covariance matrix
based on Kalman Gain
and the linearized measurement model
. The following equations express the procedure in EKF’s update part
The equation in the EKF update part is formulated in discrete time. The time step at which the equation is evaluated is denoted by k. The notation signifies that the variable or state being considered is at time step k. On the other hand, refers to the estimation or prediction at time step k based on the information available up to the previous time step, which is .