GPS integration

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Vladimir_VVV
Posts: 1
Joined: Mon Oct 01, 2012 10:37 pm

Re: GPS integration

Post by Vladimir_VVV »

Jonit wrote:EOSBandi thank you for fixing that 2km error in serial code, I'll test it as soon as possible! :D

EDIT: hmm... just loaded new dev_20120622 into my FC and I am still getting that 2km error :? what am I doing wrong? PS: (I have TinyGPS)

Jonit

GPS.ino have an error.
need to change a fractions order, and 'divisor' size:
GPS.ino: Line>502

Code: Select all

#if defined (TINY_GPS)
  int32_t GPS_coord_to_decimal(struct coord *c) {
  #define GPS_SCALE_FACTOR 10000000L
  uint32_t deg = 0;
  deg = (uint32_t)c->deg * GPS_SCALE_FACTOR;

  uint32_t min = 0;
  min = (uint32_t)c->min * GPS_SCALE_FACTOR;
  /* add up the BCD fractions */
  uint32_t divisor = (uint32_t)GPS_SCALE_FACTOR/10; // prev. uint16_t divisor = (uint16_t)GPS_SCALE_FACTOR/10;
  for (uint8_t i=0; i<NMEA_MINUTE_FRACTS; i++) {
    uint8_t b = c->frac[i/2];
    uint8_t n = (i%2 == 0 ? b&0x0F : b>>4);// prev. uint8_t n = (i%2 ? b&0x0F : b>>4); or just swap : uint8_t n = (i%2 ? b>>4 : b&0x0F);
    min += n*(divisor);
    divisor /= 10;
  }
  /* now sum up degrees and minutes */
  return deg + min/60;
}
#endif

Now +-2m :D

jy0933
Posts: 180
Joined: Wed Jun 27, 2012 4:24 pm

Re: GPS integration

Post by jy0933 »

i was reading the changes in the dev code.. since ublox6 all support 10hz refresh rate.. why dont init-config to 10hz ...but rather 5hz?

and also the gps speed filter that eliminate random glitch(sunnden pos to 100m away and back to right pos)?

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: GPS integration

Post by Mis »

jy0933 wrote:i was reading the changes in the dev code.. since ublox6 all support 10hz refresh rate.. why dont init-config to 10hz ...but rather 5hz?

Because in this case MORE Hz is not EQUAL to BETTER. It was written about it about 100 times. GPS have worst precision at 10Hz.

el_nono
Posts: 2
Joined: Wed Sep 28, 2011 2:39 pm

Re: GPS integration

Post by el_nono »

Hello Friends, I have a problem

I have the 2.1 with i2C_GPS multiwii interface (http://code.google.com/p/i2c-gps-nav/)
The problem is that the direction of Home, shows 180 ° opposite. Actual multiwii config. And flying the aircraft flies to the opposite side.
The magentometro I use is the HMC5883, North magentico is reported correctly by the.

Any idea how to reverse course?

regards

El Nono

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: GPS integration

Post by pm1 »

Mis wrote:Because in this case MORE Hz is not EQUAL to BETTER. It was written about it about 100 times. GPS have worst precision at 10Hz.


Where does this wisdom come from? Is it because MTK GPSs cannot use WAAS/Egnos at 10 Hz? The precision is a don't care for me. I do not want to make geographical measurements. Consecutive measurements have to be consistent and reflect the movements of the copter. For ublox GPS with 10 Hz this works absolutely fine.

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: GPS integration

Post by crashlander »

pm1 wrote:
Mis wrote:Because in this case MORE Hz is not EQUAL to BETTER. It was written about it about 100 times. GPS have worst precision at 10Hz.


Where does this wisdom come from? Is it because MTK GPSs cannot use WAAS/Egnos at 10 Hz? The precision is a don't care for me. I do not want to make geographical measurements. Consecutive measurements have to be consistent and reflect the movements of the copter. For ublox GPS with 10 Hz this works absolutely fine.

Neo6 is 5Hz by spec. so 10Hz is just some more noise. :)
And when using UBLOX binary protocol you get much better resolution (not precision) and you do not need GPS_FILTERING so you get true 5Hz and not filtered 2Hz (from 10Hz)...
EOSBandi explained that stuff many pages back....

