MAVLINKHUD

Overview

The SAIL parameter group configures the Autonomous Sailing logic for ArduRover.

This library allows rovers (Boats) to navigate using wind power. It manages complex sailing behaviors like tacking, jibing, and sail trim based on wind direction.

Key Concepts

1. Sail Control Types (SAIL_TYPE)

Defines the hardware used for sail adjustment.

  • 0: Manual (Servo direct).
  • 1: Winch (Standard servo/winch).
  • 2: Wing Sail (Rotating mast/wing).

2. Upwind Navigation (SAIL_NO_GO_ANGLE)

Boats cannot sail directly into the wind. If a waypoint is upwind, the autopilot will autonomously calculate a "tack" (zig-zag) path to reach it.

  • SAIL_NO_GO_ANGLE: The angle relative to the wind (typically 45°) where the boat cannot maintain speed.

3. Safety (SAIL_HEEL_MAX)

To prevent capsizing, the autopilot monitors the roll angle. If the boat heels past this limit, the sails are automatically eased to dump wind pressure.

Parameter Breakdown

  • SAIL_ENABLE: Master switch.
  • SAIL_ANGLE_IDEAL: Optimal sail angle for maximum thrust.
  • SAIL_WNDSPD_MIN: Minimum wind speed required to attempt sailing.

Integration Guide

  1. Hardware: Requires a Wind Vane sensor (WNDVN_TYPE) to see the wind direction.
  2. Enable: Set SAIL_ENABLE = 1.
  3. Calibrate: Ensure the wind vane is aligned with the boat's nose.
  4. Mode: Use AUTO, GUIDED, or ACRO to see the sailing logic in action.

Developer Notes

  • Library: Rover/sailboat.cpp.
  • Navigation: Integrated with the L1 controller to handle tacking and crosstrack limits.

SAIL_ANGLE_IDEAL

deg
Default 25
Range 0 90

Sail ideal angle (SAIL_ANGLE_IDEAL)

Description

This parameter defines the optimal angle of attack for the mainsail to generate maximum thrust. The autopilot uses this value, combined with the wind vane reading (apparent wind direction), to automatically trim the sail servo.

The Mathematics

$$ \theta\_{\text{sail}} = \theta\_{\text{wind}} - \text{SAIL\_ANGLE\_IDEAL} $$
(Simplified logic for sail setting).

The Engineer's View

Defined in Rover/sailboat.cpp. Used in the update_mainsail() function.

  • Physics: Represents the angle where the lift/drag ratio of the sail is maximized.

Tuning & Behavior

  • Default Value: 25 deg
  • Adjustment:
    • Soft Sails: Typically 20-30 degrees.
    • Wing Sails: May require different settings based on the airfoil profile.

SAIL_ANGLE_MAX

deg
Default 90
Range 0 90

Sail Maximum Angle (SAIL_ANGLE_MAX)

Description

SAIL_ANGLE_MAX defines the mechanical limit of your sailboat's rig.

It represents the angle of the boom relative to the boat's longitudinal axis when the mainsheet servo is at its maximum travel (loose). This value is used by the sailing controller to calculate how much to "Sheet In" or "Sheet Out" based on the wind direction.

  • Standard Setting: 90 degrees (Boom can swing fully perpendicular to the boat).

Tuning & Behavior

  • Default: 90.
  • Measurement: Let your mainsheet out completely and measure the angle of the boom. If your rigging prevents the boom from reaching 90 degrees (e.g. hitting the shrouds), enter the actual maximum angle here.
  • Note: For rotating masts (wing sails), this parameter defines the rotation limit.

SAIL_ANGLE_MIN

deg
Default 0
Range 0 90

Sail Minimum Angle (SAIL_ANGLE_MIN)

Description

SAIL_ANGLE_MIN defines the "Fully In" position of the sailboat's rig.

It represents the angle of the boom relative to the boat's centerline when the mainsheet servo is at its minimum travel (tight). This is used when sailing "Close-Hauled" (upwind) to generate maximum lift from the sail.

  • Standard Setting: 0 degrees (Boom is perfectly aligned with the boat).

Tuning & Behavior

  • Default: 0.
  • Measurement: Tighten your mainsheet completely and measure the angle. If your mechanical setup doesn't allow the boom to reach the center (0°), enter the actual minimum angle here.

SAIL_ENABLE

Default 0
Range 0 1

Enable Sailboat (SAIL_ENABLE)

Description

SAIL_ENABLE turns on the specialized sailboat flight controller.

When enabled, the vehicle will use wind direction data (from a wind vane) to automatically trim sails and perform "tacking" maneuvers (zigzagging) when navigating directly into the wind (the "No Go Zone"). This is only relevant for wind-powered aquatic vehicles.

  • 0: Disable. The vehicle behaves like a standard motor-powered Rover/Boat.
  • 1: Enable. Enables sail servos and sailboat navigation logic.

Tuning & Behavior

  • Reboot Required: Yes.
  • Dependencies: Requires a wind vane (WNDVN_TYPE) to be configured and functional.

