M4 Ladybrid Position Hold and PH controller Questions

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

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby bn999 » Mon Jan 05, 2015 6:36 am

Mr OlliW,

Looks to me you are one to not give up in pursuit of answers to questions. This is familiar to me as I tend to work the same way. First thing you need to know, is that there are no hard specifications. When you ask how much deviation is allowed, the answer is simply "the less, the better." Perhaps not what you want to hear, but it is the truth.

Watching your video, I'm fairly certain you do not have the GPS reception necessary to perform a tight position hold. This first shows up with vertical position uncertainty. And, since vertical position is mostly determined by satellites at a perpendicular angle to your local vertical, positioning yourself between two houses only works against you.

Next, the antenna that you are using is not going to be anywhere as effective as an active ceramic patch. I know for a small machine, carrying such a burden is a problem, but it is necessary for any sort of precision. I'm not saying that you can not get the dipole antenna to work to some degree, but it is far from ideal. A 35mm, active ceramic patch antenna with the proper ground plane will allow an M4 FC to perform to 10cm precision. Yes, just the antenna would weigh more than the entire gross weight of the craft, but that's the problem. I've used 10mm active ceramic patches with fairly good results, but far from perfect.

Then, to truly diagnose the situation, you are going to need a log of the flight. Due to its small size, the M4 does not have an onboard uSD interface. You would need an expansion board attached to achieve this. The logged data should paint a picture which show exactly what is going on. You show a <0.5m HACC while static (which I believe) but I don't know what is being reported during the course of the actual flight.

For the altitude hold, there are now two modes automatically switched between depending on the reported GPS accuracy. The primary is dominated by the GPS's reported vertical velocities. The second is a backup used when there is "far less than ideal" GPS data and relies entirely on the barometer, ACCs and estimated attitude - mainly used for indoors.

As to the questions about the MAG sensors, if you have run through the onboard calibration routines, your MAGs are probably calibrated well enough to resolve to better than 5 degrees from actual. If you have good GPS signal, the system will refine this as time goes on. In your video, I do not see any evidence that your estimated heading is causing you problems.

Let's all keep in mind that the M4 in a LadyBird configuration is less than 40 grams. It is amazing to me that such a setup is able to have any autonomous capabilities, much less precision. Please do not let this tarnish the true strength of the AQ firmware which with proper configuration, can perform incredibly well, even with the tiny M4 FC. The M4 in a native configuration is extremely fun to fly, but other than the novelty of the fact that it has an autonomous mode, is really just a toy because the necessary antennas and shielding simply weight too much. The idea is that this "toy" is able to be upgraded and used in a serious application without compromise.
bn999
 
Posts: 1559
Joined: Thu Jun 21, 2012 11:40 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Mon Jan 05, 2015 12:08 pm

Hey Mr. bn999 ;)

big THANKS for these detailed & precise infos.

First thing you need to know, is that there are no hard specifications. When you ask how much deviation is allowed, the answer is simply "the less, the better." Perhaps not what you want to hear, but it is the truth.
THAT is a statement I'm very satisfed with, since it's a clear statement on the status (I mentally insert a "to the best of our knowledge") !

Let me make a honest comment, which is probably inappropriate, but anyway. Obviously, experience yields figure of merits. The above statement can now mean one of two things: Either, you guys are currently lacking the experience and hence can't say better (please don't get this wrong, I find that VERY natural, for many of my own projects I face exactly the same thing, it's only a status statement). Or, you guys do have the experience but never got around and together to put them into figure of merits. I somehow have a feeling that it's rather the second situation. In that case, and if my assumption that with the M4 you're aiming at a wider audience is true, I only can recommend that you sit together and try to find the best figures of merit you currently can. Ideally they would be complemented by some insight into why.

Any manual on calibration is IMHO meaningless without a comment on the expected accuracy. If it's not yet known, that's perfectly fine, but it then should be said.

As to the questions about the MAG sensors, if you have run through the onboard calibration routines, your MAGs are probably calibrated well enough to resolve to better than 5 degrees from actual. ... In your video, I do not see any evidence that your estimated heading is causing you problems.
Very clear and precise statements, answering a couple of questions. Thx.

(and btw you say here better than "the less the better" :D, this statement is potentially very useful to many, much appreciated)

Watching your video, I'm fairly certain you do not have the GPS reception necessary to perform a tight position hold.
Very clear and precise statements, Thx.

So, the overall picture is that the calibrations are probably OK, but that GPS reception isn't good enough.

(I hope that it becomes now better understandable why I'm so insisting ... various info from various sources need to be aligned, I don't like to gather wrong knowledge ;))