jy0933
Posts: 180
Joined: Wed Jun 27, 2012 4:24 pm

Re: GPS integration

Post by jy0933 »

this is what i found from ublox spec

ublox.PNG


seems 6M only got 1hz?!

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: GPS integration

Post by Mis »

Look at this more precise.
NEO6M have 5Hz update rate. NEO6P and V have only 1Hz.

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: GPS integration

Post by pm1 »

Ok, I checked that again. It delivers data at 10 Hz..., it isn't less precise... it doesn't produce more noise..., it simply delivers same data twice ;) .....

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS integration

Post by dramida »

I found an European good source of GPS and fpv related gadgets here http://www.mr-lee-catcam.de/pe_cc_o3_en.htm

EmmeDi8
Posts: 18
Joined: Thu Sep 06, 2012 5:15 pm

Re: GPS integration

Post by EmmeDi8 »

Hi,

Tomorrow, finally, I will try my new app.

https://play.google.com/store/apps/deta ... HRpd2lpIl0.

I made it to understand how the feedback of PID act on commands.
Obviously pid parameters that are inserted in the apps are not automatically activated in i2c_gps_nav or multiwwi, these should be entered manually on form i2c_nav_gps or multiwii.
Is a simulation that uses the NMEA senteze provided in real time by GPS. For now, the simulation is only active for the pos hold.

cswiger
Posts: 12
Joined: Wed Jun 20, 2012 11:43 pm

Re: GPS integration

Post by cswiger »

Ok, finally got some time and a new ftdi board (the ckdevices one for easy rx/tx crossover) - my goal is to get binary gps data running instead of nmea to get rid of the twitching during gps hold and rth. I've uploaded the mtk 3329 with MTK3329_A1.5E_20110118_10Hz_115200.bin and using the stock I2C_GPS_NAV with MTK set but when snooping the gps module output (in crossover) it still prints lines like:

$GPRMC,004526.900,A,3820.8585,N,08140.6991,W,57.03,318.26,071012,,,A*49

with the twitchy .0001 minute resolution. I thought it should be setting it to binary:

#if defined(MTK)
/* Using the AXN 1.51 firmware which defaults at 1Hz/38400 but supports binary protocol
* First connect to it with 38400, then set the speed to 115200
* and set the update rate to 10Hz
* and finally switch to Binary mode
*/

cswiger
Posts: 12
Joined: Wed Jun 20, 2012 11:43 pm

Re: GPS integration

Post by cswiger »

Oh, think I got it - had to update the mtk3329 on the Navigatron to the latest and greatest v1.6 ( http://code.google.com/p/ardupilot/wiki/MediaTek ) and NOW the setup part of I2C_GPS_NAV works - at least when copy/pasting the command into realterm ( http://diydrones.com/profiles/blogs/usi ... s-gps-with ) - it starts out in 38400, switches to 115200, switching to binary then sets update rate to 10HZ, at least in realterm - real world test coming soon. Hopefully the low res nmea sentence twitching will end now.

#if defined(MTK)
/* Using the AXN 1.51 firmware which defaults at 1Hz/38400 but supports binary protocol
* First connect to it with 38400, then set the speed to 115200
* and set the update rate to 10Hz
* and finally switch to Binary mode
*/

Serial.begin(38400);
delay(1500); //let it init
Serial.write("$PMTK251,115200*1F\r\n"); // set 115200 baud
delay(300);
Serial.end();

Serial.begin(115200);
Serial.write("$PGCMD,16,0,0,0,0,0*6A\r\n"); // binary
delay(1000);
Serial.write("$PGCMD,16,0,0,0,0,0*6A\r\n"); // twice ??
delay(300);
Serial.write("$PMTK220,100*2F\r\n"); // 10Hz update

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

So I read many articles in this thread but cant decide what GPS is the best one.

I ordered MediaTek MT3329 GPS 10Hz + Adapter Basic Compatible with Remzibi's OSD(Poor Man's OSD) http://www.goodluckbuy.com/mediatek-mt3 ... -osd-.html but it didnt arrive for long time so I going to look for new one.

