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
PatrikE
Posts: 1963
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS integration

Post by PatrikE »

No there is no file But i Made a package for you.


/Patrik
Attachments
MultiWii_Gps.zip
(51.46 KiB) Downloaded 1095 times

Gaza07
Posts: 12
Joined: Sat Apr 23, 2011 9:28 pm
Location: Nottingham Uk

Re: GPS integration

Post by Gaza07 »

Hi Patrik thanks for that, I just spent ages copying and pasting the files before I saw your reply :D
I have edited them for my hardware and uploaded them to my quad using Arduino-0022 but I am not stuck
on the multiwii conf, How do I make an executable file from the pde,
Sorry for the quastions but the dev releases I used before where all packaged up :D

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

Re: GPS integration

Post by PatrikE »


Gaza07
Posts: 12
Joined: Sat Apr 23, 2011 9:28 pm
Location: Nottingham Uk

Re: GPS integration

Post by Gaza07 »

Hi Patrik thanks for your help I now have a working multiwiiconf.exe :D

boke
Posts: 11
Joined: Sat Aug 13, 2011 1:36 am

Re: GPS integration

Post by boke »

Hey guys, thanx for working on gps integration! Which gps module do u use?
Greetings Boke

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: GPS integration

Post by MichalM_sk »

Hi,

http://www.sendspace.com/file/x2pfoa

This is promised MultiWii 1.8 version with my addons.

Added:

MultiWii firmware:

1.GPS I2C Support for Arduino Pro Mini & Mega boards
2.GPS is divided into Serial(SER) and I2C in Config part
3.Position hold (should work on both not tested in 1.8 yet) - position hold
is activated after the AUX1 or AUX2 switch if GPS fix is on
then the head rotates to the True North.

MultiWii config

1.View Latitude, Longitude
2.If no fix - values lat, lon, numSats are red.

Warning:

This firmware is only for testing purposes , GPS not tested on version 1.8 yet only on 1.7.
I am not responsible for any damage.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: GPS integration

Post by kataventos »

Hi Alex, I am new on this project and just as a pilot. I have been reading everything about it and about this post I have a question.
Does this GPS ( MediaTek MT3329 GPS 10Hz + Adapter ) will work? The description seems to be apropriated.
Thank you for your time.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: GPS integration

Post by Alexinparis »

kataventos wrote:Hi Alex, I am new on this project and just as a pilot. I have been reading everything about it and about this post I have a question.
Does this GPS ( MediaTek MT3329 GPS 10Hz + Adapter ) will work? The description seems to be apropriated.
Thank you for your time.


