Thread Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: MRR

Date: 27 Sep, 2008 22:47:01

Message: 1 of 11

Hi everybody,

I am trying to develop a Kalman filter able to estimate position, velocity and acceleration (i have the kalman filter designed in a function but i need the system to estimate). I measure the position of an object with two sensors (and Kalman filter has to give estimations of position, velocity and aceleration).

I suppose an object moving with trayectories with constant velocity and constant acceleration, suppose for example 10 seconds with constant velocity and other 10 seconds with constant acceleration. My doubt is: How can i model the system ?

I thought about this system in space states:
[x(k+1);v(k+1);a(k+1)] = [1 T T2/2;1 0 T;0 0 1] * [x(k);v(k);a(k)] + w(k) (w(k) is noise)

x is the position (the object moves just in ONE DIMENSION)
v velocity
a aceleration

I obtained it since the motion equations:
x = x0 + v0*T + 0.5*a*T2
v = v0 + a*T
a = a0 (as i said i suppose trayectories with constant velocity)
T is the period of the discrete system.

but: how can i "mix" the meausre of the two sensors?
because z = [1 0 0]*[x(k);v(k);a(k)] + h(k) (h(k) is noise) would represent just one sensor.

And also, what happens if the trayectory is with cero acceleration, then the system showed before is not appropiate (maybe i?d need to use acceleration as input the system).

So, what system would represent the dynamic and how can i use the measures of two sensors in each time ? (multisensorial).


Any information will be very useful, kind regards.
 

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: Bruno Luong

Date: 28 Sep, 2008 07:02:01

Message: 2 of 11

"MRR " <mario_ruz@hotmail.com> wrote in message <gbmd55$an6$1@fred.mathworks.com>...

>
> but: how can i "mix" the meausre of the two sensors?
> because z = [1 0 0]*[x(k);v(k);a(k)] + h(k) (h(k) is noise) would represent just one sensor.

Use a long column "observation" matrix (M x 3) in Kalman filter after state model, allow you to duplicate to M sensors. Alternatively if the measurements are synchronize and measure the same quantity, you might combine sensors by take the mean of the measurements.

>
> And also, what happens if the trayectory is with cero acceleration, then the system showed before is not appropiate (maybe i?d need to use acceleration as input the system).

I do not take a close look of your model, but this is in general not good. I suggest to work more on your model.

>
> So, what system would represent the dynamic and how can i use the measures of two sensors in each time ? (multisensorial).
>

See above. I suggest you to take a closer look at the Kalman filtering theory again. After you understand the theory, the questions would become fairly trivial.

Bruno

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: MRR

Date: 28 Sep, 2008 07:26:01

Message: 3 of 11

Hi Bruno,

Thanks for your answer.

As for the outputs I thought using 2x3 matrix ([1 0 0;1 0 0]) as you said.

Concerning the model, it is my main doubt, and that was i mainly asked. I think I have read enough about Kalman theory (it?s basically and optimum estimator of the states of a system, which reduce the square variance error difference beetween the "real" and "estimated" states). But i didnt found any literature related with multisensorial data of one state, and i couldnt find any model for a point moving with constant acceleration AND sometimes constant velocity.

Thank you for your answer.





"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gbna59$422$1@fred.mathworks.com>...
> "MRR " <mario_ruz@hotmail.com> wrote in message <gbmd55$an6$1@fred.mathworks.com>...
>
> >
> > but: how can i "mix" the meausre of the two sensors?
> > because z = [1 0 0]*[x(k);v(k);a(k)] + h(k) (h(k) is noise) would represent just one sensor.
>
> Use a long column "observation" matrix (M x 3) in Kalman filter after state model, allow you to duplicate to M sensors. Alternatively if the measurements are synchronize and measure the same quantity, you might combine sensors by take the mean of the measurements.
>
> >
> > And also, what happens if the trayectory is with cero acceleration, then the system showed before is not appropiate (maybe i?d need to use acceleration as input the system).
>
> I do not take a close look of your model, but this is in general not good. I suggest to work more on your model.
>
> >
> > So, what system would represent the dynamic and how can i use the measures of two sensors in each time ? (multisensorial).
> >
>
> See above. I suggest you to take a closer look at the Kalman filtering theory again. After you understand the theory, the questions would become fairly trivial.
>
> Bruno

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: Bruno Luong