MTK3339 with batt https://www.adafruit.com/products/746
MTK3329 with batt http://www.goodluckbuy.com/mediatek-mt3 ... -osd-.html
CN-06 GPS Receiver V2.0 u-blox NEO-6M GPS module http://rctimer.com/index.php?gOo=goods_ ... oductname=

Adafruit Ultimate GPS Breakout - 66 channel w/10 Hz updates - Version 3 looks nice because have possibility connect external antenna like CM-06.
or some other good?

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: GPS integration

Post by shikra »

I use this one. Just plug into board and go. No messing with programming as its all done.
http://www.multiwiicopter.com/products/ ... iwiicopter


I also did my own serial version initially, works but I think I2C based GPS is better on these 8 bit 16mhz processors. And it was a pain to set up!

Had some fun on the weekend flying the copter to end of the field. As far as I dare put into PH to get it stable. Drop it down a little then activate RTH.
See how low I could get it to come back without hitting the cows. LOL
It flies real slow in RTH...

I'll do some vid next time. It did look pretty cool.



Heres an earlier test vid with the GPS linked above. Holds position pretty well.


http://www.youtube.com/watch?v=PwntTHftI6Q

Termic1
Posts: 40
Joined: Tue Aug 21, 2012 11:14 am

GPS integration

Post by Termic1 »

shikra wrote:It flies real slow in RTH...


yes... with default settings rth is too slow (3m/s) It is OK only for tests.

In gps.ino you can raise rth speed

Now I'm using 5m/s and I feel more confortable...

Luciano

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: GPS integration

Post by shikra »

Thanks - I probably will increase.
Its the first time I used it for a RTH of more than a few meters- maybe 150m. I3 is great for testing but in real life i think 5-7 would be good as you say
It worked real well though.

Termic1
Posts: 40
Joined: Tue Aug 21, 2012 11:14 am

GPS integration

Post by Termic1 »

shikra wrote:Thanks - I probably will increase.
Its the first time I used it for a RTH of more than a few meters- maybe 150m. I3 is great for testing but in real life i think 5-7 would be good as you say
It worked real well though.


First time I tried RTH from 600 meters I had to stop it as I was running out of battery.

With 5 m/s is much better and in about 3 minutes you are at home safely

http://www.youtube.com/watch?v=FpoMjCTDSFg

Luciano

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: GPS integration

Post by shikra »

Cool. Wonder if can scale speed by distance....?
I see you are using serial,GPS too. How are you finding that? I was getting some glitches on mine which seemed to be related to GPS ser routine

Termic1
Posts: 40
Joined: Tue Aug 21, 2012 11:14 am

Re: GPS integration

Post by Termic1 »

shikra wrote:Cool. Wonder if can scale speed by distance....?
I see you are using serial,GPS too. How are you finding that? I was getting some glitches on mine which seemed to be related to GPS ser routine


I'm pretty happy with it.
Recently (after rel 2.1 with EOSbandi mods) I've tested GPS Hold and RTH many times just to see how they are working in LOS and FPV.
I've got some problems only a couple of times and with wind more than 10 Km/h
I haven't experienced glitches or something like that.

http://www.youtube.com/watch?v=_LygiWPKxF4

http://www.youtube.com/watch?v=fi8amsVH1IM

Luciano

cswiger
Posts: 12
Joined: Wed Jun 20, 2012 11:43 pm

Re: GPS integration

Post by cswiger »

Huh, even with gps protocol set and verified in binary, navigatron equiped quad *still* has a case of twitching, no change at all.

https://www.youtube.com/watch?v=6gQb0R9Nsfw

Turning on gps filtering seems to help (subjective, hard to measure 'twitch') altho we are told it's not needed with mtk binary : :?:

6 decimal places precision
Attachments
GPS with 6 decimal place precision
GPS with 6 decimal place precision

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: GPS integration

Post by EOSBandi »

Hi Folks,

Just a quick note, I'm still alive (barely). I had many things over my head during the past months (including a full house renovation plus a change of job). My spare time dramatically decreased, but I'll try to catch up on recent development of MultiWii.... stay tuned.

Regards,
EOSBandi

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

