Foaly

  • *
  • 8
Attitude : complementary vs INS13
« on: January 30, 2016, 01:56:08 pm »
Hi everyone, new guy here,

I've recently discovered LibrePilot and I built a new quadcopter around the Revolution board to test it (I've used some APMs, Piwhawks and Nazas before but Im not completely satisfied with them). So far I've been really pleased with it, it's really easy to configure and enjoyable in the air, so I decided to upgrade it with a GPS and an oplink but I've got problems with the GPS.

What is the difference in the Attitude settings between "Basic (Complementary)" and "GPS Navigation (INS13)"? If I understand correctly, I need to select INS13 if any of my flight modes requires the GPS (position hold, GPS Assist...), but then I am unable to take off if GPS is not fixed (indoor, for example). Is there a way to have a basic Stabilized flight mode to use without gps and two other flight modes with GPS? Or even better, to automatically disable the GPS in the sensor fusion algorithm (and GPS Assist) when it is not available?

Other problem : it seems I have a interference issue between the GPS and the mag (to be fair, they are really close to each other). However, even when Ive got a good GPS fix, atti/stab green and the mag yellow or even green, it won't arm. Is there a way to see which alarm is preventing arming? Nothing is red in the System Health pannel.

And finally, last issue : I've added a simple battery voltage sensor (a simple resistor divider basically), configured it according to the documentation, and it seems that everything is correct since I see the correct voltage in the System/Data objects tab. However, nothing is displayed in the Flight Data tab. Did I miss something?

Thanks in advance!

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Attitude : complementary vs INS13
« Reply #1 on: January 30, 2016, 04:04:13 pm »
Hi,

Currently you need all sensors ok for EKF initialization and Arming. No "degraded" mode available if GPS data is missing for example.

EKF uses 13 inputs from all sensors and determine the attitude state (orientation/velocity/position)

Complementary determine attitude orientation only based on Gyro/Accel sensors.

There is no reason the Mag has problems with GPS. Mag can only got interference from local magnetic fields, usually places/wires where are "strong" currents.
If ekf is not initialized you can't arm, others "no arming" causes are reported with one alarm.

The thing needed for voltage display on PFD is a Battery module enabled.
Nothing on top and nothing on left battery panel ?
https://librepilot.atlassian.net/wiki/display/LPDOC/PFD

Laurent

Foaly

  • *
  • 8
Re: Attitude : complementary vs INS13
« Reply #2 on: January 30, 2016, 04:59:57 pm »
Hi, thanks for your reply,

I did some tests and it seems that you are right, the GPS is not to blame for the mag problems (placing it farther doesn't change the mag's Scope). However sometimes I get a completely flat signal from the mag (see Untitled4.png attached), does it mean hardware problem? If I'm correct the mag is embedded in the same chip as the accels and gyros, which work fine. How can I see if the EKF is initialized?

For the "degraded" mode I'll try to save different settings files ("with gps" and "without gps") and upload them via telemetry.

And for the battery, please see Untitled 1 to 3 attached, I think i set up everything correctly but it doesn't show on the PFD.

Thanks for your time!

Edit : further question, what is the difference between MagState and MagSensor in the Data Objects? They are different, which one should I trust/check?
« Last Edit: January 30, 2016, 05:04:22 pm by Foaly »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Attitude : complementary vs INS13
« Reply #3 on: January 30, 2016, 05:24:24 pm »
Hum... the PFD looks strange with those white cells.
15.09 version ? Witch OS and package source ?
I'm pretty sure the no-display comes from the same issue :)

MagSensor refers to internal Mag sensor (separate sensor/package if Revo) without any rotation/orientation = raw sensor output

MagState are the values used in case of values can be trusted, can be internal sensor or external mag sensor.
« Last Edit: January 30, 2016, 05:27:26 pm by f5soh »

Foaly

  • *
  • 8
Re: Attitude : complementary vs INS13
« Reply #4 on: January 30, 2016, 05:39:48 pm »
I'm using 15.09-1 on Arch-Linux from the repositories, with firmware 15.09 (see attached).