Date: 28 Sep, 2008 08:03:01

Message: 4 of 11

"MRR " <mario_ruz@hotmail.com> wrote in message <gbnbi9$cse$1@fred.mathworks.com>...

>
> Concerning the model, it is my main doubt, and that was i mainly asked. I think I have read enough about Kalman theory (it?s basically and optimum estimator of the states of a system, which reduce the square variance error difference beetween the "real" and "estimated" states). But i didnt found any literature related with multisensorial data of one state, and i couldnt find any model for a point moving with constant acceleration AND sometimes constant velocity.
>

Well the multi-sensors is embedded in the filtering theory. I doubt there is something more to be said about it.

Constant velocity means zero acceleration. You can write down the transition matrix with you state defined as x=(position,v,a)'. Both constant velocity OR (not AND) constant acceleration can be written with transition matrix. Even more complicated varying acceleration can be express by transition matrix. All you need is to pick your control (acceleration?), and write down the kinematic to see how it affects the state vector (it should be linear).

Your problem (Data as well as Model) falls exactly into the theory framework, without the need of any twisting a smallest bit. That's probably why you cannot find anything more intelligent in the literature beside the Kalman theory itself.

Bruno

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: MRR

Date: 3 Oct, 2008 12:10:03

Message: 5 of 11

Hi Bruno,

A few days ago i solved the problem, but i wanted to ask you. First of all, when i said "with constant acceleration AND sometimes constant velocity", of course AND means in the same simulation, its logic that you cannot have constant velocity with non-zero acceleration and viceversa.

What i was asking was this, maybe it can help anybody to have a simple MODEL MOTION in space states:

[pos(k+1);vel(k+1);a(k+1)] = [1 T 0; 0 1 0;0 0 0] * [pos(k);vel(k);a(k)] + [T^2/2; T;1]*u + [h1(k);h2(k);h3(k)]

[z1(k);z2(k)] = [1 0 0;1 0 0]* [pos(k);vel(k);a(k)] + [w1(k);w2(k)];

h and v are noise vectors. And the entrance u is the acceleration, then i can generate trayectories with constant acceleration or constant velocity. That was what i want.

"That's probably why you cannot find anything more intelligent in the literature beside the Kalman theory itself" --> when somebody asks anything these kind of answers are not useful, because it doesn?t solve anything.



"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gbndnl$rc8$1@fred.mathworks.com>...
> "MRR " <mario_ruz@hotmail.com> wrote in message <gbnbi9$cse$1@fred.mathworks.com>...
>
> >
> > Concerning the model, it is my main doubt, and that was i mainly asked. I think I have read enough about Kalman theory (it?s basically and optimum estimator of the states of a system, which reduce the square variance error difference beetween the "real" and "estimated" states). But i didnt found any literature related with multisensorial data of one state, and i couldnt find any model for a point moving with constant acceleration AND sometimes constant velocity.
> >
>
> Well the multi-sensors is embedded in the filtering theory. I doubt there is something more to be said about it.
>
> Constant velocity means zero acceleration. You can write down the transition matrix with you state defined as x=(position,v,a)'. Both constant velocity OR (not AND) constant acceleration can be written with transition matrix. Even more complicated varying acceleration can be express by transition matrix. All you need is to pick your control (acceleration?), and write down the kinematic to see how it affects the state vector (it should be linear).
>
> Your problem (Data as well as Model) falls exactly into the theory framework, without the need of any twisting a smallest bit. That's probably why you cannot find anything more intelligent in the literature beside the Kalman theory itself.
>
> Bruno

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: Bruno Luong

Date: 3 Oct, 2008 13:57:01

Message: 6 of 11

"MRR " <mario_ruz@hotmail.com> wrote in message <gc522r$av1$1@fred.mathworks.com>...

> A few days ago i solved the problem, but [snip]...

Very good.

Bruno

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: MRR

Date: 3 Oct, 2008 15:48:01

Message: 7 of 11

I'm sorry i forget to mention thank you for your help. I had an error in the multisensorial focus.

Kind regards??

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: Student S

Date: 13 Apr, 2009 04:35:01

Message: 8 of 11

Could you tell me, how to merge the induction motor with kalman filter

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: Jorge

Date: 15 Dec, 2009 15:18:01

