Fix release of MSP port when MSP and MSP telemetry are used on the same
[betaflight.git] / docs / Gps.md
blob77acd83ddbf3db0a53c8082782eafeeefa329940
1 # GPS
3 Two GPS protocols are supported. NMEA text and UBLOX binary.
5 ## Configuration
7 Enable the GPS from the CLI as follows:
9 1. configure a serial port to use for GPS.
10 1. set your GPS baud rate
11 1. enable the `feature GPS`
12 1. set the `gps_provider`
13 1. connect your GPS to the serial port configured for GPS.
14 1. save and reboot.
16 Note:  GPS packet loss has been observed at 115200.  Try using 57600 if you experience this.
18 For the connections step check the Board documentation for pins and port numbers.
20 ### GPS Provider
22 Set the `gps_provider` appropriately.
24 | Value | Meaning  |
25 | ----- | -------- |
26 | 0     | NMEA     |
27 | 1     | UBLOX    |
29 ### GPS Auto configuration
31 When using UBLOX it is a good idea to use GPS auto configuration so your FC gets the GPS messages it needs.
33 Enable GPS auto configuration as follows `set gps_auto_config=1`.
35 If you are not using GPS auto configuration then ensure your GPS receiver sends out the correct messages at the right frequency.  See below for manual UBlox settings.
37 ### SBAS
39 When using a UBLOX GPS the SBAS mode can be configured using `gps_sbas_mode`.
41 The default is AUTO.
43 | Value | Meaning  | Region        |
44 | ----- | -------- | ------------- |
45 | 0     | AUTO     | Global        |
46 | 1     | EGNOS    | Europe        |
47 | 2     | WAAS     | North America |
48 | 3     | MSAS     | Asia          |
49 | 4     | GAGAN    | India         |
51 If you use a regional specific setting you may achieve a faster GPS lock than using AUTO.
53 This setting only works when `gps_auto_config=1`
55 ## GPS Receiver Configuration
57 UBlox GPS units can either be configured using the FC or manually.
59 ### UBlox GPS manual configuration
61 Use UBox U-Center and connect your GPS to your computer.  The CLI `gpspassthrough` command may be of use if you do not have a spare USART to USB adapter.
63 Display the Packet Console (so you can see what messages your receiver is sending to your computer).
65 Display the Configation View.
67 Navigate to CFG (Configuration)
69 Select `Revert to default configuration`.
70 Click `Send`.
72 At this point you might need to disconnect and reconnect at the default baudrate - probably 9600 baud.
74 Navigate to PRT (Ports)
76 Set `Target` to `1 - Uart 1`
77 Set `Protocol In` to `0+1+2`
78 Set `Protocol Out` to `0+1`
79 Set `Buadrate` to `57600` `115200`
80 Press `Send`
82 This will immediatly "break" communication to the GPS. Since you haven't saved the new baudrate setting to the non-volatile memory you need to change the baudrate you communicate to the GPS without resetting the GPS. So `Disconnect`, Change baud rate to match, then `Connect`. 
84 Click on `PRT` in the Configuration view again and inspect the packet console to make sure messages are being sent and acknowledged.
86 Next, to ensure the FC doesn't waste time processing unneeded messages, click on `MSG` and enable the following on UART1 alone with a rate of 1. When changing message target and rates remember to click `Send` after changing each message.:
88     NAV-POSLLH
89     NAV-DOP
90     NAV-SOL
91     NAV-VELNED
92     NAV-TIMEUTC
94 Enable the following on UART1 with a rate of 5, to reduce bandwidth and load on the FC.
96     NAV-SVINFO
98 All other message types should be disabled.
100 Next change the global update rate, click `Rate (Rates)` in the Configuration view.
102 Set `Measurement period` to `100` ms.
103 Set `Navigation rate` to `1`.
104 Click `Send`.
106 This will cause the GPS receive to send the require messages out 10 times a second.  If your GPS receiver cannot be set to use `100`ms try `200`ms (5hz) - this is less precise.
108 Next change the mode, click `NAV5 (Navigation 5)` in the Configuration View.
110 Set to `Dynamic Model` to `Pedestrian` and click `Send`.
112 Next change the SBAS settings.  Click `SBAS (SBAS Settings)` in the Configuration View.
114 Set `Subsystem` to `Enabled`.
115 Set `PRN Codes` to `Auto-Scan`.
116 Click `Send`.
118 Finally, we need to save the configuration.
120 Click `CFG (Configuration` in the Configuration View.
122 Select `Save current configuration` and click `Send`.
124 ### UBlox Navigation model
126 Cleanflight will use `Pedestrian` when gps auto config is used.
128 From the UBlox documentation:
130 * Pedestrian - Applications with low acceleration and speed, e.g. how a pedestrian would move. Low acceleration assumed. MAX Altitude [m]: 9000, MAX Velocity [m/s]: 30, MAX Vertical, Velocity [m/s]: 20, Sanity check type: Altitude and Velocity, Max Position Deviation: Small.
131 * Portable - Applications with low acceleration, e.g. portable devices. Suitable for most situations. MAX Altitude [m]: 12000, MAX Velocity [m/s]: 310, MAX Vertical Velocity [m/s]: 50, Sanity check type: Altitude and Velocity, Max Position Deviation: Medium.
132 * Airborne < 1G - Used for applications with a higher dynamic range and vertical acceleration than a passenger car. No 2D position fixes supported. MAX Altitude [m]: 50000, MAX Velocity [m/s]: 100, MAX Vertical Velocity [m/s]: 100, Sanity check type: Altitude, Max Position Deviation: Large
134 ## Hardware
136 There are many GPS receivers available on the market, people have reported success with the following receivers:
138 Ublox Neo-7M GPS with Compass and Pedestal Mount
139 http://www.hobbyking.com/hobbyking/store/__55558__Ublox_Neo_7M_GPS_with_Compass_and_Pedestal_Mount.html
141 RY825AI 18Hz UART USB interface GPS Glonass BeiDou QZSS antenna module flash
142 http://www.ebay.com/itm/RY825AI-18Hz-UART-USB-interface-GPS-Glonass-BeiDou-QZSS-antenna-module-flash/181566850426