GPS integration
Re: GPS integration
I think my GPS is not working anymore.
So I can't test anymore.
So I can't test anymore.
Re: GPS integration
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
Re: GPS integration
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'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.
Re: GPS integration
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...
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: GPS integration
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!!!
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!!!
Re: GPS integration
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

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



Re: GPS integration
offtopic on
summerhouse, winterhouse, lab......
whats going on here ?
have you won in the lottery?
offtopic off
summerhouse, winterhouse, lab......
whats going on here ?

have you won in the lottery?

offtopic off
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: GPS integration
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
Re: GPS integration
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?
Re: GPS integration
Katch wrote:Will this require reprogramming the Arduino on the i2c GPS BoB?
Yepp...
Re: GPS integration
jevermeister wrote: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.
Well,
I'm porting this http://code.google.com/p/arducopter/wiki/AC2_loiter_PID which is a proven method, and most of the code is available in arduino format. Almost finished...
- jevermeister
- Posts: 708
- Joined: Wed Jul 20, 2011 8:56 am
- Contact:
Re: GPS integration
Hey Andras,
That is exactly what I wm talking about.cool. I tried to export the mikrokopter code but hwd problems importing it into the code.
Andras,if you need help or ideas,please contact me. I am very interested in helping you.
Nils
That is exactly what I wm talking about.cool. I tried to export the mikrokopter code but hwd problems importing it into the code.
Andras,if you need help or ideas,please contact me. I am very interested in helping you.
Nils
Re: GPS integration
I know you are doing a great job and putting a lot of effort, thank you all.
here's just a thought, when you are already taking GPS speeds into equations of rth...
it would be nice if in upcoming config or gps section of the code, we could define some things if needed
- max ground speed of rth function (if we don't need to come fast from far away, but rather calm speed)
- facing the model to rth point while returning, now it stays oriented as it was, only tilts to home, doesn't turn
(would be better for AP and FPV use)
here's just a thought, when you are already taking GPS speeds into equations of rth...
it would be nice if in upcoming config or gps section of the code, we could define some things if needed
- max ground speed of rth function (if we don't need to come fast from far away, but rather calm speed)
- facing the model to rth point while returning, now it stays oriented as it was, only tilts to home, doesn't turn
(would be better for AP and FPV use)
Last edited by dr.tom on Thu May 03, 2012 2:01 pm, edited 1 time in total.
Re: GPS integration
an other factor that is look interesting for secure is the altimeter for return to home.
if we use return to home is often because we are at long distance so we need to come back without going into a tree. By putting a min altitude for the return to home in secure conditions.
if we use return to home is often because we are at long distance so we need to come back without going into a tree. By putting a min altitude for the return to home in secure conditions.
Re: GPS integration
Bledi wrote:an other factor that is look interesting for secure is the altimeter for return to home.
if we use return to home is often because we are at long distance so we need to come back without going into a tree. By putting a min altitude for the return to home in secure conditions.
First : Stable poshold.
Second : Rate based, cross track corrected RTH
All others after these two...
Re: GPS integration
OK Folks,
I can not hold it back anymore, here is a work-in-progress http://code.google.com/p/multiwii-gps-work/
release. It's a vanilia MultiWii 2.0 codebase for SERIAL GPS ONLY with the following changes:
-Improved mag calibration. It's crucial to have a dead on compass for gps nav. Alex did a great work on simplifying the mag gain and offset calibration, but it also added some non-linearity.
-Added magnetic decliniation to the heading. You can set it at the beginning of the MultiWii.ino
-Raised resolution of the gps coordinates to 1deg = 10 000 000. I had bad experiences with the pervious lower resolution.
-Added a pos_hold PI and a pos_hold_rate PID controller. See description here : http://code.google.com/p/arducopter/wiki/AC2_loiter_PID
-Using PI and PID controller classes (they are in the libraries folder, copy them to arduino libraries folder)
Notes : PI and PID values are not wired out to the gui yet, you have to change them at the beginning of multiwii.ino.
It's a work in progress now, so i'm continously working on this code. You can try it if you really know what are you doing, please do not use it if you are not familiar with multiwii code. I know this code does not follow standard multiwii coding guidelines (for example using classes and libraries) and not optimalised, so please do not complain for these.
And finally, I do not believe that this code will fit into a 328, so please use 1280 or 2560 based boards for testing.
Once the code is stabilised (more or less) i'll put it to the i2c_gps codebase...
I can not hold it back anymore, here is a work-in-progress http://code.google.com/p/multiwii-gps-work/
release. It's a vanilia MultiWii 2.0 codebase for SERIAL GPS ONLY with the following changes:
-Improved mag calibration. It's crucial to have a dead on compass for gps nav. Alex did a great work on simplifying the mag gain and offset calibration, but it also added some non-linearity.
-Added magnetic decliniation to the heading. You can set it at the beginning of the MultiWii.ino
-Raised resolution of the gps coordinates to 1deg = 10 000 000. I had bad experiences with the pervious lower resolution.
-Added a pos_hold PI and a pos_hold_rate PID controller. See description here : http://code.google.com/p/arducopter/wiki/AC2_loiter_PID
-Using PI and PID controller classes (they are in the libraries folder, copy them to arduino libraries folder)
Notes : PI and PID values are not wired out to the gui yet, you have to change them at the beginning of multiwii.ino.
It's a work in progress now, so i'm continously working on this code. You can try it if you really know what are you doing, please do not use it if you are not familiar with multiwii code. I know this code does not follow standard multiwii coding guidelines (for example using classes and libraries) and not optimalised, so please do not complain for these.
And finally, I do not believe that this code will fit into a 328, so please use 1280 or 2560 based boards for testing.
Once the code is stabilised (more or less) i'll put it to the i2c_gps codebase...
Last edited by EOSBandi on Thu May 03, 2012 9:59 pm, edited 1 time in total.
Re: GPS integration
No complaints, thanks for working on it all.
I look forward to testing the I2C version when you are finished, keep up the good work

I look forward to testing the I2C version when you are finished, keep up the good work
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: GPS integration
Is there a safe way to ground test these new features? I am in the process of building a new copter with a 1280 but it is not totally ready yet or that I would trust for GPS flight testing. I really would like to help out if possible.
Re: GPS integration
Hi EOSBandi ,
Today i have test your GPS code
but i think there is a proplem into yout code .
After Switch On GPS Position Hold all is ok , but after ~ 20 - 30 sek. the Copter make a Flip
I have make around 10 Flights , and 9 of tham End with a Flip after turn On Gps .
The Onetime where the copter makes no Flip was the Firt Flight .
But without Flip , the GPS Wokrs very great !
Im not 100% shure that is it a proplem of your code , its also possible that is it a proplem of my Hardware .
My Setup Is :
QuadX
Multiwii 2.0 Processing Gui
Standart Reveiver
Flyduino Mega
Mediatek GPS with 9600bd
MS5611
ITG3200
HMC5843
ADXL345
GPS is Connect to Serial Port 3 .
PID and Pi Parameter from GPS are default
Today i have test your GPS code

but i think there is a proplem into yout code .
After Switch On GPS Position Hold all is ok , but after ~ 20 - 30 sek. the Copter make a Flip

I have make around 10 Flights , and 9 of tham End with a Flip after turn On Gps .
The Onetime where the copter makes no Flip was the Firt Flight .
But without Flip , the GPS Wokrs very great !
Im not 100% shure that is it a proplem of your code , its also possible that is it a proplem of my Hardware .
My Setup Is :
QuadX
Multiwii 2.0 Processing Gui
Standart Reveiver
Flyduino Mega
Mediatek GPS with 9600bd
MS5611
ITG3200
HMC5843
ADXL345
GPS is Connect to Serial Port 3 .
PID and Pi Parameter from GPS are default

Re: GPS integration
LuFa wrote:Hi EOSBandi ,
Today i have test your GPS code![]()
but i think there is a proplem into yout code .
After Switch On GPS Position Hold all is ok , but after ~ 20 - 30 sek. the Copter make a Flip![]()
I have make around 10 Flights , and 9 of tham End with a Flip after turn On Gps .
The Onetime where the copter makes no Flip was the Firt Flight .
But without Flip , the GPS Wokrs very great !
Im not 100% shure that is it a proplem of your code , its also possible that is it a proplem of my Hardware .
My Setup Is :
QuadX
Multiwii 2.0 Processing Gui
Standart Reveiver
Flyduino Mega
Mediatek GPS with 9600bd
MS5611
ITG3200
HMC5843
ADXL345
GPS is Connect to Serial Port 3 .
PID and Pi Parameter from GPS are default
Exactly how do you describe the "flip" ? The GPS code indiced banking is limited to +/- 20deg. So it could not lead to a flip, but could look like an agressive bank.
However it's recommended to use the gps at least 5Hz update rate (10Hz is better) which requires 57kbaud or 112.2K speed.
1Hz is definitely a no go... it throws the pid controller to the extremes.
You can try to limit further the GPS banking by modifying this line in the gps.pde
#define NAV_BANK_MAX 2000
100 = 1deg
Re: GPS integration
Hi EOSBandi
Just tested you new GPS code, "GPS Position Hold"function wokes very great! no flip.
Thanks your wonderful work.
Next step I will test "GO home"function.
BTW, I can say that your code runs on the M328 board very well with a serial 5 Hz Ulbox GPS, of course, "serialCom()" must be commented.
EDIT : "Go home" is also perfect.
Thanks EOSBandi again
Just tested you new GPS code, "GPS Position Hold"function wokes very great! no flip.
Thanks your wonderful work.
Next step I will test "GO home"function.
BTW, I can say that your code runs on the M328 board very well with a serial 5 Hz Ulbox GPS, of course, "serialCom()" must be commented.
EDIT : "Go home" is also perfect.
Thanks EOSBandi again
Re: GPS integration
Hi ygl611,
Can you share, what ublox gps do you use?
Thanks,
John
Can you share, what ublox gps do you use?
Thanks,
John
Re: GPS integration
can you tell me your PID Values ?
today i have found the Flipproplem
it wars a bad cabel connection .
@ EosBandi , witch GPS Modul did you use ?
today i have found the Flipproplem

@ EosBandi , witch GPS Modul did you use ?
Re: GPS integration
flyrobot wrote:Hi ygl611,
Can you share, what ublox gps do you use?
Thanks,
John
I made the Ublox GPS board by myself, use the Ulbox chip NEO6M. GPS PID is defaut value
Last edited by ygl611 on Sat May 05, 2012 2:12 pm, edited 1 time in total.
Re: GPS integration
That is cool.
This gps was using by dji wkm and MK with very good result.
Do you plan to sell with mega 328 ?
John
This gps was using by dji wkm and MK with very good result.
Do you plan to sell with mega 328 ?
John
-
- Posts: 44
- Joined: Wed Apr 25, 2012 11:21 pm
Re: GPS integration
Hello-
Does anybody know how to change the GPS refresh rate of a NAVIGATRON I2C GPS module?
I really would love to test the serial GPS Dev Version of EOSbandi but also see no point in trying this with a refresh rate of 1Hz.
The module should be able to output a 10 Hz position signal.
Thanks and have a nice weekend
Roman
Does anybody know how to change the GPS refresh rate of a NAVIGATRON I2C GPS module?
I really would love to test the serial GPS Dev Version of EOSbandi but also see no point in trying this with a refresh rate of 1Hz.
The module should be able to output a 10 Hz position signal.
Thanks and have a nice weekend
Roman
Re: GPS integration
Quad FRITZ wrote:Hello-
Does anybody know how to change the GPS refresh rate of a NAVIGATRON I2C GPS module?
I really would love to test the serial GPS Dev Version of EOSbandi but also see no point in trying this with a refresh rate of 1Hz.
The module should be able to output a 10 Hz position signal.
Thanks and have a nice weekend
Roman
Current dev is serial gps only.... i2c is still the old code.... stay tuned for the i2c version

Re: GPS integration
10 flight later
I have big proplem with overshoot .
But i know its a proplem of the default setting from the Mediatek GPS , because its only 1hz at 9600bd .
Now i have search for a config tool and have found one
The name is " Mini GPS Tool" (here is the Download link : http://www.robotshop.com/content/SOFTWA ... s-pa6b.zip) .
Know i have setup 10hz and 115200bd and hope i get a better GPS Position Hold .
now i waiting for the rain does stop outside
I will report after the next flight

I have big proplem with overshoot .
But i know its a proplem of the default setting from the Mediatek GPS , because its only 1hz at 9600bd .
Now i have search for a config tool and have found one

Know i have setup 10hz and 115200bd and hope i get a better GPS Position Hold .
now i waiting for the rain does stop outside

I will report after the next flight

Re: GPS integration
now i have make some test flights with 10hz and 115200bd .
But the Position Hold is not realy better than bevor
First 10sek. the Copter Hover at the Hold Position , after some sek. the copter move to one site and the copter goes faster and faster and come not realy back to the Hold position .
Looks like the Compass is wrong , but in GUI the direction is right and also calibrated .
any ideas why ?
EDIT :
what make this line ?
But the Position Hold is not realy better than bevor

First 10sek. the Copter Hover at the Hold Position , after some sek. the copter move to one site and the copter goes faster and faster and come not realy back to the Hold position .
Looks like the Compass is wrong , but in GUI the direction is right and also calibrated .
any ideas why ?
EDIT :
what make this line ?
Code: Select all
SerialWrite(GPS_SERIAL,'$');
SerialWrite(GPS_SERIAL,'P');
SerialWrite(GPS_SERIAL,'M');
SerialWrite(GPS_SERIAL,'T');
SerialWrite(GPS_SERIAL,'K');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,',');
SerialWrite(GPS_SERIAL,'1');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,'*');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'F');
SerialWrite(GPS_SERIAL,'\r');
SerialWrite(GPS_SERIAL,'\n');
Last edited by LuFa on Sat May 05, 2012 6:51 pm, edited 1 time in total.
Re: GPS integration
LuFa wrote:now i have make some test flights with 10hz and 115200bd .
But the Position Hold is not realy better than bevor![]()
First 10sek. the Copter Hover at the Hold Position , after some sek. the copter move to one site and the copter goes faster and faster and come not realy back to the Hold position .
Looks like the Compass is wrong , but in GUI the direction is right and also calibrated .
any ideas why ?
1. did you check and set your magnetic declination ?
2. try changing pid values for powerful copter, decrease P for weak ones, increase....
3. with bad pid's it must oscillate and/or doing circles, if it's flying away then someting basically wrong....
Re: GPS integration
1. declanation is set to 2.55f
2. does i try tomorrow
3. yes i think so , but the Compass work , maybe a proplem of X Config ? I can not realy say if the Copter try to fly back , because i stop the copter after 30-40m .
2. does i try tomorrow

