Adaptive Zigzag Mapping of a Patchy Field by a Long-Range Autonomous Underwater Vehicle

Spatial heterogeneity and temporal evolution are intrinsic features of some important oceanic processes, e.g., harmful algal blooms and oil spills, where aggregations of organisms or materials are localized and noncontinuous. In a sparse patchy field, routine lawnmower-mode or zigzag surveys by ships or autonomous platforms are not efficient since a large proportion of the survey time is spent on no-patch areas. We developed an adaptive zigzag algorithm for an autonomous underwater vehicle (AUV) to map patchy fields more efficiently than routine zigzag surveys. An AUV autonomously detects the peak and the edge of a patch, and accordingly determines when to turn onto the next zigzag leg. The AUV sweeps through the field on successive zigzag legs. Using an oil spill model data set, the performance of adaptive zigzag surveys is compared with that of routine zigzag surveys. In April 2022, the algorithm was tested on a long-range AUV through a 16-h survey in Monterey Bay, CA, USA, by reading the oil spill model data as the virtual measurement in real time.

An AUV can survey a spatial field on preprogrammed grid tracks (i.e., lawnmower mode) [6] or zigzag tracks [7].However, in a sparse patchy field, such fixed patterns are not efficient since a large proportion of the survey time is spent on no-patch areas.Adaptive methods have been developed to improve search and survey efficiency.In [8], an AUV autonomously located and tracked phytoplankton patches using a gradient-search algorithm.It is observed that moths adopt zigzag-like flight paths upwind in search of an odor source [9].Olfactory-based AUV search algorithms were designed for tracing chemical plumes.The vehicle achieves detection when the measurement exceeds a preset threshold and then makes turns with a certain pattern to remain in or reacquire the plume [10], [11], [12].
In this article, we consider mapping a field of distributed patches and tracking the patches' evolution over time, which is desired in investigations of oil spills, HABs, and other patchy and dynamic fields.Detecting and mapping many disjoint patches in a field, rather than tracing a single patch, presents a design challenge of not only detecting individual patches but also exploring the broad field.We developed a method for an AUV to detect and map distributed patches on adaptive zigzag transects through the field.
The rest of this article is organized as follows.The algorithm is presented in Section II.Simulation tests and performance comparisons with routine zigzag surveys are given in Section III.The algorithm was tested on a long-range AUV (LRAUV) in a field experiment in Monterey Bay, CA, USA, as reported in Section IV.Finally, Section V concludes this article.

II. ADAPTIVE ZIGZAG ALGORITHM
An AUV maps the patchy field through zigzag transects (in the horizontal dimension) on sawtooth (i.e., yo-yo) profiles (in the vertical dimension).The adaptive zigzag algorithm comprises two parallel behaviors.1) In the vertical dimension: extracting the maximum signal value on each descent or ascent yo-yo profile, i.e., the per-yo-yo maximum.2) In the horizontal dimension: adaptive zigzags based on the detection of patch peaks and edges.The AUV locates the patch peak out of per-yo-yo maxima of successive yo-yo profiles and locates the patch edge where the signal drops below a threshold percentage of the patch peak.

A. Vertical Dimension: Extracting Per-Yo-Yo Maximum
The AUV extracts the maximum signal value on each descent or ascent yo-yo profile, as shown in Fig. 1(a).The vehicle keeps track of the start and the end of each profile by detecting the vehicle's attitude flip [13] and reports the maximum signal value on completion of that profile.To remove spurious spikes due to sensor noise, the raw measurement goes through a median filter followed by a moving-average lowpass filter [8].