Nice to see you OK, we was affraid viewtopic.php?f=16&t=2558

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: GPS integration

Post by jevermeister »

Welcome back Andras,
we missed you, mate.

Nils

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: GPS integration

Post by Hamburger »

yep; good to hear you are well.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: GPS integration

Post by shikra »

Good to see you back Andras - and thanks again for bring Jason's code to MultiWii. It's a bigger and better thing for it.

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: GPS integration

Post by brettwal »

Welcome Back & Good Luck with the new job.

flyrobot
Posts: 73
Joined: Thu Apr 05, 2012 3:59 pm

Re: GPS integration

Post by flyrobot »

Very nice to see you Andras. I just try r1177 the alt hold is much better and the stability also improve alot, i think now ready for mission or way point.

John

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: GPS integration

Post by msev »

Some Arduplane plane port would be interesting maybe for you Andras, where's that Easystar you said you were going to buy :D

User avatar
NikTheGreek
Posts: 348
Joined: Thu Dec 08, 2011 4:17 pm
Location: Greece
Contact:

Re: GPS integration

Post by NikTheGreek »

Hi.
Successfully flashed my Skylab SKM53 according the directions found here http://code.google.com/p/i2c-gps-nav/do ... p&can=2&q=

Everything during the flash went as expected..BUT
when i'm trying to test my GPS using Minigps found in the in the above link seems that is not working.
In the program i select the com port and boudrate and then "COLD START"
a yellow " led " is blinking all the time but i get no results at all.

Any idea what i'm doing wrong ?

User avatar
NikTheGreek
Posts: 348
Joined: Thu Dec 08, 2011 4:17 pm
Location: Greece
Contact:

Re: GPS integration

Post by NikTheGreek »

SOLVED !!!

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

Hi,
I got strange problem with GPS CN-06 v2 and crius AIOP MW1177.
make
#define GPS_SERIAL 2
#define GPS_BAUD 115200
#define UBLOX
and comment out //#define GPS_FILTERING

Serial is 115200 in serial com speeds.

CN-06 I plug to ucenter and setup 115200 and 5Hz, seeing nice data flow without interuption,

When I connect to MW I got every 3-5 sec bad data like on video

http://youtu.be/CSX69gkECtk

I goes back and tune CN-06 by the EOSBandi config file, so sending only UBX protocol, no alerts, errors and so. Still in Ucenter see nice data flow but same problem in MW.

EDIT, tested 1223 build same, switch from UBlox to NMEA in GPS and config and no problem.

Any ideas please?

Mac9
Posts: 45
Joined: Thu Oct 20, 2011 2:47 pm
Contact:

Re: GPS integration

Post by Mac9 »

Better late than never Or so I say!
Welcome back Andras as some one else said you have been missed and I agree. As I know to my cost moving or renovating the family seat is a great deal of hassle even more than not getting your Hex, Quad or Try doing what you would like it to do.
Keep up the good work and have a look at Height Hold not sure the solution is going well, hope that statement don't re start the cold war :lol: :roll: :shock:

Regards

John

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: GPS integration

Post by Mis »

Janekx:
Set GPS_BAUD to 38400.

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

I tryed 57600 in comunication with ucenter but it have pauses in signal so i not tryed it with MW.
Do you thing that lower bautrate will correct it?

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: GPS integration

Post by Mis »

Ublox with binary mode work even at 19200baud with 5Hz update rate, but 38400baud is optimal. Belive me. And you don't need configure your ublox with PC. The MWC firmware (starting from dev version 1117) configure speed and other parameters of ublox in right way.

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

Thenks will try it.
Can someone send me config file of the cn06 with original setings i am affraid that something changed and wouldlike to reset to default

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

Same with 38400 still got bad datas. coordinates alt speed jumping and sats from count to 0, GPS fix freen and red blinking. With NMEA not get GPSfix solid green too, but datas not jump

EDIT I reset GPS to defaul and set only 5Hz and 115200 now I got only not acurate data. Not that before that jump from positive to negative in latitude and so but changing last 2-3 numbers in lat and lon and speed changes from 0-14
MW seted to 115200 and Ublox GPSfix blinking green to gray. alt not change sat 8-9

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: GPS integration

