/GPS |
The NG GPS Support
Contents
Introduction
The NG supports all sorts of different GPS receivers. Any 3.3V powered GPS receiver supporting the NMEA protocoll, a serial port and 4-5Hz or more update rate should do.
Proven GPS Modules
Venus GPS with SMA Connector
The Sparkfun Venus GPS is used by several NG developers.
The module can be configured to an amazingly powerful 10Hz update rate, with 14 channel tracking! 28mA operating current, and high sensitivity, this receiver seriously opens new doors for tracking. Module outputs the standard NMEA-0183 or SkyTraq Binary sentences at a default rate of 9600bps (adjustable to 115200bps).
Venus GPS Logger with SMA Connector
The Sparkfun Venus GPS Logger is similar to the above Venus GPS but contains als a 2MB storage for GPS Logging capabilities. It's also used by several NG developers.
The module can be configured to an amazingly powerful 10Hz update rate, with 14 channel tracking! 28mA operating current, and high sensitivity, this receiver seriously opens new doors for tracking. Module outputs the standard NMEA-0183 or SkyTraq Binary sentences at a default rate of 9600bps (adjustable to 115200bps).
Cabeling
How to connect your GPS
The GPS gets connected to the serial port of the SB-Controller using the Molex connector on the NG sensor board.
Configuring your GPS for the NG
Configuring a Sparkfun Venus GPS Logger Module
Start the GPS Viewer Software under Windows and connect to the COM port where you Venus GPS is attached.
Go to the Binary-Menu of the GPS Viewer Software. There configure the following:
- Baudrate: 115200
- AGPS: enabled
- WAAS: enabled
- NMEA Messages needed: GGA, GSA, RMC
- Update rate: 10Hz
Make sure that you kicl on the AGPS Download menu point in the AGPS menu which will download the current ephemeris data using FTP and then flash it to your Venus GPS.
Configuring GPS support on the NG
How to configure the baud rate
You can configure the baud rate on the SB-Controller using it's shell.
Note: The SB-Controller is a 3.3V device!
Checking and setting the SB-Controller terminal baud rate:
UAVP-NG, SB-Controller, Version 0.60, Revision r4827 Use 'help' to show a list of commands # set HW.uart.baud 115200 Setting integer 'HW.uart.baud' to '115200' # show globals Current global configuration: HW.uart.baud 115200 UART baudrate ...
How to configure the global settings
Make sure you activate the hardware data aquisition drivers in the global parameters. To do GPS navigation you will need to activate NGPP, GPS and the Compass as it has been done it the following settings:
# set HW.use.ngpp yes Setting boolean 'HW.use.ngpp' to '1' # set HW.use.gps yes Setting boolean 'HW.use.gps' to '1' # set HW.use.compass yes Setting boolean 'HW.use.compass' to '1' # show globals Current global configuration: Name DCM-TR3530 Configuration name ... HW.use.sound inverted HW do use sound device HW.use.acc yes HW do use accelerometer HW.use.baro yes HW do use barometer HW.use.ngpp yes HW do use NG peripherial protocol (NGPP) HW.use.gps yes HW do use Global Positioning System (needs NGPP) HW.use.compass yes HW do use compass (needs NGPP) ...
The above will make sure, your NG will fetch the necessary data from the attached peripherial CPUs and provide them to the NG controllers.
How to configure the controller settings
To get a controller to use the compass and GPS data in it's closed-loop, you also have to activate their usage in the controller dependent parameters:
# set CTRL.use.compass yes Setting boolean 'CTRL.use.compass' to '1' # set CTRL.use.gps yes Setting boolean 'CTRL.use.gps' to '1' # show conf Current system configuration: Controller amir-ng Closed-loop controller ... CTRL.use.acc yes CTRL do use accelerometer CTRL.use.baro yes CTRL do use baro CTRL.use.compass yes CTRL do use compass (needs NGPP) CTRL.use.gps yes CTRL do use GPS (needs NGPP) ...
How to check the GPS gets recognized
When the GPS gets recognized by your NG it will create a device table entry for it. You can check if the GPS got recognized like this:
# show devices Detected devices: Addr Bus Description 0x16 I2C0 Atmel 644P RC/Comm Controller 0x18 I2C0 Atmel 328P SB Controller 0x02 ADC12 ADXR/MLX MEMS Gyroscope 12bit (nick) 0x01 ADC12 ADXR/MLX MEMS Gyroscope 12bit (roll) 0x00 ADC12 ADXR/MLX MEMS Gyroscope 12bit (yaw) 0x00 SPI0 LIS3LV02DQ 3-Axis Accelerometer 0x02 SPI0 ADS1255 24bit Analog Digital Converter 0x03 SPI0 AD7924 12bit Analog Digital Converter 0x00 SBCTRL MicroMag 3 Magnetic Compass (calibrated) 0x02 SBCTRL NMEA Global Positioning System
How to configure behaviors rules GPS
There are several behavior actions related to GPS navigation:
- nav.position.hold(on/off)
- nav.coming.home(on/off)
- nav.store.target()
- nav.set.target(lat,lon)
Elementary behavior configuration for position hold (PH) consists of two simple behavior rules to activate and deactivate position hold when (for example) pot2 gets triggered:
# list behaviors List of currently defined behaviors: No Condition Action ... 14 when.rc.pot.binary(2,0) => nav.position.hold(off) 15 when.rc.pot.binary(2,1) => nav.position.hold(on) ...
Checking GPS data
How to check your NG's current position
You can check your NG's current position with the print position command:
# print position GPS Status: valid Satellites: 10 Time: 18:45:00.600 Date: 17-09-2010 Latitude: 47.3614387 degree Longitude: 8.600522 degree Altitude: 620.9000244 meters Speed: 10 cm/s
How to check your NG's current date and time
You can check your NG's date and time, received by GPS with the print time and print date commands:
# print time 18:45:54.200 # print date 17-09-2010
Checking navigation
How to check the current navigation calculation
You can check the current GPS navigation calculation with the command show nav in a GPS-enabled controller. For this to work, your NG has to be flying (so you need to fly or start a simulation) and you need to activate position hold (PH) using a behavior rule.
# show nav Navigation: Flight state: GPS position hold Kalman Position lon: -4.09 [m] (fused guess) Kalman Position lat: -2.43 [m] (fused guess) Current target position lon: 0.00 [m] Current target position lat: 0.00 [m] Current target curse lon: 4.09 [m] Current target curse lat: 2.43 [m] Current copter heading Y_mag: 129.9 [deg] (compass) Current copter heading Y_n: 130.0 [deg] (compass) Navigation target deviation angle: 19.6 [deg] Navigation target distance: 4.8 [m] Navigation nick stick override navN: 224 [angle] 2.5 [deg] Navigation roll stick override navR: -82 [angle] -0.9 [deg]
Using GPS in-flight
How to use GPS Position Hold (PH)
To use position hold (PH) in-flight you need to configure behavior rules the activate it, as described above.
When you switch on PH using the behavior action nav.position.hold(on) your NG will store it's current position as target position, will start doing navigational calculations and it will begin to influence your sticks. The command show nav will display this calculation and it's results.
How to use GPS Coming Home (CH)
Your NG stores it's home position when it starts. You can use coming home (CH) to make your NG fly back to it's start position.
When you switch on CM using the behavior action nav.coming.home(on) your NG will set the home position as target position, will start doing navigational calculations and it will begin to influence your sticks. The command show nav will display this calculation and it's results.
How to use GPS Waypoint Navigation (WN)
TODO


