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
Post Reply
User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: GPS integration

Post by jevermeister »

You are very welcome.

We all learn by helping each other.

This is not "bigger than". this is a right shift, it is a mathematical opration not a comparison.

Take a look at this page (I always have it open while programming) :

http://processing.org/reference/

The right shift is described here:http://processing.org/reference/rightshift.html

Nils

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: GPS integration

Post by KeesvR »

Thanks again, time to learn for me to better understand all these things.

ankimo
Posts: 30
Joined: Fri Jan 20, 2012 7:31 am

Re: GPS integration

Post by ankimo »

MelihK wrote:Improved version of EOS Bandit's I2C GPS Code,

Features:
  • 9600 baud standard GPS switching code added, this MTK command switching the GPS module to 115200 baud. You can use same command set with any baudrate to 115200
  • NMEA sentence configurator MTK command added. It is removing useless NMEA codes from the stream.
  • LED indicator added. Arduino LED(pin 13) blinking for 3 seconds at start and very short blinks after GPS lock.

@EOS Bandit, Please check it and add into your repository, if they are useful features.

I2C_GPS_NAV.zip

Hi MelihK

I bought Navigatron_I2C_GPS at the end of last month.

I wanted for a GPS cycle to be 10 Hz, and replaced I2 C_GPS_NAV.zip.
However, it cannot operate in a huge I2C error.
It tried on Wii2.0.

Where is the original firmware downloadable?

Furthermore, the method of setting GPS to 10 Hz?

Best regards
Kazz

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

Re: GPS integration

Post by EOSBandi »

Hi Kazz,
The original code is here http://code.google.com/p/i2c-gps-nav/
MelihK's changes will be added shortly..
Bandi

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

PID based gps pos hold

Post by EOSBandi »

Hi All,
Since nobody started to work on this, and I promised a significant update to i2cGPS code. I ported the arducopter loiter (pos hold) code to MultiWii. I just flown a first couple of packs to sort out coding errors, and it seems to work. It's based on a PI+PID controller (PI for speed and PID for rate (inclination) to reach speed). I did not do any PID tunung yet. But it quite OK with the default parameters. (Significantly better than the current rudimentary code). Here is a quick video : http://www.youtube.com/watch?v=6iYM1LBG680

I'll post the code till the end of this weekend. Currently it's not polished, and due memory constraints runs only ot AtMega2560 based boards. I'll add it to the i2cGPS code, so AtMega328 boards could benefit from it too.
Stay tuned.

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

Re: GPS integration

Post by msev »

Is atmega1280 too small?

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

Re: GPS integration

Post by EOSBandi »

atmega 1280 will be ok

LuFa
Posts: 160
Joined: Fri Jan 27, 2012 7:56 pm

Re: GPS integration

Post by LuFa »

EOSBandi you are a Big Hero for me !

when did you plan to put this code into your i2cGPS code ?
Cant wait to test it ;D

Thanks so mutch !

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: GPS integration

Post by Wayne »

Thank you EOSBandi, I hope to see results like yours.
Question: Will serial GPS include your improvements?
If not I have a retired Warthox board I may put into service as i2cGPS.
Keep up the good work!
Wayne

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

Re: GPS integration

Post by EOSBandi »

I do my dev with a serial GPS, and an atmega2560 board. It's more easier to debug the algorithm that runs with the multiwii code, once the code is OK i'll put it into the i2cgps board. This method esures that both platforms are got the code :D

User avatar
Bledi
Posts: 187
Joined: Sat Sep 10, 2011 6:36 pm

Re: GPS integration

Post by Bledi »

EOSBandi, I don't know if you have see that : viewtopic.php?f=8&t=1551
For the moment we use the SD to store GPS nav datas (KML file for google map)
We can use it to read the WP datas.
As the board is based on a modified version of your I2CGPS, it will be fine to develop a comun solution the the WP (for board with or without SD)
What do you think about it ?
Last edited by Bledi on Sun Apr 29, 2012 1:30 pm, edited 1 time in total.

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

Re: GPS integration

