I have been in R&D phase of UAVs for past some time, especially self-stabilization algorithms.

It may sound a dumb question but comparing DCM vs Kalman Filter, is that a fair comparison?


My understanding was that Kalman filter is used to smoothen the IMU signals and calculate precise Roll and Pitch angles. While DCM (Direction Cosine Matrix) is something (blackbox for me for now) which is actually the stabilization algorithm (as if Kalman Filter readings are fed into DCM to determine the attitude of the flying vehicle).


Then suddenly I read somewhere (I think another post of DIYdrones) that Arduino is not capable of Kalman Filter, so DCM is a better choice.


It has tunred my so-far acquired concepts upside down ;-)

Can anyone please explain the above two to me and also if there is really a connection in between them or they are rather different approaches to solve the same problem?


I wished I had been an engineer, sounds embarassing asking such a fundamental questions.

But beleive me, I am truly after it. It's so damn interesting and appealing.



Views: 14867

Reply to This

Replies to This Discussion

I don't know about UAV applications for KF, but I know that Team Tobor did position/heading estimation with an EKF with (?) 5 states or 6 or... more (?) on an Arduino for his ground vehicle for the Sparkfun AVC. All KF's aren't the same. It's a question of how many state variables, update rate required, etc.


A KF is used to filter noise and estimate system state, but requires the system can be mathematically modeled (e.g., acceleration, velocity, position). And so if the state variables describes heading/attitude, it can be used for an AHRS (e.g., the CHR-6dm I'm using on my AGV, Data Bus).


DCM is also used to estimate heading and attitude in a popular autopilot program; it just takes a different approach for error correction, I guess. I have no idea if DCM can be used for other applications.

Thanx Bot,


Is that right to say that Kalman Filter may be used for AHRS provided the apropriate state variables are used while DCM is purely for AHRS for Aerospace area?



The term "DCM" used around here is in reference to an algorithm that using the direct-cosine matrix to compute the attitude of the craft (an AHRS) while compensating for the gyro drift.


A Kalman can be used to do the same thing; however, it is much more computationally complex and provides similar results.


Hope that helps.



Tom touched on the correct subject. The way the term DCM is used around here is very misleading. Direction Cosine Matrix (DCM) is only the name for a way to construct a rotation matrix.

The actual process used by Bill Premerlani in filtering/combining data from different sensors uses a complementary filter approach. So the two processes you want to compare are sensor fusion by complementary filter versus Kalman filter.

As Tom correctly pointed out, complementary filter is able to deliver results similar to Kalman filter without the high computational costs.

The AHRS information-roll,pitch and yaw in UAV sensors is updated (60 packets/sec) faster than GPS (1 packet/sec).Trajectory tracking has erroneous results if you estimate the position with GPS to follow your trajectory( as your velocity and acceleration values vary significantly in this 1 sec).So you apply kalman filter(like  dead reckoning) to estimate the position and also to eliminate the error in AHRS .S=S'+ut+1/2 at2.[S' is your position from GPS and U from GPS velocity token].

The velocity obtained from GPS is in WGS 84 co-ordinate system.The AHRS information is in body reference frame.If the trajectory is to be plotted in UTM projections ,WGS frame is to be projected in UTM ..This is done by multiplying with DCM(the euler  angles obtained from AHRS shows the differerce of angles between these two frames and are presented as a matrix which is called as directional cosine matrix).

As you thought earlier,both KF and DCM are entirely different .

Thanks to all of you but as I mentioned earlier, I don't have an engineering background, I think that's the reason, I am having trouble understanding these terms WGS, UTM, Euler angles, Quaternions etc.


Is it possible that someone can tell me that these terms/concepts fall under what subject or university course?

Or even if they come from variety of courses, I'd really like to have deep dive and conquer them no matter what it takes. (may not be overnight, but I am up for it)


I am from Software Development field, hopefully it won't be a big deal for me to understand these fundamental concepts provided I am going into the right direction.


I greatly appreciate help of each and everyone of you.

I do have an engineering background but probably can't explain Euler angles and quaternions. :D It's just a question of starting to learn some new stuff. It will start to fall into place. As far as I understand, albeit imprecisely, Euler angles describe 3d orientation in terms of rotating about 3 axes. But there's a bit of an issue. It's called gimbal lock. Quaternions come into play here, but I've yet to wrap my tiny mind around them in any meaningful way. :)

You're familiar with latitude and longitude right?  Well, UTM is also a coordinate system, too. Instead of coordinates based on angles about the earth, it uses parallel lines (aka cartesian coordinates).

GPS uses lat / lon, but those aren't very meaningful unless you have a frame of reference. WGS-84 is that standard frame of reference. Suffice it to say that the same lat / lon doesn't map to the same spot between two different datums (WGS-84, NAD, WGS-72, ED-50, etc.)

You are probably looking for classes in Dynamics (Advanced Dynamics even) to cover Euler angles, quaternions, and how these are related to what the gyros and accelerometers sens, and in Linear Control Theory to cover state estimators which would include the Kalman Filter and possibly complementary filter techniques.  Both of these classes also rely heavily on Linear Algebra and Multi-variable Calculus, so those would be good place to start.

Thanx Bot and AndrewF,


Now I, kind of got my orientation ;-) I will now be heading to the regional library, or Googling may help too, I guess. If you guys know any online resources on the subject, please do let me know, I will greatly appreciate that.


Developing a self-stabilizing system for fixed wing or multi-rotor seems to be a tall order for someone like me. So, instead of going bottom up, I have another plan. Please help me with your expert advise.


I plan to use a professional IMU like VectorNav (9DOF), which takes care of DCM, KF, Quarternion, Euler Angles and all those things which are a few light year away from me.

I already have good understanding of Arduino, PWM, Motor and Servo Controls etc. And of course PIDs as well.

Shall I be able to make a primitive self-stabilizing flying vehicle using above?

If Yes, I want to give it a try and once I have a working model, while still researching on it, I will be acquiring knowledge of the above subjects so that I can make my own IMU.

Please do comment, if it sounds a crap plan ;-)


Or if there is a better plan, please do advise on that as well.

I am not looking for short cuts, but I do need to have some sense of achievement every now and then while working on my long term plan.



No expert advises??? :-(

Wished I could advise. I've never built a flying autonomous vehicle. For that matter, I've yet to build a functioning autonomous ground vehicle. I do agree that an off-the-shelf IMU/AHRS solution is the best way to go vs. trying to roll your own with limited experience. You can always work up to that point, but sometimes it is easier to get there if you first experiment with someone else's solution.

Bot Thoughts,


Thanx a lot

Your "thought" right on the "spot" ;-)

I am from Computer Science background, so I wanted to work on those areas first where I can apply my acquired skills. I shall definitely learn control theory and advanced dynamics and all related sciences, but at a slightly later stage.


Let me give it a try, will keep you guys updated

Reply to Discussion



Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service