My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
GpsNavigation  
An overview of the GPS navigation functionality in UAVX
Featured, GPS, UAVX, UAVXNav, UAVPSet, gke, jesolins, UAVP
Updated Apr 26, 2010 by gke3...@gmail.com

Navigation has been implemented using the 18F2620 PIC which has significantly more memory available to it. This was one of the reasons that Wolferl was not able to implement navigation for the 16F876 version of of the original quadrocopter.

Requirements

Minimum:

  • UAVP "Black" flight control board
  • Accelerometer, Compass and SMD500 Baro
  • Six channel Tx/Rx ( no Nav sensitivity adjustment or camera pitch trim available )
  • Replace 16F876 PIC with 18F2620 PIC
  • 1Hz GPS Unit capable of NMEA $GPGGA sentences at 9600baud with 4 or 5 decimal places of coordinate precision (see below).
  • The latest versions of UAVX and UAVPset (see downloads page).

Recommended substitutions/alternatives:

  • Seven Channel or more Tx/Rx
  • BMP085 Barometer with 3.3V modification
  • Accelerometer supply reduced to 3.3V
  • 5Hz GPS Unit with additional NMEA $GPRMC and $GPGSV sentences.
  • Melexis Gyros for Roll/Pitch using the analog interface but the digital option.
The current implementation only requires the $GPGGA sentence but other sentences may be included for compatibility with, for example, the EagleTree OSD Pro. The flight firmware rejects all other NMEA sentence types however their reception does place an additional load on the PIC. Sentences other than those strictly necessary should be deselected when configuring your GPS. $GPRMC may be potentially used for heading control in later versions of UAVX.

Your GPS should preferably have the ability to update at 5Hz. Lower update rates will work but not as well. If you use only $GPGGA then you may use the 5Hz update rate. If you are using $GPGGA, $GPRMC and $GPGSV set the update at 3-4Hz maximum because of the additional processing load; yes it takes processing time to throw away stuff!

GPS units produce coordinates which typically have 4 or 5 decimal places of precision; older GPS units may have only 3. UAVX can automatically read coordinates with either 4 or 5 decimal places ONLY.

  • 5 digit example: $GPGGA,113627.00,5139.83616,N,00720.65450,W ........
  • 4 digit example: $GPGGA,113627.00,03738.1360,S,14525.2502,E ........

Use your GPS logger to determine which format your GPS uses.

The ETEK and Locosys LS20031 GPS units have been used with success. Some GPS units have built in battery backup making startup faster.

UAVPset allows most hardware configurations to be set directly rather than requiring the previous multiple HEX files. There are however separate HEX files for debugging sensors and for 6 channel Rxs. The test and flight firmware are now combined.

The following Tx/Rx combinations are supported:

  • Futaba Ch3 Throttle - Aileron, Elevator, Gear, Aux2
  • Futaba Ch2 Throttle - Aileron, Rudder, Gear, Aux2
  • Futaba 9C DM8/AR7000 - Throttle, Aileron, Rudder, Aux2
  • JR XP8103/PPM - Throttle, Elevator, Gear, Aux2
  • JR 9XII DM9/AR7000 - Aileron, Rudder, Gear, Aux2
  • JR DXS12/AR7000 - Aileron, Rudder, Gear, Aux2
  • Spektrum DX7/AR7000 - Aileron, Rudder, Gear, Aux2
  • Spektrum DX7/AR6200 - Throttle, Elevator, Gear (CAUTION - not recommended for other than short range use)

With the modes:

  • Mode 1 - Left Stick Elevator and Rudder, Right Stick Throttle and Ailerons
  • Mode 2 - Left Stick Throttle and Rudder, Right Stick Elevator and Ailerons.

The important factor for Tx/Rx combinations is that the Rx servo pulses do not overlap each other in time. Although your Tx/Rx combination may not be explicitly named in the combinations above there is a reasonable chance that one of the combinations will work.

The supported Roll/Pitch Gyros are:

  • ADXRS610/300, Melexis90609
  • ADXRS613/150
  • IDG300

The Melexis Gyro is preferred.

PC/GPS Switching

The arming switch needs to be replaced by a double switch, which when arming, disconnects the PC Tx signal to the quadrocopter and connects the GPS Tx signal. When armed the UAVX software expects only valid GPS NMEA sentences. Specific details will appear under hardware related pages. See also:

http://www.rcgroups.com/forums/showpost.php?p=12843408&postcount=3297

Compass Orientation

The software expects the compass orientation to be the same as in the manual. A correction is made by the software such that a heading of zero is obtained when the forward arm points True North. The Compass may be mounted elsewhere on the aircraft as it is the orientation that is important. The orientation was not important for non-GPS versions which used changes in direction not the absolute direction. Be aware that the North arrow on the Sparkfun boards may be incorrect! The normal offset for newer compasses is 270deg but there are 90 degree (90D) hex files for the older compasses.