(and sandmen will, rightfully, say, I told you so :D)( ... but it's always good to have a second opinion)

You would need an expansion board attached to achieve this.
Well, you know, this is exactly what I don't want to do. I totally understand your position, and it's easy to predict what your response is going to be. BUT: I entered the M4 game because it promised to me a relatively simple entrance (relatively simple != simple) into the UAV world. If I have to establish the full ecosystem to get anywhere I will conclude that the concept didn't worked out as well as I thought (and would think that you should tone better your advertisments) - without any second guesses! Anyway, the BT link seems to be working fairly well, I know now what to look for, and I will find an arragement within my possibilities to gather the required info. :)

The primary is dominated by the GPS's reported vertical velocities. The second is a backup used when there is "far less than ideal" GPS data and relies entirely on the barometer
Could this be maybe a bit more specified. I understand that it's difficult to say precisely with algorithms which work with statistics, and that's it's probably not a sharp transition. Could one say something like when the GPS accuracy is about X m then both the GPS and baro are considered about eually much, i.e. that the crossover from one dominating the result over the other is about X m. ?

It is amazing to me that such a setup is able to have any autonomous capabilities
I TOTALLY AGREE!
I'm not trying to tarnish anything, I'm trying though to get a realistic picture :).

I think that your last paragraph, with some adaption, would be placed also well in the wiki.

Thanks so much,
Olli
OlliW
 
Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby bn999 » Mon Jan 05, 2015 2:46 pm

OlliW wrote: Or, you guys do have the experience but never got around and together to put them into figure of merits. I somehow have a feeling that it's rather the second situation.


This is precisely the situation.

OlliW wrote:
The primary is dominated by the GPS's reported vertical velocities. The second is a backup used when there is "far less than ideal" GPS data and relies entirely on the barometer


Could this be maybe a bit more specified. I understand that it's difficult to say precisely with algorithms which work with statistics, and that's it's probably not a sharp transition. Could one say something like when the GPS accuracy is about X m then both the GPS and baro are considered about eually much, i.e. that the crossover from one dominating the result over the other is about X m. ?


The blue LED comes on once you get better than 3.0m of reported horizontal accuracy (hAcc.) This does not mean that the system will work very well with a 3.0m hAcc, it just means that the FC will allow you to try with the hope that things are getting better. :)

Notice that I say "reported" accuracy, because that is all it is - an estimate given by the UBlox module. Although the number itself does not mean much, I have come to trust it as a reliable relative indication of the quality of the position and velocity estimates reported by the UBlox. Having said that, I have also seen it "tricked" for short periods of time by EMI and multi-path signals, but this only seems to happen when your antenna, ground plane or sky view are not up to muster.

The switch between barometer only to heavy GPS influence for altitude estimation happens at 0.8m hAcc. There is no hysteresis at the moment, so if you are crossing the 0.8m boundary back and forth, you will likely see constant shifting in estimated altitude. In such a case, you should not expect very good altitude hold.

About the pressure sensor - everyone will tell you to cover it with foam, and that is good advice. But problematic bias shifting is influenced more by exposure to light (especially sunlight) than it is turbulent air. So, covering it with a completely opaque material is essential. I normally locate the sensor on the underside of a board shadowed by other components, but in the case of the M4, top and bottom can and are easily exchanged.

Realize that all of these (and other) numbers have been chosen based on the experience of a very few developers. This is an open source project, so they can be changed. Some might even need to be made tunable parameters with defaults that depend on what AQ FC you are using. The more feedback that we get, the more polished we can make the system.

What is expected is that hAcc slowly improves from the time of first fix until the end of flight. With proper antenna and ground plane, you should be seeing better than 0.5m hAcc for most of the flight. If I can't see better than 0.5m consistently, then I try to figure out what's wrong. The UBlox-M8 module that the M4v2 is equipped with will report as low as 0.25m hAcc (using an antenna designed to receive both GPS & Glonass sats) and in my experience, performs much better than the UBlox 6 & 7 that are found in the prior versions of AQ FC's. Of course, only with the right antenna, ground plane, etc.
bn999
 
Posts: 1559
Joined: Thu Jun 21, 2012 11:40 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Mon Jan 05, 2015 5:23 pm

very cool answer, thanks soo much !

About the pressure sensor - is influenced more by exposure to light
I thus covered the foam with this metal looking foil seen in the photos, which is from an antistatic bag used for electronic devices. I hope it to be quite good from this perspective, I'm not yet sure if it creates some other issues. Tests will tell.

The switch between barometer only to heavy GPS influence for altitude estimation happens at 0.8m hAcc. There is no hysteresis at the moment, so if you are crossing the 0.8m boundary back and forth, you will likely see constant shifting in estimated altitude.
let me try to understand this better: I was assuming, since a UKF is used, that the crossover is not like a switch but smoothly controlled by the relative statistical weights calculated by this Kalman P equation thing (I forget the proper name for that). An alternative procedure, more along the lines of a tuned complementary filter, would be a smooth crossover controlled by some error estimates such as Hacc. The simplest procedure would be to just switch between GPS or baro at a certain threshold value of Hacc. Your text seems to imply that it is in fact this last method which is used by AQ, do I understand this correctly?

Thx again,
Olli
OlliW
 
Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby bn999 » Mon Jan 05, 2015 5:50 pm

