I2C/Mini Ublox NEO-M8N GPS problems with Revo
« on: June 02, 2017, 10:30:31 pm »
Hello all

I bought the Mini Ublox NEO-M8N GPS and compass to use with my Revo quad. I imidiately got the GPS up and running with the flexi-port set to GPS. But the compass wasn't getting through. Chatted with hobbyking support who told me that the Mini Ublox NEO-M8N GPS used I2C bus communication. But no matter what I try with the flexi-port set to I2C there is no connection with either GPS or Compass. I also get a "red cross" on I2C in the system health. Any ideas?

But when I think about it... If it was I2C comm then I probably wouldn't see the GPS work with the flexi-port set to GPS?

btw. using newest firmware...

Mateusz

  • *
  • 808
Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #1 on: June 03, 2017, 07:42:50 am »
Hi Mikael,

You need two cables from GPS
  • 4 wires cable: TX, RX, VCC, GND (not sure about order check wiki). This is serial/uart.
  • 2 wires cable: SDA, SCL. This is I2C bus, but without VCC, GND pins, as these are already included in 4 wires cable.

Once you connect that, you need to set in GCS in Mangetometer settings to use "I2C".
If you have cheap GPS, I2C might be tricky and pull-up resistors might be missing or too weak and if your wire is too long Mag might not work. If that's the case search forum for "I2C pullup resistors values".

Once you have GPS and I2C green. You can take care of Magnetometer orientation (since software assumes 0,0,0 but manufactures can mount Mag in any orientation). Basically you enable "Use both" magnetometers, do calibration outdoors (skip first 5 steps and  rotate in all directions on 6th, then save). Then you try different values of magnetometer rotation (pitch,roll,yaw), these values are usually multiple of 45,90 deg. If you have to enter values like 30,20,15... then likely you doing something wrong. You can verify if both internal Revo's Mag and external are aligned by editing values displayed on one of scopes and showing both internal and external Mag. When you rotate copter scopes should show the same behavior, corresponding X,Y,Z axis from two devices should behave the same.

Good luck! :)

Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #2 on: June 03, 2017, 08:21:57 pm »
To add a little.  :)

For the style of GPS/compass you refer to, it must have two connectors coming out to have the compass available.  (Info: DJI/Naza GPS/compass puts both signals on one cable)  If it does not have two cables, it may be that it has a compass inside and it just needs a second cable added.  That is fairly simple if you can solder, with the hardest part being which wire of the new connector goes to the SCL pad inside the GPS and which new wire goes to SDA.  Wiki will show you.

I have seen some of these GPSs where the GPS says "GPS / Compass" on the case, but the compass is not connected because there is no second cable.

Often though, if it doesn't have a second cable, then the compass/mag chip is missing inside to save cost.  So...  I would start by opening the GPS case and looking for a small, square chip that is probably labeled "L883" or something similar.

Good luck.

Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #3 on: June 04, 2017, 03:43:35 pm »
Thanks for the good advice. I'm not at home these days and have no possibility for soldering before I come home. Do You maybe have a link for somewhere I could buy the connector for the "board end" of new wires needed for the compass?

Have done a lot of testing with the new GPS and onboard compass. The onboard compass gives good data (green all the time) when quad not flying and becomes yellow some of the time in air. Is that ok? Quad fly ok (still a little bit unstable) on "Basic" but VERY unstable flying on "INS13" (close to not flying at all). In all these tests I had the calibrations done like video in Wiki except temperature. Also flying with Altitude hold works fine (foam covered barometer). Will adding the second Aux Compass improve stability?

Today I have just done the temperature calibration (-25 dgrC to +45 dgrC), but are not able to test due to very windy conditions.

Br Mikael


Mateusz

  • *
  • 808
Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #4 on: June 04, 2017, 04:11:31 pm »
  • INS13 won't be stable unless mag is green all time, yet it can be green all time and still not fly well if rotations are not correct. Complementary does not use Mag at all. So yes on 250mm size the only way is to use AuxMag.
  • temp calibration is done for gyro and baro so must be montionless in darkness and without air moving.

Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #5 on: June 04, 2017, 06:11:17 pm »
Thanks again.

I just opened the GPS. Unfortunately it doesn't quite look like the others pictured in the forum. I'm not sure I can locate the compass chip on there and there are no marked pads for soldering wires onto. Instead there is a 6 pin connector where only 4 wires (for the GPS) are connected. Between the battery and the connector there is a small square (4x4mm) empty place. Hope its not where the compass was supposed to go  :(


f5soh

  • *****
  • 4572
    • LibrePilot
Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #6 on: June 04, 2017, 06:16:26 pm »
No mag chip soldered.
You can erase the mention "with compass" :)

https://forum.librepilot.org/index.php?topic=1110.msg8434#msg8434

Mateusz

  • *
  • 808
Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #7 on: June 04, 2017, 06:46:54 pm »
Between the battery and the connector there is a small square (4x4mm) empty place. Hope its not where the compass was supposed to go  :(

Well spotted, its where 5883L chip (compass) goes :) You can still get yourself $1-2 board like this http://www.ebay.com/itm/GY-273-HMC5883L-Triple-Axis-Compass-Magnetometer-Sensor-Module-For-Arduino-3V-5V-/400362466832 and mount it under GPS (not to block patch antenna). But you would need to mount it flat and set rotations in GCS. Alternatively buy GPS with compass.

Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #8 on: June 04, 2017, 06:54:52 pm »
From some stuff I have bought recently.  :)

