Keith, The Kalman filter is probably too difficult to calculate on the controller I am using (a micro PLC with floating point math) , so I am going to do a first and perhaps a second order lag filter first and see what happens. If the lag filters are in-effective then I will chase a Kalman filter solution. I am going to try out your example anyway since it sounds really interesting. :)
Thanks, Dave On 8/21/2011 3:25 PM, Keith Curtis wrote: > Hi Dave, > > I have a tiny bit of experience with Kalman filtering for state > estimation, and attached a toy example that might help get you > started. I have written it to work with Octave which is open source so > you can install it if you don't already have it. The idea as I > understand it is that you have a model of how the state updates, like > Newton's laws. You predict what you'll measure, compare that to your > actual measurement and the apply the Kalman gain matrix K to the > difference to update your estimate of the state. > > You can run the example in Octave with > > octave:1> kalman_example > > In the example, I have an object moving in a parabolic arc, and in a > commeted-out line, an object moving in a straight line. The > measurements that are the input the filter are stored in y. You can > plot the measurements out with > > plot(y(1,:), y(2,:), 'o') > > At the end of the script the estimate state positions are plotted with > > plot(x_hat_plus(1,:), x_hat_plus(2,:), 'o') > > > The tricky parts seem to be what sort values to put in the initial P, > Q, and R covariance matrices. > > Hope this helps. > > > Cheers, > Keith > > On Sun, Aug 21, 2011 at 12:08 PM,<kth.cur...@yahoo.com> wrote: > >> >> ---------- Forwarded message ---------- >> Date: Wed, 17 Aug 2011 16:18:51 -0400 >> From: Dave<e...@dc9.tzo.com> >> Reply-To: "Enhanced Machine Controller >> (EMC)"<emc-users@lists.sourceforge.net> >> To: emc-users@lists.sourceforge.net >> Subject: [Emc-users] OT ? Kalman Filter >> >> >> I have an application that I believe could greatly benefit from a Kalman >> Filter. Kalman filters are oftentimes used for guidance systems and >> that is what I need it for - except that I am guiding a boat! >> However the same filter I understand can also be used to predict >> (estimate) velocity and position based upon what would normally be >> considered incomplete information. One example I heard what that a >> Kalman filter can >> be used to predict velocity when used with low count encoders - as in >> low count encoders used on servo motors. >> >> If you do a look up of "Kalman filter" on Youtube you can get an idea of >> their flexibility. >> >> Does anyone have any experience with Kalman filters? I have searched >> the web for a simple explanation and John Crenshaw of embedded magazine >> started a series of articles in the March 2011 edition (sort of a >> Kalman filter for dummies) but he stopped short of publishing the second >> article which gets into the actual filter software explanation. >> >> I found a "primer" on the web that I downloaded. It is a PDF document >> that is 189 pages long! >> >> Where do I start with this?? >> >> I get the feeling that if I just grab some source code and implement >> something it won't work since the filter has to be "setup" to allow the >> software to properly predict or estimate a value. >> >> Thanks, >> >> Dave >> >> ------------------------------------------------------------------------------ >> Get a FREE DOWNLOAD! and learn more about uberSVN rich system, >> user administration capabilities and model configuration. Take >> the hassle out of deploying and managing Subversion and the >> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 >> _______________________________________________ >> Emc-users mailing list >> Emc-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/emc-users >> ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users