Multiwii Crius vers2.5/GPS problem

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

I am relatively new to quads.I have programmed the flight controller and initially had problems with electrical interference which has been rectified.All modes seem to function correctly until you come to GPS functions.GPS hold does not function and when GPS RTH is selected the quad rises to about 15 metres and loss of manual throttle control and does not RTH.
I am using a CN06 GPS,i2c GPS board.
Been through the config h code and with my limited knowledge can't see where I am going wrong.The i2c is giving a 3d fix and when connected via Bluetooth to my tablet and running EZ-GUI ground station it gives me a quite accurate position fix on the map.If I look at switch selection on the EZ GUI both GPS hold and GPS RTH seem to select ok.
Any advice on where I may be going wrong would be greatly appreciated.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

Some of the many things that can make GPS malfunction.

Did not calibrate mag before using (You should always properly calibrate the mag before any gps flight)

Wrong magnetic declination in config.h

Wrong GPS protocol enabled in config.h

Failure to enable the waypoint define in config.h
//Enables the MSP_WP command set , which is used by WinGUI for displaying an setting up navigation
#define USE_MSP_WP

Having the next statement un commented in config.h
// HOME position is reset at every arm, uncomment it to prohibit it (you can set home position with GyroCalibration)
//#define DONT_RESET_HOME_AT_ARM

Impatience. You must wait for a 6 satellite lock. Your quad will show accurately on the map with only 1 satellite.

Space weather. (Solar flares) Do not depend on GPS

Geomagnetic weather. (geomagnetic storms) Do not depend on GPS

RX and TX wires not reversed

GPS antenna pointed wrong direction (ceramic antenna should face up)

Funny thing is, I consider my GPS to work pretty well most of the time (95%) and then some days it just messes up. Doesn't seem to matter if everything is right on those days. I am always ready to flip out of mission if I'm in one and fly it back manually if needed.
Last edited by Kbev5709 on Sat Jan 23, 2016 12:15 am, edited 1 time in total.

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

Kbev5709 wrote:Some of the many things that can make GPS malfunction.

Did not calibrate mag before using (You should always properly calibrate the mag before any gps flight)

Wrong magnetic declination in config.h

Wrong GPS protocol enabled in config.h

Failure to enable the waypoint define
//Enables the MSP_WP command set , which is used by WinGUI for displaying an setting up navigation
#define USE_MSP_WP

Having the next statement un commented
// HOME position is reset at every arm, uncomment it to prohibit it (you can set home position with GyroCalibration)
//#define DONT_RESET_HOME_AT_ARM

Impatience. You must wait for a 6 satellite lock. Your quad will show accurately on the map with only 1 satellite.

Space weather. (Solar flares) Do not depend on GPS

Geomagnetic weather. (geomagnetic storms) Do not depend on GPS

RX and TX wires not reversed

GPS antenna pointed wrong direction (ceramic antenna should face up)

Funny thing is, I consider my GPS to work pretty well most of the time (95%) and then some days it just messes up. Doesn't seem to matter if everything is right on those days.

If the EZ-GUI Groundstation is displaying a position on the map whether it's 1 or 6 satellites does that indicate that the flight controller is accepting and processing information from the i2c.If that is the case then it must be something I haven't set correctly in config h.Having only say 2 satellites would only make your position inaccurate wouldn't it?

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

fly4fun6719 wrote:GPS hold does not function and when GPS RTH is selected the quad rises to about 15 metres and loss of manual throttle control and does not RTH.
The following code in the nav section in your config.h comes set to function by default and this is why it rises to height and you have no throttle control. Reasons for not returning to home are detailed further down below. Code:

Code: Select all

//Defines the RTH altitude. 0 means keep current alt during RTH (in meters)
#define RTH_ALTITUDE               15        //(**)

//Wait to reach RTH alt before start moving to home (0-no, 1-yes)
#define WAIT_FOR_RTH_ALT           1         //(**)

//Navigation engine will takeover BARO mode control
#define NAV_TAKEOVER_BARO          1         //(**)

//Throttle stick input will be ignored  (only in BARO)
#define IGNORE_THROTTLE            1         //(**)


fly4fun6719 wrote:If the EZ-GUI Groundstation is displaying a position on the map whether it's 1 or 6 satellites does that indicate that the flight controller is accepting and processing information from the i2c.
So it would seem to me :shock:
fly4fun6719 wrote:If that is the case then it must be something I haven't set correctly in config h.
All I did was provide a list of things that will prevent GPS from working. Four of those things are config.h related.
fly4fun6719 wrote:Having only say 2 satellites would only make your position inaccurate wouldn't it?

