M4 Ladybrid Position Hold and PH controller Questions

Info and discussion about the autonomous Micro FC, suitable for nanos, micros and mini multirotors

M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Thu Jan 01, 2015 6:49 pm

Hey Folks,

thx to the improved weather I found some time today to play with the Position Hold and RTH, but I'm not getting along well with them with my M4 ladybird. I actually have two issues, but one is more my different expectation, so I'll here focus first on the first issue, but come back to the second one later.

As advised by the wiki I first did the RTH tests. I spend three batteries on it, but could not achieve or observe consistent nor satisfying behavior. Probably I'm just doing something obvious wrong, but I don't get it.

The craft didn't really stayed in position, often it would describe kind of circles with ca 1m radius (toilet bowl like), mostly it just "floated" around within a square of ca 1x1m^2, often it would slowly decent after switching to PH, sometimes it would even drift fastly away because the craft isn't leveled but no counter action is taken.
As regards RTH it of course starts moving when flipping the RTH switch, and the movement is roughly in direction of the home position, but in no case it returned to a position I would identify as its home, sometimes it would just move few meters, although it would have to return ca. 5-10m. The altitude remained totally unclear to me (the wiki is quite confusing on this point).

Since it was cold outside, I had the ladybird sitting on the balcony for more than 1/2 hour, before I went to the tests. Since it's not clear to me what values are reset when the M4 is disarmed, I always switched it off, waited for the blue led to come up, and then started. I also did a couple of tests, where I waited another min or so after the blue led went solid before I lifted the ladybird (to see if the GPS might be a bit better then). This had no effect as much as I could observe. The RTH were done by lifting the ladybird to about 2.5-3m, hover there, switching to PH, and centering the thr stick. The hover thr was just a tiny mark below the center position. The craft flew perfectly in manual mode, exactly as indoors. I then flew around, and with the craft typically 5-10 m away triggered the RTH. The calibrations were done indoors. For practical reasons I didn't had telemetry.

The RT calibration of course suggests itself as the root of the issues, especially I could imagine that the toilet bowl could be due to a improper mag calibration. This, however raises the question of how accurate it needs to be. Please don't answer now with "accurate" :). Should the determined south be within 1°, 5°, ???. Could the temperature effect be strong enough? Also, the acc calibration might be wrong and induce off-level and hence the fast drifting in one direction. But in manual mode it would fly nicely. Anyways, the observed inconsistent behavior during the same afternoon runs, just by repeating the procedure many times, doesn't suggest a calibration thing as main issue, since it should have been equally inaccurate during all the test runs.

At this point my reasoning stops. What am I doing wrong?

Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby kinderkram » Thu Jan 01, 2015 7:07 pm

Hi Olli, happy New Year!

In general the Onboard Calibso should be done in an open space with no magnetic, electrical or ferrite material around.

Did you set up your magnetic inclination/declination correctly bf you did the Onboard Calibso?
http://autoquad.org/wiki/wiki/configuri ... clination/

To verify the magnitudes, check this page:
http://autoquad.org/wiki/wiki/configuri ... alibration

Mag magnitude should be ~2.0 and ACC magnitude should be ~9.8. The more accurate, the better! ;)

And a telemetry connection always comes handy so you could watch the HAcc and VAcc GPS accuracy values in the "Status Details" widget.
Posts: 2911
Joined: Fri Jun 22, 2012 7:47 am

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby Max » Thu Jan 01, 2015 7:15 pm

Please post some pictures of your setup. Accurate GPS reception is highly susceptible to electronic noise from the onboard components, environment, weather, satellite position, and so on. Also w/out a log or telemetry, there's no way to tell what the actual reception quality was (the blue light indicator comes on at 3m horiz. accuracy, which for a micro is a lot of space).

I wouldn't expect perfect accuracy from anything a Ladybird-sized MR can carry in terms of antenna and shielding, but it should be better than what you're describing.

Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby chschmid » Thu Jan 01, 2015 7:22 pm

Hi Olli

Let me add some comments to Norberts explanations.

For the GPS navigation, including PH and RTH, a good GPS Hacc is the key.
When you fly on a balcony, I guess one side is not open space. The blue LED signals 3D lock which starts at 3m Hacc.

Check Hacc thru telemetry. A good value for M4 is 0.5-0.8m.
The toilet bowl happens if the mags are off. In the actual FW, the mags are only used at liftoff time and the values will be replaced/adjusted by GPS data after a short flight time. To have them right from liftoff, do the cal as Norbert explained.

Posts: 1800
Joined: Wed Jul 11, 2012 7:41 pm
Location: Herrliberg, Switzerland

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Fri Jan 02, 2015 1:05 am

THX a lot for these many suggestions

as regards the calib, well, I think it's not like that I didn't try to squeeze as much info out of the wiki as I could ;)