SAIL_HEEL_MAX

deg
Default 15
Range 0 90

Sail Maximum Heel Angle (SAIL_HEEL_MAX)

Description

SAIL_HEEL_MAX is the "Capsize Prevention" setting for autonomous sailboats.

When the boat banks over (heels) due to wind pressure, there is a risk of losing control or taking on water. If the measured heel angle exceeds this value, the autopilot will automatically ease the sails (let the sheet out) to reduce the sideways force and level the boat, even if it means losing speed.

Tuning & Behavior

  • Default: 15 degrees.
  • Recommendation: Set this based on your boat's stability. For a wide-beamed boat or one with a heavy keel, you might increase this to 25 or 30 degrees. For a light catamaran, keep it lower (e.g., 10 or 15).
  • Safety: This is a critical safety parameter for long-distance autonomous voyages.

SAIL_LOIT_RADIUS

m
Default 5
Range 0 50

Sail Loiter Radius (SAIL_LOIT_RADIUS)

Description

SAIL_LOIT_RADIUS defines the size of the "Waiting Area" for a sailboat.

Since a sailboat cannot simply stop and hover (unless it drops an anchor), it "Loiters" by sailing in a continuous circle or figure-eight pattern. This parameter sets the radius of that pattern.

Tuning & Behavior

  • Default: 5 meters.
  • Recommendation: Set this to a value at least 3 to 5 times the length of your boat. If the radius is too small, the boat will spend all its time turning (tacking) and may lose momentum and get stuck.
  • Safety: Ensure the radius is large enough for the boat to successfully complete a turn (tack or jibe) without exiting the loiter boundary.

SAIL_NO_GO_ANGLE

deg
Default 45
Range 30 60

Sail No-Go Zone Angle (SAIL_NO_GO_ANGLE)

Description

SAIL_NO_GO_ANGLE defines the "Upwind Limit" of your boat.

A sailboat cannot sail directly into the wind; if it tries, the sails will simply luff (flap) and the boat will stop. This parameter defines the boundary of that unusable sector. When the autopilot needs to reach a waypoint that is directly upwind, it will use this angle to calculate the "Tacks" (zig-zagging) required to get there.

Tuning & Behavior

  • Default: 45 degrees.
  • High Performance: For a fast racing yacht with high-quality sails, you can decrease this to 35 or 40 degrees.
  • Casual/Draggy: For a bulky boat or one with less efficient sails, you might need to increase this to 50 or 55 degrees.
  • Effect: If this value is too low, the boat will constantly lose speed and "Stall" while trying to point too high into the wind. If too high, the boat will be inefficient and take much longer to reach upwind targets.

SAIL_TYPE

Default 0
Range 0 1

SAIL_TYPE: Sailboat simulation sail type

Description

This parameter selects the mechanical configuration of the sail for the SITL (Software-In-The-Loop) sailboat simulation.

Values

Value Meaning
0 Mainsail with Sheet (Conventional cloth sail)
1 Directly Actuated Wing (Rigid wing sail)
  • Default: 0 (Mainsail)

Description

SAIL_TYPE tells the simulator which physics model to use for the sailboat's propulsion.

  • Mainsail (0): Simulates a flexible sail controlled by a winch (sheet). The sail billows and generates lift based on the tension of the sheet and wind angle.
  • Wing (1): Simulates a rigid wing (similar to those on high-performance racing catamarans) that is directly rotated to a specific angle of attack by a servo.

SAIL_WNDSPD_MIN

m/s
Default 0
Range 0 5.0

Sailboat Minimum Wind Speed (SAIL_WNDSPD_MIN)

Description

SAIL_WNDSPD_MIN defines the "Calm Water" transition point for autonomous boats.

If the measured wind speed (via WNDVN_SPEED) falls below this value, the autopilot assumes there isn't enough wind to sail effectively. If the boat has an auxiliary motor, the autopilot will engage the motor to maintain its mission speed. If there is no motor, the boat will simply drift or hold position until the wind picks up.

Tuning & Behavior

  • Default: 0 (Always try to sail).
  • Recommendation: Set to 0.5 m/s to 1.0 m/s to prevent the boat from "Gilled" (stuck with no speed) in very light air.
  • Dependency: Requires a functional wind speed sensor and an auxiliary motor if motoring is desired.

SAIL_XTRACK_MAX

m
Default 10
Range 5 50

Sailboat Max Cross-Track Error (SAIL_XTRACK_MAX)

Description

SAIL_XTRACK_MAX defines the "Corridor Width" for sailing missions.

When sailing upwind, a boat must zig-zag (tack) to reach its target. This parameter sets how far the boat can move to either side of the direct line (the "Cross-Track") before the autopilot triggers a tack to come back toward the center.

  • Default: 10 meters.
  • Recommendation: For large open water, you can increase this to 20 or 30 meters to reduce the number of tacks and improve efficiency. For narrow channels, keep it at 5 or 10.