Add a mag chip?
« on: November 29, 2016, 10:55:04 pm »
Ok, this may be a bit far out there, and I'm assuming the answer is "no", but just wanted to make sure. 

Is there any reasonable way to ADD a mag chip to an existing GPS?  I've got photo of my unit from Banggood attached.

This one was supposed to have a mag per their posting, but did not.  (FYI, they have compensated me for that error.)  Just trying to see if I can salvage use of this.

Paul

hwh

  • *
  • 1018
Re: Add a mag chip?
« Reply #1 on: November 30, 2016, 12:37:28 am »
It's certainly possible to solder a mag chip onto the board.  Because the chip doesn't have pins it would be hard to do with a soldering iron but it might be possible to do it.   With a hot air rework station it would be reasonably easy.

The chip is a HMC5883L and the easiest, cheapest way to get one would be to order one of the hmc5883L boards on eBay or on banggood http://www.banggood.com/Electronic-Compass-Module-Three-Axis-Magneto-Resistive-Sensor-p-926151.html?p=SO28133399239201512V

I think I remember a post by someone in the forum that took a board like that and just put the whole board inside the GPS case with hot melt glue without trying to unsolder the chip and move it to the GPS board.  That would make all the soldering much easier since it would just be soldering wires.

Re: Add a mag chip?
« Reply #2 on: November 30, 2016, 04:58:00 am »
It looks like there is a place for a mag chip below and left ANT.

I have a hot air rework station and I would just solder one on the board.  It looks like it also already has the SDA and SCL lines for the mag at the connector.

Re: Add a mag chip?
« Reply #3 on: November 30, 2016, 02:20:57 pm »
Thanks guys!  I have an EE friend...  Will see if possibly he could help. 


Sent from my iPad using Tapatalk

Mateusz

  • *
  • 808
Re: Add a mag chip?
« Reply #4 on: November 30, 2016, 02:58:53 pm »
Also easy to order chip alone http://www.ebay.com/itm/HMC5883-HMC5883L-Honeywell-COMPASS-Triple-Axis-I2C-LCC-16-NEW/222161143987 plenty of them unsoldered on the ebay.
You may want to watch to the end this youtube movie how to solder QFN package that has no side pins exposed using just hot-air gun

Re: Add a mag chip?
« Reply #5 on: November 30, 2016, 11:52:46 pm »
Thanks for all the responses!  Extremely helpful.

So, after viewing the video I'm going to opt for just using the full board.  My EE buddy doesn't have the equipment nor do I feel I can likely get the job done to work with just the chip.  But can someone guide me on how to connect the board:

  • What needs to be soldered to where?
  • Do I need to do anything else with the (4 wire) connection to the FC?/li]
All the sources appear to be from China or Hong Kong, so it will take a few days to get this in.  But adding a $5 board seems much more reasonable that plopping down 8-10 times that for a whole new unit.

hwh

  • *
  • 1018
Re: Add a mag chip?
« Reply #6 on: December 01, 2016, 12:43:51 am »
It depends on the exact board but essentially SDA and SCL need to be run down to the revo's matching pins on the FLEXI port.   And connect the appropriate power/ground from somewhere to the board.  The main gps cable brings 5v from the revo to the gps if it runs on 5v, if not the 5 pin component on the gps is probably a 3.3v regulator you could steal 3.3v from.

Mateusz

  • *
  • 808
Re: Add a mag chip?
« Reply #7 on: December 01, 2016, 12:15:51 pm »
I haven't tried this, but source code indicates that HMC5x83 chips should be supported

Code: [Select]
librepilot/flight/pios/inc/pios_hmc5x83.h:    bool    TempCompensation; // enable temperature sensor on HMC5983 for temperature gain compensation

I think this $2 board is pretty nice as it has two screw holes, which allow you to mount magnetometer firmly, such that it is not rotating after calibration.
http://www.ebay.com/itm/HMC5883L-Triaxial-Compass-High-Accuracy-HMC5983-Replace-Temperature-Compensation-/282092719710

You could also solder it (wthout pins) just small wires and hot glue next to ublox module, if you have space in GPS case (not sure), just be careful to insulate it from remaining electronics.

hwh

  • *
  • 1018
Re: Add a mag chip?
« Reply #8 on: December 01, 2016, 08:08:01 pm »
...You could also solder it (wthout pins) just small wires and hot glue next to ublox module, if you have space in GPS case (not sure), just be careful to insulate it from remaining electronics.
I'm sure I saw a post about someone who did that but couldn't find it when I searched.  I think he even posted a picture of the gps with the mag board in it.
« Last Edit: December 01, 2016, 08:12:00 pm by hwh »