3. yes i think so , but the Compass work , maybe a proplem of X Config ? I can not realy say if the Copter try to fly back , because i stop the copter after 30-40m .
Re: GPS integration
LuFa wrote:1. declanation is set to 2.55f
2. does i try tomorrow![]()
3. yes i think so , but the Compass work , maybe a proplem of X Config ? I can not realy say if the Copter try to fly back , because i stop the copter after 30-40m .
just a short question, did you donwnloaded the whole dev code?
Re: GPS integration
yes 
but i have use copy paste for download your code
because i have no SVN Client to download it , and i dont know how it work ^^

but i have use copy paste for download your code

Re: GPS integration
@Lufa,
This forces the (MediaTek)GPS to output at 10Hz.
SerialWrite(GPS_SERIAL,'$');
SerialWrite(GPS_SERIAL,'P');
SerialWrite(GPS_SERIAL,'M');
SerialWrite(GPS_SERIAL,'T');
SerialWrite(GPS_SERIAL,'K');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,',');
SerialWrite(GPS_SERIAL,'1');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,'0');
SerialWrite(GPS_SERIAL,'*');
SerialWrite(GPS_SERIAL,'2');
SerialWrite(GPS_SERIAL,'F');
SerialWrite(GPS_SERIAL,'\r');
SerialWrite(GPS_SERIAL,'\n');
This forces the (MediaTek)GPS to output at 10Hz.
Re: GPS integration
ok , thanks !
is it need to that that every newstart from the Mwii or does the Mediatek safe this setup ?
is it need to that that every newstart from the Mwii or does the Mediatek safe this setup ?
Re: GPS integration
I've got a DiyDrones MTK2239
When I use MiniGPS_1.4.exe (with FTDI cable direct to the GPS) to change baud rate from 38400 to 115200 and update speed to 10Hz, it works fine, until power is removed.
All settings then revert to default 38400 baud and 1Hz update.
The work-around is to re-configure the GPS at every MultiWii startup.
In config, make a new #define for your defualt GPS baud rate. #define GPS_DEFAULT_BAUD 38400) (DiyDrones GPS is 38400)
and then also define the new GPS baudrate : #define GPS_BAUD 115200
At the end of gps.pde, make a serial function for the GPS,
Then, in multiwii.pde, a the end of setup(), add the following code, to re-configure the GPS.......
Sometimes my GPS takes over 3 minutes to get a fix, other times, 35 seconds???
When I use MiniGPS_1.4.exe (with FTDI cable direct to the GPS) to change baud rate from 38400 to 115200 and update speed to 10Hz, it works fine, until power is removed.
All settings then revert to default 38400 baud and 1Hz update.
The work-around is to re-configure the GPS at every MultiWii startup.
In config, make a new #define for your defualt GPS baud rate. #define GPS_DEFAULT_BAUD 38400) (DiyDrones GPS is 38400)
and then also define the new GPS baudrate : #define GPS_BAUD 115200
At the end of gps.pde, make a serial function for the GPS,
Code: Select all
void GPS_Send_Char(const char *c) {
while (*c) SerialWrite(GPS_SERIAL, *c++);
}
Then, in multiwii.pde, a the end of setup(), add the following code, to re-configure the GPS.......
Code: Select all
#if defined(GPS) // This code sets the MediaTek GPS default 38400 baud to 115200 and set to send NEMA frames
SerialOpen(GPS_SERIAL,GPS_DEFAULT_BAUD);
delay(10);
GPS_Send_Char("$PMTK251,115200*1F\r\n"); //set baudrate 115200
delay(10);
SerialOpen(GPS_SERIAL,GPS_BAUD); // open the serial port at the new speed
delay(10);
GPS_Send_Char("$PMTK314,1,1,1,1,1,5,1,1,1,1,1,1,0,1,1,1,1*2C\r\n"); //set to NMEA output
delay(10);
GPS_Send_Char("$PMTK220,100*2F\r\n"); //Will set the GPS to output serial at 10hz
delay(10);
#endif
Sometimes my GPS takes over 3 minutes to get a fix, other times, 35 seconds???

