Replacing FMA with a 6DOF IMU

Hello,If I understand right, Ardupilot is dependent on FMA for roll and pitch stability.I have 6DOF IMU from Sparkfun and I want to use it to monitor the roll, yaw and pitch angles of my model airplane and use this data to perform FMA functions i.e. maintain roll and pitch stability.Sparksfun's 6DOF IMU gives accelerations and gyro data. On benchtop experiments, I can accurately measure my roll and pitch angles using only accelerometers. But, if the IMU flies in model UAV, it will be subject to all sort of other accelerations, rotations and accelerarometer readings will not be sufficient to measure roll and pitch angles.Can someone tell explain how to use 6DOF IMU to calculate roll,yaw,pitch angles in flight and eventually use 6DOF IMU to replace FMA? Do you have Arduino code for thisRob.
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • T3
    Ryan,

    By the way, the concept behind the DCM algorithm is rather simple, it goes back to elementry rotation kinematics:

    The velocity of a point on a rigid body, with respect to its center of mass, is equal to the vector cross product of the vector rotation rate of the body with a vector from the center of mass to the point. The resulting nonlinear ordinary differential equation can be numerically integrated to track the point.

    By tracking the three points at the ends of unit vectors along the coordinate axes in the plane frame of reference, you maintain the attitude information for the plane.

    Numerical integration errors and gyro drift are detected and corrected by taking the vector cross products of benchmark vectors with corresponding rows or columns of the direction cosine matrix. The result of the cross products are rotation vectors that will correct the drift.

    Best regards,
    Bill
    Производство и продажа гибридных широкоформатных УФ принтеров LinkPrint. Point.by
    Компания Поинт техно, производитель и дистрибьютор печатного оборудования Link Print, OKI, IQDemy
  • T3
    Ryan,

    Regarding methods for estimating attitude from gyros and accelerometers....

    The DCM algorithm is an elegant method that is easy to understand, performs well, and does not require much computational power.

    I explained it to Jordi Munoz in one day, it then took him two days to program it. Many other members of diydrones have implemented on their own platforms without any help from me, including Brian Wolfe, for example.

    The performance of the Kalman filter relative to the DCM algorithm depends on how level your aircraft is flying, and which version of the Kalman filters you are using.

    For flying that is more or less level at constant altitude, with gentle turns, just about anything will work. When I started out 5 years ago, I was using two simple first order low pass complementary filters (washout filters) to implement return to launch with a GPS, two gyros, and one accelerometer. It worked rather well as long as the turns were gentle and the pitch and roll angles were small.

    Recently, I decided that I wanted something that would eventually allow full aerobatics, with good attitude estimation in any orientation, including upside down and sideways, without requiring a lot of computational power. The DCM algorithm seems to Mahony and myself to be the best way to go.

    The DCM algorithm is nonlinear. As Mahony points out, the problem with the simpler versions of the Kalman filter, is that they do not respect the nonlinearities of the rotation group. When an aircraft changes orientation, it rotates. The kinematics of rotation are nonlinear. There is no way to accurately model a rotation with a linear filter. You can come pretty close for small pitch and roll angles, but for combined 360 degree loops and twists, the simpler Kalman approaches run out of gas.

    Paul Bizard did some simulations to compare various approaches, which I hope he will eventually publish, that included high-fidelity models of his model airplane, doing various stunts. He compared various versions of Kalman with the DCM algorithm.

    What he found was basically two things:

    1. The DCM algorithm blows the doors off of simple linear Kalman filters. The computational requirements are of the same order of magnitude, but DCM performs much better.

    2. To achieve performance comparable to that of the DCM algorithm, you need an extended Kalman filter, with a high-dimensionality Jacobian, and a large matrix to invert. Paul found that the computational requirements for the extended Kalman filter was 1000 times that of the DCM algorithm.

    The bottom line is that the DCM algorithm delivers a lot of performance with very little computational burden.

    By the way, there is another approach, based on quaternions, that is entirely equivalent to the DCM algorithm. In fact, in Mahony's papers, he covers both a direction-cosine-matrix representation, and a quaternion representation, for performing the rotational transformations implied by the kinematics of rotation.

    Best regards,
    Bill
  • Developer
    The Kalman is pretty intense but that's because all of the people that talk about want to show off their skill. There are some very simplified fixed gain filters out there that are really simple and very intuitive to understand. The Kalman is an optimal solution but the gains don't move that much from the steady state so you can fix them and it greatly simplifies things! You do have to add a little bit of intelliegence and understand the 6dof eqns but they are fairly simple for the averge UAV hobiest
  • 3D Robotics
    Mael: Direction Cosine Matrix. See Bill's work for more.
  • Sorry for my noob question guys, what is DCM stands for? Where can I learn more about it? Kalman filter is a bit complex for me..
  • Hi Chris.
    I have really had some trouble at sunset with the FMA co-pilot. Doesn't stabilize well at all.
    Guess i shouldn't be flying at sunset but i only get the chance to do so after class.
  • 3D Robotics
    Cronselaar, just a FYI that the regular ArduPilot with thermopiles works fine at night. They use IR, not visible light. Night is a good as day to them.
  • Sweet (",)
    IMU based AP. Night flying here i come!
  • 3D Robotics
    Michael,

    Stay tuned for an announcement this week from Jordi on that. Let's just say you guessed right ;-)
  • The DCM algorithm in the UAV DevBoard performs as well as an Extended Kalman filter.
    DCM updates "state" at 40 hz using approximately 5% of a dspic30 horsepower running at low megahertz.

    Assuming Atmels 1Mip/Mhz, hardware PWM generation and hardware multiplier, I'm going to go out on a limb and guess the Arduino could run DCM using no more than 50% of its computing horsepower.
    (Conservatively assuming that it is 10 times slower than the dspic - but it probably isn't)

    If you plan to fly an airplane and have access to GPS look at all the nonsense DCM saves you:

    No square roots, no floating point, no insane modeling of the airframe, no matrix differentials, no UDUT factoring, no Kalman, no Bierman-Thorton, no probablity theory, no reading 300 papers from Kalman to Extended Kalman to Sigma Point to Neural Networks filtering, no Linear Quadratic Control theory, no Floating point DSPs, no FPGAs, no 400 Mhz X-Scales.

    I think once enough people take the time to understand the DCM within the UAV Devboard, which will accelerate now that sparkfun has the gyro's and accelerometers for ArduPilot, DCM will be the preferred algorithm of choice for amateur UAV modeler's.

    Leave Kalman to the guys with the big budgets and the advanced degrees.
This reply was deleted.