Functionality

Navigation uses the Gear (Ch5) and Ch7 inputs. This means that parameters can no longer be changed in flight using Ch5, and roll trim for any servo driven camera is no longer available. Signals for roll and tilt stabilisation are still generated. Ch6 is still available for camera tilt trim.

The implementation provides three principal functions:

  • Position Hold: The current position is maintained while neither the pitch nor the roll stick are moved (a threshold of about 3% applies). When either is moved away from the neutral position a new potential hold point is recorded from the GPS. Ch7 controls the overall sensitivity of position acquisition and hold. Navigation may be disabled by turning the Ch7 Tx potentiometer to minimum sensitivity (usually Anti CW). For a 6Ch Rx the sensitivity is set using UAVPSet.
  • Return to Home (RTH): If the Gear switch (Ch5) is activated the quadrocopter will attempt to return to the launch point (Origin), or more specifically, the position at which a reliable GPS signal was first acquired prior to launch. Auto-land may be selected using UAVPSet with a programmed delay before descending after reaching home.
  • Full Navigation (NAV) (Northern Summer 2010): The mid-point setting of Ch5 selects full navigation mode. Missions are entered using UAVXNav (See Wiki). Waypoints are achieved in 3D (position and altitude) and include loiter time at each waypoint. The precision with which the waypoint is to be achieved is programmable. Arrival times at the waypoint relative to launch time may be included in future releases.

CAUTION: Engaging RTH/NAV disables ALL pilot throttle control. Deactivating RTH/NAV restores throttle to whatever it is set to at the instant of deactivation. Make sure you have a throttle setting that is appropriate when you deactivate RTH/NAV. If you are close to the ground when RTH/NAV is deactivated and you have inadvertently closed the throttle the quadrocopter will fall like a brick! This caution does not apply if you have RTH/NAV altitude hold disabled.

Normally the altitude is controlled directly by the pilot with the assistance of the barometer. The barometer will attempt to maintain a hover if the throttle stick has not moved for ~3 Sec.

During GPS acquisition there will be a flashing Blue LED and a solid Red LED. Once the GPS initial location is determined the Red LED will go out and be replaced by a solid Green LED. This may take a few minutes to occur depending on the update rate of your GPS as UAVX requires around 100 valid GPS sentences with a small position error bound. The rate at which the Blue LED flashes depends on the GPS unit's update rate.

UAVPset Parameters

The new version of UAVPSet modified for use by UAVX MUST be used otherwise several additional parameters associated with Navigation will not be defined leading to possible loss of the quadrocopter. Use of the older incompatible versions of UAVPSet may appear to work but will not have done so. Some attempt is made within UAVX to detect this situation and if detected it will result in the quadrocopter failing to arm.

The important additional parameters are:

  • Radius: The closing radius in Metres around the desired GPS position. Outside this radius maximum corrective control is applied. Inside the radius proportionately less control is exerted.
  • Neutral Radius: Inside this radius the quadrocopter relies on its gyros and accelerometer to maintain level flight with some drift; no GPS corrections are made. In essence the Radius and the Neutral Radius form a flat bottom bowl shape into which the quadrcopter is guided. Without the Neutral Radius the shape is an inverted cone with the quadrocopter tending to rock around in the bottom.
  • Magnetic Variation: The number of degrees Magnetic North is East of True North for your location.
  • Wind Compensation: Increases the amount of compensation if the desired position is not being maintained.
  • Velocity Compensation: To velocity when approaching the desired position particularly with RTH.
  • RTH Altitude: The GPS altitude in Metres relative to the launch point to be maintained. The default is acquire and hold RTH Altitude when RTH is engaged. This may be disabled - see stick programming. Be aware that RTH altitude hold is disabled then the altitude will depend on the pilot or Rx failsafe stick setting.
  • RTH Altitude Proportional & Integral: PI constants for GPS based altitude hold. Not used if the altitude source selected is the Barometer.
  • Altitude Source: This checkbox selects which altitude measurement source is to be used for RTH and is either the Barometer or GPS.

CAUTION: The GPS altitude can be inaccurate depending on the satellite constellation selected/reselected in flight by the GPS unit. The Barometer may also fail if exposed to icing or water droplets which can block the sensor hole.

There are, of course, many other tuning parameters within the code which have not been brought through the UAVPSet interface!

The UAVX version of UAVPSet can read older parameter files and write them to the UAVX software on the quadrocopter. Parameters read from UAVX are not compatible with the original UAVP flight software.

Stick Based Configuration