B. Horizontal Dimension: Adaptive Zigzags Based on Patch Peak and Edge Detections
The AUV searches for patches on successive zigzag legs, as shown in Fig. 1(b).If the vehicle does not detect any signal above a detection threshold (denoted by thresh detection as shown in Fig. 2) after a wait limit (green #4), it makes a turn onto the next zigzag leg.When the AUV transects a patch (blue #1), the signal level rises (on entry into the patch) and then drops (on departure from the patch).The patch peak is picked out of the per-yo-yo maxima on successive yo-yo profiles within a sliding window spanning a certain distance (so that distant peaks are excluded from consideration).When the signal level drops below a threshold percentage of the patch peak, the vehicle declares edge detection and continues flight on the current heading (up to a duration limit) in the hope of finding an adjacent patch.On the continued flight, if the vehicle does not detect a new patch within the continued-flight duration limit (red #2), it makes a turn onto the next zigzag leg (blue #3); but if the vehicle detects a new patch on the continued flight (red #5), it starts a new leg maintaining the current heading (blue #6).The algorithms of edge

C. Patch Edge Detection and Continued-Flight Patch Detection
The patch edge detection threshold is defined as thresh edge = patch peak × (patch edge/patch peak percentage threshold).As the AUV departs from a patch, when the signal level drops below this threshold, the AUV declares edge detection.Then the vehicle continues flight on the current heading hoping to find an adjacent patch.On the continued flight, if the peak value of a newly detected patch exceeds thresh edge of the preceding patch, the vehicle starts a new leg maintaining the current heading [see Fig. 2(a)].The rationale is: the peak value of the newly detected patch on the continued flight being higher than thresh edge (used for edge detection of the preceding patch) is an indication that the patches persist in this direction.Hence it is worthwhile to continue the survey on this heading.If the AUV does not detect any patch above thresh edge within the continued-flight duration limit, the vehicle deems it less likely to find new patches in this direction, hence making a turn onto the next zigzag leg [see Fig. 2(b)].

D. Consideration of Sweep Directions and Zigzag Headings
Suppose oil spills are advected by an eastward current, which results in an east-west-oriented swath of patchy field.We accordingly define an east-west oriented box region and let an AUV zigzag through the box on east-west sweeps.This is more efficient than north-south sweeps in a north-south oriented box because the latter would waste some time in no-patch areas to the north or south of the east-west-oriented patchy field.If information about the regional ocean current direction is available, we set the sweep direction to be the same as the anticipated current direction.
When setting the zigzag headings, we need to consider two conflicting requirements.1) A shorter AUV-traveled distance for faster mapping (at a given vehicle speed).2) Denser zigzag legs for a higher spatial resolution of mapping.We use a simple hypothetical case of a wall-to-wall zigzag sweep as a benchmark for making these considerations, as shown in Fig. 3.The AUV sweeps through a bounded region of length L and width W. The zigzag legs are symmetric.The heading of the northeastward leg is θ.The zigzag track bounces off the south and north walls.The track distance (i.e., the total length of all legs) of one sweep is: Dist track = L/sin θ.The midpoint spacing between

III. SIMULATION TESTS
We test the adaptive zigzag algorithm using an oil spill model data set.The performance of adaptive zigzag surveys is compared with that of routine zigzag surveys.

