GPS fix lost

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
mathias_popsel
Posts: 24
Joined: Mon Dec 01, 2014 6:57 pm

GPS fix lost

Post by mathias_popsel »

hi all,

i managed to setup and fly my Multi rotor. now i want to go one step further an duse the gps rth and pos hold. when i open the gui i notice that i have the "gps fix lost" also on the map the position is not the right one...i dont get any satelite. i am using the Multiwii pro V2.3 (eosbandi code) i already tried to use another GPS, but it is the same. I think there are some issues in the arduino code. can someone help me what i am doing wrong and wich variable do i have to schange? Perhaps it is an baudrate problem?

thanks a lot!

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

Re: GPS fix lost

Post by brewski »

mathias_popsel wrote:hi all,

i managed to setup and fly my Multi rotor. now i want to go one step further an duse the gps rth and pos hold. when i open the gui i notice that i have the "gps fix lost" also on the map the position is not the right one...i dont get any satelite. i am using the Multiwii pro V2.3 (eosbandi code) i already tried to use another GPS, but it is the same. I think there are some issues in the arduino code. can someone help me what i am doing wrong and wich variable do i have to schange? Perhaps it is an baudrate problem?

thanks a lot!

Which FC & which GPS module. Also post GPS section of Config.h that you have modified.

Arakon
Posts: 196
Joined: Thu Jul 17, 2014 2:22 pm

Re: GPS fix lost

Post by Arakon »

And how long did you wait? A cold start on a GPS can require up to 30 minutes to get a fix. Also, chances are you didn't set up the GPS right, with the correct baud rates.

mathias_popsel
Posts: 24
Joined: Mon Dec 01, 2014 6:57 pm

Re: GPS fix lost

Post by mathias_popsel »

Hi,

thanks for the reply,

I use the multiwii pro V2.3 from hobbyking (the red one) with a MTK 3329 GPS: http://hobbyking.com/hobbyking/store/__ ... odule.html

I already tried this:
//#define NMEA
//#define UBLOX
//#define MTK_BINARY16
//#define MTK_BINARY19
#define INIT_MTK_GPS

Uploaded to the FC, power down wait for 5 min. and power up and then loaded next in the FC

#define NMEA
//#define UBLOX
//#define MTK_BINARY16
//#define MTK_BINARY19
//#define INIT_MTK_GPS

Hereby i post the code of the GPS.


/**************************************************************************************/
/*********************** GPS **************************/
/**************************************************************************************/

//#define GPS_SIMULATOR

/* GPS using a SERIAL port
if enabled, define here the Arduino Serial port number and the UART speed
note: only the RX PIN is used in case of NMEA mode, the GPS is not configured by multiwii
in NMEA mode the GPS must be configured to output GGA and RMC NMEA sentences (which is generally the default conf for most GPS devices)
at least 5Hz update rate. uncomment the first line to select the GPS serial port of the arduino */

#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
//#define GPS_PROMINI_SERIAL // Will Autosense if GPS is connected when ardu boots.

// avoid using 115200 baud because with 16MHz arduino the 115200 baudrate have more than 2% speed error (57600 have 0.8% error)
#define GPS_BAUD 115200

/* GPS protocol
NMEA - Standard NMEA protocol GGA, GSA and RMC sentences are needed
UBLOX - U-Blox binary protocol, use the ublox config file (u-blox-config.ublox.txt) from the source tree
MTK_BINARY16 and MTK_BINARY19 - MTK3329 chipset based GPS with DIYDrones binary firmware (v1.6 or v1.9)
With UBLOX and MTK_BINARY you don't have to use GPS_FILTERING in multiwii code !!! */


#define NMEA
//#define UBLOX
//#define MTK_BINARY16
//#define MTK_BINARY19
//#define INIT_MTK_GPS // initialize MTK GPS for using selected speed, 5Hz update rate and GGA & RMC sentence or binary settings


//**!*!*!*!*!*!*!*!*!*!* I2C GPS code is NOT finished in this version, please DON'T USE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/* I2C GPS device made with an independant arduino + GPS device
including some navigation functions
contribution from EOSBandi http://code.google.com/p/i2c-gps-nav/
You have to use at least I2CGpsNav code r33 */
//#define I2C_GPS
// If your I2C GPS board has Sonar support enabled
//#define I2C_GPS_SONAR

