News:


Advertise Here

  • October 28, 2021, 01:27:37 AM

Login with username, password and session length

Author Topic: Kalman Filtering  (Read 2961 times)

Offline Tim Wescott

  • 2016 supporter
  • Trade Count: (0)
  • Admiral
  • *
  • Posts: 12066
Kalman Filtering
« on: September 05, 2013, 02:27:45 PM »
   You aren't going to do a full pattern on inertial guidance with the current MEMs types that would fit in an airplane without an external observer of some sort. the drift and scale factor with 360-degree-per-second maneuver over 6 minutes. And I might suggest you don't want a Kalman filter to incorporate the observers, either, or at least I have seen plenty of cases where the Kalman filters were not optimal in these DOF-constrained cases.

  But overall, the notion that it couldn't be done and therefore there's no reason for concern is clearly not valid, even assisting in a few spots could make all the difference in the world, per Igor's example.

    Brett

I'm not so sure.  Given that you have the constraint that the flight lies pretty close to a sphere of constant radius, I think those 360 degree/second turns end up being very information-rich, and should help a lot more than they hurt.

I'm playing with it now.  If I don't get sick of the math, I'll know more in a few weeks or months.  My primary goal at the moment is to get a really good velocity estimate, which I'm highly confident of.  Getting an actual movie of the trajectory of the IMU post-flight would be a big plus, and very interesting.
AMA 64232

The problem with electric is that once you get the smoke generator and sound system installed, the plane is too heavy.

Offline Brett Buck

  • Trade Count: (0)
  • Admiral
  • ******
  • Posts: 12147
Re: Kalman Filtering
« Reply #1 on: September 05, 2013, 04:29:50 PM »
I'm not so sure.  Given that you have the constraint that the flight lies pretty close to a sphere of constant radius, I think those 360 degree/second turns end up being very information-rich, and should help a lot more than they hurt.\]

    Very information rich (presuming you have an observer at about the same time),  but you don't have to have variable gains (Kalman Filter) to estimate the scale factors or bias (or alignment, which will also matter). A fixed-gain system many times works better in these cases where the kinematics are heavily constrained. Kalman filters as generally created through standard formulations have a nasty tendency to update things in the wrong axis when the references change directions and you have strong axial coupling. 

    Brett

Offline Tim Wescott

  • 2016 supporter
  • Trade Count: (0)
  • Admiral
  • *
  • Posts: 12066
Re: Kalman Filtering
« Reply #2 on: September 05, 2013, 05:49:08 PM »
Very information rich (presuming you have an observer at about the same time)

I'm trying to wedge your terminology into my terminology, and things aren't fitting.  Do you mean observer in the control-theory-ish sense?  I would peg the KF as being that critter in this case.  If not, please elucidate.

,  but you don't have to have variable gains (Kalman Filter) to estimate the scale factors or bias (or alignment, which will also matter). A fixed-gain system many times works better in these cases where the kinematics are heavily constrained.

One of the reasons that I'm thinking of going with a full-on strapdown solution complete with a Kalman is because I want to maintain a good moment-to-moment velocity estimate, even in the face of the aircraft changing orientation due to wind buffet, etc.  Without the 6-axis strapdown solution any such buffet is going to mix accelerometer axes in an unfortunate way: with it, I think I can have a nice high-bandwidth estimate of the aircraft's forward velocity at all times.

The main reason for the Kalman is that with the constantly-changing orientation, I'm not sure how or if I can squeeze a fixed-gain solution out.  Given what you're saying at some point I'll put it into a closed container and heat it up, and see if I can distill a fixed-gain system out of it.  If you have any good books or papers to recommend I'd certainly appreciate it.

Kalman filters as generally created through standard formulations have a nasty tendency to update things in the wrong axis when the references change directions and you have strong axial coupling.

If you would be so kind, check your email when you get home.  If you don't do anything else with what you find, let me know if what I'm proposing matches your "standard formulation".  It's based on some work that I did for a client a while back merging GPS and IMU information: the only time that particular filter had such axis-mixing problems was at startup when it was fumbling around for the initial orientation, and after some really extreme GPS errors due to multipath.  Neither of those will be at issue here, because my intention is to start the thing out with a knowledge of which way the pilot is standing with respect to the airframe (hence orientation should be roughly known from the beginning of time), and there won't be any GPS in the picture at all.

