LibrePilot Forum

General Category => General Discussion => Topic started by: drmeatball on January 18, 2017, 06:38:38 am

Title: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 18, 2017, 06:38:38 am
I'm running 16.09 with an external mag on a mast. No interference afaict, works flawlessly under load (green/0-3% under full throttle).

If I have the Revo set for Complementary everything works fine. As soon as I switch to INS13 or INS13Indoors the horizon starts flipping. Restore complimentary, things go back to normal.

I've recalibrated everything numerous times.

(On a tablet, I'll post the config once I get on a real computer)
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: Jhinta on January 18, 2017, 07:53:39 am
Make foto of inside(mag placed wrong ?), Also test mag with a other magnet see if it's reacts like crazy ( I had one that work like it was on but with no effect -/+ 1 or 3 change)

Verstuurd vanaf mijn LG-D855 met Tapatalk

Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: Jhinta on January 18, 2017, 08:21:07 am
Also on your photo I believe to see a av TX with no antenna and your battery connected ( DONT !!!!)

Verstuurd vanaf mijn LG-D855 met Tapatalk

Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: Mateusz on January 18, 2017, 09:21:31 am
Flipping horizon is usually bad orientation of external magnetometer (AuxMag) in your screenshot you have Aux Mag Orientation (Pitch = 0, Roll =0, Yaw = 0), this is only true for OP GPSv9.
Other GPS may have different orientation and you need to adjust these values by +-45,90,180 degrees, depending on your GPS. Values in the bars should be very close to zero. You should see on scope that both AuxMag and Internal Mag respond the same when copter is rotated and values for orientations set correctly.

If your Mag orientation does not match what accelerometers measures, EKF will go crazy and you will see horizon going crazy or even flipping up-side-down.
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 18, 2017, 03:50:20 pm
Also on your photo I believe to see a av TX with no antenna and your battery connected ( DONT !!!!)

Verstuurd vanaf mijn LG-D855 met Tapatalk

All good, I had the TX unplugged from the battery (as well as the gimbal) so things wouldn't waste power / over heat. It's partly why there's a mess of wires hehe.
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 18, 2017, 03:51:52 pm
Flipping horizon is usually bad orientation of external magnetometer (AuxMag) in your screenshot you have Aux Mag Orientation (Pitch = 0, Roll =0, Yaw = 0), this is only true for OP GPSv9.
Other GPS may have different orientation and you need to adjust these values by +-45,90,180 degrees, depending on your GPS. Values in the bars should be very close to zero. You should see on scope that both AuxMag and Internal Mag respond the same when copter is rotated and values for orientations set correctly.

If your Mag orientation does not match what accelerometers measures, EKF will go crazy and you will see horizon going crazy or even flipping up-side-down.


Hrm, let me look into this. I just saw a LP tutorial video on this as well.
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 18, 2017, 04:24:34 pm
I think I got it working (or close enough). Roll 180, Pitch 0, Yaw 180

Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: Mateusz on January 18, 2017, 04:58:28 pm
Looks good;)
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 18, 2017, 05:57:33 pm
Hrm, needs some more work. Immediately crashed. TY for the help tho!
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: TheOtherCliff on January 18, 2017, 07:47:11 pm
Always get it flying well without GPS, using Attitude mode and Basic AttitudeEstimationAlgorithm before advancing to using GPS.

The GPS needs this stuff to work right, and if you have a problem, you won't know whether to blame GPS/mag or other stuff.
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: zukenj on January 18, 2017, 10:02:42 pm
I think I got it working (or close enough). Roll 180, Pitch 0, Yaw 180

Please correct me if I am wrong. but isn't Roll 180, Pitch 0, Yaw 180 = Roll 0, Pitch 180, Yaw 0?

Thanks
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: DocHardinger on January 18, 2017, 10:10:14 pm
Yes thats correct :-)
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 19, 2017, 07:02:30 pm
Thanks everyone for the help, got it going [mostly] pretty well!

When I switch to a GPS Assisted mode, the hex seems to hop a lot, about once every second. I'll see if I can take a better video (this time of the drone itself rather than from the drone camera), but basically side to side position hold is fine, up and down isn't. Is this a 'put foam on the barometer' thing?


https://www.facebook.com/plj1225/videos/10155027913144456/?l=6516908638670423611
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 19, 2017, 07:27:14 pm
SS of barometer scope. Sitting perfectly still on a table top and it's been on for about 10min.
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: f5soh on January 19, 2017, 07:47:23 pm
Better select the altitude (m) in scope instead of pressure.

The altitude should still within 1m at least, this is a unfiltered value.
Be sure the pressure sensor is protected from light. (box, opaque cover)

Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 19, 2017, 08:42:06 pm
Cool I'll get it thanks!

Here's a better video. Hands completely off the controller, hex is in Position Hold.

https://www.facebook.com/plj1225/videos/10155028418204456/?l=1413037631953414758
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 19, 2017, 09:08:01 pm
I didn't see a scope for altitude, here's the closest I could find.

https://www.facebook.com/plj1225/videos/10155028526499456/?l=5201258071668102753

FC is a Revo Mini with opaque box (also has foam in it (shipped that way)).
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: f5soh on January 19, 2017, 09:20:16 pm
You may need to reset the config after switching to 16.09 and get some default scopes configured, like the Barometer that show altitude, temperature and pressure

(https://forum.librepilot.org/index.php?action=dlattach;topic=2936.0;attach=5080)
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 19, 2017, 09:59:07 pm
I'm not sure how to read it, but that looks fairly steady  ???
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: f5soh on January 19, 2017, 10:02:31 pm
Disabling temperature will give you the altitude trace alone and min/max spikes
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 20, 2017, 08:02:35 pm
Is this it?
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: f5soh on January 20, 2017, 08:21:44 pm
You should not have 2m spikes like that.

Take a look at this page, the first scope refers to a good baro / regulator :
https://librepilot.atlassian.net/wiki/display/LPDOC/Altitude+Hold#AltitudeHold-Hardwareissues
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 20, 2017, 08:41:15 pm
Do you think my Revo is a candidate for the C9 mod?
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 20, 2017, 09:00:06 pm
I think I'll bust out the soldering iron tonight. My other hex has a regular Revo (this one has a mini Revo) and it has none of the BaroSensor.altitude wonkiness going on that this mini has.

Thanks!
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: f5soh on January 20, 2017, 09:17:54 pm
I don't know if you need to remove the capacitor, depends on regulator used.
The Revo Mini design is really simplified and if i recall right only use one regulator for all the board.

Full sized Revo has one regulator for sensors, another one for CPU and one for modem.
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 20, 2017, 10:36:29 pm
I'm not sure what to do from here.. should I just order a new revo?
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: TheOtherCliff on January 21, 2017, 06:17:42 pm
If your Revo / Sparky2 has much more than a 1m variance in baro altitude, before ordering another one, I would do the quick and easy thing of removing that particular capacitor and retesting the baro altitude variance.

I have a Sparky2 with this issue.  Reading this got me interested again.  I removed the capacitor and the variance dropped from about 3m to less than 1m.
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: drmeatball on January 22, 2017, 07:23:04 pm
With a 'Rev C' Revo, is there anyway of looking at this to figure out which is the relevant capacitor?
Title: Re: INS13 causes horizon to flip; AuxMag works beautifully
Post by: TheOtherCliff on January 23, 2017, 01:19:08 am
Did you look through the bad baro thread?  I would have to look there myself...