Yes, but by default it will output binary data.
(http://store.diydrones.com/MediaTek_MT3 ... 329-01.htm)

You have to find a way to configure it to output NMEA data before.

User avatar
Loosi
Posts: 63
Joined: Sat Aug 20, 2011 8:31 pm
Location: Germany (HSK)
Contact:

Re: GPS integration

Post by Loosi »

Alexinparis wrote:
kataventos wrote:Hi Alex, I am new on this project and just as a pilot. I have been reading everything about it and about this post I have a question.
Does this GPS ( MediaTek MT3329 GPS 10Hz + Adapter ) will work? The description seems to be apropriated.
Thank you for your time.


Yes, but by default it will output binary data.
(http://store.diydrones.com/MediaTek_MT3 ... 329-01.htm)

You have to find a way to configure it to output NMEA data before.


Good morning!

You can change the output format between NMEA and MKT (binary) protocol (https://docs.google.com/Doc?docid=0ASI4 ... l=en&pli=1)

You can find some infos under the following links:
-DataSheet
-Custom Binary Protocol Reference
-MTK Commands Manual

If i understand it correct, you can change to output all messages with

Code: Select all

$PGCMD,16,1,1,1,1,1*6B


Or only GGA:

Code: Select all

$PGCMD,16,0,0,0,0,1*6B


see this link, table 2

To do this with Arduino:

Code: Select all

Serial.print("$PGCMD,16,0,0,0,0,1*6B\r\n");


I think it should be possible to add the binary mtk protocol to multiwii, i will try it, but at the moment i dont have much time.

Greetings
Daniel

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: GPS integration

Post by MichalM_sk »

Hi,

I use Mtk3329 chipset ( Skylab SKM53 gps module) in my GPS to i2c board. It is a good module for a low price.

Default config for this module:
1Hz refresh rate (up to 10Hz)
NMEA sentenses On
Baud rate 9200bps

Configuration messages that I use for MTK 3329 chipset GPS module:

Code: Select all

#define SBAS_INTEGRITY_ON "$PMTK319,1*24\r\n"
#define SBAS_TEST_ON "$PMTK319,0*25\r\n"
#define WAAS_ENABLE  "$PMTK313,1*2E\r\n"                                         
#define WAAS_DISABLE "$PMTK313,0*2F\r\n"
#define DGPS_SBAS_ON "$PMTK301,2*2E\r\n"                  // default is SBAS on

#define MEDIATEK_BAUD_RATE_38400 "$PMTK251,38400*27\r\n"
#define MEDIATEK_BAUD_RATE_57600 "$PMTK251,57600*2C\r\n"
#define MEDIATEK_BAUD_RATE_115200 "$PMTK251,115200*1F\r\n"
#define MEDIATEK_REFRESH_RATE_4HZ "$PMTK220,250*29\r\n"                      //refresh rate - 4Hz - 250 milliseconds
#define MEDIATEK_REFRESH_RATE_5HZ "$PMTK220,200*2C\r\n"
#define MEDIATEK_REFRESH_RATE_10HZ "$PMTK220,100*2F\r\n"                      //refresh rate - 10Hz - 100 milliseconds
#define MEDIATEK_FACTORY_RESET "$PMTK104*37\r\n"                             //clear current settings
#define NMEA_GGA_ENABLE "$PMTK314,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*27\r\n" //Set GGA messages

Attachments
MTK_commands.rar
MTK 3329 commands
(71.4 KiB) Downloaded 654 times

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: GPS integration

Post by kataventos »

Loosi wrote:
Alexinparis wrote:
kataventos wrote:Hi Alex, I am new on this project and just as a pilot. I have been reading everything about it and about this post I have a question.
Does this GPS ( MediaTek MT3329 GPS 10Hz + Adapter ) will work? The description seems to be apropriated.
Thank you for your time.


Yes, but by default it will output binary data.
(http://store.diydrones.com/MediaTek_MT3 ... 329-01.htm)

You have to find a way to configure it to output NMEA data before.


Good morning!

You can change the output format between NMEA and MKT (binary) protocol (https://docs.google.com/Doc?docid=0ASI4 ... l=en&pli=1)

You can find some infos under the following links:
-DataSheet
-Custom Binary Protocol Reference
-MTK Commands Manual

If i understand it correct, you can change to output all messages with

Code: Select all

$PGCMD,16,1,1,1,1,1*6B


Or only GGA:

Code: Select all

$PGCMD,16,0,0,0,0,1*6B


see this link, table 2

To do this with Arduino:

Code: Select all

Serial.print("$PGCMD,16,0,0,0,0,1*6B\r\n");


I think it should be possible to add the binary mtk protocol to multiwii, i will try it, but at the moment i dont have much time.

Greetings
Daniel


Hi and thanks to all,

The HK OSD GPS that Alex is using to code seems to be weak! just 1hz refresh rate, this is bad for solid GPS navigation, but, is this enough for "accured" position hold? 1x data per second! I´m tempted to buy this one for now because of the OSD, I fly my Multiwiiquadcopter only in FPV and with this cheap equipment is better then have nothing, and if Alex is coding with this one... Better! About your reply´s, at this moment I am just checking what´s best and cheaper and it seems that the MediaTek MT3329 GPS 10Hz is a good choice!

Greetings,
Henrique

babelo
Posts: 28
Joined: Wed Jul 06, 2011 12:56 pm

Re: GPS integration

Post by babelo »

Hi,

i have done a gps integration on promini board, gps should go in place of LCD connector in my sample. I need someone to check my code, because i did not know if problem come from my GPS or from the code.
My gps come from remzibi OSD, i ve no test board other than fcwii, so it is hard to check.
The idea i s to have the GPS on LCD conector and to use the serial used by computer seetings tool to send data to remzibi OSD

Thanks for help
Fabrice,
Attachments
gpspromini.zip
patch file
(3.02 KiB) Downloaded 718 times

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

Re: GPS integration

Post by msev »

Guys here is another cheap candidate for a gps: http://www.dealextreme.com/p/em-411-gps ... pset-80037

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

Re: GPS integration

Post by PatrikE »

MichalM_sk
Can you test if this works.?
I dont have a shield redy for my MEGA yet so i cant test it.
Trying to get it to run on a PROMINI.

This small calculation will rotate GPS axis to compensate Roll & Pich To the compass heading.
Add it last in void GPS_position_control.

Remove magHold = DECLINATION_FACTOR functions

Code: Select all

/*==========================================
 Adding compensation with compassheading.
 By Patrik E                        
==========================================*/

  float Angle= radians(heading+DECLINATION_FACTOR);
 
/* Convert from GPS coordinates to Compass coordinates 
==========================================*/
  command_gps_roll  = command_gps_roll*cos(Angle)+command_gps_pitch*sin(Angle);
  command_gps_pitch =-command_gps_roll*sin(Angle)+command_gps_pitch*cos(Angle);
/*==========================================*/
 


You may have to adust directions in your code.

And maby do like this.

Code: Select all

     
  rcCommand[ROLL]  += gps_roll;                 //GPS added to Rc command
  rcCommand[PITCH] += gps_pitch;   
 


/Patrik

babelo
Posts: 28
Joined: Wed Jul 06, 2011 12:56 pm

Re: GPS integration

Post by babelo »

@patrike

You can use my previous post , it should work, i get data from my GPS, but it is hard to debug with this board. Don't forgot to comment the part about INT on PORTD in newsoftserial.
I report this part in RX.pde to handle interrupt and forward it to NEwSoftSerial class.

@alexinparis, if you can look at this code or have a devel board

Latest library is here http://arduiniana.org/libraries/newsoftserial/
And my patch for MultiWii is just above this post

Fabrice,

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: GPS integration

Post by MichalM_sk »

Hi,

ok i will test it.

PatrikE wrote:MichalM_sk
Can you test if this works.?
I dont have a shield redy for my MEGA yet so i cant test it.
Trying to get it to run on a PROMINI.

This small calculation will rotate GPS axis to compensate Roll & Pich To the compass heading.
Add it last in void GPS_position_control.

Remove magHold = DECLINATION_FACTOR functions

Code: Select all

/*==========================================
 Adding compensation with compassheading.
 By Patrik E                        
==========================================*/

  float Angle= radians(heading+DECLINATION_FACTOR);
 
/* Convert from GPS coordinates to Compass coordinates 
==========================================*/
  command_gps_roll  = command_gps_roll*cos(Angle)+command_gps_pitch*sin(Angle);
  command_gps_pitch =-command_gps_roll*sin(Angle)+command_gps_pitch*cos(Angle);
/*==========================================*/
 

TennesseePilot
Posts: 2
Joined: Thu Jan 20, 2011 2:17 am

Re: GPS integration

Post by TennesseePilot »

Will the current dev 20110903 display the no. of sats and distance home in the GUI if a working gps is attached to serial2? The GPS define has been uncommented, baud set at 38400, using serial2 and activated gps checkboxes. Using a mega 1280.....or is that still to be developed?

TP

User avatar
Loosi
Posts: 63
Joined: Sat Aug 20, 2011 8:31 pm
Location: Germany (HSK)
Contact:

Re: GPS integration

Post by Loosi »

Hi!

I´m not sure if it was the dev 20110903 or the current svn revision, but normally it should switch to green and display the no. of sats and die distance, i try it in 2 hours when i´am at home.

TennesseePilot
Posts: 2
Joined: Thu Jan 20, 2011 2:17 am

Re: GPS integration

Post by TennesseePilot »

Thanks Loosi. Right now I'm not getting any data display in the GUI. Let me know what you find out later when you get to try it.

TP

User avatar
Loosi
Posts: 63
Joined: Sat Aug 20, 2011 8:31 pm
Location: Germany (HSK)
Contact:

Re: GPS integration

Post by Loosi »

Hi!
Sorry my Laptop crashed and i had to replace the harddisk :(

The version on page 3 of this topic is the working one :) viewtopic.php?f=8&t=649&start=20#p3555

multiwii_gps.JPG

mr_swell
Posts: 3
Joined: Thu Sep 22, 2011 11:48 am

Re: GPS integration

Post by mr_swell »

Hallo MichalM_sk,
i have the Flyduino V2 (Mega2560/ and the GPS Mtk3329 connected serial2, it is ok, see in Multiwii GPS Signal and get FIx
http://store.diydrones.com/MediaTek_MT3329_GPS_10Hz_Adapter_Basic_p/mt3329-02.htm

I don't really know how can i do this, get 10Hz, i look in the GPS.pde, config.h etc, found nothing...
Configuration messages that I use for MTK 3329 chipset GPS module:

#define SBAS_INTEGRITY_ON "$PMTK319,1*24\r\n"
#define SBAS_TEST_ON "$PMTK319,0*25\r\n"
#define WAAS_ENABLE "$PMTK313,1*2E\r\n"
#define WAAS_DISABLE "$PMTK313,0*2F\r\n"
#define DGPS_SBAS_ON "$PMTK301,2*2E\r\n" // default is SBAS on

#define MEDIATEK_BAUD_RATE_38400 "$PMTK251,38400*27\r\n"
#define MEDIATEK_BAUD_RATE_57600 "$PMTK251,57600*2C\r\n"
#define MEDIATEK_BAUD_RATE_115200 "$PMTK251,115200*1F\r\n"
#define MEDIATEK_REFRESH_RATE_4HZ "$PMTK220,250*29\r\n" //refresh rate - 4Hz - 250 milliseconds
#define MEDIATEK_REFRESH_RATE_5HZ "$PMTK220,200*2C\r\n"
#define MEDIATEK_REFRESH_RATE_10HZ "$PMTK220,100*2F\r\n" //refresh rate - 10Hz - 100 milliseconds
#define MEDIATEK_FACTORY_RESET "$PMTK104*37\r\n" //clear current settings


Greetz
Jo

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: GPS integration

Post by MichalM_sk »

mr_swell wrote:Hallo MichalM_sk,
i have the Flyduino V2 (Mega2560/ and the GPS Mtk3329 connected serial2, it is ok, see in Multiwii GPS Signal and get FIx
http://store.diydrones.com/MediaTek_MT3329_GPS_10Hz_Adapter_Basic_p/mt3329-02.htm

I don't really know how can i do this, get 10Hz, i look in the GPS.pde, config.h etc, found nothing...
Configuration messages that I use for MTK 3329 chipset GPS module:

#define SBAS_INTEGRITY_ON "$PMTK319,1*24\r\n"
#define SBAS_TEST_ON "$PMTK319,0*25\r\n"
#define WAAS_ENABLE "$PMTK313,1*2E\r\n"
#define WAAS_DISABLE "$PMTK313,0*2F\r\n"
#define DGPS_SBAS_ON "$PMTK301,2*2E\r\n" // default is SBAS on

#define MEDIATEK_BAUD_RATE_38400 "$PMTK251,38400*27\r\n"
#define MEDIATEK_BAUD_RATE_57600 "$PMTK251,57600*2C\r\n"
#define MEDIATEK_BAUD_RATE_115200 "$PMTK251,115200*1F\r\n"
#define MEDIATEK_REFRESH_RATE_4HZ "$PMTK220,250*29\r\n" //refresh rate - 4Hz - 250 milliseconds
#define MEDIATEK_REFRESH_RATE_5HZ "$PMTK220,200*2C\r\n"
#define MEDIATEK_REFRESH_RATE_10HZ "$PMTK220,100*2F\r\n" //refresh rate - 10Hz - 100 milliseconds
#define MEDIATEK_FACTORY_RESET "$PMTK104*37\r\n" //clear current settings


Greetz
Jo


these configuration messages I use in my GPS to I2c board, in multiwii firmware with directly connected serial GPS it isnt implemented yet.

In a short time (when I fix crashed quadcopter) I add a new version of multiWii firmware with MediaTek serial configuration + patch 2 + some code changes + GPS telemetry support

mr_swell
Posts: 3
Joined: Thu Sep 22, 2011 11:48 am

Re: GPS integration

Post by mr_swell »

hi micha,
i am glad to test it
(when I fix crashed quadcopter)
= possibly your gps flight ;)
thx
jo

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

Re: GPS integration

Post by crashlander »

Hello!
I'm using couple of years old GPS module form SparkFun (LS20031, it is 32 channel and 1Hz) which defaults to 57600bps (and I set it in code) and I'm unable to change that (tried suggestions from previous posts with no success).
By default it is "producing" code like that (without position lock):
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79
$GPRMC,235951.426,V,8960.0000,N,00000.0000,E,0.00,0.00,050180,,,N*74
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
$GPGGA,235951.626,8960.0000,N,00000.0000,E,0,0,,137.0,M,13.0,M,,*48
$GPGLL,8960.0000,N,00000.0000,E,235951.626,V,N*4D
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79
$GPRMC,235951.626,V,8960.0000,N,00000.0000,E,0.00,0.00,050180,,,N*76
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32

But I can not see anything (when connected to MultiWii GUI) with or without position lock.
Any suggestions?!

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: GPS integration

Post by MichalM_sk »


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

Re: GPS integration

Post by crashlander »

MichalM_sk wrote:Hi,

you use this version?
viewtopic.php?f=8&t=649&start=20#p3555

I'm using version from Alex, from SVN. I don't have enough tools/expiriences to create custom PCB, program and solder Atmega168. Could you design Arduino (ProMini) based board and firmware?

Andrej

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: GPS integration

Post by MichalM_sk »

This firmware viewtopic.php?f=8&t=649&start=20#p3555 also works with serial GPS module.
Another multiwii config utility doesn't permit display GPS info currently.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: GPS integration

Post by Alexinparis »

crashlander wrote:Hello!
I'm using couple of years old GPS module form SparkFun (LS20031, it is 32 channel and 1Hz) which defaults to 57600bps (and I set it in code) and I'm unable to change that (tried suggestions from previous posts with no success).
By default it is "producing" code like that (without position lock):
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79
$GPRMC,235951.426,V,8960.0000,N,00000.0000,E,0.00,0.00,050180,,,N*74
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32
$GPGGA,235951.626,8960.0000,N,00000.0000,E,0,0,,137.0,M,13.0,M,,*48
$GPGLL,8960.0000,N,00000.0000,E,235951.626,V,N*4D
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,00*79
$GPRMC,235951.626,V,8960.0000,N,00000.0000,E,0.00,0.00,050180,,,N*76
$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32

But I can not see anything (when connected to MultiWii GUI) with or without position lock.
Any suggestions?!


Hi,
I've uploaded a new dev (28 september), could you try this one ?

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

Re: GPS integration

Post by msev »

Will this gps integration be universal, work with different gps's from cheap one's with low update rate to the faster, better, more expensive 10Hz one's :D ?

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

Re: GPS integration

Post by crashlander »

Hello,
@Alexinparis: yes now it works (in GUI) I can see data at 57600bps
@MichalM_sk: sorry I vas unaware that it works with serial GPS, but now I tested it and can see data in GUI. But my current (new) Mega shield only supports Spektrum satellite receiver, so I'm currently unable to test any further with your code.

Regards Andrej

Gaza07
Posts: 12
Joined: Sat Apr 23, 2011 9:28 pm
Location: Nottingham Uk

Re: GPS integration

Post by Gaza07 »

Ive got a flyduino mega v1.1 with 1280 chip and a fmp-04 gps module on serial 2, the gps works with the latest multiwii dev, my gps works on the NMEA protocol and the baud set to 38400bps :D
cheers
Gazza

cob
Posts: 37
Joined: Thu Jul 07, 2011 12:00 am

Re: GPS integration

Post by cob »

I've got GPS working on Blackvortex board with Atmel 2560. It is a NEO-6Q Ublox GPS receiver.
I just configured like this in config.h MWII 1.8 by MichalM_sk:

Code: Select all

/* Serial GPS
   only available on MEGA boards
   if enabled, define here the Arduino Serial port number and the UART speed
   note: only the RX PIN is used, the GPS is not configured by multiwii
   the GPS must be configured to output NMEA sentences (which is generally the default conf for most GPS devices)
*/
#define GPS_SER
#define GPS_SERIAL Serial2 // should be Serial2 for flyduino v2 ... and it is for Blackvortex
#define GPS_BAUD   38400

So i get the GPS values displaying nicely on the GUI

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: GPS integration

Post by aBUGSworstnightmare »

Hi there,

is there a version were I can configure my GPS with? The current gps.pde does not allow to send configuration messages to the GPS, so were to find one which can do this?

I'm working on a GPS BOB which I want to test with the MultiWii software. The module runs on 4800baud, sending NMEA messages. I want to increase the baud rate by sending the appropriate command.

Thanks for answering.
aBUGSworstnightmare

P.S. Here's a picture of my current dev (in progress). Sry, no details on the module at the moment :?:
Attachments
aBUGSworstnightmare's GPS BOB
aBUGSworstnightmare's GPS BOB

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

Re: GPS integration

Post by dramida »

I am ready to test GPS HOLD function with my multiwii octocopter, when it will be available?

didlawowo69
Posts: 38
Joined: Tue Oct 11, 2011 1:42 pm

Re: GPS integration

Post by didlawowo69 »

any news about gps integration ?
HK gps with OSD have a good resolution ?

whowe
Posts: 12
Joined: Thu Oct 20, 2011 4:04 am

Re: GPS integration

Post by whowe »

I don't like the idea of soft serial. I believe it takes too much CPU resource to do the UART simulation.
When flying, serial 0 is not in use. So I think sharing serial 0 with PC is a good idea.

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: GPS integration

Post by ziss_dm »


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

Re: GPS integration

Post by jevermeister »

Hi,
Paul from Flyduino sent me a GPS bob to test with but I have some startup problems.
I use a FLyduino v2.1 and I am unsure which serial I have to use with the 20111029 DEV version,
I need to use the serial Port with RX3 TX3 written on it, because the bob does not have the smal gps connector yet.

Which serial port is that? Serial3?

Nils

ps.: GPS TX to Flyduino RX?

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: GPS integration

Post by aBUGSworstnightmare »

Hi there,

Nils, as already mentioned you need to do a 1:1 connection between the GPS and the Flyduino Mega.
I hope to have the connector at hands by the end of the week --> send me a PN with your address and I will mail one.

Well, I couldn't locate in the code which UART is assigned to the GPS.
Config.h only lets you choose

Code: Select all

/* GPS     only available on MEGA boards (this might be possible on 328 based boards in the future)     if enabled, define here the Arduino Serial port number and the UART speed     note: only the RX PIN is used, the GPS is not configured by multiwii     the GPS must be configured to output NMEA sentences (which is generally the default conf for most GPS devices)  */  //#define GPS  //#define GPS_SERIAL Serial3 // should be Serial2 for flyduino v2  //#define GPS_BAUD   4800  //#define GPS_BAUD   9600  


with def.h redefines this to

Code: Select all

Def.h only gives

[code]#if defined(GPS)    #define GPSPRESENT 1  #else    #define GPSPRESENT 0  #endif  [/code]



But, were in the code is GPSPRESENT and GPS_BAUD used so far???

MultiWii.pde only has

Code: Select all

  #if defined(GPS)      GPS_SERIAL.begin(GPS_BAUD);    #endif  

but were is GPS_SERIAL assigned?

Rgds
aBUGSworstnightmare
Attachments
aBUGSworstnightmare GPS connected to FTDI for testing
aBUGSworstnightmare GPS connected to FTDI for testing

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: GPS integration

Post by Alexinparis »

Hi,

GPSPRESENT is used to set a bit in a variable (GUI communication) to indicate the presence of the GPS.
GPS_BAUD and GPS_SERIAL are defined in config.h and used in multiwii.pde

aBUGSworstnightmare wrote:Hi there,

Nils, as already mentioned you need to do a 1:1 connection between the GPS and the Flyduino Mega.
I hope to have the connector at hands by the end of the week --> send me a PN with your address and I will mail one.

Well, I couldn't locate in the code which UART is assigned to the GPS.
Config.h only lets you choose

Code: Select all

/* GPS     only available on MEGA boards (this might be possible on 328 based boards in the future)     if enabled, define here the Arduino Serial port number and the UART speed     note: only the RX PIN is used, the GPS is not configured by multiwii     the GPS must be configured to output NMEA sentences (which is generally the default conf for most GPS devices)  */  //#define GPS  //#define GPS_SERIAL Serial3 // should be Serial2 for flyduino v2  //#define GPS_BAUD   4800  //#define GPS_BAUD   9600  


with def.h redefines this to

Code: Select all

Def.h only gives

[code]#if defined(GPS)    #define GPSPRESENT 1  #else    #define GPSPRESENT 0  #endif  [/code]



But, were in the code is GPSPRESENT and GPS_BAUD used so far???

MultiWii.pde only has

Code: Select all

  #if defined(GPS)      GPS_SERIAL.begin(GPS_BAUD);    #endif  

but were is GPS_SERIAL assigned?

Rgds
aBUGSworstnightmare

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: GPS integration

Post by aBUGSworstnightmare »

Hi Alex,

yes, that's clear! But were can I see which hardware UART is associated to/with GPS_SERIAL label?

Rgds
aBUGSworstnightmare

Alexinparis wrote:Hi,

GPSPRESENT is used to set a bit in a variable (GUI communication) to indicate the presence of the GPS.
GPS_BAUD and GPS_SERIAL are defined in config.h and used in multiwii.pde

aBUGSworstnightmare wrote:Hi there,

Nils, as already mentioned you need to do a 1:1 connection between the GPS and the Flyduino Mega.
I hope to have the connector at hands by the end of the week --> send me a PN with your address and I will mail one.

Well, I couldn't locate in the code which UART is assigned to the GPS.
Config.h only lets you choose

Code: Select all

/* GPS     only available on MEGA boards (this might be possible on 328 based boards in the future)     if enabled, define here the Arduino Serial port number and the UART speed     note: only the RX PIN is used, the GPS is not configured by multiwii     the GPS must be configured to output NMEA sentences (which is generally the default conf for most GPS devices)  */  //#define GPS  //#define GPS_SERIAL Serial3 // should be Serial2 for flyduino v2  //#define GPS_BAUD   4800  //#define GPS_BAUD   9600  


with def.h redefines this to

Code: Select all

Def.h only gives

[code]#if defined(GPS)    #define GPSPRESENT 1  #else    #define GPSPRESENT 0  #endif  [/code]



But, were in the code is GPSPRESENT and GPS_BAUD used so far???

MultiWii.pde only has

Code: Select all

  #if defined(GPS)      GPS_SERIAL.begin(GPS_BAUD);    #endif  

but were is GPS_SERIAL assigned?

Rgds
aBUGSworstnightmare

JohnyGab
Posts: 144
Joined: Sat Oct 29, 2011 4:41 am

Re: GPS integration

Post by JohnyGab »

Did you guy see any problem working the gps at 115200 on mega board?

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

Re: GPS integration

Post by jevermeister »

I tested it with 115200 on my flyduino, the data looked good, but I have not flown it yet...

Nils

Ben_der
Posts: 9
Joined: Thu Aug 25, 2011 5:22 pm

Re: GPS integration

Post by Ben_der »

What about piping the NMEA-Frame delivered by I2C GOS Devices with UART-mimic?
Maybe the Fastrax IT 430 ?

something like :

Code: Select all

const int WANTED_NUMBER = 67; // A usual GPGGA NMEA frame, 67 bytes including $;<CR>;<LF>
static uint8_t datastring [WANTED_NUMBER];
static uint32_t gpscycle;


Code: Select all

#if defined (SOME_GPS_I2C)
  getData();
  while (Wire.available()) {
  if (GPS_newFrame(datastring [WANTED_NUMBER])){
      if (GPS_update == 1) GPS_update = 0;
      else GPS_update = 1;
      if (GPS_fix == 1) {
        if (GPS_fix_home == 0) {
          GPS_fix_home = 1;
          GPS_latitude_home = GPS_latitude;
          GPS_longitude_home = GPS_longitude;
        }
        GPS_distance(GPS_latitude_home,GPS_longitude_home,GPS_latitude,GPS_longitude, &GPS_distanceToHome, &GPS_directionToHome);
      }
    }
  }


&

Code: Select all

float getData ()
      {
      TWBR = ((16000000L / 400000L) - 16) / 2;
      i2c_rep_start(0x60);                     //GPS sample I2c address
           for (byte i = 0; i < WANTED_NUMBER; i++)
           datastring [i] = i2c_readAck();
           datastring [WANTED_NUMBER]= i2c_readNak();           
           return datastring[WANTED_NUMBER];                 // maybe here we will need a terminating null
             if ( (micros()-gpscycle )  < 250000 );   
                 gpscycle = micros();             //250ms = 4Hz refresh;
             getData();                                         
      }
 


roundabout...not tested..waiting for module but will have to switch with a I2C PCA.. least problem i think...

User avatar
dialfonzo
Posts: 62
Joined: Sun Nov 20, 2011 3:18 pm
Location: Quebec, Canada

Re: GPS integration

Post by dialfonzo »

Hi All,

I have hook a GPS to my Mega board yesterday.

Activate the code in config.h

Code: Select all

#define GPS
#define GPS_SERIAL Serial3 // should be Serial2 for flyduino v2
#define GPS_BAUD   4800


The GPS look to work since the GUI tell me that i have setellites...
Picture of GUI
http://static.rcgroups.net/forums/attachments/1/7/6/6/8/9/a4427740-182-MultiWii%20-%20Arduino%20Mega%201280%20-%20GPS.png

I wonder how do i know if it work.. or if i have position data ?

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

Re: GPS integration

Post by jevermeister »

If you have satellites: It works.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: GPS integration

Post by kataventos »

Hi, is there any news about promini integration? I would like to have one on my Paris v4 board! :)

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

Re: GPS integration

Post by dramida »

Hi guys, I need GPS Position hold for making aerial panoramas. Here you can see my albums.

http://caseta.ro/html/fotografie_aeriana.html

User avatar
dialfonzo
Posts: 62
Joined: Sun Nov 20, 2011 3:18 pm
Location: Quebec, Canada

Re: GPS integration

Post by dialfonzo »

I need a Ferrari...!

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: GPS integration

Post by kataventos »

dialfonzo wrote:I need a Ferrari...!


:lol: First the position hold then the Ferrari, one thing at a time!

Post Reply