Skip to content

Commit a0d968c

Browse files
committed
INAV V4 docs transcribed
1 parent 61b55ca commit a0d968c

44 files changed

Lines changed: 4723 additions & 48 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 48 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
36.6 KB
Loading
429 KB
Loading
480 KB
Loading
72.4 KB
Loading
704 KB
Loading
719 KB
Loading
42.3 KB
Loading
39.7 KB
Loading
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
title: Developer Info
3+
---
4+
5+
## Inertial position estimator (INAV)
6+
7+
Position estimator is a vital component for navigation subsystem. It takes data from all available sensors and fuses them together to figure out coordinates and velocities in the local frame of reference. All navigational decisions are made based on estimated position/velocity data.
8+
9+
It is currently desined for multirotors.
10+
11+
## Principle of operation
12+
13+
The key sensor for INAV is an accelerometer. Measured acceleration is translated from body-fixed frame to local NEU coordinates and integrated to yield velocities in North, East and Up directions. Velocity is further integrated to produce coordinates.
14+
15+
As accelerometer tend to drift, estimated velocities and coordinates tend to drift as well. This accumulated error is corrected from various reference sources - GPS, BARO, SONAR. Position estimator also maintains estimated position error for horizontal (X-Y) and vertical (Z) position.
16+
17+
When reference source is not available for some reason, estimated position error increases until it reaches a certain threshold. Beyond that threshold position is no longer updated and marked invalid until a valid reference source is available avain. This allows, for example, to fly through short (measured in seconds) GPS outages.
18+
19+
Using multiple sensors for estimation allows to filter noisy data (e.g. from barometer), interpolate between rare readings (e.g. from GPS), and immediately react on fast motion changes (using accelerometers) in the same time.
20+
21+
![Intertial Estimator Diagram](/img/content/inertial_estimator_diagram.jpg)
22+
23+
## Data soures
24+
25+
The following reference sources (with corresponding parameters for weight) are available for altitude and climb rate:
26+
27+
* Barometer - altitude (**inav_w_z_baro_p**)
28+
* Barometer - velocity (**inav_w_z_baro_v**)
29+
* Sonar - altitude (**inav_w_z_sonar_p**)
30+
* Sonar - velocity (**inav_w_z_sonar_v**)
31+
* GPS - altitude (**inav_w_z_gps_p**)
32+
* GPS - velocity (**inav_w_z_gps_v**)
33+
34+
Sonar is optional source, it's only used when available and valid data received. GPS altitude is very noisy and is limited to FIXED_WING aircraft (experimental and untested).
35+
36+
The following reference sources (with corresponding parameters for weight) are available for position and velocity:
37+
38+
* GPS - position (**inav_w_xy_gps_p**)
39+
* GPS - velocity (**inav_w_xy_gps_v**)
40+
41+
## Dead reckoning and handling sensor unavailability
42+
43+
* Enable dead reckoning (**inav_enable_dead_reckoning**)
44+
45+
* Dead reckoning - position (**inav_w_xy_dr_p**)
46+
* Dead reckoning - velocity (**inav_w_xy_dr_v**)
47+
48+
* Velocity decay rate, XY-axis (**inav_w_xy_res_v**)
49+
* Velocity decay rate, Z-axis (**inav_w_z_res_v**)
50+
51+
## Estimated position error thresholds
52+
53+
* Maximum acceptable position error (**inav_max_eph_epv**)
54+
* Position error for SONAR sensor (**inav_sonar_epv**)
55+
* Position error for BARO sensor (**inav_baro_epv**)
56+
57+
## GPS delay compensation
58+
59+
GPS data is not updated instantly. GPS module needs time to calculate new position and velocity. INAV has means of compensating for this delay. Expected GPS delay in milliseconds is controlled by **inav_gps_delay_ms** parameter. Typical value for GPS delay is 200ms.
60+
61+
62+
## Position and altitude PID controllers
63+
64+
### PID regulators in ALTHOLD mode (Z-controller)
65+
66+
ALTHOLD mode uses two PIDs - **ALT** and **VEL**. Navigation Z-controller functional diagram is shown below:
67+
68+
![Nav PIDs Diagram](/img/content/nav_althold_pids_diagram.jpg)
69+
70+
#### ALT PID
71+
Actually ALT PID parameters control two P-controllers: Position-to-Velocity and Velocity-to-Acceleration
72+
73+
* **ALT_P** - defines how fast quad will attempt to compensate for altitude error, converts altitude error to desired vertical velocity (climb rate)
74+
* **ALT_I** - not used
75+
* **ALT_D** - not used
76+
77+
#### VEL PID
78+
This PID-controller is an Acceleration-to-Throttle controller
79+
80+
* **VEL_P** - defined how much throttle quad will add/reduce to achieve desired velocity
81+
* **VEL_I** - controls compensation for hover throttle (and vertical air movement, thermals). This can be zero if hover throttle is precisely 1500us. Too much VEL I will lead to vertical oscillations, too low VEL I will cause drops or jumps when ALTHOLD is enabled, very low VEL I can result in total inability to maintain altitude
82+
* **VEL_D** - acts as a dampener for acceleration. VEL D will resist any velocity change regardless of its nature (requested by VEL P and VEL I or induced by wind).
83+
84+
### PID regulators in POSHOLD/RTH/WP modes (XY-controller)
85+
86+
XY-controller uses two PIDs - **POS** and **POSR**
87+
88+
![Nav pos hold](/img/content/nav_poshold_pids_diagram.jpg)
89+
90+
#### POS PID
91+
This is a Position-to-Velocity P-controller active in POSHOLD, RTH and WP modes
92+
93+
* **POS_P** - translates position error to desired velocity to reach the target
94+
* **POS_I** - not used
95+
* **POS_D** - not used
96+
97+
#### POSR PID
98+
Position rate PID-controller, controls Velocity-to-Acceleration
99+
100+
* **POSR_P** - controls acceleration to achieve desired velocity
101+
* **POSR_I** - controls compensation for side wind or other disturbances. In totally calm air POSR I can be close to zero
102+
* **POSR_D** - dampens response from P and I components; Tests indicate that this one can be zero at all times
103+
104+
Output of POSR PID-controller is desired acceleration which is directly translated to desired lean angles.
105+
106+
107+
108+
## Coordinate systems
109+
110+
Navigation operates in 3 different coordinate systems.
111+
112+
### LLH (Geographic) Coordinate System
113+
114+
Represents position on or above earth with a latitude, longitude and height value. Height is defined as altitude above the mean sea level.
115+
116+
![](https://upload.wikimedia.org/wikipedia/commons/6/62/Latitude_and_Longitude_of_the_Earth.svg)
117+
118+
### NEU Coordinate System
119+
120+
* The x axis is aligned with the vector to the north pole (tangent to meridians).
121+
* The y axis points to the east side (tangent to parallels)
122+
* The z axis points up from the center of the earth
123+
124+
This is a classical cartesian coordinate system where the 3 axes are orthogonal to each other.
125+
126+
![](https://upload.wikimedia.org/wikipedia/commons/7/73/ECEF_ENU_Longitude_Latitude_relationships.svg)
127+
128+
The units for the NEU coordinate system are centimetres.
129+
130+
## Frames of reference
131+
132+
### Global (geodetic) frame of reference
133+
134+
This frame of reference defines coordinates in LLH coordinate system. This frame of reference is not used directly by the code and is provided as an interface for defining waypoints and receiving reference data from GPS.
135+
136+
### Local frame of reference
137+
138+
This frame of reference defines coordinate in NEU coordinate system relative to a GPS Origin point. GPS origin is defined as a point where GPS fix with sufficient accuracy was firstly acquired. GPS Origin is usually a point of launch. Most calculations are done in this frame of reference.
139+
140+
### Body-fixed frame of reference
141+
142+
Attached to the aircraft.
143+
144+
* The x axis points in forward direction (as defined by geometry and not by movement) (roll axis)
145+
* The y axis points to the right (geometrically) (pitch axis)
146+
* The z axis points upwards (geometrically) (yaw axis)
147+
148+
This frame of reference is used to read sensor data and calculate lean angles. Usually the only operations in this frame of reference are coordinate transformations to/from local frame of reference.

0 commit comments

Comments
 (0)