GPS feature questions

Post Reply
pelotron
Posts: 7
Joined: Thu Jul 25, 2013 5:29 pm

GPS feature questions

Post by pelotron »

Hi all! Recently I added a GPS receiver to my tricopter's flight controller and upgraded to MW 2.4. I have been wanting to test the GPS Hold/Home features but ran into an oddity when testing my configuration.

Here is a baseline example where you can see the AUX1 and AUX2 channels activating Mag and Horizon modes.
Image

But why do the GPS features not seem to be coming on when I set AUX1 to activate them? You can see that I have valid GPS data coming in. Is there some other requirement for these features to be activated, such as motors armed or being some distance from the home location?
Image
Image
Last edited by pelotron on Mon Nov 21, 2016 12:58 am, edited 1 time in total.

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

Re: GPS feature questions

Post by Kbev5709 »

pelotron wrote:But why do the GPS features not seem to be coming on when I set AUX1 to activate them?
For one thing, you need to use either Win GUI or EZ GUI to actually use and interact with GPS. All that switch grid does in the configurator in regards to GPS is let you know what switch your GPS will be activated by, at least as far as I know. It probably won't ever light up green like mag and horizon and stuff. I don't ever try to see if my GPS is working using the configurator so I don't know for sure if it will work, especially since I don't see the "armed" green light on in your screenshot either. Your craft must be armed before anything works in GPS.
pelotron wrote: You can see that I have valid GPS data coming in. Is there some other requirement for these features to be activated, such as motors armed or being some distance from the home location?
]

I see no such thing as "valid GPS data" in any of your screen shots. If you are referring to the grey line that never stays level that is your baro info. It can be affected by even minor changes in wind speed outside even when you're indoors.
There is no indication of GPS activity on your screenshots because the MW configurator doesn't support GPS.
If you decide to use WinGUI you will need to change your firmware's version number in the multiwii.h file from 240 back to 230 or the Win GUI will never open.

After you figure out the GUI stuff....
Have you gone into your config.h sketch in the firmware and enabled the waypoint feature?
Did you reverse the RX and TX wires during connection of GPS module to the FC like you are supposed to?
Did you set up the GPS section in config.h that deals with ublox or nmea? Are you using serial or I2C? Correct baud speeds?
Do you have your MD set for the flight location? Is your craft ACC calibrated and do you calibrate the mag before trying to fly GPS? When you try to hook up to GPS after everything else is right do you try it outdoors instead of indoors? Do you wait patiently for a five satellite GPS lock before expecting any feedback or ability to fly?
Do you understand waypoint navigation well enough to actually use it? Did you check the space weather to see if GPS will even be reliable that day?
Perhaps most importantly, have you enabled your failsafe in the config.h file?
All of that and more is your responsibility if you plan on using GPS to fly with. It's something you should read all you can about before actually doing it or even trying to do it.

pelotron
Posts: 7
Joined: Thu Jul 25, 2013 5:29 pm

Re: GPS feature questions

Post by pelotron »

I knew that to use the mission planning system WinGUI was required. This part of the MWC display implies it is at least aware of my GPS module:
Image

GPS is greenlit in the list of sensors and the box at the bottom with GPS data was never populated before, but now shows the correct information (the elusive "valid gps data"). Since that much appeared to be working correctly, and because I'm not interested in missions but would like to use GPS Home/Hold, I assumed I could still get by with MWC. Correct me if I'm wrong.

From config.h:

Code: Select all

#define GPS_SERIAL 2
#define GPS_BAUD 9600 // Adafruit Ultimate GPS Breakout V3 - MTK3339 spec
#define NMEA
#define GPS_LED_INDICATOR
#define USE_MSP_WP
#define NAV_CONTROLS_HEADING       1
#define NAV_TAIL_FIRST             0
#define NAV_SET_TAKEOFF_HEADING    1
#define MAG_DECLINATION  1.95f
#define GPS_LEAD_FILTER
#define GPS_WP_RADIUS              300
#define SAFE_WP_DISTANCE           500
#define MAX_NAV_ALTITUDE           100
#define NAV_SPEED_MIN              100
#define NAV_SPEED_MAX              400
#define NAV_SLOW_NAV               0
#define CROSSTRACK_GAIN            .4
#define NAV_BANK_MAX 3000
#define RTH_ALTITUDE               15
#define WAIT_FOR_RTH_ALT           1
#define NAV_TAKEOVER_BARO          1
#define IGNORE_THROTTLE            1
#define FENCE_DISTANCE      600
#define LAND_SPEED          100