Last edited by howardhb on Sat May 05, 2012 10:46 pm, edited 2 times in total.
Re: GPS integration
AAAAAAAAaaaaaaHHHHHhhhhhh
that is my proplem of the bad GPS Postition Hold
i have set the new setup with Mini-GPS Tool but the GPS doesnt remember the setup after a new start .

that is my proplem of the bad GPS Postition Hold

Re: GPS integration
I'm using dev20120504 and my MAG never showed the correct direction, according to true compass readings, so I added declination and a compass installation angle correction.
Now, the heading indicator in the GUI, shows exactly NORTH (UP) when copter is facing North (used a hiking compass)
I think this is absolutely necessary for the GPS to work properly.
I made 2 defines in config.h:
#define MAG_DECLINATION -272 // NEGATIVE 27.2 degrres in Port Elizabeth
#define MAG_MOUNTING_ANGLE 1800 // My compass is mounted backwards?
In imu.pde: look for heading = _atan2( EstG.V.X * EstM.V.Z - EstG.V.Z * EstM.V.X , EstG.V.Z * EstM.V.Y - EstG.V.Y * EstM.V.Z ) /10;
Now, the heading indicator in the GUI, shows exactly NORTH (UP) when copter is facing North (used a hiking compass)
I think this is absolutely necessary for the GPS to work properly.
I made 2 defines in config.h:
#define MAG_DECLINATION -272 // NEGATIVE 27.2 degrres in Port Elizabeth
#define MAG_MOUNTING_ANGLE 1800 // My compass is mounted backwards?
In imu.pde: look for heading = _atan2( EstG.V.X * EstM.V.Z - EstG.V.Z * EstM.V.X , EstG.V.Z * EstM.V.Y - EstG.V.Y * EstM.V.Z ) /10;
Code: Select all
#if MAG
// Attitude of the cross product vector GxM
heading = _atan2( EstG.V.X * EstM.V.Z - EstG.V.Z * EstM.V.X , EstG.V.Z * EstM.V.Y - EstG.V.Y * EstM.V.Z );
#if defined(MAG_DECLINATION) // defined in Config.h NOTE: negative or positive. see: http://magnetic-declination.com
heading += MAG_DECLINATION;
#endif
#if defined(MAG_MOUNTING_ANGLE) // to correct the direction of heading indicator. MAG_MOUNTING_ANGLE defined in Config.h
heading += MAG_MOUNTING_ANGLE;
#endif
heading /= 10; // dividing by 10 here gives one decimal place precision for declination, without using floating point addition
if ( heading > 180) // Once we've added the declination and mounting angle correction, make sure heading is in the range of: -180 < HEADING > 180
heading -= 360;
else if (heading < -180)
heading += 360;
#endif
Re: GPS integration
@howardhb : have your GPS a backup battery ?
Re: GPS integration
You can find your specific declination here: http://magnetic-declination.com/
Re: GPS integration
LuFa wrote:@howardhb : have your GPS a backup battery ?
No it doesn't