On the other hand, that filter was unscented, and this one needs to run on a processor that won't weigh down a stunt plane.  So I'm planning on going no further than an extended Kalman.
AMA 64232

The problem with electric is that once you get the smoke generator and sound system installed, the plane is too heavy.

Offline Brett Buck

  • Trade Count: (0)
  • Admiral
  • ******
  • Posts: 12147
Re: Kalman Filtering
« Reply #3 on: September 05, 2013, 09:21:35 PM »
I'm trying to wedge your terminology into my terminology, and things aren't fitting.  Do you mean observer in the control-theory-ish sense?  I would peg the KF as being that critter in this case.  If not, please elucidate.

    What I think we are talking about are taking accelerometers and gyros to determine the position and attitude and then incorporating absolute position and attitude references to correct from cumulative errors arising from gyro/accelerometer scale factor, misalignment, and drift.

   Absolute position and attitude indicators are frequently referred to as observers. What a typical inertial navigation system does is integrate the gyro and accelerometer data, include the geometry/kinetmatics, and generate an estimated position and attitude. In the absence of other information these will generate growing errors over long periods of time, but they are pretty clean (in terms of noise) and have a decent bandwidth over short periods. Every so often you need to correct for the tendency for the error to grow by incorporating an external absolute reference - GPS, Star tracker, magnetometer, sextant data. These are typically pretty noisy from second to second, and not available at a sufficient rate to use continuously, but don't wander off over time. Typically these are called observers.

   Since the observers are known to be noisy, you don't want to take any individual reading of absolute position and/or attitude and just wipe out your estimate with it. What you want to do is nudge your estimate towards the observer information slowly, so, take the difference between your integrated estimate from the gyros/accelerometer and the observer reference, multiply it by some factor less than one , and add that to the estimate. Now the estimate is closer to the observer. If it's off the same direction the next time, you nudge the estimate closer, etc. Over time, if your estimate was really off, it will approach the average of the noisy observer (which is presumed to be accurate) even though none of the individual observer readings are really correct due to noise. So you wind up with an estimate that is not noisy, and right down the middle of the observer readings, perfect accuracy. The degree to which you nudge to towards the observer is the system gain.

    Note also that there is drift (its always telling you a rate or acceleration that is in error by a fixed amount regardless of the actual rate) what will happen is that the estimate never gets to the average of the observer readings. It will approach it until the degree of update from the observer is the same as the drift. Of course, this allows you to estimate the drift, since you know that the average error is persistently in the same direction and roughly the magnitude. In fact the average error over time is is proportional to the drift. You can then use this drift estimate to alter the gyro information before you integrate it, so over time the estimate of the position or attitude is corrected. With a little more work you can use similar reasoning to determine error in the gyro or accelerometer that is not fixed, but some function of the rate - the scale factor error, and an error sources related to the absolute orientation - the misalignment.

  You probably knew all this already. What I think we are not communicating on is how this is done. Kalman Filtering can be applied to this problem, but you can do it without Kalman filtering, too. The difference is that a Kalman filter considers the postulated degree and nature of the various error sources (degree of noise, amount of drift, etc) and changes the gain based on how long you have gone since the last update. If you have been without observers for a long time, it is reasonable to expect that the estimate has drifted off a long way, so when you get the next observer reading, you probably want to take a bigger jump towards it even though it is noisy. Once you have gotten lots of observer data, you might think your estimates are all pretty good, so you want to take only tiny jumps towards the observer position to mitigate the noise. Assuming you accurately know the noise and drift characterstics, this creates what is purported to be an "optimal" estimator, meaning that it drives the overall error to near zero in the "best possible way", i.e it converges really fast and then rejects all the noise nicely.

   But no one says you have to do it that way. Many, many systems use fixed gains that always nudge the estimate towards the observe by the same amount regardless of error sources, how long it has been, etc. You can set them to converge fast but permit a lot of noise through, or to filter the noise nicely but take a long tome to converge, or something in between, but it doesn't change itself based on time or lack of updates. In many cases where observer data is available at a fixed interval, the gains of the Kalman filter converge to fixed values and then it operates absolutely identically to a fixed-gain system. Some hack even simulate their problem using a Kalman Filter, see what the gains wind up, then use these as the fixed gains in their real system. That's because they can't do math but they can type things into computers.

    These are perfectly valid systems and most of the time they work similarly. The difference is that Kalman Filters have variable gains and other systems have fixed gains. A full-up Kalman filter is very computationally intense, requiring extensive matrix manipulation, fixed gain systems are far less so, even when you include the kinematics. The other problem is you never know what a Kalman filter is going to do in closed-form, or in real life, and it's response varies intentionally over time. If you lose the observer for a while, when it comes back, it will take the first reading it gets as perfect, dump almost all of the error at once, and cause a big jump in the reference.

   There are many erroneous papers written describing "Kalman Filters" that are partial implementation, or just generically calling all inertial reference systems that include absolute references as "Kalman Filters".

   My point was that in many cases where the axes are strongly coupled and constrained, not only are the extensive Kalman filter calculations not required, you don't need or want the variable gain features because you would rather have controllable smooth updates rather than unpredictable jumpy updates, and the strong constraints tend to cause the gains to vary in detrimental ways, while it actually helps in some of the fixed-gain systems.

   Brett

