kymhorsell's picture

Pico navigation module up on AX-11 "tankbot"

After some algebra corrections, the basic 1-d filter for my cheap accellerometers is yielding reasonable results.

The platform is my old AX-11 tankbot  running an mc6811 "brick" running Interactive C (IC).

The accellerometor is an old 2-axis Memsic device giving a 1 mg error over a 2g range.

It can operate in I2C or PWM mode, and I've selected the latter. The value for accel is obtained by the ratio of the "up" time of the pulse, vs the period, multiplied by a fudge factor. The sign, of course, is unknown as far as the sensor is concerned. But we *do* know which direction the motor is *supposed* to be driving the robot, so there's another fudge there. :)

The "Handyboard" clone offers a couple of inputs to measure pulse widths, but I've declined the offer since it turns off the board's IR link. Instead, I'm just doing a couple of loop-and-waits on the digital input connected to the X-axis of the sensor via a TTL adaptor board. This method seems to easily return the 8 bits of "real" data the sensor is capable of working to.

I'm presently sampling the sensor as fast as possible in a foreground loop. (IC allows simple threading). But a future experiment will try to determine the slowest sample rate that doesn't affect the measured position more than a given amount.

The output from the accel is "pre-smoothed" a bit and then put into a filter that also is given the motor control value(s). The filter produces an estimate of the (instantaneous) accel, velocity, and position on the x-axis.

These first experiment are very simple -- make the tank move forward at different speeds (but both motors together!) and estimate the position after smoothing and filtering against the motor control input; using a long-distance sonar ranger, measure the distance as well. Compute difference.

The initial run along the footpath in my block (200m without any cross-streets) gave a depressing exponential drift. After only 10 seconds of running, the estimated position was 1/2 m out. After 30 sec is was 50 m out. After 5 mins it was about 1/2 km out!

But burning some midnight oil and re-arranging some algebra -- and tuning up some values used to estimate the translation of motor speed to actual over-ground speed after gearing and tread slippage on concrete (sometimes the tankbot tends to start up with a jerk; and having a \_/ shape on the tread means it can pitch up & down 20 deg if the speed changes are bigger than some critical factor), the drift is now a VERY reasonable 5 m per minute.

Since the tank has simple odometers (IR sensors over some codewheels attached to the driven wheels), this exercise may be a bit moot. But it's at least given me some simple example of a working Kalman filter and a headache when trying to tune it up to actually work. :)

 

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <h1> <h2> <h3> <h4> <h5> <quote> <a> <em> <strong> <u> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <p> <sub> <sup> <strike> <blockquote> <hr> <br> </quote>
  • Lines and paragraphs break automatically.

More information about formatting options