If you haven't bought a GPS pole mount yet, these are fairly cheap at about USD $2 shipped.
http://xt-xinte.com/?goods=detail&id=18429

You need to plan where you will mount the GPS/mag and how long the wires need to be.  With any of these connector and wire options, you will need to extend the wire length for the mag cable (none of the connectors come with long wires) and may need to extend the GPS wires too.

Note that most setups have 4 wires in the GPS connector, but only 2 wires in the mag connector.  They don't bother with power and ground wires in the mag connector.  If you have a separate mag board, you will need all 4 wires going to it and be careful to check the voltage before you buy because the mag chip needs 3.3V and the wires from the FC are usually 5V.  You need a mag board with a voltage regulator.  It looks like that one has a regulator.

These are the JST-SH style (1.0mm pin spacing) connector with wires that you need.  The wires are 10cm=4inch and are reasonably priced at USD $2.30 shipped for quantity 10.
http://www.ebay.com/itm/10-sets-Micro-JST-SH-1-0mm-4-Pin-Female-Connector-with-Wire-and-Male-Connector-/142067841999

or just 5 for $1.90
http://www.ebay.com/itm/5-sets-Micro-JST-SH-1-0mm-4-Pin-Female-Connector-with-Wire-and-Male-Connector-CA-/142067842038

This version has longer (about 20cm=8inch) wires than some versions, but even that is not long enough and they are rather expensive at USD $4.50 shipped for quantity 5.  If you have to solder wires together to make them longer, you might cut these up and get 40cm length by using wire + connector from one and cut off wires from another?
http://www.ebay.com/itm/JST-SH-1-0mm-4-Pin-Female-Connector-Housing-with-wire-28AWG-Length-200mm-x-5-pcs-/172543490834

Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #9 on: June 04, 2017, 08:05:38 pm »
Thanks for all your help. Think I'll go for a new GPS WITH compass from eBay. At what distance would you suggest the GPS/compass mounted over the quad frame (DJI flame wheel frame with battery on top)?

Mateusz

  • *
  • 808
Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #10 on: June 04, 2017, 09:20:07 pm »
Thanks for all your help. Think I'll go for a new GPS WITH compass from eBay. At what distance would you suggest the GPS/compass mounted over the quad frame (DJI flame wheel frame with battery on top)?

On my 280mm build, I used 14cm mast, but maybe ~12cm would be enough, you need to test, probably depends on your wiring and overall built. All these masts are 14cm anyway, for example
https://www.banggood.com/Folding-GPS-Mount-Support-Holder-For-DJI-ZERO-QAV250-RC-Multicopters-p-983662.html
I think it's good that it's plastic and that has 2 screws so wont rotate and mess up your calibration. Also it might bend on crash which is good.

mr_w

  • *
  • 207
    • LibrePilot
Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #11 on: June 04, 2017, 11:04:10 pm »
Well I don't know if I would recommend this specific type or not - the pole itself is not made of plastic but carbon fiber (my guess - it is very hard and doesn't flex at all), which is a good thing.

On the other hand, the problem with it is that you need to use very good glue at both ends of the pole, as otherwise it does rotate in plastic parts (bottom and top), indeed messing up with your calibration.


Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #12 on: June 05, 2017, 05:34:15 am »
I've got a couple GPSs mounted with carbon masts.  I filed tiny flats in the carbon mast for the set/grub screw and flooded the flats and the mast ends with thin CA to harden and keep it from breaking when I tighten the screws.  Of course, let it dry thoroughly before assembling.  Also I don't over tighten the set/grub screws.  You do want to over tighten the pivot bolt though.  Tighten it enough to compress the fork and remove slop.

Build/mount the mast without the GPS and last step stick the GPS on the mast with double sided tape.  This way the alignment of the flats in the mast is not critical.

Remember that the wires come out of the back of the GPS for most GPSs except for DJI/Naza.  Always look for the arrow on the GPS to tell you which way is forward.  But don't worry if you do it backwards or it isn't perfectly straight, you can fix it with Attitude -> Magnetometer -> AuxMagRotation.

One more bit of advice is that I use standard double sided tape (the white stuff, not the strong black or gray stuff) to attach the GPS mount base to the quad frame.  It stays on very well, but comes loose without breaking in a "crash".  ;)

Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #13 on: June 05, 2017, 10:05:28 am »
A lot of fast and good advice. The best forum! Thank You guys (I imagine you are guys anyway :) )

Mateusz

  • *
  • 808
Re: I2C/Mini Ublox NEO-M8N GPS problems with Revo
« Reply #14 on: June 05, 2017, 10:32:12 am »
Well I don't know if I would recommend this specific type or not - the pole itself is not made of plastic but carbon fiber (my guess - it is very hard and doesn't flex at all), which is a good thing.

On the other hand, the problem with it is that you need to use very good glue at both ends of the pole, as otherwise it does rotate in plastic parts (bottom and top), indeed messing up with your calibration.

Haha, sorry for not being specific :)
The other parts are of course plastic, like the mounting circle, you don't want big metallic circle not only because that would be heavy, but also it might saturate Mag or mess-up readings.
Pole is carbon fiber, I used super-glue :) It's a foldable pole, normally it stands fine, but if you push it really hard it folds down, has small locking system and folding it requires applying some force. I think it's a good thing :) They're dirty cheap, order two different kinds and test them what works for you best :) Maybe the one with 4 bottoms screws is better for bigger 450mm DJI frame. On 280mm build, I found that two screws fits well in the holes I had already in top plate.