I might not have been clear enough in some points
* I didn't fly on or from the balcony ;), I just wanted to tell that I've ensured that the M4 had outside temperature :)
* Q: Let's assume "perfect" calibration of both the acc and mag at RT, could the changes in calibration at the sub-degree temperatures explain all or any of the above effects? (I wouldn't think so, but ...)
* I understand that the "original" toilet bowl is typically due to having a mag and some currents during flight, but that the AQ uses the mag just at startup. However, my thought was that if the mag at startup gives south wrong by, let's say, 15° that then the navigation controller would apply the correction signal into a direction off by15^, would soon after realize that the craft doesn't move into the expected direction, would again calculate a correction which is wrong by 15° and so ... I could imagine that this mechanism could lead to flying circles. So, my question. I rephrase:
Q: If the mag predicts south wrong by e.g. 15°, what would the consequences for PH be?
(the 15° is just totally arbitrary number I've chosen for the sake of the example)

I will try to post a photo as soon as I can, but it's really close to the reference build.
I have a BT installed, is this maybe know to worsens GPS reception? (wouldn't think so, but ...)

As regards the HAcc and VAcc thing, I might have underestimated this ... I admittedly assumed that the solid blue led was chosen such that it would work "reasonably". I'll see if I get a telemetry log (working extensively in the outside is not very convenient currently LOL). Maybe I should try to better understand accuracy and resolution of GPS (I assumed that, as usual, resolution is much better than accuracy also for GPS).

Q: With the blue led on, what accuracies can one expect for the horizontal and vertical position hold? (3 m???)

Maybe it could be worthwhile to consider some blue led signaling from which one can deduce the GPS accuracy, such that it blinks faster the better the GPS, or blinks faster with every 0.5m better accuracy, or so ... I would find it inconvenient if one would have to bring to the flying field a "car full of electronics" (i.e a lapi and run telemetry to check H/VAcc) just to fly the M4-LB ...

Q: A question as regards the RTH: Is it supposed to also bring back the aircraft to the original altitude of the home position? I read the wiki to say yes, but never could see that happen.

Thx for your help, and sorry for these questions, I feel a bit stupid myself :oops:
Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Fri Jan 02, 2015 12:20 pm

a quick question please:

The magnetic inclination value, should it be positive or negative?

(following the wiki/using QGC gives conflicting results)
Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby kinderkram » Fri Jan 02, 2015 12:51 pm

Where did you stumble upon the conflict?
I think the Wiki is pretty clear on this, saying inclination is always reversed, a negative value is needed for the Northern Hemisphere.

3 essential steps to do:

1. go to http://magnetic-declination.com and remember the values given there for your local site
2. use the tool in the "IMU Calibration widget" from the "other tools" and calculate the values
3. reverse the inclination value, submit them in "Misc Settings" and save them. Restart afterwards

In my example I get 1.25 for declination and 66.32 for inclination. Calculating these values I get 1.42 for inc and 66.53 for dec. So the values I have to enter are 1.42 and (reversed) -66.53
Posts: 2911
Joined: Fri Jun 22, 2012 7:47 am

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Fri Jan 02, 2015 1:39 pm

I apologize but I choose to not agree

the wiki indeed tells repeatedly very loudly in red that inclination should be negative, BUT it also tells clearly that one can/should use the tool, that the tool does ALL the conversions (reverses and converts to decimal), so I did that and get the line

#define IMU_MAG_INCL 64.20


Now guess what does a C programmer think when she/he sees a line starting with '#define' ?
She/he thinks it must be dammed important and it must be dammed correct ;)

Where is obviously a conflict in information. I obviously went with the #define since while I'm happy to accept that the wiki is not perfect and info might be a bit outdated especially when just new firmware versions came up, I'm not happy to assume that a #define is incorrect. (and in the wiki its indeed negative).

Where is obviously a conflict in information. :) :) :)

I'll do it negative now. Thx!
Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby joebar.rc » Fri Jan 02, 2015 2:49 pm

Hi Olli,

Good idea for the gps led, in my code I have a slow blinking for 2d fix and solid for 3d fix, so another pattern for Hacc 100-200 for example is a good idea.

Yes, return to home alt should be the behavior, there are obvious various reasons why not, a not so good Vacc will give bad results too.
Posts: 1084
Joined: Fri Jun 22, 2012 8:59 am
Location: The netherlands

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Sun Jan 04, 2015 7:34 pm

OK, today I had some chance to repeat the RTH test under some somewhat better conditions. I changed location (I'm back at home), which might be a bit better GPS wise (I'm sure you will tell me if it's good or not). Also, I checked Hacc and Vacc and first tested to what "best" values it might converge (Hacc ca 0.5m, Vacc ca 0.7m), and then did the RTH test with having waited long enough for these "best" to have been (nearly) achieved. I have also redone all the calibration stuff, for my location, and so on. I didn't had yet time to get familiar with the telemetry logging, so only some online data of Hacc/Vacc in the video.

The result, in short: I still find the behavior inconsistent. Sometimes it's ok, sometimes not.

I took a video ... äh, my son took a video of the last test of today. See below, the audio tells (in German) what is going on. The video actually was made because in a previous test flight the ladybird was really standing quite still besides some serious wind, so that the copter was tilted by ca 25°, which looked awesome. Unfortunately, until I got my son and the video etc, conditions have changed and wind was nearly gone, so we didn't manage to get this on tape. Anyhow, this was very impressive, and I'm sure that if we would have gotten it on video it would have made it to the front page. The truth is however, that this was not representativ of the overall performance. Just watch the video.

I don't have the experience to compare that to other flight controllers, or AQ-based copters. So I don't know if I should be now very impressed by the perfomance, considering the conditions, or dissapointed. You will tell me. :)

If, btw, you tell me that the perfomance would be much much better, for similar conditions, with a better GPS antenna instead of the dipole one, then I would not hesitate to buy the one you recommend me most from jussis shop (but it should then really perform).

Thx for everything!

PS: I would be still interested in answers to the first two questions :)

Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm


Return to AutoQuad M4 Micro Controller

Who is online

Users browsing this forum: No registered users and 3 guests