Re: Add a mag chip?: Some progress.. but need help
« Reply #9 on: January 04, 2017, 12:42:19 am »
Ok, over the long silence I did [finally] get the external mag received and installed.  Good news is I've run it through configuration and can consistently get "green" lights.  Taken a test flight and checked the flight log, and the mag stayed "green" throughout.

But as soon as I switched to INS13 navigation, my flight data screen (artificial horizon) goes haywire.  When I switched back to basic (complementary) mode the quad won't fly right now either.

here's a youtube of my screen while the quad is setting idle, with good satellite lock and all "green".



Any idea what's going on?  I rerun all the calibrations (except the thermal one) and the thing still thinks its upside down and moving around bunches.

I've also tried playing around with the mag installation settings (Pitch/Roll) but those don't seem to have any affect either!

I was a little suspicious of my antenna layout, but moving those around don't seem to affect anything at all... so I don't think those are the issue.

I do have a "non ferous" barier (foil tape) lining the bottom shell of the GPS unit, between the GPS board and the mag.

Paul

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Add a mag chip?
« Reply #10 on: January 04, 2017, 12:53:52 am »
You should adjust the AuxMag Orientation, looking at the 3 blue bars in Magnetometer tab:


The MAG alarm can be green with orientation completely wrong.


Re: Add a mag chip?
« Reply #11 on: January 04, 2017, 03:49:33 am »
Ok, that helped a lot, so thanks!  Went through several recalibration efforts and adjustment of the aux mag x,y,z values.

Getting close but I can't get it to totally zero'd out.  And AH is now just a few degrees off rather than being totally upside down, but I can't get it truly level just yet.

Since the onboard mag is poor to begin with, (yellow a lot) what does success look like and what is the relationship between x, y, z and roll, pitch and yaw.  Is there a guide on this?  Clearly these are not directly related.  Ie: How do I know which values to change and in what direction?

Right now I'm getting close with two of the values set to 180... But playing around with the other one doesn't seem to drive it home...


Sent from my iPad using Tapatalk

Re: Add a mag chip?
« Reply #12 on: January 05, 2017, 06:53:41 am »
Long stories short:
- For I2C aux mag you need "aux mag orientation" (board rotation) 0,180,0 or 180,0,180 (they are the same)
- a little bit of leaning and wobble in the PFD is normal

PFD leaning can be corrected using:
https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration
See the section titled "Fine Tuning Your Hover To Stop Drift (Not Required)"

Re: Add a mag chip?
« Reply #13 on: January 05, 2017, 08:20:48 pm »
Long stories short:
- For I2C aux mag you need "aux mag orientation" (board rotation) 0,180,0 or 180,0,180 (they are the same)
- a little bit of leaning and wobble in the PFD is normal

PFD leaning can be corrected using:
https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration
See the section titled "Fine Tuning Your Hover To Stop Drift (Not Required)"


Thanks, found that doc last night late after another failed attempt.

Given all that I've learned so far, here are the plans for my next attempt:

-Get everything flying (with minimal/zero drift) in basic navigation/attitude mode by adjusting the board orientation settings (after basic calibration) with GPS and AuxMag disconnected. 
-Make note of a  physical location and orientation where the unit can be positioned to get a good position reflected on the Artificial Horizon.  This needs to be outdoors and away from any metallic interferences.
-Change to INS13 with Aux Mag only
-Perform AuxMag calibration with typical battery fully installed and powered up
-Return the model to the previous position used at the conclusion of the basic tests.
-Adjust roll,pitch,yaw settings of the AuxMag only until the Artificial Horizon is 'close' to previous basic results (referencing reply and documentation above).  Start with pitch (not upside down) then yaw (make sure North is North), then tweak from there.
-Confirm stable Mag and GPS status, even with light power applied to motors
-test fly in a non GPS mode, (attitude) and make any final adjustments to AuxMag orientation to minimize drift
-finally test something like GPS Hold mode

I know I've skipped several otherwise recommended steps that some have proposed, but I cannot power up my AuxMag without connecting my battery, not installing the battery gives me inaccurate calibration once the battery is installed, and when the system is fully powered up the onboard mag is pretty useless as it spends most of its time yellow/red.

Am I overlooking anything?





Sent from my iPad using Tapatalk

Re: Add a mag chip?
« Reply #14 on: January 06, 2017, 01:17:50 am »
Getting it "level" entails a lot more than you would think, so I skip that and use "hovers without drift" as the best definition of "level".

If even a single motor is not perfectly vertical it won't hover level.
If the gear are bent or stressed it won't
If an arm is bent...
Crash damage...

Some aircraft don't hover level by design.  Helis, Tris...

For me it is just easier to do normal calibrations carefully, but not splitting hairs, then jump to flying in Attitude mode to get the level perfect.