Post by EOSBandi »

Hi Bledi,
Yes I saw that and altought it's an obvious idea, I think it just an interim solution. (I admit this is covinient). This definitely OK for logging GPS nav data, but does not work for storing other multiwii nav and control parameters. My idea is to log critical parameters (such as gyro/acc data, PID integrators and pid errors in real time (up to 50Hz) which helps to fine tune control algorithms.
The problem with the SD card is speed, the added overhead of the file system prohibits storing even GPS + nav PID data at 10Hz.

I ported Arducopter dataflash logging to MultiWii, which uses a RAM buffered FLASH chip to store log data, and will release it along with the new WinGUI 2.0

So SD cardis OK as a fancy feature, but not really helpfull as a debug/dev tool.

Andras

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: GPS integration

Post by KeesvR »

@EOSBandi: Have you seen my problem? What do you think about this?
viewtopic.php?p=12548#p12548

I'm not the only one with this problem.

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

Re: GPS integration

Post by EOSBandi »

It seems that your gps has something with the 3d fix indicator (it could be even a code error on my side) for a quick fix, you can use 2DFIX checking....

Code: Select all

   if (_i2c_gps_status & I2C_GPS_STATUS_2DFIX) { //Check is we have a good 3d fix (numsats>5)

micropuller
Posts: 8
Joined: Tue Apr 03, 2012 3:34 pm

Re: GPS integration

Post by micropuller »

Hello EOSBandi.
I'm having the same problems as KeesvR.
I tried your quick fix (at least I think I did. I presume you meant to say to just change "I2C_GPS_STATUS_3DFIX" into "I2C_GPS_STATUS_2DFIX"?), allas with the same results.
Could you please direct me to where in the code the 3D fix is implemented? I tried searching for it, but couldn't find it at first glance.

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: GPS integration

Post by KeesvR »

I also tried this with the same result as Micropuller.

We both live in The Netherlands so our altitude is below sea level, maybe this has something to do with this.
I know PatrikE said something about this in the past.

I've found it:
viewtopic.php?p=10757#p10757

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

Re: GPS integration

Post by dramida »

I am glad to see that the main GPS navigation function is fine-tuned.

Actually i am using GPS functions on a 328 board with serial 0 realocated to serial GPS and GUI disabled by commenting serialCom() function.

I hope that Bandi's newly implemented algorithm for pos hold to fit in 328 processor also.

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

Re: GPS integration

Post by EOSBandi »

KeesvR wrote:I also tried this with the same result as Micropuller.

We both live in The Netherlands so our altitude is below sea level, maybe this has something to do with this.
I know PatrikE said something about this in the past.

I've found it:
viewtopic.php?p=10757#p10757


Strange, I checked code and it should not be confused by a negative altitude. Could you send me a gps output log ? (Just connect your gps to serial monitor).

You also can remove the altitude parsing part :

Code: Select all

                      case 9: i2c_dataset.altitude = atoi(string);
                              break;

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

Re: GPS integration

Post by EOSBandi »

dramida wrote:I am glad to see that the main GPS navigation function is fine-tuned.

Actually i am using GPS functions on a 328 board with serial 0 realocated to serial GPS and GUI disabled by commenting serialCom() function.

I hope that Bandi's newly implemented algorithm for pos hold to fit in 328 processor also.


I think it's impossible. The current MultiWii code is pushing the envelope on 328 proc. It's not only program memory issue but also a ram issue. As I see, for a 328 flight controller, you have to have an i2cGPS nav board.

micropuller
Posts: 8
Joined: Tue Apr 03, 2012 3:34 pm

Re: GPS integration

Post by micropuller »

EOSBandi wrote:Could you send me a gps output log ? (Just connect your gps to serial monitor).

I'd be glad to help, but I'm not sure how to do that. Do I connect the GPS to an Arduino over I2C and then read the serial monitor?
Or do I use an FTDI cable or breakout board to connect it to the pc directly?
And how do I save the data from the serial monitor?

ApoC
Posts: 31
Joined: Fri Feb 10, 2012 2:16 pm

Re: GPS integration

Post by ApoC »

Today i had time to test the GPS Feature. Dev from the 14th.

Flyduino Mega, serial FMP04 GPS, Quad from Jakub and 950kV Suppos. 10x4,5 Props.
In the GUI i have Lock and sats. If i go away with my COpter, the distance to home increase. Seems to work, or?

I connected my Lipo, waited till the LED is flashing (Lock). Flown and switched to RTH. My Copter goes crazy and hitted the Ground - not really, because i switched back to Level und hold it in the air. ;)