When the quadrocopter is disarmed the Tx sticks may be used to access some paramters in the field without the use of a PC.

  • Pitch Stick: The "corners" are used with left side being parameter set 1 and right side 2. If the bottom corners are used RTH altitude hold is enabled. If the top corners are used then the Pilot controls RTH altitude. You should see the Blue LED flash and hear short beeps for the parameter set chosen followed by a slightly longer beep if RTH altitude hold is enabled.
  • Throttle Stick: Only the bottom corners are used. Bottom left disables Turn to Heading (TTH) and so the Quadrocopter uses a combination of pitch and roll to move towards the Origin; Bottom right enables TTH where the Quadrocopter turns and pitches directly towards the origin.

You will only hear beeps if the setting you have selected is different from the previous setting.

TTH is not active within the closing distance, or radius, of the Origin nor is it active when simply holding a position. The Pilot still has control of a yaw offset and thus can control the direction of camera gaze regardless of whether TTH is active or not although if it is active then there will be a small "resistance" to yaw commands.

Way Points

Way point navigation has not been implemented.

NMEA

For maximum flexibility in GPS choice we have chosen to implement the GPS interface using NMEA sentences. A reference to NMEA is at:

http://home.mira.net/~gnb/gps/nmea.html

GNU Conditions

The GNU conditions apply to this software which may be used entirely at your own risk.

Leave a comment if you have suggestions or can help out.

Comment by russell....@gmail.com, Oct 23, 2008

For GPS choice, I'd recommend the Etek EB-85a. I've used a couple of these with different OSD modules, and find them to be very sensitive, and fast. They also have dual serial channels for possible use with multiple applications (UAVP + OSD for example). Sparkfun sells an evaluation board and software that works with these, and when they're in stock, Ohararp sells the units for only $55 each- http://www.ohararp.com/products.html Rusty

Comment by project member jesol...@gmail.com, Oct 23, 2008

Rusty is correct as usual about the Etek EB-85a. It has also been remnamed as the FV-M8 Here: http://www.dpcav.com/xcart/product.php?productid=16161. It is hard to beat the $55 Oharp price, but they are currently out of stock. Cheers, Jim

Comment by project member gke3...@gmail.com, Oct 28, 2008

I think we should start with NMEA for maximum flexibility. The Processing/size overheads are manageable but probably not on the 876 PIC. I do have parsing code in C for NMEA and Trimble binary.

Comment by bdap...@gmail.com, Oct 30, 2008

For the hobby standpoint, It will fits everyone's budget if supporting NMEA protocol.

Comment by project member gke3...@gmail.com, Nov 18, 2008

So in the code I am building I propose that if the the Tx signal is lost the UAVP returns to the launch origin at an appropriate altitude (100 feet?). If the signal is not restored after some period, or if the main battery volts falls to the alarm threshold, the UAVP will land. Loss of signal may be deliberate ie Tx is turned off, or simply out of range. If Tx signal is restored then control returns to manual. Any comments welcome.

Comment by project member robomage...@gmail.com, Nov 18, 2008

I like the approach you are taking. Return to launch on signal loss is definitely better than the current "idle throttle" for 30 seconds.

Comment by project member jesol...@gmail.com, Jan 10, 2009

Greg,

Your RTB plan and implementation at 100ft sounds great. There might be a reason to adjust that altitude, but recompiling it for that would be OK if the lines that did that were clear enough for the code challenged like me...;)
Cheers, Jim

Comment by project member jesol...@gmail.com, Feb 21, 2009

Greg,

Have you taken a look at this separate GPS Nav solution based on Arduino?
Here: http://www.rcgroups.com/forums/showthread.php?t=979372 Might this be another path for UAVP GPS navigation? Cheers, Jim

Comment by obinol...@gmail.com, Nov 21, 2009

Hello, I understand how great this unit is but I am a user not a programmer or engineer. the question I have is this: who can help me build a quad with a payload capacity of 3-6 pounds? I need a brain that is ready to go with at most a GUI in windows to set the setup of the brain for flight. I am not looking to spend 5-10k but would like some help. and am willing to pay for that help from a professional/hobbyist that REALLY knows this stuff. I am a professional Heli pilot looking to get away from the gas machines for AP work and try the quad electric.

I want to fly a Canon 5d camera with a airfoil remote pan/tilt mount

obin@dv3productions.com please let me know if you know anyone in the US that can help me with this quest. :) thanks!

Comment by meena...@gmail.com, Jun 15, 2010

can anybody help me making GPS connection with ATMega32.

Comment by zap...@gmail.com, Jan 31, 2011

An note on connecting the Quadroufo GPS Module is that the Bbackup pin or the solder +ve -ve pads need to be connected underneath to get a response from the GPS.

Comment by corb...@live.com.au, Mar 6, 2011

can some one please post were to get the Requirements from? any help would be great!


Sign in to add a comment
Powered by Google Project Hosting