MultiWii GPS support
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
MultiWii GPS support
MultiWii 1.8 with gps I2C support here http://www.sendspace.com/file/x2pfoa
I am software developer and fan of Multiwii project . Before two weeks ago I started a project to support gps for multiwii. I ordered serial gps module EM-406 - very slowly so replaced!! by the Skylab SKM53 (Mediatek MTK3329 chipset) and developed hardware (based on atmega 168) & software to read gps NMEA strings from gps module, parsing data from nmea and sending these data (now are sending Altitude,Latitude, NumSats) 10 bytes data packet via twi (i2c) interface of atmega 168 to master multiwii control board. I2c communication is directly based on twi interface and TWI registers. Supported and tested is 100Khz and 400Khz i2c bus speed. System stability of my i2c sensor emulation ist good now but much time was necessary until I solved all problems with system freezing. My multiwii board contains (wmp,nk,bmp085,hmc5843 and now gps ) No changes to multiwii control board twi interface code only added gps support.
Status: relased first version - work only with Mediatek MTK3329 chipset with a different
chipset will not work - differently config GPS sentenses.
I used SKM53 gps module , check "read info.txt" in package!! .
Connecting elements:
GPS to I2C board TX -------------> RX of GPS module
GPS to I2C board RX -------------> TX of GPS module
GPS to I2c board VCC -------------> VCC of GPS module
GPS to I2c board GND -------------> GND of GPS module
Video - Data only for visualisation, I work on position hold algoritm, no decimal precision of alt,lat,lon for now
http://www.youtube.com/watch?v=N2DuavNyLHE
Top side of gps board
Bottom side of gps board
I2c connection with control board
Last edited by MichalM_sk on Tue Sep 06, 2011 11:59 am, edited 7 times in total.
Re: MultiWii GPS support
Looks very interesting. Keep up the good work.
Re: MultiWii GPS support
Hey michalM_SK,
Thats awesome. Really great. Where do yo come from?
Did you think to realize a position hold with your gps code?
Kind regards
Kayle
Thats awesome. Really great. Where do yo come from?
Did you think to realize a position hold with your gps code?
Kind regards
Kayle
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: MultiWii GPS support
Hi Michal,
It's a great news toward a GPS integration.
do you you have an idea about the time needed to sent the 23 bytes over I2C at 400kHz ?
It's a great news toward a GPS integration.
do you you have an idea about the time needed to sent the 23 bytes over I2C at 400kHz ?
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
Kayle wrote:Hey michalM_SK,
Thats awesome. Really great. Where do yo come from?
Did you think to realize a position hold with your gps code?
Kind regards
Kayle
Hi, I am from Slovakia.
Position hold is goal of this project.
Alexinparis wrote:Hi Michal,
It's a great news toward a GPS integration.
do you you have an idea about the time needed to sent the 23 bytes over I2C at 400kHz ?
Thank you, I modifies code (master side) and find out what time it is necessary to transfer all gps data via I2C 400kHz.
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
I modified code to view duration of i2c operation (reading gps data - 23 bytes)
results:
Code: Select all
uint32_t sTime = 0; //start time
uint32_t eTime = 0; //end time
uint32_t dTime = 0; //duration time
sTime = micros();
//change I2C bus speed to 400kHz
TWBR = ((16000000L / 400000L) - 16) / 2;
i2c_rep_start((9<<1) + 1); //GPS I2c address 0x09 (7bit) and 0x12 (8bit)
for(uint8_t i = 0; i < 22; i++)
gpsData[i]= i2c_readAck();
gpsData[22]= i2c_readNak();
eTime = micros();
dTime = eTime - sTime;
Serial.print("duration of i2c operation in uSec: "); Serial.println(dTime);
results:
Code: Select all
100kHz - 692 uSec
400kHz - 616 uSec
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
I added a new video with full implementation to MultiWiiConf.
http://www.youtube.com/watch?v=PZN7VO-xhuE
http://www.youtube.com/watch?v=PZN7VO-xhuE
Re: MultiWii GPS support
Hey michalm_sk,
Great, keep going. I check the details from the gps modul you are using. The positional accuracy is normaly 10m. Do you think there is a good position hold function thinkable?
Greetings Kayle
Great, keep going. I check the details from the gps modul you are using. The positional accuracy is normaly 10m. Do you think there is a good position hold function thinkable?
Greetings Kayle
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
Kayle wrote:Hey michalm_sk,
Great, keep going. I check the details from the gps modul you are using. The positional accuracy is normaly 10m. Do you think there is a good position hold function thinkable?
Greetings Kayle
+- 10 meters is normal positional accuracy for non-SBAS (WAAS, EGNOS,...). but sirfstar III chipset in EM-406 support WAAS. so I will test it with WAAS enable. Only tests confirm what is the real accuracy. Also it is possible to use any other GPS module (connected to gps board) with standard NMEA 0183 data format
Re: MultiWii GPS support
MichalM_sk wrote:Code: Select all
100kHz - 692 uSec
400kHz - 616 uSec
I'd hate to tell you that those numbers are a little bit off. There is no way that reading 23 bytes will take such a short time.
Let's do some math: at 100kHz one bit takes exactly 1/100000 = 10us, so one byte with start, ack, and stop bits will take about 100us. Reading 23 byte should take about 23 * 100 = 2300us, plus you need another 2 bytes of address before that, so total would be 2500ms.
At 400kHz it will be much faster, one byte is about 30us, so 23 * 30 = 690 plus 2 bytes of address, 750us total.
To prove the math I attached the screenshots from oscilloscope.
First two show signals at 100kHz, and the third one is at 400kHz.
- Attachments
-
- I2C_400kHz_1.gif
- (9 KiB) Not downloaded yet
-
- I2C_100kHz_2.gif
- (8.97 KiB) Not downloaded yet
-
- I2C_100kHz_1.gif
- (7.58 KiB) Not downloaded yet
Re: MultiWii GPS support
Supppose you will not use i2c but custom bit-banged protocol sending blindly data and clock? Then speed depends only of yor processors clock (assuming that int's are disabled during transfer). In that case you'd need a separate processor at the gps side collecting and deciphering data from slow gps module. As soon as main processor enables transfer, it could be done very quickly.
I used such trick in my gamma-spectrometer (PhD work). Can't tell exact transfer time right now but it was below 1ms for sure.
I used such trick in my gamma-spectrometer (PhD work). Can't tell exact transfer time right now but it was below 1ms for sure.
Re: MultiWii GPS support
HI Guys,
I appriciate the work to bring gps to MultiWii, but do we really need to go along the i2c path? The amount of data that we need to move is quite big, compared to the sensor data and with a 10Hz GPS it will slow down the cycle time significantly. Plus the serial to i2c conversion also add unneccessary complication to the system. I rather suggest to connect gps to a serial port. I know that the Arduino mini does not have enough ports, but some of the recent developments also requires a ATMega 2560 or similar board.
Regards,
Andras
I appriciate the work to bring gps to MultiWii, but do we really need to go along the i2c path? The amount of data that we need to move is quite big, compared to the sensor data and with a 10Hz GPS it will slow down the cycle time significantly. Plus the serial to i2c conversion also add unneccessary complication to the system. I rather suggest to connect gps to a serial port. I know that the Arduino mini does not have enough ports, but some of the recent developments also requires a ATMega 2560 or similar board.
Regards,
Andras
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
I use custom i2c protocol, 23 bytes was sent only for visualization purposes in multiwiiconf, currently is addressed only 10Byte (4 bytes Latitude , longitude and 2 conf bytes), control board read data from i2c GPS every 100 ms. Reading speed at 400 kHz is now comparable to the HMC5843.
Refresh rate of EM406 GPS module is too low (1Hz) so it is currently used MediaTek MT3329 GPS module with refresh rate increase up to 10Hz.
In the coming days I will test it, but in the moment I have a problem with PID values on dev firmware. Default values is not working for me.
Refresh rate of EM406 GPS module is too low (1Hz) so it is currently used MediaTek MT3329 GPS module with refresh rate increase up to 10Hz.
In the coming days I will test it, but in the moment I have a problem with PID values on dev firmware. Default values is not working for me.
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
currently is implemented the routine to hold position and go home position (not complete - missing yaw correction)
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
Project status:
Position hold work (still needs a lot of testing) but i have gps unacuracy during the day sometimes up to 20 meters (in Slovakia, like elsewhere in Europe), about 10 - 11.00 pm only 1 to 2 m.
I have to try it when the geometry of satellites in the sky to determine the best accuracy.
Position hold work (still needs a lot of testing) but i have gps unacuracy during the day sometimes up to 20 meters (in Slovakia, like elsewhere in Europe), about 10 - 11.00 pm only 1 to 2 m.
I have to try it when the geometry of satellites in the sky to determine the best accuracy.
Re: MultiWii GPS support
Hi,
Do you have the code or diff from svn ? I wan to do a try with my gps from remzibi osd )
Thanks
Do you have the code or diff from svn ? I wan to do a try with my gps from remzibi osd )
Thanks
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
babelo wrote:Hi,
Do you have the code or diff from svn ? I wan to do a try with my gps from remzibi osd )
Thanks
Hi,
At the moment the project is not public, want to have any testing until it was finalized.
For GPS position hold will be required:
- GPS sensor board (serial MTK GPS connected to developed custom I2C board)
- Magnetometer (determine the size of the angle between the head and the true North)
Re: MultiWii GPS support
Ok so, i can continue to look at part of code from ardupirat, which took pid loop for lat / lon, and maybe heading can be read from gps too when copter is in move.
Code is there just need to extract part for NMEA serial, reading / pid loop
Code is there just need to extract part for NMEA serial, reading / pid loop
Re: MultiWii GPS support
I am just playing around with a Holux GPSlim 236 on a Arduino Mega Serial port.
I think the NMEA protocol doesnt provide a higher update rate than 1 Hz, which should be high enough for position hold an autonomous flight (and in contrast to the speed of quadrocopters and the precision of GPS)?
Regards
Kai
I think the NMEA protocol doesnt provide a higher update rate than 1 Hz, which should be high enough for position hold an autonomous flight (and in contrast to the speed of quadrocopters and the precision of GPS)?
Regards
Kai
Re: MultiWii GPS support
here's some kind of motivation to get GPS support going
http://www.multiwii.com/forum/viewtopic.php?f=7&t=469&p=3244#p3244
Greetings,
Lapino
http://www.multiwii.com/forum/viewtopic.php?f=7&t=469&p=3244#p3244
Greetings,
Lapino
Re: MultiWii GPS support
Hello Michal
I would love to hear if you've made any progress with your GPS software and are perhaps ready to share it with us...
Thanks
I would love to hear if you've made any progress with your GPS software and are perhaps ready to share it with us...
Thanks
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
Hi,
I returned from vacation.
Following days I will implement my code to multiwii 1.8 and then publish the source code.
Info for all interested
This project is built on the Arduino pro mini platform which has only one serial port. Therefore, communication with the GPS is solved through the I2C bus. After more testing I found no errors during i2c comunication with my board so there is no freeze I2C bus, which could cause an accident.
Benefits I2c solutions
Main CPU does not slow down with reading serial port data (every 100ms), decoding the GPS data, position data averaging
Only 10Bytes is sending via I2C
Very short transfer time (about 300 us)
400kHz I2C bus
I returned from vacation.
Following days I will implement my code to multiwii 1.8 and then publish the source code.
Info for all interested
This project is built on the Arduino pro mini platform which has only one serial port. Therefore, communication with the GPS is solved through the I2C bus. After more testing I found no errors during i2c comunication with my board so there is no freeze I2C bus, which could cause an accident.
Benefits I2c solutions
Main CPU does not slow down with reading serial port data (every 100ms), decoding the GPS data, position data averaging
Only 10Bytes is sending via I2C
Very short transfer time (about 300 us)
400kHz I2C bus
Re: MultiWii GPS support
Amazing. I'm new to this world of MultiWii, but i want to help soon! I'm a Java programmer and i want to contribute with to help our platform be bigger and mature.
I need to take a look at this forum to start with this exciting world...
Best regards!
I need to take a look at this forum to start with this exciting world...
Best regards!
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
I added sources. More info in this topic http://www.multiwii.com/forum/viewtopic.php?f=8&t=649&start=20
Re: MultiWii GPS support
Wow i am really astonished how fast the things moved.
I am still full of work and have hardly any time to test all the thing which are new here.
Did a quick test with a Flyduino V2 and a FMP04, got no fix.
Changed the serial3 simply to serial2 but may i am wrong and its more complicated.
I think my serial mapping makes some problems, as the GPS proved to work on the megapriate before.
Its on Serial2 for the V2 Flyduino.
The cables should arrive tomorrow, but i still need some time to evaluate the new GPS module abugsnightmare found, have it here but didnt connected it, in my opinion its a hot item and the support will be good, it will be also relaitve cheap.
So more will come for sure.
I am still full of work and have hardly any time to test all the thing which are new here.
Did a quick test with a Flyduino V2 and a FMP04, got no fix.
Changed the serial3 simply to serial2 but may i am wrong and its more complicated.
I think my serial mapping makes some problems, as the GPS proved to work on the megapriate before.
Its on Serial2 for the V2 Flyduino.
The cables should arrive tomorrow, but i still need some time to evaluate the new GPS module abugsnightmare found, have it here but didnt connected it, in my opinion its a hot item and the support will be good, it will be also relaitve cheap.
So more will come for sure.
Re: MultiWii GPS support
Dear Michal,
I very interested in your GPS solution.
Can you give me your schematic and source for the GPS adapter board to implemt this in my MULTIWII Copter with Arduino Pro Mini?
thanks
Oliver
I very interested in your GPS solution.
Can you give me your schematic and source for the GPS adapter board to implemt this in my MULTIWII Copter with Arduino Pro Mini?
thanks
Oliver
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
SoundMTB wrote:Dear Michal,
I very interested in your GPS solution.
Can you give me your schematic and source for the GPS adapter board to implemt this in my MULTIWII Copter with Arduino Pro Mini?
thanks
Oliver
Hi,
sources & pcb layout in my first post
Re: MultiWii GPS support
Thanks
sorry I was so happy to find a GPS solution than I haven't seen the file
gread job
Oliver
sorry I was so happy to find a GPS solution than I haven't seen the file
gread job
Oliver
Re: MultiWii GPS support
Hi MichalM_sk,
thank you for posting your GPS-I2C-Converter.
I have a 4800baud-GPS-Modul (1Hz). Am I able to use your converter as it is, or are there changes to be done in the Mega168-Firmware ?
Can you send me the sourcecode? Then i can do the changes myself.
Thank you alot
have a nice day
Matthias
thank you for posting your GPS-I2C-Converter.
I have a 4800baud-GPS-Modul (1Hz). Am I able to use your converter as it is, or are there changes to be done in the Mega168-Firmware ?
Can you send me the sourcecode? Then i can do the changes myself.
Thank you alot
have a nice day
Matthias
Re: MultiWii GPS support
Has anybody an idea what happened to MichalM_SK ?
Re: MultiWii GPS support
Userstats say
Last visited:02 Nov 2011 10:34
So probably done something else for a while.
Last visited:02 Nov 2011 10:34
So probably done something else for a while.
-
- Posts: 1
- Joined: Thu Jan 12, 2012 6:57 pm
Re: MultiWii GPS support
Hi
Sorry for my english
I want to build this project
to my multiwii
I have 2 questions about the construction.
First Q2 how much Mhz?
Second Does the GPS sensor will be good?
http://www.maritex.com.pl/pl/shop/produ ... /1/backurl
Thank you very much for your help.
Sorry for my english
I want to build this project
to my multiwii
I have 2 questions about the construction.
First Q2 how much Mhz?
Second Does the GPS sensor will be good?
http://www.maritex.com.pl/pl/shop/produ ... /1/backurl
Thank you very much for your help.
Re: MultiWii GPS support
Hello,
I have a plan to create a GPS I2C adapter board, but I encountered a problem in the making.
Unable to figure out the value of Q2.
It would be very grateful to you if we who says that value
Thanks
I have a plan to create a GPS I2C adapter board, but I encountered a problem in the making.
Unable to figure out the value of Q2.
It would be very grateful to you if we who says that value
Thanks
Last edited by skazic on Thu Jan 19, 2012 10:32 am, edited 1 time in total.
Re: MultiWii GPS support
I think it will work.
It have both Serial and USB ports.
It have both Serial and USB ports.
Re: MultiWii GPS support
leszczuarek wrote:Hi
Sorry for my english
I want to build this project
to my multiwii
I have 2 questions about the construction.
First Q2 how much Mhz?
Second Does the GPS sensor will be good?
http://www.maritex.com.pl/pl/shop/produ ... /1/backurl
Thank you very much for your help.
Hi,
I think you are from Poland so please read this post
http://rc-fpv.pl/viewtopic.php?t=5576
But fer every other people who want to use this module - I have custom firmware for this module with 10Hz support and binary protocol
-
- Posts: 1
- Joined: Tue May 01, 2012 6:47 pm
Re: MultiWii GPS support
Hello Michal,
great work !
Could you please also post a schematic of the pcb.
In your first post are the pcb and the placement of the parts but no schematics.
I just bought a TQFP-Breakoutboard and don't want to use your PCB due to space problems in my copter .
May you be so kind, to attach it here ?
Greetings from Munich Uli
great work !
Could you please also post a schematic of the pcb.
In your first post are the pcb and the placement of the parts but no schematics.
I just bought a TQFP-Breakoutboard and don't want to use your PCB due to space problems in my copter .
May you be so kind, to attach it here ?
Greetings from Munich Uli
-
- Posts: 89
- Joined: Wed Jun 15, 2011 5:04 pm
- Location: Slovakia
Re: MultiWii GPS support
Hi,
new schematic + latest hex (from 3.10.2011) in attachment.
I use my I2c board about one year without any problems. Now with modified MultiWii 2.0
Regards Michal M
new schematic + latest hex (from 3.10.2011) in attachment.
I use my I2c board about one year without any problems. Now with modified MultiWii 2.0
Regards Michal M
- Attachments
-
- gpsI2cBoard.zip
- (15.43 KiB) Downloaded 417 times
Re: MultiWii GPS support
KaiK wrote:I am just playing around with a Holux GPSlim 236 on a Arduino Mega Serial port.
I think the NMEA protocol doesnt provide a higher update rate than 1 Hz, which should be high enough for position hold an autonomous flight (and in contrast to the speed of quadrocopters and the precision of GPS)?
Regards
Kai
Hello Kai
I just placed order for my multiwii quad parts, waiting for shipment to be delivered.
I have Holux GPSlim 236 as well, and i am totally new to electronics and Quad Copters, this is my first attempt in doing something in this Hobby.
since holux gpslim236 can output gps data over bluetooth interface, initially i thouhgt of getting bluetooth module for Cirus Multiwii SE and interfacing with Holux GPSlim236 in getting the gps data, later i found that mini USB interface on Holux GPSlim can output serial data.
I found this info regarding the holux gpslim 236 pinout
http://pinouts.ru/GPS/holux_gps_pinout.shtml
i thought it might help.
If you are still playing with GPSlim236, I will be joining you soon .
Thanks
Chandoo
Re: MultiWii GPS support
Forget the holux, it's a SirfIII based module, max 1Hz update rate. Not enough for poshold.
Re: MultiWii GPS support
What do i need to coonect GPS to my MultiWii SE board?
Can you please give me link to best price?
Thank You!
Can you please give me link to best price?
Thank You!
Re: MultiWii GPS support
thats know the right plase to ask question about gps :
viewtopic.php?f=8&t=649
viewtopic.php?f=8&t=649
Odp: MultiWii GPS support
I started to think about buying a gps. Which one is better u-blox or MTK?
Re: MultiWii GPS support
I have both MTK and ublox, i still prefer MTK chipset FMP04 from flyduino (its serial). FMP04 just plug and run without any modification and very good signal reception.