Offline Tim Wescott

  • 2016 supporter
  • Trade Count: (0)
  • Admiral
  • *
  • Posts: 12066
Re: Kalman Filtering
« Reply #4 on: September 05, 2013, 09:46:44 PM »
    What I think we are talking about are taking accelerometers and gyros to determine the position and attitude and then incorporating absolute position and attitude references to correct from cumulative errors arising from gyro/accelerometer scale factor, misalignment, and drift.

<snip>

  You probably knew all this already. What I think we are not communicating on is how this is done. Kalman Filtering can be applied to this problem, but you can do it without Kalman filtering, too. The difference is that a Kalman filter considers the postulated degree and nature of the various error sources (degree of noise, amount of drift, etc) and changes the gain based on how long you have gone since the last update.

<snip more>


We were mostly singing off the same sheet of music, but the titles were different.  That's a relief.

Your "observer", by the way, is just totally different from what a guy trained in control theory calls an "observer".  In all of the books that line my shelves, if an "observer" is mentioned at all then it is a filter that estimates the states of a system, given a system model, the system inputs, and the system outputs.  While not all observers (in the control theory sense) are Kalman filters, all Kalman filters are observers.

Your "observer" would be what I'd call a source of measurements, or some such.  But if I ever find myself at a cocktail party full of navigation folks, I'll know what they're saying.

(Allow me to digress -- you have just contributed to a book chapter that I'm writing, one small section of which is about terminology collisions between different disciplines.  This is a prime example, because your "observer" and my "observer" are well known in our respective disciplines, both show up in the same system, yet mean totally different -- indeed, contradictory -- things.  Because I know this sort of thing happens I knew to ask "what the???".  The book chapter mentions it so that fresh-faced kids who haven't been through a Hardening have at least a small clue.)

I'm not sure if all of what you were saying takes the orientation correction into account.  If you have gyro and accelerometer data, with GPS coming in the side (GPS being your "observer"), then you can use the GPS updates to solve for the vehicle orientation.  But the only way that I know how to do that is to use a Kalman filter.  Indeed, because you only get information on orientation when the vehicle is accelerating there can be long dry periods (when you're moving in a straight line at steady speed, or worse are in free fall) where the IMU+GPS combination gives you no clue about orientation at all.  It was this that I was hoping that you may have references (to real working examples, of course) that you could share.

In the case of the current project, I'm expecting a really good estimate of velocity, and I'm hoping for something that lets me land, download a huge slug of data, then regenerate a movie of the flight on my computer screen.  I'm pretty sure that in order to do that I need a really-o truly-o Kalman filter, but that is something to be avoided if possible.

(And I appreciated your putting the word "optimum" into quotes.  Every young engineer needs to have an older engineer around who snorts and makes snide comments whenever the word "optimal" or "optimum" comes into the conversation.  Even as I design "optimal" filters or whatnot, I do so with the awareness that they are only optimal in the fever-dreams of some mathematician.)
AMA 64232

The problem with electric is that once you get the smoke generator and sound system installed, the plane is too heavy.

Offline Brett Buck

  • Trade Count: (0)
  • Admiral
  • ******
  • Posts: 12147
Re: Kalman Filtering
« Reply #5 on: September 05, 2013, 11:07:35 PM »
Your "observer", by the way, is just totally different from what a guy trained in control theory calls an "observer". 

   That's very interesting.

    Brett


Advertise Here
Tags:
 


Advertise Here