Sunday, March 11, 2012

Quadcopter Inertial Position Tracking

  Although I am sure I will enjoy every aspect of building this quadcopter,  it is the Inertial Position Tracking (IPT) feature that I'm most excited about.

  In a traditional small quadcopter, there is no ability for it to track its own current position internally.  The flyer moves the controls and the 'copter moves in what ever direction is requested.  Once the flyer stops giving the aircraft commands, it will attempt to stay in one position.  The challenge a "dumb" quadcopter like this has is that since it doesn't know where it is, it won't be very good at staying in one position.  If a gust of wind blows it away, it will react to attempt to stop moving, but it won't really know how far to go to get back to where it was before the wind came.

  This is where the IPT system comes in.  In simple terms, it uses the readings from the 3 axis accelerometer and readings from the three axis gyro to detect how the quadcopter is moving.  Using some math, it then figures out how far it thinks the 'copter has moved since the last time it did it's calculations.  It then "adds" this very small bit of movement to it's last position to figure out where it is in relation to a reference point.  To begin with, I will make this reference point the place where the copter takes off from.  Returning to the wind gust example above, the IPT will "see" the quadcopter move off course, and it will then be able to return to it's previous point with a high degree of precision.  All of this without any input from the flyer.

  Once this IPT system is implemented, it would be very easy to start giving the quadcopter a list of locations to visit.  For example, it could be programmed to watch the inputs from the flyer.  If there is no commands for a "long" period of time, the 'copter could then return to it's start point and land itself.  More advanced exercise could involve carrying a video camera and tracking a straight line and then circling a predetermined circle as part of filming a movie.  This could allow for getting shots with very little setup time and no worries about hiding camera cranes or tracks or cords.

  One question you might ask would be why not just use a GPS mounted to the aircraft?  The main reasons are accuracy, update rates, and indoor operation.  Although GPS technology can be relatively accurate, it generally can't be more accurate than 3-10 feet (1-3m).  This just isn't good enough for precise flying.  The rate at which an affordable GPS receiver updates is usually only a couple of times per second.  This is not often enough for precisely tracking unless the 'copter is moving slowly.  If you want to fly in a building it can be impossible to get a GPS signal.  By using IPT it is possible to get around most of these problems.  Having pointed out these issues, I really think it could be exciting to combine GPS with IPT.  In this situation, the quadcopter could use IPT for it's precision while also using GPS to get positional information that would allow the aircraft to relate easily to the rest of the world.  It could be very useful to plot a flight plan using google earth and then have your 'copter fly that path.

  Given my optimism for IPT, here's some possible challenges to my project.  I am using cheap off-the-shelf sensors.  There's a possibility they won't be accurate enough to give the precision I need.  The math involved is somewhat complex and needs to happen pretty often to keep up with the quadrotor, it's possible an 16MHz Arduino won't have the processing power needed.  I will very likely end up with two processors to make this work (one to fly the quadcopter and one dedicated to IPT).

  Well... I intended to get into the math behind IPT in this post.  Instead of looking at it in detail I'll just give you the following.  Because the quadrotor can be in any orientation, there is no super simple way to figure out how a small move in the airplanes X/Y/Z or Roll/Pitch/Yaw relates to the out side world.  This is solved by using a 4x4 transform matrix.  The small incremental moves of the aircraft that the sensors observe are "plugged" into one of these transform matrices (I use plugged loosely.. it actually takes 29 trig functions, 16 multiplies and 4 additions).  The magical part is that when this incremental 4x4 transform matrix is multiplied by the 4x4 transform matrix that represents  the aircraft's previous position, a new 4x4 matrix is created that represents the current position and orientation.  I'd love to claim credit for this, but this type of math operation is used heavily in both computer graphics and robotics (among other places).  It's a ridiculously powerful and elegant solution to very complex problem.

  Time for this post to stop.  Sorry for the wall of text.  Let me know if you have any questions.

~Phillip

<< Previous Quadrotor Post | Next Quadrotor Post >>

No comments:

Post a Comment