A. Oil Spill Model Data Set
An oil spill model was developed based on Delft3D software [14] to obtain representative oil concentration data.The model domain was proximal to the Alaska Burger Oilfield in the Chukchi Sea (71.251 °N, 163.195 °W), with an average water depth of 45.5 m [15].The full model domain extended about 54 km in the east-west direction and 28 km in the north-south direction.Using Delft3D's domain decomposition feature, a 100-m high-resolution grid, extending about 31 km in the eastwest direction and 18 km in the north-south direction, was created at the center of the full model domain.Bathymetry data for the model domain was developed based on the International Bathymetric Chart of the Arctic Ocean (IBCAO) v. 3.0 [16].In the model, it was assumed that the sea was covered by a layer of ice that moved in the northeast direction at a speed of 6 cm/s.Ocean currents traveled easterly with a speed of 10 cm/s.At the start of the simulation, the model assumed that oil had pooled on the underside of the ice, and dissolved oil particles generated by the oil layer were dispersed downward into the water by turbulence (see Fig. 4).The dispersion of the oil particles was modeled using Delft3D's particle tracking feature, and a vertical dispersion coefficient of 8 × 10 −4 m 2 /s was assumed.The model simulated 120 h with particle generation only in the first 40 h.
For simulating AUV surveys in the oil spill field, the oil spill model data are used to calculate the virtual measurements of the AUV on the survey track.For producing the virtual measurement at time t and location (x, y, z), the following 16 data points surrounding the AUV measurement point (in time and space) are interpolated for generating the virtual measurement: where Oil AUV_virtual (x, y, z, t) is the AUV virtual measurement at time t and location (x, y, z), and Oil model (x i , y j , z k , t n ) is the oil model data at time t n and location (x i , y j , z k ) where Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.i, j, k, n = 0 or 1.The model data points are the nearest points that enclose the AUV virtual measurement location and time: x lies between x 0 and x 1 ; y lies between y 0 and x 1 ; z lies between z 0 and z 1 ; and t lies between t 0 and t 1 .M interp is the linear interpolation matrix [17].

B. Parameter Settings
In each test, the AUV reads the virtual measurement (i.e., the interpolated oil spill model data) starting from one day into the model simulation.The parameter settings for the adaptive zigzag algorithm are given in Table I.Based on the geographical size of the oil spill model and the ocean current direction information, we let the AUV run east-west sweeps to map a bounded region of 31 km east-west by 22 km north-south.On an eastward sweep, the headings of the northeastward and the southeastward legs are set to 30°and 150°, respectively, for a reasonable tradeoff between AUV-traveled distance and mapping resolution.On a reverse (i.e., westward) sweep, the headings of the northwestward and the southwestward legs are set to 330°and 210°, respectively.The yo-yo depth range is set to 0.3-10 m.
In the model simulations, we observed that the horizontal scale of individual AUV-transected patches is on the order of a few kilometers.Accordingly, we set the length of the sliding window to 50 yo-yo profiles (corresponding to 1.9 km at 1 m/s Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE II (CONTINUED)
speed and 20°pitch angle) for picking out the peak within the horizontal scale of a patch.We set the continued-flight duration limit to 30 min (corresponding to 1.5 km) in the hope of detecting an adjacent qualified patch.In Section V, we discuss the future development of algorithms that will enable an AUV to autonomously adjust these parameters based on real-time statistics learned during mapping.

C. Simulation Test Example
In the simulation tests, we modified the algorithm: on a leg bouncing from a bounding wall, the AUV maintains heading until detecting signals above thresh detection or reaching the maximum leg distance or hitting another bounding wall at which point the vehicle turns onto the next zigzag leg; on a leg not starting from a wall-bounce but preceded by a leg that has encountered a patch, after a wait limit without signal detection, the vehicle turns onto the next zigzag leg.The rationale for the two different treatments is as follows.On a fresh leg starting from a wall-bounce, before encountering any patch, the AUV should maintain the current heading to search for one, because making turns would not increase the likelihood of finding a patch presuming equal likelihood in all directions.However, in the case that the AUV encounters a patch and then continues on the current heading but fails to find an adjacent patch after a certain duration, the vehicle considers it more worthwhile to make a turn in the hope of finding an adjacent patch lateral to the just-encountered patch.
The adaptive zigzag transect in one simulation test is shown in Figs. 4 and 5. Two snapshots of the oil spill model field (at the start and the end of the zigzag transect, respectively) are shown in the right panels of each figure.Over the 15.6-h duration, the oil patches were advected eastward by the ocean current.The AUV captured the patches on the eastward sweep comprising a sequence of zigzag legs.At the junction points between the legs (marked in Figs. 4 and 5, and listed in Table II), the AUV either made a turn or maintained the current heading as detailed below.
The AUV started (point 1 ) on 30°heading.It then detected a patch with a peak value of 1.6 kg/m 3 .When the vehicle departed from the patch and the oil level dropped to thresh edge = patch peak × patch edge patch peak percentage threshold = 1.6 kg/m 3 × 10% = 0.16 kg/m 3 the AUV declared edge detection (junction point 2 ).The vehicle continued flight on 30°heading.On the continued flight, the AUV detected a patch with a peak value of 0.25 kg/m 3 .Because 0.25 kg/m 3 > 0.16 kg/m 3 (thresh edge of the preceding patch), at this 0.25 kg/m 3 patch's edge (junction point 3 ) the vehicle started a new leg maintaining the current heading.At junction point 4 , when reaching the 60-minute limit without detecting signals above thresh detection = 0.1 kg/m 3 , the vehicle made a turn to 150°heading.The zigzag transect continued up to the eastern bound.In the middle of the transect when the vehicle hit the southern bound (junction point 11 ) on 150°heading, it turned to 30°heading back into the bounding box.

