<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
		<id>https://wiki.ardumower.de/index.php?action=history&amp;feed=atom&amp;title=Kalman_ru</id>
		<title>Kalman ru - Versionsgeschichte</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.ardumower.de/index.php?action=history&amp;feed=atom&amp;title=Kalman_ru"/>
		<link rel="alternate" type="text/html" href="https://wiki.ardumower.de/index.php?title=Kalman_ru&amp;action=history"/>
		<updated>2026-10-09T08:38:57Z</updated>
		<subtitle>Versionsgeschichte dieser Seite in www.wiki.ardumower.de</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://wiki.ardumower.de/index.php?title=Kalman_ru&amp;diff=2669&amp;oldid=prev</id>
		<title>Unlogic: Die Seite wurde neu angelegt: „=Idea=  For the Extended Kalman Filter (EKF) you have...  # A model of a robots state at every time (e.g. actual heading, actual heading speed).  # A certain n…“</title>
		<link rel="alternate" type="text/html" href="https://wiki.ardumower.de/index.php?title=Kalman_ru&amp;diff=2669&amp;oldid=prev"/>
				<updated>2015-08-22T19:24:33Z</updated>
		
		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „=Idea=  For the Extended Kalman Filter (EKF) you have...  # A model of a robots state at every time (e.g. actual heading, actual heading speed).  # A certain n…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Idea=&lt;br /&gt;
&lt;br /&gt;
For the Extended Kalman Filter (EKF) you have...&lt;br /&gt;
&lt;br /&gt;
# A model of a robots state at every time (e.g. actual heading, actual heading speed). &lt;br /&gt;
# A certain number of sensors. Each sensor has a certain measurement error (%). &lt;br /&gt;
&lt;br /&gt;
Kalman fusions all sensors measurements by iterating over and over two phases:&lt;br /&gt;
&lt;br /&gt;
# Predict: we predict the next robot's state by help of the old robot's state and a certaincy for each sensor.&lt;br /&gt;
# Correct: we correct the certaincy based on new measurements for each sensor. Does the prediction fit to the sensor measurement, we increase certaincy for that sensor, otherwise we decrease certaincy.&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
We have a heading (theta) and a heading speed rate (omega). The new heading can be predicted by old heading plus heading rate and delta time:&lt;br /&gt;
&lt;br /&gt;
 theta = theta_k+1 + omega * dt&lt;br /&gt;
&lt;br /&gt;
 theta_k+1: new heading&lt;br /&gt;
 theta_k: old heading&lt;br /&gt;
 omega: heading speed rate&lt;br /&gt;
 dt: delta time&lt;br /&gt;
&lt;br /&gt;
The heading speed rate is modelled after this:&lt;br /&gt;
  &lt;br /&gt;
  omega = omega_k+1&lt;br /&gt;
&lt;br /&gt;
This is a model only. The real heading rate will change. The Kalman considers this. Those both state equations can now be turned into state space form which is basically a matrix form of the two equations:&lt;br /&gt;
&lt;br /&gt;
 x_k = A * x_k+1&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
 &lt;br /&gt;
 x = [ theta&lt;br /&gt;
       omega ]&lt;br /&gt;
&lt;br /&gt;
 A = [ 1    dt &lt;br /&gt;
       0    1  ]&lt;br /&gt;
&lt;br /&gt;
If you muliply the matrix equation, you get again both state equations. Kalman filter also uses additional matrizes:&lt;br /&gt;
&lt;br /&gt;
 y_k = C * yk+1 &lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
 &lt;br /&gt;
 y = [ theta &lt;br /&gt;
       omega ]&lt;br /&gt;
&lt;br /&gt;
 C = [ 1   0&lt;br /&gt;
       0   1 ]&lt;br /&gt;
&lt;br /&gt;
Matrix C transfers measurements into state variables. The Kalman filter also uses Covariance Matrix P which describes how well state variables and measurements fit.&lt;br /&gt;
&lt;br /&gt;
Furthermore, Kalman uses a measurement error matrix R where you can estimate the measurement error for each signal.&lt;br /&gt;
&lt;br /&gt;
Finally, there's a process error matrix Q which models the complete system error (due to noise in servos, motors etc).&lt;br /&gt;
&lt;br /&gt;
=Scilab=&lt;br /&gt;
 Kalman algorithm implemented with free math software &amp;quot;Scilab&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 % initialize&lt;br /&gt;
 A=[1 dt; 0 1]; % state transition matrix; represents how we get from prior state to next state&lt;br /&gt;
 C=[1 0; 0 1]; % the matrix that maps measurement to system state&lt;br /&gt;
 P=[1000 0; 0 1000]; % sets the initial covariance to indicate initial uncertainty&lt;br /&gt;
 Q=[0.01 0; 0 0.01]; % process noise; I just picked some numbers; you can play with these&lt;br /&gt;
 R=[0.01 0; 0 0.01]; % measurement noise; I just picked some numbers here too&lt;br /&gt;
&lt;br /&gt;
 % loop the following every time you get a new measurement&lt;br /&gt;
&lt;br /&gt;
 % PREDICT&lt;br /&gt;
 % we predict the next system state based on our knowledge (model) of the system&lt;br /&gt;
 x = A*x;&lt;br /&gt;
 % We also have to adjust certainty. If we're predicting system state&lt;br /&gt;
 % without meausrements, certainty reduces&lt;br /&gt;
 P = A*P*A' + Q; % adjust certainty with the state transition, too. Add process noise&lt;br /&gt;
&lt;br /&gt;
 % CORRECT&lt;br /&gt;
 % With measurements, we correct the state estimate&lt;br /&gt;
 z=[gpsHdg; gyroHdgRate]; % this is the measurement matrix&lt;br /&gt;
 % First, find the Kalman Gain; how much we trust the estimate vs measurements&lt;br /&gt;
 K = P*C'*inv(C*P*C' + R)&lt;br /&gt;
 % Then we find out the error between prediction and measurement (the Innovation)&lt;br /&gt;
 % z-C*x&lt;br /&gt;
 % and correct the estimate -- but only a little at a time,&lt;br /&gt;
 % as determined by the Kalman Gain&lt;br /&gt;
 x = x + K*(z-C*x)&lt;br /&gt;
 % Likewise, we correct (actually increase) certainty, because any time&lt;br /&gt;
 % we have a measurement we can be a little more certain about our estimate&lt;br /&gt;
 P = (I-K*C)*P&lt;/div&gt;</summary>
		<author><name>Unlogic</name></author>	</entry>

	</feed>