kymhorsell's picture

Nano navigation module in "alpha"

After "solving" the problem of dead-reakoning in 1 axis with an accellerometer, I'm now moving to add a compass and the Y-axis to my simple s/w so the tankbot can determine -- roughly -- where it is in 2D.

 

As for the first part of the exercise, all modules are configured in pwm mode with TTL levels, and are connected to digital inputs of my Handboard-based bot.

The nuts-and-bolts "sample" end of the s/w chain is now a bit more complex -- I have to measure the period and "up" time of 3 inputs. While they could -- of course -- simply be sampled in sequence, I've elected (with an eye to the future) of running a "parallel" bit-bashing method. Something like "read from the parallel port" with no parallel port, kinda thing. :)

The MEMSIC accel is now attached to the front of the tankbot, with the Y axis aligned left/right. Since it's returning "pulse widths", the sign of the Y accel is not immediately apparent. But as for part #1, I'm using the difference between the motor control parameters for left/right to "guess" which direction the Y-accel will be.

The basic code took an hr to hack together and download, but now comes the tedious part of determining why it doesn't work as well as part #1 (i.e. 1-D navigation).

With the same kind of mild smoothing of each of the inputs, plus a kalman filter to combine and estimate X/Y position, velocity, and accel, there are some nasty drifting characteristics to date.

After getting the 1-D case down to an error of less than 10 m over 1 minute of integration, the present 2-D s/w seems to be back to an exponential drift with a simple "square routine" claiming the bot has moved off km's in a northerly direction after only a couple of mins of motion.

Again, the process of "tuning" the filters will probably be the key (barring any stoopid mistooks I notice in the coding over the next couple of days -- and there are bound to be some). I'll probably have to cook up a more accurate model of exactly how the difference in left and right motor speeds influences the "theta dot", rather than assuming it's just linear.


The attached vid shows what you get when you have too much technology and too much spare time.

video: 

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