OlliW wrote:
The switch between barometer only to heavy GPS influence for altitude estimation happens at 0.8m hAcc. There is no hysteresis at the moment, so if you are crossing the 0.8m boundary back and forth, you will likely see constant shifting in estimated altitude.
let me try to understand this better: I was assuming, since a UKF is used, that the crossover is not like a switch but smoothly controlled by the relative statistical weights calculated by this Kalman P equation thing (I forget the proper name for that). An alternative procedure, more along the lines of a tuned complementary filter, would be a smooth crossover controlled by some error estimates such as Hacc. The simplest procedure would be to just switch between GPS or baro at a certain threshold value of Hacc. Your text seems to imply that it is in fact this last method which is used by AQ, do I understand this correctly?


Yup. From run.c:

// determine which altitude estimate to use
if (gpsData.hAcc > 0.8f) {
runData.altPos = &ALT_POS;
runData.altVel = &ALT_VEL;
}
else {
runData.altPos = &UKF_ALTITUDE;
runData.altVel = &UKF_VELD;
}
bn999
 
Posts: 1559
Joined: Thu Jun 21, 2012 11:40 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Mon Jan 05, 2015 6:00 pm

now things start to clear up significantly in my head, pieces fall together and the observed behavior starts to make sense ... hopefully weather will allow some tests tomorrow :o

there is then obviously room for improvement in the code, instead of a hysteresis a smooth crossover function would likely do a much better job ... I guess I should see if I can get the code compiled LOL

thanks again very much, this was very helpful
I'll report my new findings
OlliW
 
Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby bn999 » Mon Jan 05, 2015 6:02 pm

What has not been completely clear to me is how much our traditional GPS shield acting as a ground plane vs acting as a EMI shield contributes to its success. In the case of a passive dipole, you have neither.

An interesting test would be to surround the entire M4 board in tin foil, leaving only the dipole sticking through. Of course, you would need to cover it in something non-conductive first. This should cut down on the radiated EMI significantly. If something like that works, it might suggest that there would be a benefit to some sort of light weight RF opaque canopy or housing for the board.
bn999
 
Posts: 1559
Joined: Thu Jun 21, 2012 11:40 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby Kisssys » Mon Jan 05, 2015 8:35 pm

Hi Olliw,

I wrote a long post today and when I took a phone call it all dropped out of the editor so I'll try again. I would doubt if anyone as spent more time than I have on the M4 and it's use on dozen's of different frames. From my experience this is what I've found IMHO.

It will in fact do exactly what everyone has described and all of their fixes are dead on. But if we've led you to believe that with that dipole antenna you are always going to get good gps hold we have been amiss IMHO. If you went out to a open field with full view of the sky, and if you allow the M4 to get it's accuracy down to less than 1 meter, and if you arrive at a good compass heading before entering position hold, and if you are flying during the time of day with optimum satellite position you will get outstanding position hold with that very very very poor antenna. Lot's of if's.

The dipole is used because it's light enough for the Ladybird to carry and let's people play with position hold which is fun on a small machine. The antenna does not have circular polarization and is therefore more susceptible to multipath signals and it is as able to pick up signals that come from the M4, BT or reflecting off of the ground as easily as it picks up signals from the sky. It is very hard to tune an antenna at those frequency's so it's probably not on frequency. Just the plastic or glue one uses can throw it off. The little patch antenna's that we sometimes use can be bought in packs of 10 or 20 each with a slightly different frequency. The idea being you try each one to see which one shifts to the correct frequency in the environment that it has around it. The point being is it's hard to make a good antenna installation even if you have the best equipment to work with. The fact the dipole or little patch or whatever you use on a small machine works at all is amazing and is a statement as to how good the onboard gps receiver is.

It would be absolutely impossible for you to judge what the M4 can do without giving it a good antenna system and flying it in a suitable location. I would encourage you to compile the code and make contributions but I would suggest flying it on a full size machine with a good ground plane and patch antenna before making judgement.

Cheers
Steve
Steve
Kisssys
Kisssys
 
Posts: 1340
Joined: Sat Jun 23, 2012 9:23 pm

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby kinderkram » Tue Jan 06, 2015 12:29 am

Yah, Steve has done a lot of tests with ALL kinds of GPS modules and antennas, groundplanes, shields, hoods, whatever.

And he had proven that you´ll be getting a perfect Hacc of 10cm with an active 35mm patch antenna.
So it´s not the M8Q module - it´s the best we ever had.

GPS antennas is still in discussion and Larry has posted an interesting one here:
viewtopic.php?f=40&t=3975&start=10#p29434
kinderkram
 
Posts: 2911
Joined: Fri Jun 22, 2012 7:47 am

Re: M4 Ladybrid Position Hold and PH controller Questions

Postby OlliW » Tue Jan 06, 2015 11:15 am

thanks a lot for these usefull thoughts!

I'm not sure at which point but somewhere a slight missunderstanding seems to have creeped in. I'm not doubting the M4's cababilities in any way, I in fact believed and continue to believe that this is just an amazing piece of hardware. In whatever I'm saying I'm referring ONLY to it installed on a ladybird with a dipole antenna.

I'm following the GPS antenna thread with much interest :)
OlliW
 
Posts: 60
Joined: Sat Nov 01, 2014 3:08 pm

PreviousNext

Return to AutoQuad M4 Micro Controller

Who is online

Users browsing this forum: No registered users and 4 guests

cron