I might just add a 3V lithium cell or a super capacitor for back-up, for when changing the copter's lipo for a new flight...
Last edited by howardhb on Sun May 06, 2012 7:09 am, edited 1 time in total.
-
- Posts: 44
- Joined: Wed Apr 25, 2012 11:21 pm
Re: GPS integration
@EOSBandi
Thank you so much for the quick reply!
I ll stay tuned because it is bejond my horizon to implement it myself
(or at leat I do not have the time
)
Kind regards
Roman
Thank you so much for the quick reply!
I ll stay tuned because it is bejond my horizon to implement it myself


Kind regards
Roman
Re: GPS integration
does onywhere no , why Serial Sum doesnt work at Arduino Mega and Mwii 2.0 with EOSBandi GPS ?
The Channles move right in the GUI but with big spiks
PPM is connect to PIN 19 (Serial1)
The Channles move right in the GUI but with big spiks

PPM is connect to PIN 19 (Serial1)
Re: GPS integration
@Lufa, just add : Look in config.h
For PPM input on the mega, you must:
For PPM input on the mega, you must:
Code: Select all
/********************************** Buzzer Pin **********************************/
// this moves the Buzzer pin from TXO to D8 for use with ppm sum or spectrum sat. RX (not needed if A32U4ALLPINS is active)
#define D8BUZZER
Re: GPS integration
@howardhb : same proplem
i use graupner MX16 Hott with GR-16
Edit : Have found the proplem
the Receiver is defect .
Question to EOSBandi : it the Home and Hold position allready store in :
GPS_latitude_hold
GPS_longitude_hold
and
GPS_latitude_home
GPS_longitude_home
?
thanks