I noticed that I can arm with INS13 only when my flightmode is Stabilized (Attitude/Attitude/Rate) with no Assisted Control and Manual Thrust, otherwise it wont (even just Altitude Hold doesn't arm). However the PFD is completely crazy, not level at all, and it moves a lot even though my quad is resting still on the table. Mag oscillates between gree/orage/red. May my problems come from a bad GPS? The position on the map is not stable, nor is the speed in the System tab. I'm currently inside but I had the same problems outside yesterday.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Attitude : complementary vs INS13
« Reply #5 on: January 30, 2016, 05:47:25 pm »
Indoor GPS give bad results, you can see on screenshot GPS velocity is 3m/s

MAG should only have a green alarm and sometimes orange with motors.
If one sensor is not ok, the EKF can't initialize. In current case, Mag issue.

Yes, arming is done only using a normal/not assisted stabilization mode.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Attitude : complementary vs INS13
« Reply #6 on: January 30, 2016, 05:52:31 pm »
Your package uses Qt5.5.x from system and 15.09 should use Qt5.4.1, you may consider compile your own Gcs version.
next (development branch) works fine, see howto build here: https://librepilot.atlassian.net/wiki/display/LPDOC/Linux+-+Building+and+Packaging


Foaly

  • *
  • 8
Re: Attitude : complementary vs INS13
« Reply #7 on: January 30, 2016, 06:58:14 pm »
I compiled, it starts but with the following error and I dont have a PFD (its not in the list and PfdQml is red in About Plugins) :
Code: [Select]
/home/foaly/Software/librepilotgcs/librepilot/build/librepilot-gcs_release/lib/librepilot-gcs/plugins/LibrePilot/libPfdQml.so: Cannot load library /home/foaly/Software/librepilotgcs/librepilot/build/librepilot-gcs_release/lib/librepilot-gcs/plugins/LibrePilot/libPfdQml.so: (/home/foaly/Software/librepilotgcs/librepilot/build/librepilot-gcs_release/lib/librepilot-gcs/plugins/LibrePilot/../../libGCSOsgEarth.so.1: undefined symbol: _ZThn248_N9osgViewer14GraphicsWindow13requestRedrawEv)
Quote
Yes, arming is done only using a normal/not assisted stabilization mode.
I'm wondering, what is the reason behind this limitation? If a want as assisted mode, should I arm, then swith, then take off, or switch during flight?

Again, thanks for taking the time to answer my questions :)

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Attitude : complementary vs INS13
« Reply #8 on: January 30, 2016, 08:02:30 pm »
About the error: I think you have installed the osgearth pre-compiled but it should not match you host (precompiled from ubuntu)

Try removing the tools/osgearth dir and keep the tools/osg dir.

Or compile your own osg libs with 'make osg_all', it take some time...
And copy the ./build/3rdparty/install/osg* dirs into ./tools, also store generated tgz archives from ./build/3rdparty/install/ is a good idea.

Do not forget a 'git pull' and keep your source tree sync with repo.

Limitation is due to safety, avoiding weird stuff about baro/thrust for example.
You can switch next to assisted flight mode without issue.




Foaly

  • *
  • 8
Re: Attitude : complementary vs INS13
« Reply #9 on: January 31, 2016, 09:45:30 pm »
Hi,

There was no osgearth* in tools. I tried to compile everything again (rm -rf + git clone) and I noticed these warnings which seem relevant :
Code: [Select]
~/Software/librepilotgcs/librepilot   next > make all_sdk_install
 NOTE        Use 'make all_sdk_distclean' to remove installation files
 NOTE        Use 'make all_sdk_version' to check toolchain versions
 NOTE        Add 'V=1' to make command line to diagnose make problems
 NOTE        Add 'BATCH=1' to make command line to disable progress reporting during downloads
 WARNING     tools/osg-3.4-linux-x64-qt-5.5.1 not found (make osg_install), using system PATH
 WARNING     tools/osgearth-2.7-linux-x64-qt-5.5.1 not found (make osgearth_install), using system PATH
(...)

Code: [Select]
  ~/Software/librepilotgcs/librepilot   next > make gcs           
 WARNING     tools/osgearth-2.7-linux-x64-qt-5.5.1 not found (make osgearth_install), using system PATH

Just to make sure, I downloaded the archive, it got rid of the warnings, but Ive got the same problem with the PFD. Compiling without it (which seem to be better according to what you say) doesn't seem to work either. But don't waste your time on that, I'll try to find the problem when I have enough free time. For now I'm waiting a better weather (damn rain) to redo proper tests and calibrations outside. I'll post the results and edit the first post with my findings for people googling the same issues.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Attitude : complementary vs INS13
« Reply #10 on: January 31, 2016, 10:25:56 pm »
Did you reset config after the switch to next branch ?

Code: [Select]
make gcs && ./build/librepilot-gcs_release/bin/librepilot-gcs -reset


Foaly

  • *
  • 8
Re: Attitude : complementary vs INS13
« Reply #11 on: February 01, 2016, 09:10:32 am »
I did, same error. Don't worry about it, I'll try on another computer. Thanks anyway :)

Foaly

  • *
  • 8
Re: Attitude : complementary vs INS13
« Reply #12 on: February 07, 2016, 05:19:31 pm »
Hi,

So it was sunny yesterday, so I went to do some tests.

First of all, I used my other laptop running Windows, and there was no problem with the PFD or anything, so that's something solved (by the way, I noticed the battery indicator is not the only thing missing on Linux, most of the infos on the bottom are missing as well, such as the (Dis-)Armed status).

As for the GPS/Mag problem, it was almost good, but most of the time the Atti was erratic. No way to take off this way. I think the problem is that my GPS is too cheap (it's a Neo-6M from Hobbyking), its signal is not good enough, and the FC is thinking it's constantly moving and gets seasick. I was in open field, no buildings at less than 100m, almost no clouds. Is anyone using a 6M successfully? Otherwise I guess I'll have to upgrade to a 8M.

Other than that, in Stabilized mode, it's very pleasant to fly, even in quite strong wings. I'll keep it this way for the moment.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Attitude : complementary vs INS13
« Reply #13 on: February 07, 2016, 06:01:49 pm »
Great :)

Your Linux issue should not be here if you compile using Qt5.5.1
Remember to rebuild from a 'make clean' or old pfd file can still here.
Code: [Select]
make -j2 opfw_resource && make -j2 gcs && ./build/librepilot-gcs_release/bin/librepilot-gcs
You can also try:
RevoSettings > FusionAlgorithm > Complementary+Mag+GPSOutdoor
Neo6 should works the same.