Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

Åland Sailing Robots (http://www.sailingrobots.ax/) is a project at the Åland University of Applied Sciences and is concerned with various aspects of autonomous sailing. One main objective is to design a control system that enables autonomous missions with propulsion by sails alone over long periods, from hours to months. The focus is on small sailing vessels between one and four meters in length, with correspondingly limited solar panel and accumulator capacity for supplying electricity to the control and measurement system. A related challenge is power management for the control unit, sensors and actuators. A separate study presents detailed power management solutions for operating different sensors and actuators at different, and varying, sampling rates as well as the microcontroller at different, and varying, clock rates [1] .

In the present study, a model for the sailboat is evaluated using three criteria:

  • How well does the model describe the behaviour of the Mini 12 used for the practical trials?

  • Can the model be used to develop a useful control strategy?

  • Can the model be used for reliable state estimation?

The reason for selecting these three criteria is connected to the overall strategy for the long-term operation of an autonomous sailing vessel discussed in the above mentioned study [1]. In this paper, the focus is not on a practical implementation of the overall strategy but rather on a flexible solution for evaluating different aspects of the strategy. The setup used for experiments on a Mini 12 sailboat is also described.

2 Model for the Sailboat

A rather exhaustive presentation of ship navigation and control models can be found in the volume written by Fossen [2]. His main focus is on ships and underwater vehicles, but a similar approach to modeling has been extended to sailboats in [7]. The model presented [7] has also been used as a basis for theoretical studies on simulations of and control strategies for sailboats [3, 6]. A simplified model has been presented in [5], with a modest number of parameters and thus attractive for controller design. Given the success of practical trials for autonomous tracking by a sailboat achieved by the team around Jaulin, it seems that the simple model captures the sailboat dynamics essential for controller design. Therefore, the model presented in [5] is also chosen as the basis for the model development of the present study.

Fig. 1
figure 1

Definitions of state variables, wind vectors and control parameters

The model is given by non-linear differential equations in state space and are provided in Eq. (4). The states \(X = \begin{pmatrix}x\ y\ \theta \ v\ \omega \end{pmatrix}^T\) are defined in Fig. 1. The model is given in a North-East-Up reference frame, i.e., an easterly x-axis and northerly y-axis. The origin of the boat is its center of gravity and v is the speed in the direction of the boat. Wind is described both in reference to the earth and to the sailboat corresponding to true wind (tw) and apparent wind (aw), respectively. Figure 1 also illustrates the angle \(\psi \) and speed a of the wind in polar coordinates. For convenience, \(W_{p,\mathrm{{tw}}} = \begin{pmatrix} a_\mathrm{{tw}} \ \psi _\mathrm{{tw}} \end{pmatrix}^T\) is introduced. Given the speed and heading of the boat, true wind can be calculated from the apparent wind or vice versa. Apparent wind in Cartesian coordinates relative to the direction of the boat, i.e., the first coordinate corresponding to the heading of the boat, can be calculated from true wind by

$$\begin{aligned} W_{r,\mathrm {aw}} = \begin{pmatrix} a_\mathrm{{tw}}\cos (\psi _\mathrm{{tw}}-\theta )-v\\ a_\mathrm{{tw}}\sin (\psi _\mathrm{{tw}}-\theta ) \end{pmatrix} \end{aligned}$$
(1)

The corresponding polar coordinates are thus given by

$$\begin{aligned} W_{p,\mathrm {aw}} = \begin{pmatrix} a_\mathrm{{aw}} \\ \psi _\mathrm{{aw}} \end{pmatrix} = \begin{pmatrix} |W_{r,\mathrm {aw}}|\\ \mathrm {atan2}( W_{r,\mathrm {aw}} ) \end{pmatrix} \end{aligned}$$
(2)

In compact notation, the model is given by

$$\begin{aligned} \dot{X} = f(X,U,W_{p,\mathrm {tw}}) \end{aligned}$$
(3)

corresponding to

$$\begin{aligned} \begin{pmatrix} \dot{x} \\ \dot{y} \\ \dot{\theta } \\ \dot{v} \\ \dot{\omega } \end{pmatrix} = \begin{pmatrix} v \cos (\theta ) + p_1 a_\mathrm{{tw}} \cos (\psi _\mathrm{{tw}}) \\ v \sin (\theta ) + p_1 a_\mathrm{{tw}} \sin (\psi _\mathrm{{tw}}) \\ \omega \\ (g_s \sin (\delta _s) - g_r p_{11} \sin (\delta _r) - p_2 v^2)/p_9 \\ (g_s(p_{6}-p_{7}\cos (\delta _s)) - g_r p_8 \cos (\delta _r) -p_3 \omega v )/p_{10} \end{pmatrix} \end{aligned}$$
(4)

where \(U = \begin{pmatrix}g_s\ g_r\end{pmatrix}^T\) are the forces generated by sail and rudder. These are given by,

$$\begin{aligned} \begin{pmatrix} g_s \\ g_r \end{pmatrix} = \begin{pmatrix} p_4 a_\mathrm{{aw}} \sin (\delta _s - \psi _\mathrm{{aw}}) \\ p_5 v^2 \sin (\delta _r) \end{pmatrix} \end{aligned}$$
(5)

Since the sheet is flexible, the sail cannot hold against the wind and thus stall the boat. This is also accounted for in the model, i.e.,

$$\begin{aligned} \delta _s = -\mathrm {sgn}(\psi _\mathrm{{aw}}))\min (|\pi -|\psi _\mathrm{{aw}}||,|\delta _s|) \end{aligned}$$
(6)

