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.
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
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.
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
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.
Michael Zaffuto : Thanks for clarifying the Kalman vs DCM issue. I could not have phrased it better since I don't have the mathematical know-how to mess with such things, and that's the issue right there with Kalman.
It's not for the sunday hobbyist. Adjusting gains in DCM is a piece of cake, in Kalman, it's probably very easy for those with math PhD's but completely out of reach for the layman.
I am sure that a solid Kalman code can rival DCM but who wants to spend hours messing with code when it can be done in seconds with DCM?
Looking forward to Jordi's future annoucement, from what I hear, sounds like he has ported DCM over to Ardupilot, in which case, we have a winning solution that everybody can have fun with without risking divorce!
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.
Comments
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
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
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.
It's not for the sunday hobbyist. Adjusting gains in DCM is a piece of cake, in Kalman, it's probably very easy for those with math PhD's but completely out of reach for the layman.
I am sure that a solid Kalman code can rival DCM but who wants to spend hours messing with code when it can be done in seconds with DCM?
Looking forward to Jordi's future annoucement, from what I hear, sounds like he has ported DCM over to Ardupilot, in which case, we have a winning solution that everybody can have fun with without risking divorce!
IMU based AP. Night flying here i come!
Stay tuned for an announcement this week from Jordi on that. Let's just say you guessed right ;-)