1

Kalman filters and quaternions are something new for me.

I have a sensor which output voltage on its pins changes in function of its inclination on x,y and/or z-axis, i.e. an angle sensor.

My questions:

  • Is it possible to apply a Kalman filter to smooth the results and avoid any noise on the measurements?

  • I will then only have 1 single 3D vector. What kind of operations with quaternions could I use with this 3d vector to learn more about quaternions?

Luis Mendo
  • 110,752
  • 13
  • 76
  • 147

1 Answers1

2

You can apply a Kalman filter to accelerometer data, it's a powerful technique though and there are lots of ways to do it wrong. If your goal is to learn about the filter then go for it - the discussion here might be helpful.

If you just want to smooth the data and get on with the next problem then you might want to start with a moving average filter, or traditional lowpass/bandpass filters.

After applying a Kalman filter you will still have a sequence of data - it won't reduce it to a single vector. If this is your goal you might as well take the mean of each coordinate sequence.

As for quaternions, you could probably come up with a way of performing quaternion operations on your accelerometer data but the challenge would be to make it meaningful. For the purposes of learning about the concept you really need it to make some sense, so that you can visualise the results and interpret them.

I would be tempted to write some functions to implement quaternion operations instead - multiplication is the strange one. This will be a good introduction to the way they work, and then when you find an application that calls for them you can use your functions and you'll already know how the mechanics work.

If you want to read the most famous use of quaternions have a look at Maxwell's equations in their original quaternion form, before Heaviside dramatically simplified them and put them in the vector notation we use today.

Also a lot of work is done using tensors these days and if you're interested in the more complex mathematical datatypes that would be a worthwhile one to look into.

xenoclast
  • 1,635
  • 15
  • 26
  • Also there is an interesting discussion of some of the uses of quaternions here which might give you some ideas: http://stackoverflow.com/questions/8919086/why-are-quaternions-used-for-rotations – xenoclast May 15 '15 at 07:42
  • Thank you very much for your answer! Why should I maybe use a moving average (ARMA?) filter in stead of a kallman filter? Both should more or less give me the same final result, with both I should just easily be able to "get on with" the rest of my software, right? I think this should give me a 3d vector because, i get 3 values from my sensor (x, and z) these values get then filtered. So at the end I can just put them in a vector. Truth is the vector will change a lot. What is wrong about these thoughts according to you? –  May 15 '15 at 07:46
  • I see that kallman filter is one of the moste used ones for accelerometers etc. And this would give me the opportunity to learn more about it. Why eventually not the kallman one? –  May 15 '15 at 07:48
  • You are right, Kalman filters are very popular for this application. I only meant to say that a moving average is very easy to apply, while a Kalman filter is more complex and takes more development time. That's not a reason not to use it: my point was that it depends on your priorities. If you want to learn about it then yes, do it, but if this is a time-critical project then a moving average may give you results 80% as good for 20% of the effort. – xenoclast May 15 '15 at 07:55
  • thank you very much, that is clear. What do you think about the fact that I am or am not dealing with 1 3D vector? ( see previous comment) –  May 15 '15 at 09:03
  • My pleasure : ) I think I misunderstood you about the vector: to me '1 3D vector' is a 3-tuple of points specifying the length and direction of a line in 3-space. But a vector generally is also a row or column of datapoints, and in matlab it's synonymous with a 1D array. I would probably not call your accelerometer data a 3D vector, but I understand now what you meant by it. I would call it a 3-variable matrix: although your data represent three spatial dimensions, the array itself is only in two dimensions.... the terminology is ambiguous! – xenoclast May 15 '15 at 10:24