4.1. Real-Time Controller
In this section, first, a choice of low-power sensors is justified; then, the embedded processor software architecture is described; finally, the navigation algorithm is detailed.
In order to navigate, autonomous sailboats require a number of sensors, specifically a Global Positioning System (GPS) sensor to provide real-time position, a compass that provides vessel heading, and a wind vane that returns the wind direction. The physical sensors for the SeaLeon were the same models as for the Breizh Tigresse, since they were chosen very carefully to minimize power consumption, as is reported in
Section 4.2. Specifically, the GPS was a breakout board distributed by Adafruit; it includes an on-board patch antenna, consumes extremely low power, and provides high sensitivity. It includes the GSM MTK3339 chipset and is interfaced to the controller using a USART (Universal Synchronous and Asynchronous Receiver and Transmitter). The compass was the HMC6343 by Honeywell, and provides a three-axis magneto-resistive sensor. It is interfaced to the controller using an I2C interface. Both the GPS and compass were strategically mounted inside the hull of the SeaLeon. A CV7 windvane manufactured by LCF uses ultra-sonic measurement to provide a reliable estimate of the wind direction. It was mounted on a short mast at the back of the hull, and was connected to the controller through a USART interface.
Additionally to the three sensors, the SeaLeon used an XBee Series 1 radio module for testing purposes, as well as the XEOS Onyx Iridium Asset Tracker to track and transmit the location of the sailboat. Note that during the mission, the XBee radio was disabled, and the XEOS was powered independently.
The rules for the Microtransat indicate that the sailboat must navigate autonomously. As such, to define a mission, waypoints are uploaded to the sailboat before the competition begins through the radio interface. Therefore, the SeaLeon had a waypoint loading mode, where the waypoints could be input to an electrically erasable programmable read-only memory (EEPROM) interfaced to the sailboat microcontroller. When a waypoint is reached, the next waypoint index is updated in an external EEPROM, in case there is a power failure during the mission.
Due to the metallic structures on the sailboat, especially the XEOS ONYX trackers, there was large magnetic interference with the compass. Prior to the final voyage, calibration was carried out for the Breizh Tigresse to correct for the compass considering the magnetic interference. During the calibration, angle readings were taken with the compass while the compass was turned in each 30 degree increment. The average angle was taken from three trials and compared to the actual angle, and the output served to populate a lookup table. From this information, the magnetic deviation could be calculated and was included in the code to obtain the heading with respect to true north. The final correction also included a correction that accounts for the magnetic declination between the true north and the measured north from the compass , which is a function of the longitude in degrees and can be estimated to be equal to in the North Atlantic Ocean.
The SeaLeon used one microcontroller to receive sensor data, control the motors for navigation, and communicate its location. In comparison, the previous version of the sailboat, the Breizh Tigresse, used two Microchip PIC18F2550 microcontrollers to implement the sailboat controller. The main PIC was responsible for receiving data from its peripherals, applying an algorithm, and then sending that data to the second chip. The secondary chip was only responsible for converting the motor position to a pulse width modulation (PWM) signal applied to the servo motors. The choice to integrate the motor control and the sensor acquisition system was made to reduce the number of peripherals, as well as the power consumption. The SeaLeon controller was implemented using a 32-bit SAMD20 microcontroller from Microchip that features an ARM Cortex-MO processor, and can easily interface to peripherals through multiple USART and I2C compatible pins.
The software implemented on the microcontroller is modular and has a hierarchical design with three layers: an input/output layer, a task layer, and a control layer. A hierarchical design was chosen because of its adaptability, due to the separation of hardware specific drivers from high-level logic. Specifically, this architecture allows the easy integration of new devices, since the same control layer can be used, and only the input/output layer should be updated.
The input/output layer includes device drivers for all of the peripherals used for the SeaLeon. These include the USART, the I2C bus, the analog-to-digital converter (ADC), and the pulse width modulation (PWM) generator. The task layer contains the high-level modules that control the peripherals. The control layer is responsible for managing the state of the sailboat and performing tasks at periodic intervals.
To handle the multiple tasks, a clock interrupt handler expires every 200 milliseconds. When the handler is triggered, custom coded tasks are called, each at a unique period, as summarized in
Table 2. This allows the controller to read the sensors, log the data, and control the motors at a pre-configured rate. In a future software design, the tasks running on the controller can be defined using a real-time operating system such as Free RTOS that is compatible with the ARM processor chosen. This can identify different levels of priorities for the tasks, and can be programmed to sleep to further reduce the energy consumption of the microcontroller.
The sailboat has two data logging modes: test and deploy. In test mode, the data are sent using an Xbee Series 1 radio module. The data can then be visualized in real time to a host computer for processing. The system logs sensor data including GPS coordinates, wind direction, and compass readings. It also logs controller data such as the next waypoint, the course selected by the navigation algorithm, and the rudder and sail positions. In deploy mode, data are sent less frequently via an XEOS Onyx device that communicates over the Iridium network. Log messages from the XEOS Onyx device are logged to a remote server. The data can then be viewed through a web client provided by XEOS.
To enter the waypoints, a graphical user interface on a host computer is used to define the waypoint characteristics and send them to the EEPROM. For this purpose, the microcontroller regular navigation mode is interrupted and changed to a waypoint load mode. In this mode, a waypoint entry can be sent to the sailboat which indicates the waypoint index, the GPS coordinates of the waypoint, the waypoints threshold radius, and the index of the next waypoint in the path.
One of the most critical functions of the controller is the navigation algorithm, shown in
Figure 3a. This algorithm uses information from all of the sailboat’s peripherals, as well as the waypoints from the EEPROM. The goal of the algorithm is to determine how to update the rudder and sail to make the sailboat reach the waypoint. Each waypoint has a threshold radius that is indicated when uploading the waypoint to the EEPROM. When the distance between the boat’s position and the waypoint is within the threshold radius, a validation counter is incremented. After five consecutive readings within the waypoint threshold radius, the algorithm advances to the next waypoint.
The course selection is chosen to be the bearing between the boat’s current position and the target waypoint. However, there are situations when the direction of the wind may make it impossible for the sailboat to go in that direction. The sailboat cannot travel in the direction directly opposite to the wind. Instead, the sail boat must tack back and forth to make forward progress. As shown in
Figure 3b, the sailboat must bear down when its direction is within a dead-zone, defined to be when the sailboat is against the direction of the wind
. Similarly, the sailboat luffs when it sails directly downwind, i.e.,
. Otherwise, four fixed sail settings are defined depending on if the sailboat is at close haul (below
), close reach (below
), beam reach (below
), or broad reach (below
). A similar algorithm is described in [
18].
4.2. Energy Supply
Due to the duration of the Microtransat Challenge, an energy budget must be estimated such that the vessel can cross the ocean autonomously. Ideally, the drone’s lifetime is infinite, which can be assured using rechargeable batteries. However, the effectiveness and likelihood of failure of the energy supply system must also be considered. In this section, the choice of a non-rechargeable energy source for the SeaLeon is justified.
Note that several attempts were made to cross the Atlantic. The energy supply for some of the most competitive designs is summarized in
Table 3, along with the number of days lasted at sea. It should be noted that the mission duration seems to have been very short for sailboats relying on rechargeable batteries.
In the design of the SeaLeon, the expected mission duration was approximately 90 days, with a fairly wide margin (plus or minus 30 days) depending on the sea conditions. In order to establish the energy supply requirements,
Table 4 shows a calculated power budget for the SeaLeon. The power budget was made using estimates from data sheets and actual measurements when possible. Note that in the design of the SeaLeon, the Iridium communication system was a standalone radio, with an independent battery.
The SeaLeon’s power system was designed to give as many amp hours as possible given the constraint of the size of the sailboat. This idea led to a power system consisting of 128 Lithium Thionyl Chloride () D-Cell batteries, distributed by Eagle-Picher. The batteries were placed in series giving a supply voltage of 14.8 volts, and thirty-two sets of four were placed in parallel in order to increase the amp-hour capacity. Altogether, the batteries provided a total of 680 Ah capacity.
Rechargeable methods for supplying power to the sailboat were also considered. Solar panels have been a popular choice for other Microtransat participants. For example, solar panels were used by the the Breizh Spirit, designed by Ensta-Bretagne. The Breizh Spirit had an energy supply that could last 3 days minimum, and used lead acid batteries that could be recharged up to 500 mA by solar panels.
In addition to non-rechargeable cells, rechargeable cells, such as lithium iron phosphate (
) cells, are considered as an option to increase the lifetime of the drone.
Table 5 shows a comparison of metrics for four
versus four
cells placed in series. An arrangement of eight 280 Ah prismatic (
) cells with two sets of four placed in parallel can provide 560 Ah of capacity and the ability to increase the amp-hours further by recharging the cells. However, from the table, it is apparent that
PT-2300 batteries weigh less and occupy less volume per amp-hour in comparison to the
LF280 cells. The
PT-2300 cells were chosen for the SeaLeon energy supply based on its comparison to the rechargeable cells. In addition, a rechargeable method such as solar panels would take up a significant amount of space on the sailboat. It was decided that a larger density of cells would be the best approach to a long-lasting energy supply.
Rechargeable lithium cells do provide an interesting alternative solution, particularly for sustainability considerations. Specifically, rechargeable batteries are more convenient for testing purposes, since they can be recharged rather than removed and replaced after trials. Rechargeable lithium cells also create the potential for a higher effective capacity when paired with renewable energy such as solar panels. In addition, the use of renewable energy can lead to research into software power conservation techniques. The Breizh Tigresse, for example, used a charge controller to turn off the electronics and actuator power when the battery voltage was lost. The boat was programmed to act like a drifting raft in this case. Adjustments could also be made to have the sailboat enter a ’recharge mode’ when the battery voltage drops below a certain level, and would limit the boat’s daily consumption of power.