D. Performance Comparison Between Adaptive Zigzag and Routine Zigzag Surveys
In a routine zigzag survey, the AUV turns onto the next zigzag leg only when hitting a bounding wall.To compare the performance of adaptive zigzag versus routine zigzag surveys, we ran 4 pairs of tests, as shown in Fig. 6.In each pair of tests, the adaptive zigzag survey is labeled with "A" (e.g., "A1"), and the routine zigzag survey is labeled with "R" (e.g., "R1").We randomized the tests by altering two initial-condition settings: the AUV's start latitude and heading, as shown in Table III.All of the other parameter settings are kept the same.Over the 36-h mission duration, the AUV swept eastward, hit the eastern bound, and then swept westward.
To evaluate the surveys, we set up an efficiency metric: the percentage of the total traveled distance on which the oil level exceeds the detection threshold (0.1 kg/m 3 ).A higher metric value means a larger portion of the AUV track encountered oil spills, thus more efficient.The adaptive zigzag surveys outperformed the routine zigzag surveys in tests 1, 2, and 4, and they tied in test 3, as shown in Fig. 6.The contrast is best shown in test No. 4. On the routine zigzags, the AUV blindly spanned the entire north-south breadth before turning onto the next zigzag leg, hence wasting a large proportion of the survey time on no-patch areas.On the adaptive zigzags, the AUV made timely turns based on patch detection, thus contributing more survey time to patch areas.In the tied test 3, the adaptive zigzags traversed the northern no-patch expanse, thus diminishing the performance gain over the routine zigzags.