where \(|\psi _{aw}| \le \pi \) and \(\mathrm {sgn}\) is the sign function.

The model is based on traditional translational and rotational inertia affected by forces, yielding changes in position, orientation, speed and rotation. Drift and change in position is described in the first two lines of Eq. (4), due to the speed of the boat and wind interacting with all surfaces except sails, e.g., hull and mast. The acceleration of the sailboat, line 4 in Eq. (4), is affected by three forces: The propulsion from the sails, a braking force from the rudder and a tangential friction force, the two latter being proportional to the square of the speed of the sailboat. The rotational acceleration, line 5 in Eq. (4), follows from differences in moments. The forces generated by sail and rudder are approximated by the product of a constant, the velocity of incoming flow (air or water) and sinus of mediums attacking angle, Eq. (5).

Naturally, for a sailboat the propulsion is generated by the sails alone. From a control perspective, this is an interesting characteristic since the traditional perspective defines wind as a disturbance. In this case, however, the disturbance is necessary since without any wind the boat will obviously cease to move, regardless of any efforts made by a controller.

The parameters of the model are determined by comparing simulation results with measured GPS position data as described in Sect. 6. A description of all the parameters, \(p_i\), and the values used in the simulations can be found in Table 1.

Table 1 Model parameters for the mini12

3 Control Strategy and Simulations

As a starting point for controller development, a controller inspired by [4] is used. As inputs to the controller, the state variables X, true wind, \(W_{p,\mathrm {tw}}\), and a series of way-points, P, are used. The goal is to keep the boat moving along the (linear) trajectories connecting the way-points. The trajectories are assumed to be free of obstacles. Some variables for internal use by the controller are the tack variable, \(q=\{-1,1\}\) used to register the direction of the ongoing tack and a counter k keeping track of current way-points. Also, the controller is provided with tacking angle \(\theta _t\), a no-go angle that determines when tacking is necessary. The no-go angle can be defined as a function of wind, but is typically between 30\(^\circ \) and 50\(^\circ \) on either side of the true wind, \(\psi _\mathrm{{tw}}\). In addition, two distance-related parameters are provided to the controller. The distance r, determines the size of the way-point, i.e., at what proximity is the way-point considered to have been reached. The distance, d, determines how close to the desired trajectory the sailboat will keep during tacking. The sheet angle, \(\delta _s\), is a linear function of the apparent wind angle, \(\psi _\mathrm{{aw}}\).