Edit : Have found the proplem

Question to EOSBandi : it the Home and Hold position allready store in :
GPS_latitude_hold
GPS_longitude_hold
and
GPS_latitude_home
GPS_longitude_home
?
thanks

Last edited by LuFa on Sun May 06, 2012 7:24 pm, edited 1 time in total.
Re: GPS integration
LuFa wrote:@howardhb : same proplemi use graupner MX16 Hott with GR-16
Edit : Habe found the proplemthe Receiver is defect .
Question to EOSBandi : it the Home and Hold position allready store in :
GPS_latitude_hold
GPS_longitude_hold
and
GPS_latitude_home
GPS_longitude_home
?
thanks
Yes
Re: GPS integration
great
is GPS_distanceToHold and GPS_distanceToHome also in use ?

Re: GPS integration
I pushed a quick update to the code,
Simplify GPS nav correction rotation into copters's frame reference
Increased mag declination calculation precisity based on HowardHB idea http://ww
w.multiwii.com/forum/viewtopic.php?f=8&t=649&sid=b2fce6b235836b8406d1b312d3ae0a1
2&start=530#p13470
Lowered default nav pid-s (still need to be tuned...)
Now moving to i2c_gps.....
Simplify GPS nav correction rotation into copters's frame reference
Increased mag declination calculation precisity based on HowardHB idea http://ww
w.multiwii.com/forum/viewtopic.php?f=8&t=649&sid=b2fce6b235836b8406d1b312d3ae0a1
2&start=530#p13470
Lowered default nav pid-s (still need to be tuned...)
Now moving to i2c_gps.....