IV. FIELD TEST
The LRAUVs developed by the Monterey Bay Aquarium Research Institute (MBARI) are 2.3-3.2m long (depending on the payload configuration), and have a diameter of 0.3 m at the midsection (see Fig. 7).The LRAUV routinely operates at speeds from 0.5 to 1.2 m/s.The vehicle's depth range is from the surface to 300 m.Using a rechargeable battery, the vehicle can continuously operate for 12 days at 0.8 m/s speed to cover 800 km.Using a primary battery, the vehicle has demonstrated a range of 1800 km (three-week duration) at 1 m/s speed [18].Its long-range capability is realized by minimizing propulsion power consumption through an innovative design of a low-drag body and a high-efficiency propulsion system [19].In addition, the vehicle is equipped with a buoyancy engine and is capable of auto-ballasting to neutral buoyancy, which allows flight at a reduced angle of attack to decrease drag.Using the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE IV PARAMETER SETTINGS IN THE MONTEREY BAY EXPERIMENT
percentage threshold buoyancy engine, the vehicle is also capable of drifting in a lower power state and controlling depth while the thruster is powered OFF.The LRAUV thus combines mobility and speed properties typical of propelled vehicles and the energy savings properties unique to buoyancy-driven vehicles.The vehicle's sensor suite, navigation approaches, and software architecture are introduced in [18].
On April 25, 2022, we deployed LRAUV Tethys in Monterey Bay to test the adaptive zigzag algorithm.The parameter settings are given in Table IV.
From the west edge of the bounding box, Tethys started the eastward sweep comprising a sequence of zigzag legs, as shown in Figs. 8 and 9. Tethys read the interpolated oil spill model data (starting from two days into simulation) as the virtual measurement in real time.Two snapshots of the oil spill model field (at the start and the end of the Tethys transect, respectively,) are shown in the right panels in each figure.Over the 16.5-h duration, the oil patches were advected eastward by the ocean current.Tethys captured the patches on the eastward sweep.At the junction points between the legs (marked in Figs. 8 and 9, and listed in Table V), Tethys either made a turn or maintained the current heading as detailed below.
Tethys started the mission from point 1 .Once reaching the zigzag transect beginning waypoint 36.69 °N, 122.17 °W (junction point 2 ), Tethys started the adaptive zigzag on 30°h eading.At junction point 3 , when reaching the 90-minute limit without detecting signals above thresh detection = 0.1 kg/m 3 Tethys made a turn to 150°heading.It then detected a patch with a peak value of 0.97 kg/m 3 .At the patch edge (junction point 4 ), Tethys continued flight on 150°heading.When Tethys hit the southern bound (junction point 5 ) on 150°heading, it turned to 30°heading back into the bounding box.On the 30°heading, Tethys traveled 15 km (the maximum leg distance) without detecting the patch edge because the oil level stayed high and did not fall below 10% of the recent patch peak (i.e., the patch peak within the 1.9-km sliding window), so at junction point 6 Tethys turned to 150°heading.Then, Tethys detected a patch with a peak value of 0.6 kg/m 3 .At the patch edge (junction point 7 ), Tethys continued flight on 150°heading.On this continued flight, Tethys detected a patch with a peak value of 0.17 kg/m 3 .Because 0.17 kg/m 3 was higher than the edge threshold of the preceding patch   the southern bound (junction point 9 ) and then turned to 30°h eading back into the bounding box.Then, Tethys detected a patch with a peak value of 0.57 kg/m 3 .At the patch edge (junction point 10 ), Tethys continued flight on 30°heading until the end of the mission (point 11 ).In this field experiment, the mapping efficiency metric value (i.e., the percentage of the total traveled distance on which the oil level exceeded the detection threshold) was 85%.

V. CONCLUSION
We developed an AUV adaptive zigzag algorithm for detecting and mapping disjoint patches in a field.In a set of simulation tests using an oil spill model data set, the algorithm outperformed routine zigzag surveys in terms of an efficiency metric.The algorithm was tested on an MBARI LRAUV through a 16-h survey in Monterey Bay, by using the oil spill model data as the virtual measurement.This field experiment also demonstrated a novel approach to validating algorithms progressing from simulations to actual sea conditions.
We will improve the algorithm in the following aspects.

A. Adaptive Parameter Settings
In the current algorithm, the sliding window size and the continued-flight duration limit are preset based on the horizontal scale of individual AUV-transected patches in model simulations.In field experiments, the actual features of the patches (e.g., spatial scale, distance between adjacent patches) may differ from the model.We need to develop an adaptive algorithm that starts patch mapping with certain initial settings but learns the patches' statistics on the fly and accordingly adjusts the parameters in real time.For example, the continued flight duration will be adjusted based on the accumulated data of distances between adjacent patches transected by the AUV.The ocean current direction can be estimated in real time from the discrepancy between the AUV's dead-reckoned track and the periodic surface GPS fixes, and used for adjusting the zigzag sweep direction.