/* indicate a valid GPS fix with at least 5 satellites by flashing the LED - Modified by MIS - Using stable LED (YELLOW on CRIUS AIO) led work as sat number indicator
- No GPS FIX -> LED blink at speed of incoming GPS frames
- Fix and sat no. bellow 5 -> LED off
- Fix and sat no. >= 5 -> LED blinks, one blink for 5 sat, two blinks for 6 sat, three for 7 ... */
#define GPS_LED_INDICATOR

//Enables the MSP_WP command set , which is used by WinGUI for displaying an setting up navigation
#define USE_MSP_WP

// HOME position is reset at every arm, uncomment it to prohibit it (you can set home position with GyroCalibration)
//#define DONT_RESET_HOME_AT_ARM

/* GPS navigation can control the heading */

// copter faces toward the navigation point, maghold must be enabled for it
#define NAV_CONTROLS_HEADING 1 //(**)
// true - copter comes in with tail first
#define NAV_TAIL_FIRST 1 //(**)
// true - when copter arrives to home position it rotates it's head to takeoff direction
#define NAV_SET_TAKEOFF_HEADING 1 //(**)

/* Get your magnetic declination from here : http://magnetic-declination.com/
Convert the degree+minutes into decimal degree by ==> degree+minutes*(1/60)
Note the sign on declination it could be negative or positive (WEST or EAST)
Also note, that maqgnetic declination changes with time, so recheck your value every 3-6 months */
#define MAG_DECLINATION 0.37f //(**)

// Adds a forward predictive filterig to compensate gps lag. Code based on Jason Short's lead filter implementation
#define GPS_LEAD_FILTER //(**)

// add a 5 element moving average filter to GPS coordinates, helps eliminate gps noise but adds latency comment out to disable
// use it with NMEA gps only
//#define GPS_FILTERING //(**)

// if we are within this distance to a waypoint then we consider it reached (distance is in cm)
#define GPS_WP_RADIUS 100 //(**)

// Safe WP distance, do not start mission if the first wp distance is larger than this number (in meters)
// Also aborts mission if the next waypoint distance is more than this number
#define SAFE_WP_DISTANCE 500 //(**)

//Maximu allowable navigation altitude (in meters) automatic altitude control will not go above this height
#define MAX_NAV_ALTITUDE 100 //(**)

// minimum speed when approach waypoint
#define NAV_SPEED_MIN 100 // cm/sec //(**)
// maximum speed to reach between waypoints
#define NAV_SPEED_MAX 400 // cm/sec //(**)
// Slow down to zero when reaching waypoint (same as NAV_SPEED_MIN = 0)
#define NAV_SLOW_NAV 0 //(**)
// Weight factor of the crosstrack error in navigation calculations (do not touch)
#define CROSSTRACK_GAIN .4 //(**)
// Maximum allowable banking than navigation outputs
#define NAV_BANK_MAX 1000 //(**)

//Defines the RTH altitude. 0 means keep current alt during RTH (in meters)
#define RTH_ALTITUDE 15 //(**)
//Wait to reach RTH alt before start moving to home (0-no, 1-yes)
#define WAIT_FOR_RTH_ALT 1 //(**)

//Navigation engine will takeover BARO mode control
#define NAV_TAKEOVER_BARO 1 //(**)

//Throttle stick input will be ignored (only in BARO)
#define IGNORE_THROTTLE 1 //(**)

//If FENCE DISTANCE is larger than 0 then copter will switch to RTH when it farther from home
//than the defined number in meters
#define FENCE_DISTANCE 600

//This governs the descent speed during landing. 100 is equals approc 50cm/sec
#define LAND_SPEED 100

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

Re: GPS fix lost

Post by brewski »

OK you have a known bad combination of FC & GPS. Search this and RCGroups with this combo to see.
If you want to give it a try though disable NMEA & use Initialise MTK as this GPS will not work otherwise.
The Ublox 6M modules are currently selling for <$15 & have faster acquisition & higher accuracy. My quad using UBlox 6M will Pos Hold or perform Missions to within .5m with no wind.

mathias_popsel
Posts: 24
Joined: Mon Dec 01, 2014 6:57 pm

Re: GPS fix lost

Post by mathias_popsel »

So, i have to uncommented The init gps, upload The code and then comment it again and select nmea?
Can YOU post a link where to buy The ublox?
And how to make it work? I would be verry happy ;)

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

Re: GPS fix lost

Post by brewski »