From personal experience, and lets say a few missions under my belt, two satellites will not even allow your navigation system to be functional. It is actually written into the code that you need at least 5 satellites to acquire a home position (which is not the same as just showing up on the map.) Also my EZ GUI announces when the navigation system is working so I know if I can fly using my GPS when I'm using EZ GUI because it always tells me. It never tells me until I have six satellites. A female voice actually tells me "Navigation system is working."
Here is some video of my EZ gui letting me know my nav system is working. It told me before I started filming then it told me again after I flipped into mission. Then it told me again after I flipped out of mission. I had like 12 satellites that day. http://www.youtube.com/watch?v=T4iVyityrpc
If you look below at this code from GPS.cpp in the arduino library you can see one reference to the greater than or equal to 5 satellites (really, mine never works with just 5, I don't know why) so by the looks of this code snippet you personally will need to acquire at least 5 satellites for your GPS to function. I'm pretty sure this is part of the RTH sequence. Here is the snippet:

Code: Select all

//check home position and set it if it was not set
  if (f.GPS_FIX && GPS_numSat >= 5) {
    #if !defined(DONT_RESET_HOME_AT_ARM)
       if (!f.ARMED) {f.GPS_FIX_HOME = 0;}
    #endif
    if (!f.GPS_FIX_HOME && f.ARMED) {
      GPS_reset_home_position();

You can see by the code that home position is not set until you get a 5 satellite fix. When you try and RTH, without the fix your quad goes right to the return to home height that is programmed into the config.h nav section, but when it tries to go home, no home position was set without the 5 satellite fix, so it just flies where ever it wants. All with a loss of throttle control to boot! It's probably headed towards Prague over in eastern Europe where all of the the default GPS settings are located. :mrgreen: :lol: Who knows? You just gotta flip out of RTH if things aren't right. Also this part of the above code is in reference to one of the things that I said would keep your GPS from functioning in an earlier reply:

Code: Select all

 #if !defined(DONT_RESET_HOME_AT_ARM)

Following is a link to a video of one of my autonomous flights taken from the ground http://www.youtube.com/watch?v=LYtzIHFfaxo
and one from the on board cam on that flight http://www.youtube.com/watch?v=LPiQ4UwF-sk
Proof that with perseverance, a multiwii can do waypoint stuff pretty well. But without a doubt, nav stuff has probably the steepest learning curve and can be one of the most difficult things to grasp completely, and if things aren't done correctly a disaster could ensue so before you flip that mission switch or that RTH function make sure it is actually going to work as planned. If in doubt, work with smaller RTH height settings and RTH from 20 yards or so instead of flying half a mile away. Learn from mistakes. Ask questions when something weird happens (you are doing that right now :D .) The FC can only do what it is told. Tell it the right things for the task at hand. Get to know how to use the config.h. Realize that a lot of stuff in there is enabled by default and might need to be tweaked from default settings for what you are trying to do. You can enter in different numerical values in lots of the #define_STATEMENTS. A lot of the stuff in there isn't even needed for a quadcopter and is there for collective pitch single bladed heli's and fixed wing airplanes but it is enabled by default anyway. I personally turn all of that stuff off. And last but not least, remember that any time you tweak things and re upload your sketch, you will need to accurately re calibrate both your ACC and Mag.

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

Thanks kbev5709 for all the information.A lot to digest but enjoy the challenge.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

One more little detail. Pos hold is basically a type of waypoint so you must have the following statement enabled for it to function:

//Enables the MSP_WP command set , which is used by WinGUI for displaying an setting up navigation
#define USE_MSP_WP

(Shown enabled)

I got into multiwii because it could do waypoint stuff.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

fly4fun6719 wrote:Thanks kbev5709 for all the information.A lot to digest but enjoy the challenge.

One quick question. Are you trying to do GPS using a 328P processor (in your flight controller?) I ask because you are using i2c. They are known to not have the memory to do GPS with any kind of reliability. I think a mission would be a bit much for that processor. It might do Pos Hold and RTH....I don't know. Never tried to use one. To me, that would be like bringing a knife to a gunfight.
If you aren't using a 328p, why even use the i2c? Is it for the save config function? (Not real familiar with the capabilities of that particular GPS module.)

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

Kbev5709 wrote:
fly4fun6719 wrote:Thanks kbev5709 for all the information.A lot to digest but enjoy the challenge.

One quick question. Are you trying to do GPS using a 328P processor (in your flight controller?) I ask because you are using i2c. They are known to not have the memory to do GPS with any kind of reliability. I think a mission would be a bit much for that processor. It might do Pos Hold and RTH....I don't know. Never tried to use one. To me, that would be like bringing a knife to a gunfight.
If you aren't using a 328p, why even use the i2c? Is it for the save config function? (Not real familiar with the capabilities of that particular GPS module.)

It's a Crius version 2.5 with a AT Mega 328p microprocessor.At the moment I am only interested in GPS hold and RTH.Just an option I thought I could use if in trouble.What board would you recommend as being more reliable?

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

fly4fun6719 wrote:It's a Crius version 2.5 with a AT Mega 328p microprocessor.At the moment I am only interested in GPS hold and RTH.Just an option I thought I could use if in trouble.What board would you recommend as being more reliable?

To be honest, if you can get what you want out of GPS (RTH and Pos Hold,) and get it to work on that board, stick with it if just for all the work it took to get it working :D If you find that farther down the road you want to do some autonomous flying then I would go with a mega board that uses an AT Mega 2560 processor. There is a mess of different ones out there. I personally use two RTFQ Pro 2, one RTFQ Pro 3 Blacked Mag Edition, and one Hobbyking Pro W/MTK GPS. The HK one is sort of obsolete with better boards with newer better barometers available for a better price. I would avoid that one if buying another board.
Those (the AT Mega 2560) are probably the best boards for full fledged waypoint mission stuff if you want to stay in the multiwii realm. Mine work awesomely! Other mega boards are made by Crius. I think they are called Crius AIO boards. I don't use anything from Crius.
I forgot to ask. What version of Multiwii firmware are you using? 2.2? 2.3? 2.4? The 328p if I remember correctly runs GPS best on the 2.3 version, believe it or not, because it was not fully implemented in that version. I think all it had parameters for was RTH and Pos Hold. Now in 2.4 it is full featured and the added functions I'm sure went beyond what the 328p can handle when you figure all the other libraries that were updated in the process. Mega boards have 4 times the memory of a 328p and handle GPS like it is no big deal.

Cereal_Killer
Posts: 221
Joined: Fri Mar 06, 2015 5:44 am

Re: Multiwii Crius vers2.5/GPS problem

Post by Cereal_Killer »

I'll chime in that if you're wanting full gps features from multiwii the best performing mega based board I've ever personally experienced was the Circus AIO Pro V2. I'm SURE there's others just as good but I know for sure, from my own experience the aio works great. It's also the board FungSengDrone used and had near perfect position hold from back when he was around.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

Cereal_Killer wrote:I'll chime in that if you're wanting full gps features from multiwii the best performing mega based board I've ever personally experienced was the Circus AIO Pro V2. I'm SURE there's others just as good but I know for sure, from my own experience the aio works great. It's also the board FungSengDrone used and had near perfect position hold from back when he was around.

I was talking with Fengshuidrone over at Multirotor Forums there for a while. He knew a lot about the mega boards for sure. I think he left there too. Haven't seen a post from him there in months. I think he had a falling out with Bartman over something.

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

As you suggested Kbev5709 went through the config h and disabled a lot of the default settings plus recalibrated the mag and acc after the changes.Also checked the number of satellites on two occasions using the EZ-GUI.First 7 second 10 which would be enough for RTH.Haven't tried RTH again yet since the changes.
Can I change RTH height of 15 metres to a lower altitude compile and upload just to check if that mode works without getting into too much trouble.
Sorry for throwing so many questions in there but I have one more that somebody may be able to answer.My quad is using Multistar speed controllers.What I am finding is the props don't start spinning until the throttle is at about 45%.I have done a search and apparently you can't calibrate Multistar esc's.Is there any other way around this problem?Maybe altering the min throttle command sent to the esc in the config h code.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

fly4fun6719 wrote:As you suggested Kbev5709 went through the config h and disabled a lot of the default settings plus recalibrated the mag and acc after the changes.
As long as you didn't disable any of the functions that you actually need :shock:
fly4fun6719 wrote:Also checked the number of satellites on two occasions using the EZ-GUI.First 7 second 10 which would be enough for RTH. Haven't tried RTH again yet since the changes.
Can I change RTH height of 15 metres to a lower altitude compile and upload just to check if that mode works without getting into too much trouble.
Yes, you can change that value. Just make sure nothing is between you and the quad that it can run into at low altitude. BTW, you must wait to arm until after it has that many satellites because if you take off and fly before it has a home RTH will still not work even with twenty satellites.
fly4fun6719 wrote:Sorry for throwing so many questions in there but I have one more that somebody may be able to answer.My quad is using Multistar speed controllers.What I am finding is the props don't start spinning until the throttle is at about 45%.I have done a search and apparently you can't calibrate Multistar esc's. Is there any other way around this problem?Maybe altering the min throttle command sent to the esc in the config h code.
What you need is to program the multistar with the Turnigy programming card. I have one of those and they are easy enough to use. Short of that I found two video's relating to your problem. Good old HK doesn't do a very good job helping folks who bought their stuff actually get their stuff to work correctly. For some reason they ship the ESC programmed with the brake on, and several other settings that probably need changed for them to work ok. HK probably does all that (no instructions how to calibrate, ship with brake on) so they can sell their programming card. If people actually knew how to do it without the card they (HK) would miss out on millions in programming card sales. That plus THEY DO NEED CALIBRATED. The first vid posted shows a dude with the same thing as what you have going on. Second video, he actually programs them without a card. I hope they help out with your latest issue that is really not your fault :mrgreen: https://www.youtube.com/watch?v=sK9JVypYfvU https://www.youtube.com/watch?v=XlJzCZ7qQxk

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

Thanks very much for the help Kbev.The areas where I undefined were the fixed wing and helicopters.Testing RTH will be at our local club field,a large flat grassy area.I shall watch the video.
Just as an addition to this reply the esc's were checked for calibration individually,disconnected from the FC and all worked as they should.However when connected to the FC they still have the same problem of not rotating until throttle is at about 45%.Have tried changing the min throttle from 1150 down to 1000 but still the same.Hate asking again but would you have any advice?

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

Have you done this while the FC is hooked up to the ESCs? It's down near the bottom of your config.h.

Code: Select all

/********************************************************************/
  /****           ESCs calibration                                 ****/
  /********************************************************************/

    /* to calibrate all ESCs connected to MWii at the same time (useful to avoid unplugging/re-plugging each ESC)
       Warning: this creates a special version of MultiWii Code
       You cannot fly with this special version. It is only to be used for calibrating ESCs
       Read How To at http://code.google.com/p/multiwii/wiki/ESCsCalibration */
    #define ESC_CALIB_LOW  MINCOMMAND
    #define ESC_CALIB_HIGH 2000
    //#define ESC_CALIB_CANNOT_FLY  // uncomment to activate

WARNING...you MUST take your props off to run this. What you do is enable this: //#define ESC_CALIB_CANNOT_FLY // uncomment to activate
TAKE YOUR PROPS OFF!!! Hook up the battery and then upload the sketch with that enabled and the li po plugged in. The motors should run up to full throttle for about 5 seconds. This should get your FC and ESCs on the same page.
IMPORTANT After doing that, go back and re-comment that statement then re-upload.
When you do this you want your mincommand in the config.h lower than your minthrottle in the config.h.
Perhaps at some time in the past while setting up without knowing completely what you were doing, your mincommand was set at 1300 or something like that. If this step was done with the mincommand at 1300 at some time in the past and never corrected then it would explain things. I'm just grasping at straws here. I only have one quad that uses separate ESCs and everything went smooth when setting up. On my other two quads I use a 4 in 1 Q Brain ESC. In my config.h I have a mincommand of 950 and minthrottle of 1000 on all three quads.
About that ESC programming card. It works on Turnigy stuff. I can make my motors sing little songs with it. Right now it plays Auld Lang Syne.
For others following. The topic has drifted off subject from the heading of GPS problem. Yes, pun intended. Sorry.

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

Did the esc calibration but the motors didn't spin up only the esc's beeped.throttle response didn't change.Are there any other areas of config h that would affect throttle response?
If preferred I can open a new topic on throttle adjustment.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

fly4fun6719 wrote:Did the esc calibration but the motors didn't spin up only the esc's beeped.throttle response didn't change.Are there any other areas of config h that would affect throttle response?
If preferred I can open a new topic on throttle adjustment.

That would be best. Others that know your problem can maybe help more than me that way.
Yeah, if you did that and the motors didn't spin you must have not have had your li po hooked up. Battery has gotta be plugged in when doing that. If it was plugged in then I have got to admit that we missed something somewhere but I have no clue what we missed.

Cereal_Killer
Posts: 221
Joined: Fri Mar 06, 2015 5:44 am

Re: Multiwii Crius vers2.5/GPS problem

Post by Cereal_Killer »

Kbev5709 wrote:I was talking with Fengshuidrone over at Multirotor Forums there for a while. He knew a lot about the mega boards for sure. I think he left there too. Haven't seen a post from him there in months. I think he had a falling out with Bartman over something.

He was a really great resource to have around. Shame he got ran off... last year I randomly took a vacation to where he lives, we never managed to meet up (he was also on vacation that week) but he gave me all his cool flying spots so I had sweet places to check out.

I wasn't aware who it was but yea, he definitely left after an argument. Way to go whoever that was...

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

Cereal_Killer wrote:
Kbev5709 wrote:I was talking with Fengshuidrone over at Multirotor Forums there for a while. He knew a lot about the mega boards for sure. I think he left there too. Haven't seen a post from him there in months. I think he had a falling out with Bartman over something.

He was a really great resource to have around. Shame he got ran off... last year I randomly took a vacation to where he lives, we never managed to meet up (he was also on vacation that week) but he gave me all his cool flying spots so I had sweet places to check out.

I wasn't aware who it was but yea, he definitely left after an argument. Way to go whoever that was...

Check your inbox.

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

Kbev5709 wrote:
fly4fun6719 wrote:Did the esc calibration but the motors didn't spin up only the esc's beeped.throttle response didn't change.Are there any other areas of config h that would affect throttle response?
If preferred I can open a new topic on throttle adjustment.

That would be best. Others that know your problem can maybe help more than me that way.
Yeah, if you did that and the motors didn't spin you must have not have had your li po hooked up. Battery has gotta be plugged in when doing that. If it was plugged in then I have got to admit that we missed something somewhere but I have no clue what we missed.

Yes the lipo battery was connected.Tried different methods all with the battery connected.Watched another video for ESC calibration and the motors in that didn't spin up only beeped the same as mine.Which made me think that maybe there was another piece of code in the config h that was incorrect.Thanks for your help.Shall start another topic

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

Back on the topic of GPS problems.Just tried the return to home and even though I have changed the RTH altitude to 5 it still rises to 15 metres.It now will return to home but remains at 15 metres at the home position and will not land.I have checked the config h code as best I could with my limited knowledge but can't see where I am going wrong.Checked and had 8 satellites during this flight.Any advice would be greatly appreciated.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Kbev5709 »

It won't land on a RTH. To land it has to have a land waypoint. It returns to the home position using lat. and long. and that's all. I have no idea why your 5 meter RTH is still rising to 15. I'm hoping others will help out with your problem as this is my last post here in these forums.

fly4fun6719
Posts: 26
Joined: Tue Jul 21, 2015 4:35 am

Re: Multiwii Crius vers2.5/GPS problem

Post by fly4fun6719 »

Kbev5709 wrote:It won't land on a RTH. To land it has to have a land waypoint. It returns to the home position using lat. and long. and that's all. I have no idea why your 5 meter RTH is still rising to 15. I'm hoping others will help out with your problem as this is my last post here in these forums.


Thanks very much for all your help,very much appreciated.I'll work on the 5 metre problem but could you tell me what's involved in programming a land waypoint.To allow throttle control during RTH do I change the ignore throttle comment in the config h?s

Ciki
Posts: 19
Joined: Mon Sep 14, 2015 7:59 pm

Re: Multiwii Crius vers2.5/GPS problem

Post by Ciki »

Crius SE v2.5 isn't good for gps function. It has very low memory(32kb) compared to CRIUS All in one pro v2.0 (256 kb) which has ATmega 2560 processor. Infact, when you upload sketch on the FC arduino says you that stability problem may occour due to low memory. I had the same loss of throttle control on my quad with the same fc and i passed to CRIUS AIOP and i haven't had problems anymore. Furthermore, it has 4 serial port (1 micro usb and 3 through a connector on board) which allow you to connect the gps directly to the FC. I hope it will resolve your problems. Bye.

Post Reply