# What to do when the control input of the Kalman filter is unknown?

I am implementing a simple Kalman Filter that estimates the heading direction of a robot. The robot is equipped with a compass and a gyroscope.

Say at time $t-dt$, the compass reports a reading $\theta_{t-dt}$, and the gyroscope reports a reading $\omega_{t-dt}$. Then I assume from time $t-dt$ to $t$, the rotation rate can be regarded as a constant. Thus, my current heading direction is $$\theta_{t}=\theta_{t-dt}+\omega_{t-dt}\cdot dt$$ As can be seen, the $\theta$ can be easily time-updated.

But what about my $\omega$? The robot is not at my control. So its rotation rate at next moment is unpredictable.

How should I do the time update in this case?

For both states, you are using sensors to give you the required information.

One way to make this work properly: Use the gyroscope reading for your ω and your previous state estimate for your θ (or initial state estimate if its the first iteration). This is the predict step of the filter.

Then for the update step you can use your compass measurement (this will correct the gyro drift).

For both states, you are relying on sensors to provide information about heading, not the control inputs of the robot itself.

This method is common in attitude heading and reference systems.

For your application a complementary filter may be better suited since its easily implemented and is easy to tune and can have comparable performance to a Kalman filter in many situations.