Post by Mis »

Check it at open space, not in house because in house the GPS can't receive sattelites from different georgapchical sites.

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

Offcourse on open space.
After reset to default and set GPS again it looks better not jumping arount earth;) but NMEA looks more accurate not change a position so often in same 5Hz

Mac9
Posts: 45
Joined: Thu Oct 20, 2011 2:47 pm
Contact:

Re: GPS integration

Post by Mac9 »

Hi All involved,
What are the pros and cons in using UBLOX or NEMA protocols when transmitting date to the controller. I have noticed a great deal different code in a lot of the "shared". I am interested in the developments in Height Hold., can it be that they who develop height hold are not so interested in GPS.

Regards

John

User avatar
KasparsL
Posts: 75
Joined: Wed May 16, 2012 3:31 pm

Re: GPS integration

Post by KasparsL »

janekx wrote:Same with 38400 still got bad datas. coordinates alt speed jumping and sats from count to 0, GPS fix freen and red blinking. With NMEA not get GPSfix solid green too, but datas not jump

EDIT I reset GPS to defaul and set only 5Hz and 115200 now I got only not acurate data. Not that before that jump from positive to negative in latitude and so but changing last 2-3 numbers in lat and lon and speed changes from 0-14
MW seted to 115200 and Ublox GPSfix blinking green to gray. alt not change sat 8-9


I had a problem with gps loosing satellites, jumping etc. The problem was, that the 433mhz telemetry module was sharing the same power wire with gps module. Connected them separatley and the problem was gone. So check for clean power also.

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

Thanks for idea i power GPS from crius board and on the power line is only reciever and max232 for frsky telemetry data TTL translation and bt module and nothing more. All is powered from crius board.

User avatar
NikTheGreek
Posts: 348
Joined: Thu Dec 08, 2011 4:17 pm
Location: Greece
Contact:

Re: GPS integration

Post by NikTheGreek »

Hi.
three days ago successfully flashed my SKYLAB SKM53 based in 3329 module with new firmware (more details here viewtopic.php?f=16&t=2639 )
The problem i'm facing is that i get no stable GPS FIX.
The data displayed at the GUI correctly
Lat - Lon..etc..
even if i have signal from 6 or 7 sattelites the GPS FIX doesnt light stable (flashing ON-OFF all the time) :shock:
My I2Cs boards LED flashes 3 times means that got stable signal but NO STABLE GPS FIX in my GUI. :o

I'm using MW 2.1 ver.

Any idea what i can do to fix this problem ?

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

Me too blinking gpsfix gray and green even i got 8-10 sats and datas looks well and stable

User avatar
NikTheGreek
Posts: 348
Joined: Thu Dec 08, 2011 4:17 pm
Location: Greece
Contact:

Re: GPS integration

Post by NikTheGreek »

Just an idea that came to my mind. :idea:
Do you think that the GPS FIX problem is a result of the resonators i'm using in both boards ? (I2C GPS board & the FC) :?: :shock: :o :?:

Rainer
Posts: 11
Joined: Fri Oct 26, 2012 6:53 pm

GPS integration

Post by Rainer »

Hello,

to begin thanks for this software, a wonderful work.

mine asks filter to the GPS
up to now I have used with an I2C GPS the #define GPS_FILTERING, I have not used the other and have made good experience with it.

with serial GPS I use him
#define GPS_LOW_SPEED_D_FILTER

or is it better to be chosen both filters?

which experience was made with it?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: GPS integration

Post by copterrichie »

I know this has been asked before so thank you for the understanding.

Which in your opinion is the better choice considering I can only purchase one of them? The MT3329 SKM53 or the CN-06 GPS Receiver V2.0

I will be using it with a Mega so I don't need the I2C adapter.

janekx
Posts: 63
Joined: Wed Sep 12, 2012 10:08 pm
Location: Brno, Czech Republic

Re: GPS integration

Post by janekx »

Cn06 have 25x25mm antena and it is very important

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: GPS integration

Post by copterrichie »

janekx wrote:Cn06 have 25x25mm antena and it is very important


Awesome and thank you.

Post Reply