Message: 9 of 11

"MRR " <mario_ruz@hotmail.com> wrote in message <gc5erh$nc6$1@fred.mathworks.com>...
> I'm sorry i forget to mention thank you for your help. I had an error in the multisensorial focus.
>
> Kind regards??

Hi Mario. I have facing the same situation. What do you mean by "I had an error in the multisensorial focus"??

Is then the equation:

[z1(k);z2(k)] = [1 0 0;1 0 0]* [pos(k);vel(k);a(k)] + [w1(k);w2(k)];

incorrect????

According to it, the two sensors are independent to each other. The Kalman filter estimator (so Bayesian filter) merges these 2 measures at the updating step.

Regards.


Jorge

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: MRR

Date: 15 Dec, 2009 19:32:04

Message: 10 of 11

Hi Jorge,

That equation is fine. I had an error before, and then I posted the corrected equation just if someone could find it useful.

As you can see, you obtain two independent measures (a 2x1 vector), each one with its disturbance w.

You are right, the filter obtain itself the best prediction (with minimun quadratic error), "mixing" this two measures.

Hope it helps,

Mario

Kalman filter uses this both measures to obtain a best prediction (
As you said, Kalman filter "mix" both measures to obtain the best prediction (
"Jorge " <jorgegent83@yahoo.com> wrote in message <hg89b9$fg7$1@fred.mathworks.com>...
> "MRR " <mario_ruz@hotmail.com> wrote in message <gc5erh$nc6$1@fred.mathworks.com>...
> > I'm sorry i forget to mention thank you for your help. I had an error in the multisensorial focus.
> >
> > Kind regards??
>
> Hi Mario. I have facing the same situation. What do you mean by "I had an error in the multisensorial focus"??
>
> Is then the equation:
>
> [z1(k);z2(k)] = [1 0 0;1 0 0]* [pos(k);vel(k);a(k)] + [w1(k);w2(k)];
>
> incorrect????
>
> According to it, the two sensors are independent to each other. The Kalman filter estimator (so Bayesian filter) merges these 2 measures at the updating step.
>
> Regards.
>
>
> Jorge

Subject: Kalman filter, two sensors of position. Estimation of position, velocity and acceleration

From: Jorge

Date: 16 Dec, 2009 11:30:20

Message: 11 of 11

Thank you for your answer.

J.

"MRR" <mario_ruz@hotmail.com> wrote in message <hg8o7k$1vj$1@fred.mathworks.com>...
> Hi Jorge,
>
> That equation is fine. I had an error before, and then I posted the corrected equation just if someone could find it useful.
>
> As you can see, you obtain two independent measures (a 2x1 vector), each one with its disturbance w.
>
> You are right, the filter obtain itself the best prediction (with minimun quadratic error), "mixing" this two measures.
>
> Hope it helps,
>
> Mario
>
> Kalman filter uses this both measures to obtain a best prediction (
> As you said, Kalman filter "mix" both measures to obtain the best prediction (
> "Jorge " <jorgegent83@yahoo.com> wrote in message <hg89b9$fg7$1@fred.mathworks.com>...
> > "MRR " <mario_ruz@hotmail.com> wrote in message <gc5erh$nc6$1@fred.mathworks.com>...
> > > I'm sorry i forget to mention thank you for your help. I had an error in the multisensorial focus.
> > >
> > > Kind regards??
> >
> > Hi Mario. I have facing the same situation. What do you mean by "I had an error in the multisensorial focus"??
> >
> > Is then the equation:
> >
> > [z1(k);z2(k)] = [1 0 0;1 0 0]* [pos(k);vel(k);a(k)] + [w1(k);w2(k)];
> >
> > incorrect????
> >
> > According to it, the two sensors are independent to each other. The Kalman filter estimator (so Bayesian filter) merges these 2 measures at the updating step.
> >
> > Regards.
> >
> >
> > Jorge

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
multi sensor Jorge 15 Dec, 2009 10:19:10
klaman filter Jorge 15 Dec, 2009 10:19:09
model motion ka... MRR 3 Oct, 2008 08:15:07
kalman MRR 27 Sep, 2008 18:50:03
kalman filter MRR 27 Sep, 2008 18:50:03
rssFeed for this Thread

Contact us at files@mathworks.com