MAVLINKHUD

Overview

The ZIGZ parameter group configures the ZigZag flight mode. This is a specialized semi-autonomous mode for Agricultural Sprayers and Surveying.

It allows the pilot to define two points (A and B) and then simply push the stick forward to have the drone fly a perfect straight line to the other side, "step" to the next row, and wait for the next command.

Key Concepts

1. Line Sequencing

The mode automates the repetitive "Back and Forth" work of crop spraying.

  • ZIGZ_SIDE_DIST: Defines the "Step" or width (meters) of each row.
  • ZIGZ_DIRECTION: Selects if the step should be to the left or right.

2. Auto-Spraying (ZIGZ_SPRAYER)

Can be linked to the SPRAY_ group to automatically turn the pump on during the straight segments and off during the turns.

Developer Notes

  • Library: ArduCopter/mode_zigzag.cpp.

ZIGZ_AUTO_ENABLE

Default 0
Range 0 1

ZIGZ_AUTO_ENABLE: ZigZag Auto Enable

Description

Allows you to enable (1) or disable (0) the ZigZag Auto feature.

Values

Value Meaning
0 Disabled
1 Enabled
  • Default: 0

Description

This parameter enables the advanced automation features of ZigZag Mode (Copter/Rover).

  • ZigZag Mode: A manual/semi-auto flight mode designed for crop spraying. The pilot flies to one side of the field and flips a switch. The drone records that point as "Point A." The pilot flies to the other side and flips the switch again to record "Point B."
  • Auto Enable: When this parameter is set to 1, the drone will automatically fly back and forth between the two defined lines (advancing forward by the ZIGZ_SIDE_DIST each time), essentially creating an instant grid mission without a GCS.

ZIGZ_DIRECTION

Default 0
Range 0 1

ZigZag Mode Step Direction (ZIGZ_DIRECTION)

Description

ZIGZ_DIRECTION determines which way the drone "marches" across the field.

  • 0: Right.
  • 1: Left.

Tuning & Behavior

  • Default: 0.
  • Usage: Set this based on your starting position and the shape of your field. If you start on the left edge of a field, you will want the drone to step Right (0) to cover the remaining area.

ZIGZ_LINE_NUM

Lines
Default 0
Range -1 32767

ZigZag Mode Total Lines (ZIGZ_LINE_NUM)

Description

ZIGZ_LINE_NUM defines the "Mission Length" for ZigZag mode.

  • -1: Infinity. The drone will continue flying back and forth between the A and B points and stepping sideways until the pilot cancels the mode or the battery runs low.
  • 0: Single Step. The drone will only perform the lateral movement when commanded, then wait.
  • 1-N: The drone will automatically complete this many parallel legs across the field and then come to a halt.

Tuning & Behavior

  • Usage: Set this to the number of rows in your field to automate the entire spraying or scanning job.

ZIGZ_SIDE_DIST

m
Default 4.0
Range 0.1 100.0

ZigZag Mode Step Distance (ZIGZ_SIDE_DIST)

Description

ZIGZ_SIDE_DIST defines the "Width" of your scanning pattern.

In ZigZag mode (commonly used for agricultural crop spraying), the pilot defines two points (A and B). The drone flies back and forth between these points. When it reaches one end, the pilot can command a "Step" to the side. This parameter sets how many meters the drone moves sideways for each of those steps.

Tuning & Behavior

  • Default: 4.0 meters.
  • Recommendation: Set this to the effective width of your spraying boom or the "swath" of your sensor to ensure 100% coverage with no gaps or excessive overlaps.

ZIGZ_SPRAYER

Default 0
Range 0 1

ZigZag Mode Auto Sprayer (ZIGZ_SPRAYER)

Description

ZIGZ_SPRAYER automates the crop-spraying process.

When enabled, the autopilot will automatically turn on the sprayer (via a relay or PWM) as the drone begins a "Zig" or "Zag" leg, and turn it off when it reaches the end point or while it is performing a lateral step. This ensures that chemicals are only applied over the intended area and not wasted during turns.

ZIGZ_WP_DELAY

s
Default 0
Range 0 127

ZigZag Waypoint Delay (ZIGZ_WP_DELAY)

Description

ZIGZ_WP_DELAY introduces a pause at the turn-around points.

When the drone reaches point A or point B in ZigZag mode, it will wait for this many seconds before stepping sideways and continuing to the next leg. This is useful for allowing mechanical equipment (like a sprayer pump) to fully cycle or for the drone's attitude to stabilize before the next movement.

Tuning & Behavior

  • Default: 0 seconds.
  • Recommendation: Use 1 or 2 seconds if you notice the drone's "Zig" and "Zag" legs aren't perfectly parallel due to aggressive turn-around maneuvers.