-
Notifications
You must be signed in to change notification settings - Fork 0
state estimation scratch work
This isn't too neat (yet). The plan is to use an Extended Kalman Filter (EKF) to estimate the state of the robot based on a variety of different sensors. This requires having a mathematical model of how the robot works. A good reference for the kind of thing we're trying to do is Optimal State Estimation by Dan Simon. There are free pdf's of it floating around the usual sites.
The state of the drive system consists of the following:
- The position on the field
$\vec r = (r_x, r_y)$ (in meters) - The heading
$\theta_{bot}$ (in radians) - The velocity
$\vec v = (v_x, v_y)$ (in meters per second) - The angular velocity
$\omega_{bot}$ (in radians per second) - The current through each motor
$(i_{fl}, i_{fr}, i_{bl}, i_{br})$ (in amps)
We control the voltage to each motor,
Position and heading change according to their derivatives, which are already part of the state.
The velocities change according to the forces on the robot. The primary contribution to this is the torque from each wheel, which is proportional to current. We also have to consider friction. We can assume that the force felt at each wheel is proportional to the current in that wheel, so
where each
The acceleration on the robot is then
Where slip
is some error term we need to quantify. Notice that both
The angular acceleration is computed similarly, but it depends also on the placement of the wheels and the robot's moment of inertia. Luckily, that one's actually linear (since it doesn't depend on the heading). I'm not writing it down explicitly, but it's
for some 1-by-4 matrix
TODO: model the motors. This needs to be done empirically before we can expect the rest to work.
We can measure the following things:
- the absolute position of the drive wheels
- the absolute position of dead wheels
- the current through each motor
- the 3-axis acceleration felt by the IMU
- the angle measured by the gyroscope on the IMU
- the angles from the robot to various points on the field, as measured by a camera
TODO: model some of these, both their nominal values (computed from state) and their variances