INAV Ground Station Navigation Features
The navigation system of INAV ground station is primarily used to assist pilots in performing advanced flight functions such as altitude hold, position hover, automatic return to home (RTH), and waypoint flight. This system combines inputs from GPS, barometer, gyroscope, and other sensors to provide stable and reliable navigation control capabilities for fixed-wing, multirotor, VTOL, and other aircraft.
1. NAV ALT HOLD Mode (Altitude Hold)
In INAV, the Altitude Hold mode allows the aircraft to automatically maintain its current altitude, with the pilot controlling vertical speed (climb/descent rate) through throttle input.
1.1 Working Principle
Height source: The system automatically selects the best height sensor, including:
- Barometer
- GPS
- Rangefinder
Throttle stick control logic:
- Throttle up → Aircraft climbs
- Throttle down → Aircraft descends
- Throttle centered → Aircraft maintains current altitude
1.2 CLI Parameter Explanation
- nav_use_midthr_for_althold: Defines the behavior of the "throttle mid" height reference point
- 0: Records current throttle position as mid when enabling ALT HOLD (recommended setting, more natural flight)
- 1: Forces 50% throttle to be mid
1.3 Related PID Parameters
Performance in Altitude Hold mode is controlled by the following two PID groups:
ALT PID (altitude loop): Converts the error between "target height" and "current height" into desired vertical speed
- P: Adjusts height error → speed response
- I: Adjusts speed error → acceleration response
VEL PID (speed loop): Adjusts throttle output based on vertical acceleration error to achieve fine control
2. NAV POSHOLD Mode (Position Hold)
Position Hold mode is an advanced navigation feature provided by INAV, mainly used for automatic hovering of multirotor aircraft, maintaining position at GPS coordinates and automatically maintaining heading.
Required Sensors
- Required: GPS for obtaining and maintaining geographic coordinates, accelerometer, compass/magnetometer
- For multirotors: Barometer is mandatory unless the use_gps_no_baro option is enabled
Important
Note: The compass must be calibrated before enabling POSHOLD or RTH mode, otherwise the flight mode will be locked.
Mode Behavior
- After activating POSHOLD, the flight controller will attempt to keep the aircraft hovering stationary at the current GPS coordinates.
- From INAV 2.0, POSHOLD is full 3D position hold, including vertical altitude maintenance.
- Heading Hold is automatically activated after startup without manual intervention.
2.1 CLI Parameter Control
nav_user_control_mode: Controls how the stick responds in POSHOLD mode
0 (GPS_ATTI mode):
- Right stick controls aircraft attitude (tilt angle)
- Releasing the stick records a new position and hovers
1 (GPS_CRUISE mode):
- Right stick controls speed (not attitude)
- The flight controller automatically calculates attitude based on speed to maintain smooth control
2.2 Related PID Parameters
- POS PID (position loop): Converts position error into desired speed, using only P term
- POSR PID (speed loop): Converts speed error into desired acceleration for smoother control
3. NAV RTH Return Home Mode
The "Home" point in RTH mode is the position where the aircraft was first armed (ARM). However, this position can be offset or replaced through:
- CLI parameters: nav_rth_home_offset_distance, nav_rth_home_offset_direction
- Dynamic override using SafeHome functionality
Sensor Requirements
To properly execute RTH, support from the following sensors is required: accelerometer, GPS, compass
- For multirotors, a barometer is mandatory, otherwise altitude hold flight cannot be maintained
Mode Behavior
- After activating RTH, the flight controller will navigate the aircraft back to the Home point
- Maintains a specific altitude during the return
- Upon reaching Home point: Multirotors will automatically land; fixed-wing can be set to automatically loiter or attempt auto-landing depending on configuration
Altitude Control Logic (6 modes)
Determined by CLI parameters nav_rth_alt_mode and nav_rth_altitude:
| Mode | Name | Behavior Description |
|---|---|---|
| 0 | NAV_RTH_NO_ALT | Maintains current altitude throughout (ignores nav_rth_altitude) |
| 1 | NAV_RTH_EXTRA_ALT | Climbs a certain height from current position before returning, height = current height + nav_rth_altitude |
| 2 | NAV_RTH_CONST_ALT | Climbs/descends to fixed altitude before returning, target height = nav_rth_altitude (relative to Home point) |
| 3 | NAV_RTH_MAX_ALT | Climbs to maximum recorded altitude before returning (ignores nav_rth_altitude) |
| 4 | NAV_RTH_AT_LEAST_ALT | Similar to mode 2, but only allows ascending, not descending |
| 5 | NAV_RTH_AT_LEAST_ALT_LINEAR_DESCENT | Same as mode 4, but if above return altitude, will gradually descend to target altitude during return to save energy and achieve smooth approach to Home point |
4. NAV WP - Waypoint Mode
NAV WP mode allows the aircraft to automatically execute a series of route tasks including position hover, return home, landing, etc., based on preset waypoints in the flight controller, suitable for mission-based flight on fixed-wing, multirotor, and other platforms.
4.1 CLI Command Introduction
| Command | Function |
|---|---|
| wp | Lists all waypoints currently loaded in the flight controller |
| wp load | Loads waypoint data from EEPROM to the flight controller |
| wp <n> <action> <lat> <lon> <alt> <p1> <p2> <p3> <flag> | Configures parameters for the nth waypoint |
| wp save | Saves current waypoint list to EEPROM (also saves all current CLI configurations) |
| wp reset | Clears waypoint list (sets count to 0, but doesn't delete waypoint definitions) |
Parameter Meanings for wp <n> <action> <lat> <lon> <alt> <p1> <p2> <p3> <flag>
| Parameter | Description |
|---|---|
| <n> | Waypoint number (starting from 0) |
| <action> | Waypoint behavior (detailed explanation below) |
| <lat> | Latitude (WGS84, in degrees, e.g., 12.3456789° → input 123456789) |
| <lon> | Longitude (same as above) |
| <alt> | Altitude (in cm), whether it's relative altitude is determined by Bit 0 of <p3> |
| <p1> | Specific meaning depends on <action> type, such as hover time, speed, jump index, etc. |
| <p2> | Auxiliary parameter, varies by action type (e.g., jump count, flight speed) |
| <p3> | Bit field definition, controls height reference, user-defined behaviors, etc. (detailed below) |
| <flag> | Last waypoint must be set to 165 (0xA5) to indicate end marker |
<action>Type Definitions (since INAV 2.6)
| Value | Action Type | Description |
|---|---|---|
| 0 | UNUSED | Unused |
| 1 | WAYPOINT | Normal navigation point |
| 3 | POSHOLD_TIME | Hover for specified time (multirotor) |
| 4 | RTH | Return to home |
| 5 | SET_POI | Set point of interest |
| 6 | JUMP | Jump to specified waypoint (supports looping) |
| 7 | SET_HEAD | Set heading angle |
| 8 | LAND | Land |
<p3>Bit Field Explanation
| Bit | Meaning |
|---|---|
| Bit 0 | Height reference: 0 = relative altitude (relative to takeoff point), 1 = absolute altitude (AMSL) |
| Bit 1-4 | User-defined waypoint behavior (reserved bits for logical condition triggers) |
| Bit 5-15 | Reserved, currently unused |
V. INAV Multi-mission Function Description
INAV supports up to 9 independent mission routes (Multi-mission) simultaneously stored in the flight controller. Users can input each task through CLI commands, and finally save them as a multi-mission collection with a single wp save command.
Configuration steps are as follows:
- Each mission must start with waypoint number 0.
- Each mission can be input to CLI as a separate block; just input them sequentially, no need to save each one individually.
- After all missions are input, execute the command: wp save. All missions will be merged and saved to the flight controller.
Example (three missions):
Mission 1 (3 waypoints)
wp 0 1 545722109 -32869291 5000 0 0 0 0
wp 1 1 545708178 -32642698 5000 0 0 0 0
wp 2 1 545698227 -32385206 5000 0 0 0 165Mission 2 (6 waypoints)
wp 0 1 545599696 -32958555 5000 0 0 0 0
wp 1 1 545537978 -32958555 5000 0 0 0 0
wp 2 1 545547933 -32864141 5000 0 0 0 0
wp 3 1 545597705 -32695913 5000 0 0 0 0
wp 4 1 545552910 -32598066 5000 0 0 0 0
wp 5 6 0 0 0 0 0 0 165 # 跳转动作(JUMP),指向任务逻辑中的另一航点Mission 3 (1 waypoint)
wp 0 1 545714148 -32501936 5000 0 0 0 165Save Command
wp save————This article is cited from the INAV official website: https://github.com/iNavFlight/inav/blob/master/docs/Navigation.md