RX/TX wire reversal - I'm not sure since the connection is soldered on the bottom of my FC and I wired that set of pins for the GPS module last year, but I assume I got it right since MWC shows GPS output, and because I pulled the GPS module off another Arduino project that required the same reversal.

NMEA/Baud - yes, see above

"MD set for the flight location?" - I'm sorry, what is MD?

ACC / Mag calibration - I have not done this since flashing 2.4. I thought that data was saved in EPROM and have flown the copter without incident since then, but I can perform these again if required.

5 satellites? - Yes. Both the GPS LED flash and MWC indicate there are > 5 satellites. I have tried this outdoors and indoors (screenshots taken indoors).

Understand waypoint navigation? - Not explicitly but I can't imagine it's that complicated. As I said above though, I'm not interested in waypoint planning.

Enabled failsafe? - No! I didn't realize this was required to use GPS features, but I want to use Failsafe anyway so I will define these options and do more tests.

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

Re: GPS feature questions

Post by Kbev5709 »

I use configurator so little I forgot it had the rudimentary GPS stuff. Sorry. Plus, it didn't help that part wasn't showing in your screenshot so I when I said I could see no valid data I really wasn't seeing anything there.

Then it would have to come down to the fact that your FC was not armed when trying to engage the GPS. I mentioned that in the first paragraph of my first reply.

MD is magnetic declinationhttp://www.ngdc.noaa.gov/geomag-web/. It is set in the GPS section of your firmware. You need to find out what it is for where you will fly. If you change flying locations, you will need to re enter new MD for new location. It comes set by default for Budapest Hungary. I guarantee that even minimal GPS functions like RTH and Pos Hold will not function as they should if this is set wrong. This calculator will figure out your MD down to street addresshttp://geomag.org/models/igrfplus-declination.html

Your GPS baud is awful slow. I think nmea works at 57600. Make sure that your serial baud speed is at least that too.

Every GPS quad or whatever else should have its mag re-calibrated before every GPS flight. The following link tells about that and magnetic declinationhttp://www.multiwii.com/wiki/index.php?title=Compass_CalibrationThere is a bit of misinformation in the info about MD though. It states that you must enter the MD for your country. Totally wrong!! Magnetic declination is calculated to FLIGHT LOCATION. There is no such thing as a country wide MD. Mine changes if I go 1 mile away. It also changes over time. Still, every GPS quad or whatever else should have its mag re-calibrated before every GPS flight. It is required for others like DJI. Multiwii is no different. Since I had no idea how much you actually knew about GPS or anything else multiwii, I suggested an ACC re-calibration in case one has never been done. You are correct, it is stored in memory. However, it will go away when making changes to the firmware and uploading those changes to the FC so when setting your MD to your flight location, the ACC needs re-calibrated again too. Any time you modify your config.h sketch in any way and actually upload it to the FC, the ACC needs to be calibrated again as well as the mag. The trim settings for level mode will also need reset after any upload. So basically, unless you always fly at the same place, be prepared to occasionally re calibrate things. Since MD changes over time, even if you always fly at the same place an occasional re calibration will be needed to ACC, Mag, and level trim after the MD update that will someday come.

I hope you haven't been actually flying that thing with the failsafe disabled....have you?? It's not technically required for GPS flight. It should however, be functional on EVERY flight for everyone's safety. Flyaways have the potential to kill someone should the quad crash under the right circumstances. Li Po batteries can burst into flames in a crash. Never fly without a properly set failsafe.

Try doing the switch for GPS hold after you arm. See if that lights the indicator up green.

If you are running an FC that is capable of waypoint nav, why not take advantage of that and try it? You will need Win or EZGUI for that though. If you are running something based on a 328P processor, if you get pos hold and RTH to work at all you will be very lucky as that processor has minimal if any memory left to handle GPS functions.

Post Reply