So i tested it again. Same result. So i tested Posi-Hold. The Copter doesnt hold his position. Flies away.

So what i have to to, to check, whats wrong?

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: GPS integration

Post by KeesvR »

EOSBandi wrote:
KeesvR wrote:I also tried this with the same result as Micropuller.

We both live in The Netherlands so our altitude is below sea level, maybe this has something to do with this.
I know PatrikE said something about this in the past.

I've found it:
viewtopic.php?p=10757#p10757


Strange, I checked code and it should not be confused by a negative altitude. Could you send me a gps output log ? (Just connect your gps to serial monitor).

You also can remove the altitude parsing part :

Code: Select all

                      case 9: i2c_dataset.altitude = atoi(string);
                              break;


I tried this but no good result.
I discovered that the blue led on the Flytro Navigatron doesn't flash when there is a 3D-Fix.

I tried to make an output log, I did this on my old Laptop I use in the working room, but I've a bad internet connection over there. So I gone inside to my PC but with this I get nothing in the serial monitor, so gone back to my laptop but got the same result nothing on the screen, when I tried it earlier I get some numbers but I haven't stored them. I don't know how to store them but I would make a screenshot of it.

I connected the Navigatron by the FTDI to the computer.
Open the serial monitor and set baudrate to 115200.
I don't know if I loaded the sketch to arduino when I had these numbers, but tried it both ways.

When I disconnect the Navigatron when its locked I get I2C error (thats normal) when I connect it again its working again for some (5 to 10) seconds, then it locks again.

micropuller
Posts: 8
Joined: Tue Apr 03, 2012 3:34 pm

Re: GPS integration

Post by micropuller »

@KeesvR: I do get a flashing blue led when there's a 3D fix. It's on the bottom of the board, did you look there?

I also tried getting data from the GPS and I think I was succesful. Here's what I did:

- connected the Flytron GPS to an arduino, using the I2C pins.
- uploaded the code that can be found on the Flytron website to the arduino: http://www.flytron.com/pdf/Navigatron_Master.pde
- opened the serial monitor. I got readings, but after some time (anywhere between a couple of seconds and maybe a minute), the stream of data stopped.
- closed the serial monitor and opened it up again. The readings resumed, but again only for a short while.

As I don't have a program that will let me log the data, I made a capture of the X-CTU window: http://youtu.be/REejlid8GUY

Edit: another strange thing: in the movie I didn't move the GPS. But when I tried just now, the readings didn't change.
I didn't walk around with the unit, as it's connected to my desktop at the moment, but I moved it for at least a meter. Shouldn't the values be increasing / decreasing?
Last edited by micropuller on Mon Apr 30, 2012 7:56 pm, edited 2 times in total.

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: GPS integration

Post by KeesvR »

For me the serial monitor doesn't work with the FTDI.
I tried it with bluetooth then it was working.

I've set my FTDI to 3.3V especially for the Navigatron, maybe thats the reason why its not working like it should.

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

Re: GPS integration

Post by dramida »

ApoC wrote:Today i had time to test the GPS Feature. Dev from the 14th.

Flyduino Mega, serial FMP04 GPS, Quad from Jakub and 950kV Suppos. 10x4,5 Props.
In the GUI i have Lock and sats. If i go away with my COpter, the distance to home increase. Seems to work, or?

I connected my Lipo, waited till the LED is flashing (Lock). Flown and switched to RTH. My Copter goes crazy and hitted the Ground - not really, because i switched back to Level und hold it in the air. ;)