The control algorithm is as follows.

  1. 1.

    Calculate the distance to next way-point \(r_1\). If \(r_1<r\), the way-point is reached and the way-point counter is updated, \(k=k+1\).

  2. 2.

    Calculate the desired heading \(\theta _r\) based on the shortest (signed) distance, e, from the boat to the desired trajectory by

    $$\begin{aligned} \theta _r = \beta -2\frac{\gamma }{\pi }\arctan (\frac{e}{r}) \end{aligned}$$
    (7)

    where \(\beta \) is the angle of the desired trajectory and \(\gamma >0\) is a tuning parameter, i.e., a larger value for \(\gamma \) gives a trajectory of the boat that converges faster to the desired line.

  3. 3.

    Determine mode of sailing, nominal or tack. In nominal mode, go to next step. If tacking is required, that is, true wind lies within the no go zone, q is set to 1 or \(-1\) depending on the direction of the tack and if the sailboat has reached the tacking distance d. The desired heading is correspondingly set: \(\theta _r=\psi _\mathrm{{tw}} +q \theta _t\)

  4. 4.

    Calculate rudder angle, which in the controller is proportional to the \(\sin \) of the difference between actual heading \(\theta \) and desired heading \(\theta _r\),

    $$\begin{aligned} \delta _r = \mathrm {sgn}(v) \sin (\theta -\theta _r) \delta _{r,\mathrm {max}} \end{aligned}$$
    (8)

    where \(\delta _{r,\mathrm {max}}\) is the maximal rudder angle. If the boat is going in the wrong direction, i.e., \(\cos (\theta -\theta _r)<0\), maximal rudder angle is used,

    $$\begin{aligned} \delta _r = \mathrm {sgn}(v) \mathrm {sgn}(\sin (\theta -\theta _r)) \delta _{r,\mathrm {max}} \end{aligned}$$
    (9)
  5. 5.

    Calculate sail angle (sheet length), which in the controller is proportional to the angle of the apparent wind,

    $$\begin{aligned} \delta _s = -\mathrm {sgn}(\psi _\mathrm{{aw}})\left( \frac{\delta _{s,\mathrm {min}}-\delta _{s,\mathrm {max}}}{\pi }|(\psi _\mathrm{{aw}}| + \delta _{s,\mathrm {max}}\right) \end{aligned}$$
    (10)

The closed-loop system was simulated for 600 s using a constant northerly wind of 6 m/s and the results are shown in Fig. 2, the arrow in the middle of the figure indicates true wind direction. The controller was running at 1 Hz. Maximum rudder angle was set to \(\pi {/}6\), and maximum sail angle to \(\pi {/}5.2\). A practical evaluation and the corresponding simulations of the controller are illustrated in Fig. 3. The trial lasted about 13 min, with a western wind of approximately 7 m/s. In the figure, it can be seen that the sailboat oscillated along the trajectory in the beginning of the trial. A possible explanation for this observation is a varying time-delay due to, mainly, communication between the local microcontroller and the external laptop. If a time-delay is included in the model, oscillations can be observed, but further work is required to accurately model the frequencies and amplitudes of the oscillations.

Because of the oscillations, the maximum rudder angle in the controller, \(\delta _{r,\mathrm {max}}\) in Eq. (8), was changed from \(\pi {/}6\) to \(\pi {/}9\) after 300 s of the experiment. Although this clearly improved controller performance, the figure illustrates possibilities for further improvement. Also, an obvious drawback of this modification is that maximum rudder can no longer be applied. The trial thus reveals the need to modify the “gain” of the controller without adjusting maximum rudder angle.

Fig. 2
figure 2

Simulation over 600 s with model from Eq. (4) and controller from Sect. 3. Desired trajectory, dotted (...), simulated path, dashed (– –), and wind direction indicated by the arrow

Fig. 3
figure 3

Experiment with controller compared with simulation. Desired trajectory, dotted (...), simulated path, dashed (– –), and experiment solid (—)

In order to explore options for improved control, it can be noted that the control algorithm forms a cascaded control system: The outer control loop, Eq. (7), uses GPS-measurements in order to calculate e, which, in turn, is used by a static nonlinear controller to determine the setpoint \(\theta _r\) for the inner controller. The inner controller, Eq. (8), uses compass measurements of \(\theta \) and can be seen as a nonlinear P-controller. Since the gain of the inner controller cannot easily be adjusted, an obvious possibility is to replace the inner controller by a traditional P-, or PD-controller. At this stage, integral action in the inner controller is not considered for two reasons: First, the outer controller should handle steady-state offsets. Second, for integrating processes, integral action in the controller often significantly degrades performance during step-type setpoint changes.

The use of P- and PD-controllers for the inner controller has been explored in simulations. For a simulated triangle, including a leg of tacking, the controller of Eq. (8) has been compared to a P-controller with a gain of 1 and a digital PD-controller with proportional gain 1, a filter on the derivative term and a derivative gain of 0.5. In addition to the time necessary to complete the triangle, control signal activity given by \(\sum |\delta _r|\), control performance given by \(\sum |\theta -\theta _r|\) and \(\sum |e|\) were calculated. In this comparison, the shortest time is obtained with the P-controller, followed by the PD-controller with the controller of Eq. (8) resulting in the slowest completion of the triangle. Best controller performance for both measures are obtained with the PD-controller, followed by the P-controller and Eq. (8) performing worst. Control signal activity, on the other hand, is lowest for Eq. (8) followed by the P-controller with the PD-controller requiring highest activity. In future work, these indications will be evaluated in practice.

Future work will also consider other possibilities for control. Since different controllers can perform differently depending on, e.g., the desired heading relative to the wind, an option might therefore be to apply different controllers under different circumstances. Other relevant closed-loop characteristics that will be considered are robustness to model uncertainties and noise sensitivity.

4 State Estimation

A desired feature of the autonomous system is very low power consumption during longer missions. As discussed in [1], this can be achieved by shutting down the measurement and control system for longer periods. Informed and safe choices to shut down and wake up the electronic system can be based on reliable estimates of the state of the boat, i.e., mainly the position. Given the form of the model and the promising simulations, future work will explore the possibilities for state estimation with the use of Kalman filter: Can improved estimates of position be obtained at modest computational expense compared to the use of dead reckoning, i.e., constant speed and heading.

Fig. 4
figure 4

True wind direction, measured solid (—) and estimated dashed (– –)

Fig. 5
figure 5

True wind speed, measured solid (—) and estimated dashed (– –)

A special consideration is that true wind is crucial for the model but only apparent wind can be measured in autonomous sailing. Therefore, \(a_\mathrm{{tw}}\) and \(\psi _\mathrm{{tw}}\) need to be calculated from measured apparent wind speed and angle. Also, useful estimates of true wind can be obtained by assuming that wind varies according to a random walk in discrete-time, i.e.,

$$\begin{aligned} \begin{pmatrix} \hat{a}_\mathrm{{tw}} (k+1) \\ \hat{\psi }_\mathrm{{tw}}(k+1) \end{pmatrix} = \begin{pmatrix} \hat{a}_\mathrm{{tw}} (k) + q_a \\ \hat{\psi }_\mathrm{{tw}}(k) + q_\psi \end{pmatrix} \end{aligned}$$
(11)

where \(\hat{a}\) is used to denote the filtered estimate of a and q is Gaussian noise. En example of measurements and corresponding estimates are illustrated in Figs. 4 and 5. For the same time and approximate location, the Finnish Meteorogical Institue provided a wind direction of 0\(^\circ \) and speed of 5–6 m/s, which correspond quite well to the estimates.

In addition, the estimates of true wind in state space need to be compared to measurements of apparent wind. This is achieved with the use of Eq. (1). An interesting possibility is that the model also can be used as an indicator of wind stability—a key element for assessing reliability of position estimates for autonomous sailboats.

5 Experimental Setup

Although a primary goal is to have an autonomous and energy-efficient measurement and control system, the present experimental setup is designed for easy supervision and real-time evaluation. The design uses a Raspberry Pi (2 model B V1.1) as a local computer in the sailboat. The Raspberry Pi mainly collects and transmits data to an external laptop and controls signals to the actuators. A radio link via XBee XBP24Z7SIT-004 handles communication between the Raspberry Pi and the external laptop. In order to enable rapid controller evaluation in real-time, the laptop uses LabView for supervision as well as to determine control signals. It is also possible to switch between manual and automatic control of the actuators within LabView.

A diagram of the electronic system is provided in Fig. 6. Used sensors are: Wind direction/speed LCJ Capteurs CV7, GPS GlobalSat BU-353 and Compass HMC6343. The sheet and rudder actuators are controlled via PWM signals, the linear actuators are connected via ropes and pulleys to the rudder and sheet. If the XBee link fails, it is, for safety reasons, possible to switch the PWM signals to a traditional radio controller. The range of Xbee is up to 3 Km but the range of the safety system with RC-controller is only about 500 m. It is recommended to not exceed the RC-controller range. The boat, depicted in Fig. 7, used for the experiments is a 4 m long Mini 12 belonging to the 2.4mR-class of the International Sailing Federation. Further development will include measurements of rudder angle via a potentiometer thus enabling accurate rudder control.

Fig. 6
figure 6

Electronic system: Components and communication

Fig. 7
figure 7

The mini 12 during a test

Fig. 8
figure 8

GPS position from experiment and simulated values using constant rudder resulting in circles

6 Model and Trial Experiments

The model is verified by comparing different experiments to the corresponding simulations. In the experimental setup, measurements of rudder and sheet angle are not yet available and cannot therefore be exactly replicated in the simulations. Apart from measurements of wind speed and direction as well as the initial state of the boat, open simulations are illustrated.

The first test case uses a constant rudder and a maximum sail angle resulting in circles. The ability of the boat, and the model, to turn and handle wind from all directions are thus tested and results are illustrated in Figs. 8 and 9. The second test uses a neutral rudder, constant sail angle and wind from left side. Measurements and simulations are illustrated in Fig. 10. Finally, Fig. 11 shows tacking maneuvers. The simulations uses a neutral rudder angle in between tacking, and maximum rudder during the tacking maneuver. The length of the period with non-neutral rudder is estimated from a graph and corresponding measurements of compass heading. The main sail is trimmed tightly. For these experiments manual control was applied.

Fig. 9
figure 9

Boats simulated velocity and measured speed over ground

Fig. 10
figure 10

GPS position from experiment and simulated values for line made with neutral rudder

Fig. 11
figure 11

GPS position from experiment and simulated values for tacking maneuvers

7 Conclusions

The chosen model structure is well suited for simulations and estimation. For the purpose of controller development, the model seems to capture characteristics of the sailboat observed in experiments. Correspondingly, an accurate model can greatly facilitate control design and closed-loop evaluation. In order to further explore the nonlinear features of the boat and compare controllers, more experiments under different conditions are required.

It seems that a remaining challenge is to reliably estimate position as illustrated by the growing difference between observations and simulations in, e.g., Fig. 8. Considering the endeavors connected to navigational satellite systems and the vast efforts under millennia of human civilization it is not, however, surprising that GPS measurements are vital for accurate position estimation. Still, it seems that wind and other state estimates can be used in open water to greatly decrease sampling rates and thus electrical power consumption.