mathias_popsel wrote:So, i have to uncommented The init gps, upload The code and then comment it again and select nmea?
Can YOU post a link where to buy The ublox?
And how to make it work? I would be verry happy ;)

Just use the Init MTK command. This sets module up for correct parameters every time FC boots. I don't think you need to set anything else besides Port number & Baud rate.
The UBlox module http://www.ebay.com.au/itm/APM-2-6-GPS- ... 2ed3f2abb0
These also have an external Mag. On my Crius AIOP V2 you just cut provided links to disable onboard Mag, but on HK board you need to cut the SDA/SLC lines to 5883 Mag or remove chip entirely. Search RC Groups for details. There is also some info on setting up Ext Mag on this MWForum.

To set up UBlox 6M (assuming it comes pre set to 38400) do the following in Config.h.
**************************************************************************************/
/*********************** GPS **************************/
/**************************************************************************************/

//#define GPS_SIMULATOR

/* GPS using a SERIAL port
if enabled, define here the Arduino Serial port number and the UART speed
note: only the RX PIN is used in case of NMEA mode, the GPS is not configured by multiwii
in NMEA mode the GPS must be configured to output GGA and RMC NMEA sentences (which is generally the default conf for most GPS devices)
at least 5Hz update rate. uncomment the first line to select the GPS serial port of the arduino */

#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
//#define GPS_PROMINI_SERIAL // Will Autosense if GPS is connected when ardu boots.

// avoid using 115200 baud because with 16MHz arduino the 115200 baudrate have more than 2% speed error (57600 have 0.8% error)
#define GPS_BAUD 38400

/* GPS protocol
NMEA - Standard NMEA protocol GGA, GSA and RMC sentences are needed
UBLOX - U-Blox binary protocol, use the ublox config file (u-blox-config.ublox.txt) from the source tree
MTK_BINARY16 and MTK_BINARY19 - MTK3329 chipset based GPS with DIYDrones binary firmware (v1.6 or v1.9)
With UBLOX and MTK_BINARY you don't have to use GPS_FILTERING in multiwii code !!! */


//#define NMEA
#define UBLOX
//#define MTK_BINARY16
//#define MTK_BINARY19
//#define INIT_MTK_GPS // initialize MTK GPS for using selected speed, 5Hz update rate and GGA & RMC sentence or binary settings


//**!*!*!*!*!*!*!*!*!*!* I2C GPS code is NOT finished in this version, please DON'T USE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/* I2C GPS device made with an independant arduino + GPS device
including some navigation functions
contribution from EOSBandi http://code.google.com/p/i2c-gps-nav/
You have to use at least I2CGpsNav code r33 */
//#define I2C_GPS
// If your I2C GPS board has Sonar support enabled
//#define I2C_GPS_SONAR

/* indicate a valid GPS fix with at least 5 satellites by flashing the LED - Modified by MIS - Using stable LED (YELLOW on CRIUS AIO) led work as sat number indicator
- No GPS FIX -> LED blink at speed of incoming GPS frames
- Fix and sat no. bellow 5 -> LED off
- Fix and sat no. >= 5 -> LED blinks, one blink for 5 sat, two blinks for 6 sat, three for 7 ... */
#define GPS_LED_INDICATOR

//Enables the MSP_WP command set , which is used by WinGUI for displaying an setting up navigation
#define USE_MSP_WP

mathias_popsel
Posts: 24
Joined: Mon Dec 01, 2014 6:57 pm

Re: GPS fix lost

Post by mathias_popsel »

Why Should i use an external mag? Is it better?
What About this one?
http://www.hobbyking.com/hobbyking/stor ... uracy.html

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

Re: GPS fix lost

Post by brewski »

The LEA-6H is only same accuracy as 6M unless you live in Europe or Nth USA. An Ext Mag can be positioned away from magnetic fields, but the onboard Mag is not easy to disable on HK FC. Search this & RCGroups for details.

mathias_popsel
Posts: 24
Joined: Mon Dec 01, 2014 6:57 pm

Re: GPS fix lost

Post by mathias_popsel »

Well i live in europe, is it a good choice then? Or Will The accuraty be bad?

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

Re: GPS fix lost

Post by brewski »

If you look on UBlox site you will see that all 6 series are now discontinued. I have seen the UBlox 7 series going for less than the LEA6 & 7 series has faster acquisition & higher accuracy.

Post Reply