So i tested it again. Same result. So i tested Posi-Hold. The Copter doesnt hold his position. Flies away.

So what i have to to, to check, whats wrong?


Obviously, your magnetometer is misconfigured or is affected by the magnetic field of power distribution. A three simple tests to diagnose the problem:

Test 1: Rotate the copter and observe GUI, it shoul rotate accordingly
Test 2: Lean the copter sideways and observe GUI for orientation. It shouldn't change the heading even if it is leaning.
Test 3: (after test 1 and 2 are successful) Keep the copter firmly in your hand, put your throttle to maximum and watch the heading in GUI. If heading varies with throttle, it means the magnetometer is too close to power distribution conductors and the magnetic field generated bu high currents is affecting it.

So, before testing GPS navi, make shure that Care Free mode is working properly.

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

Re: GPS integration

Post by EOSBandi »

KeesvR wrote:For me the serial monitor doesn't work with the FTDI.
I tried it with bluetooth then it was working.

I've set my FTDI to 3.3V especially for the Navigatron, maybe thats the reason why its not working like it should.


I checked the Navigatron schematics, Theoretically you can plug a 3v3 ftdi into it and access the GPS module directly.
I recommend to load the led blinking sample into the Navigatron to avoid interference on the serial bus. Then the GPS output should be available on the FTDI. Check different serial speeds, since I don't know what is the default setting for the GPS module used by MahliK.
You have to see NMEA sentences "$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47" coming on your terminal...
(Use PUTTY http://www.chiark.greenend.org.uk/~sgta ... nload.html)

micropuller
Posts: 8
Joined: Tue Apr 03, 2012 3:34 pm

Re: GPS integration

Post by micropuller »

Here's mine:

Code: Select all

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2012.05.01 12:54:28 =~=~=~=~=~=~=~=~=~=~=~=
$GPGGA,105427.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*46
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105427.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*65
$GPGGA,105428.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*49
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105428.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*6A
$GPGGA,105429.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*48
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105429.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*6B
$PMTK001,314,3*36
$GPGGA,105430.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*43
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105430.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*63
$GPGGA,105431.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*42
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105431.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*62
$GPGGA,105432.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*41
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105432.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*61
$GPGGA,105433.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*40
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105433.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*60
$GPGGA,105434.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*47
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105434.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*67
$GPGGA,105435.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*45
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105435.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*66
$GPGGA,105436.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*46
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105436.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*65
$GPGGA,105437.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*47
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105437.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*64
$GPGGA,105438.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*48
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105438.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*6B
$GPGGA,105439.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*49
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105439.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*6A
$GPGGA,105440.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*47
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105440.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*64
$GPGGA,105441.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*46
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105441.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*65
$GPGGA,105442.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*45
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105442.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*66
$GPGGA,105443.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*44
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105443.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*67
$GPGGA,105444.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*40
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105444.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*60
$GPGGA,105445.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*41
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105445.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*61
$GPGGA,105446.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*42
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105446.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*62
$GPGGA,105447.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*40
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105447.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*63
$GPGGA,105448.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*4C
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105448.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*6C
$GPGGA,105449.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*4D
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105449.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*6D
$GPGGA,105450.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*45
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105450.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*65
$GPGGA,105451.000,5241.3123,N,00514.1929,E,1,8,1.22,-11.1,M,46.9,M,,*44
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.97,1.22,1.55*08
$GPRMC,105451.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*64
$GPGGA,105452.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*44
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105452.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*67
$GPGGA,105453.000,5241.3123,N,00514.1929,E,1,8,1.12,-11.1,M,46.9,M,,*45
$GPGSA,A,3,07,05,13,28,10,26,08,02,,,,,1.40,1.12,0.84*0C
$GPRMC,105453.000,A,5241.3123,N,00514.1929,E,0.00,130.18,010512,,,A*66


I used a 3.3V FTDI bob. Serial speed was 115200.
Didn't load the "blink" sketch, hope it doesn't matter too much.
BTW: I left the Putty window open and it's still putting out data, no freezing whatsoever.

Galumbo
Posts: 1
Joined: Fri Aug 26, 2011 2:38 pm

Re: GPS integration

Post by Galumbo »

dramida wrote:
ApoC wrote:Today i had time to test the GPS Feature. Dev from the 14th.

Flyduino Mega, serial FMP04 GPS, Quad from Jakub and 950kV Suppos. 10x4,5 Props.
In the GUI i have Lock and sats. If i go away with my COpter, the distance to home increase. Seems to work, or?

I connected my Lipo, waited till the LED is flashing (Lock). Flown and switched to RTH. My Copter goes crazy and hitted the Ground - not really, because i switched back to Level und hold it in the air. ;)