B. Supplementary Search Patterns
Desert ants and male moths take spiral paths to search for the nest entrance [20] and intercept the pheromone filaments [21], [22], [23], respectively.Spiral patterns are effective when searching for targets with unknown directions, and the spiral expands over time to increase area coverage.When running the adaptive zigzag algorithm, if the AUV does not encounter a patch after a certain duration, it can switch to a spiral pattern with radius limits (an upper-limit radius to confine the search area and a lower-limit radius set to the AUV's minimum turning radius) in an attempt to intercept a patch.If no patch is detected up to the upper-limit radius, the AUV resumes the paused zigzag pattern to leave this region and explore new regions.If a patch is detected, the AUV switches to a linear leg across this patch and then continues the zigzag pattern.A spiral pattern centered

Fig. 1 .
Fig. 1.Illustration of the AUV algorithms for (a) extracting the per-yo-yo maxima (black dots) on successive yo-yo profiles and (b) zigzag tracks through an evolving patchy field.The AUV starts on a westward sweep.When the AUV reaches the northern or southern bound (i.e., if the distance to the bound is less than a specified margin distance), it bounces onto the next leg.When the AUV reaches the western bound, it reverses course to switch to an eastward sweep.The legs with different numbers and color markings are explained in the text.

Fig. 2 .
Fig. 2. Illustration of (a) patch edge detection and continued-flight patch detection, and (b) no patch detection on the continued flight.The vehicle's corresponding maneuvers are shown.

Fig. 3 .
Fig. 3. (a) Hypothetical eastward zigzag sweep through a bounded region of length L and width W for considering the tradeoff between the AUV-traveled distance (colored blue) and the interleg midpoint spacing (color red).(b) Normalized metrics Dist track /L and Spacing legs /W as functions of heading θ.

Fig. 4 .
Fig. 4. Oil levels on the AUV's adaptive zigzag transect (left panel) through the oil spill model field (snapshots shown in the right panels) in one simulation test.The AUV's zigzag track is overlaid for reference in the right panels.Latitude and longitude are in degrees.

Fig. 5 .
Fig. 5. Plan views of the oil levels on the AUV's zigzag transect (left panel) and the depth-averaged (from 0.3 to 10 m) oil spill model data (right panels) corresponding to Fig. 4. The AUV's zigzag track is overlaid for reference in the right panels.Latitude and longitude are in degrees.

Fig. 6 .
Fig.6.Performance comparison between adaptive zigzag surveys (upper row; "A" stands for "Adaptive") and routine zigzag surveys (lower row; "R" stands for "Routine") of the simulated oil spill field.The survey duration was 36 h.The start and the end of the survey are marked by the triangle and the circle, respectively.Latitude and longitude are in degrees.
thresh edge = patch peak× patch edge patch peak percentage threshold = 0.6 kg/m 3 × 10% = 0.06 kg/m 3 at the patch edge (junction point 8 ), Tethys started a new leg maintaining the current heading.Shortly afterward Tethys hit

Fig. 8 .
Fig. 8. LRAUV Tethys made an adaptive zigzag transect in Monterey Bay (left panel).During this field experiment, Tethys was reading the interpolated oil spill model data (right panels) as the virtual measurement in real time.Tethys' zigzag track is overlaid for reference in the right panels.Latitude and longitude are in degrees.

Fig. 9 .
Fig. 9. Plan views of the oil levels on Tethys' zigzag transect in Monterey Bay (left panel) and the depth-averaged (from 0.3 to 10 m) oil spill model data (right panels) corresponding to Fig. 8. Tethys' zigzag track is overlaid for reference in the right panels.Latitude and longitude are in degrees.

TABLE II JUNCTION
POINTS (MAKING A TURN OR MAINTAINING THE CURRENT HEADING) ON THE ZIGZAG LEGS SHOWN IN FIGS. 4 AND 5

TABLE III INITIAL
-CONDITION SETTINGS OF THE FOUR PAIRS OF TESTS

TABLE V JUNCTION
POINTS (MAKING A TURN OR MAINTAINING THE CURRENT HEADING) ON THE ZIGZAG LEGS SHOWN IN FIGS.8 AND 9