So i tested it again. Same result. So i tested Posi-Hold. The Copter doesnt hold his position. Flies away.

So what i have to to, to check, whats wrong?


Obviously, your magnetometer is misconfigured or is affected by the magnetic field of power distribution. A three simple tests to diagnose the problem:

Test 1: Rotate the copter and observe GUI, it shoul rotate accordingly
Test 2: Lean the copter sideways and observe GUI for orientation. It shouldn't change the heading even if it is leaning.
Test 3: (after test 1 and 2 are successful) Keep the copter firmly in your hand, put your throttle to maximum and watch the heading in GUI. If heading varies with throttle, it means the magnetometer is too close to power distribution conductors and the magnetic field generated bu high currents is affecting it.

So, before testing GPS navi, make shure that Care Free mode is working properly.


I've got the same problems like ApoC. The position hold does not work.
The carefree (head free) mode is working perfectly and in the GUI the GPS found more than 3 satellites.
What can I do to teach my copter believing and using the gps signal?

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: GPS integration

Post by dr.tom »

GPS is working ok (Navigatron I2C on Crius SE FC)

ImageImage



but when model is lets say 100m away, when RTH activates, it rushes at full speed to target, and overshots drastically,
then stops, and rushes back, overshots, and so on...

if activated at <5m, it works ok, stable at first, then after some time starts to slowly circle around the target.

Looking forward to EosBandi's code for I2C gps units, his video of GPS working is awesome! :shock:
Last edited by dr.tom on Wed May 02, 2012 3:50 pm, edited 1 time in total.

micropuller
Posts: 8
Joined: Tue Apr 03, 2012 3:34 pm

Re: GPS integration

Post by micropuller »

I've read about several people that are using the navigatron without problems, yet me an KeesvR are having problems with the data freezing.
As it looks like it's not a problem with the GPS module itself, could it be that there are units with faulty software?
I'd like to try and upload the software again, but I have no experience using an ftdi board.
Can I just put the code into an Arduino sketch, connect the Navigatron to the USB port using the ftdi board and upload the software to the chip?
Do I have to cross the tx / rx wires or not?
Last edited by micropuller on Wed May 02, 2012 8:02 am, edited 1 time in total.

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

Re: GPS integration

Post by jevermeister »

dr.tom wrote:GPS is working ok (Navigatron I2C on Crius SE FC)

Image



but when model is lets say 100m away, when RTH activates, it rushes at full speed to target, and overshots drastically,
then stops, and rushes back, overshots, and so on...

if activated at <5m, it works ok, stable at first, then after some time starts to slowly circle around the target.

Looking forward to EosBandi's code for I2C gps units, his video of GPS working is awesome! :shock:


Oh come on, does anybody read this thread?!

Alex and I stated a million times, that the GPS RTH feauture is only a test implementation.

It computest the angle to tilt into target direction in relation to distance.
THIS CANNOT WORK FOR PERFECT RTH

you have to compute speed in relation to distance - so the copter can slow down and even brake before reaching home. No it only can tilt to zero degerees when reaching home but the velocity is still there.

Sit down and code something better guys.

Nils

ps.: Sorry for the harsh tone but plz read the posts before complaining ;-)

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: GPS integration

Post by marbalon »

jevermeister wrote:
ps.: Sorry for the harsh tone but plz read the posts before complaining ;-)


Please read this thread careful before your write the same about others - you miss this post:

viewtopic.php?f=8&t=649&start=460#p12970

I think this is quite enough for most people.

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: GPS integration

Post by dr.tom »

That wasn't complaining :(
I was happy it works, so it can bring the model back if it wonders away on some noob pilot :)
That's a nice new feature. I realize it's not perfect yet, but good enough for emergency cases...

And mentioned what marbalon has just linked, an new and improved approach to GPS RTH function from EosBandi...

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

Re: GPS integration

Post by jevermeister »

dr.tom wrote:That wasn't complaining :(
I was happy it works, so it can bring the model back if it wonders away on some noob pilot :)
That's a nice new feature. I realize it's not perfect yet, but good enough for emergency cases...

And mentioned what marbalon has just linked, an new and improved approach to GPS RTH function from EosBandi...



Okay mate,
I am sorry for that last post - I am in quite a bitter mood right now.

Nobody is a noob here - you built your quad buy yourself - that is quite an accomplishment!

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: GPS integration

Post by dr.tom »

OK, no hard feelings mate :)

been building and flying multis for almost 3 years,
a lot of soldering and drilling, but no experience in coding new stuff :(
http://www.youtube.com/user/TomRi25

you people are great, providing your knowledge and makind MWC a bettter and better every day for rest ofus to fly. thank you all. :)

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

Re: GPS integration

Post by jevermeister »

dr.tom wrote:OK, no hard feelings mate :)

been building and flying multis for almost 3 years,
a lot of soldering and drilling, but no experience in coding new stuff :(
http://www.youtube.com/user/TomRi25

you people are great, providing your knowledge and makind MWC a bettter and better every day for rest ofus to fly. thank you all. :)



Youtube cchannel subscribed - WOW that is so smooth.

Send a pm about your setup man.

mine is here
http://ncopters.blogspot.com


BTW: Thanks for taht last statement: Everytime wee see a Multiwii like yours in the air - that is our reward :-)

micropuller
Posts: 8
Joined: Tue Apr 03, 2012 3:34 pm

Re: GPS integration

Post by micropuller »

Ok, according to Melih from Flytron, the problem isn't in the Navigatron, but in the GUI: http://forum.flytron.com/viewtopic.php?f=4&t=338&p=2829#p2829
That would explain a lot.

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

Re: GPS integration

Post by EOSBandi »

Guys, I need a little help. Honestly vector algebra and trigonometrics are not my favourite topics, and I'm stuck with a final step of poshold implementation..

I have a nav_lon and nav_lat calculated which tells the desired banking (nav_lat - North/South where North is positive and South is negative, and nav_lon West/East where West negative and East is positive). Now I have to rotate this vector into the copter's frame of reference.

By the book is's easy :
pitch = nav_lon*cos_yaw-nav_lat*sin_yaw
roll = nav_lon*sin_yaw+nav_lat*cos_yaw

Where sin_yaw and cos_yaw is the sin and cos of heading from compass.
However I'm not sure about the +/- combinations... Could somebody take a look and advise ?

Thanks,
Andras

User avatar
Bledi
Posts: 187
Joined: Sat Sep 10, 2011 6:36 pm

Re: GPS integration

Post by Bledi »

just a question because I don't find the answer : Why is it not possible (for the moment) to have a Position Hold (different of the home) on I2C GPS ?

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: GPS integration

Post by Tommie »

Does position hold work on serial GPS? Why not optionally implement a mode in which the course calculation is done by the main ATMega328 and only position information is transferred via I²C (like with tiny-gps viewtopic.php?f=8&t=1549)?

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: GPS integration

Post by KeesvR »

I think my GPS is not working anymore.
So I can't test anymore.

MelihK
Posts: 13
Joined: Sat Feb 18, 2012 10:00 pm

Re: GPS integration

Post by MelihK »

EOSBandi wrote:Guys, I need a little help. Honestly vector algebra and trigonometrics are not my favourite topics, and I'm stuck with a final step of poshold implementation..


Good News: I'm writing GPS position and LOS calculation codes since years because of SimpleOSD(I'm the designer). I have alot of code part and experience about fast sin/cosin calculations and heading.
Bad News: Now I'm in the winter house(in the city center) and finding a test place is impossible for me. I'm planning to go to summer house in 4 weeks and i will help about coding :)

Cheers
Melih

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: GPS integration

Post by Katch »

Can someone post a summary of what behaviour to expect while testing the i2c GPS code please?

I've just installed a Flytron i2c on my Warthox MWC with Free IMU 0.3.5.MS.

My headfree mode is working nicely and I get a 3D fix on my GPS.

At the moment when I turn on POS hold the Quad goes off on a little adventure way over there somewhere.

Haven't tested RTH but I understand I should expect the quad to strafe the sh*t out of me and then go for a little adventure way over there somewhere.

Is this basically where we are at right now with the latest dev code.

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

Re: GPS integration

Post by EOSBandi »

Katch wrote:Can someone post a summary of what behaviour to expect while testing the i2c GPS code please?

I've just installed a Flytron i2c on my Warthox MWC with Free IMU 0.3.5.MS.

My headfree mode is working nicely and I get a 3D fix on my GPS.

At the moment when I turn on POS hold the Quad goes off on a little adventure way over there somewhere.

Haven't tested RTH but I understand I should expect the quad to strafe the sh*t out of me and then go for a little adventure way over there somewhere.

Is this basically where we are at right now with the latest dev code.


I recommend to wait a couple of days... I'll release a new gps code very soon. It seems that I managed to figured out the vector rotation. Will have a test fly tomorrow, then publish...

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

Re: GPS integration

Post by jevermeister »

Eosbandi,
What are you trying to do?

If you want to implement poshold just copy alex code to have the same behavior for start.
If sou wwnt to code w better solution you have to control the approadhing speed as afunction of tilt angle.

Nils
Ps. I am in my summer house now and only uee my pad. I will try to help when I am back ih my lab - oh yes: The lab!!!

User avatar
mbrak
Posts: 136
Joined: Sat Dec 03, 2011 8:08 pm
Location: Germany, Lemgo

Re: GPS integration

Post by mbrak »

hi andras

good news :)

will you release both (serial and i2c)?

some posts before i read that you develop the code on a mega2560 with serial gps :)
my copter has a 2560 with serial gps :)

we are waiting patiently :) :) :)

User avatar
mbrak
Posts: 136
Joined: Sat Dec 03, 2011 8:08 pm
Location: Germany, Lemgo

Re: GPS integration

Post by mbrak »

offtopic on

summerhouse, winterhouse, lab......

whats going on here ? :)

have you won in the lottery? :)

offtopic off

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

Re: GPS integration

Post by jevermeister »

mbrak wrote:offtopic on

summerhouse, winterhouse, lab......

whats going on here ? :)

have you won in the lottery? :)

offtopic off


The so called summer house is the old farm of my father in law. My lab is an underground lair with lots of spiders and stuff.

Sorry no lottery.

Nils

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: GPS integration

Post by Katch »

EOSBandi wrote:
Katch wrote:Can someone post a summary of what behaviour to expect while testing the i2c GPS code please?

I've just installed a Flytron i2c on my Warthox MWC with Free IMU 0.3.5.MS.

My headfree mode is working nicely and I get a 3D fix on my GPS.

At the moment when I turn on POS hold the Quad goes off on a little adventure way over there somewhere.

Haven't tested RTH but I understand I should expect the quad to strafe the sh*t out of me and then go for a little adventure way over there somewhere.

Is this basically where we are at right now with the latest dev code.


I recommend to wait a couple of days... I'll release a new gps code very soon. It seems that I managed to figured out the vector rotation. Will have a test fly tomorrow, then publish...


Will this require reprogramming the Arduino on the i2c GPS BoB?

PatrikE
Posts: 1964
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS integration

Post by PatrikE »

Katch wrote:Will this require reprogramming the Arduino on the i2c GPS BoB?


Yepp...

Post Reply