Perseus AHRS + 3D Visualization App/Source

A short video of the Perseus AHRS using a small 3D visualization app I wrote this afternoon:

Full blog article is here:

I've been working on the Perseus Autopilot for the past few weeks and unfortunately didn't find the time to post any updates on the Andromeda Blog. I'm in the process of writing about a few things about the AHRS that I've been building as part of the project and I should hopefully post that within the week.

Also in case it might be of use to anyone, I wrote a simple 3D visualizer for the demonstration above. It will read quaternion values from the serial port in the following format:

w x y z;

But you can re-write it to accept any format. You just need to write your own custom GetRotation function. It's developed in C# and uses WPF3D for the visuals so the codebase is very small. Unfortunately it limits it to windows only (sorry). The source include the entire VS2008 project and you can do whatever you want with it.

You can download the code from here:

E-mail me when people leave their comments –

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

Join diydrones


  • @Oslon: I was reading through your comments and believe you came across a situation similar to mine. I have a sparkfun 9 axis IMU with me. And all I need to measure at this point of time is the yaw angle. I can assure you that there is no roll or pitch in my system. However the body translates in x and y direction; and when it does that I get roll and pitch values as well from my sensor. Any clue as to why I am getting this and how to overcome the same?

    Thanks in advance :)

  • Hello,


    Does anyone know how to tune up Vectornav VN100T type IMU with the filter tuning and active tuning parameters on a quadrotor platform where there exists magnetic disturbance and vibration?


    I have tried some of the examples that are given from the vectornav (also tried on my own), but still have some drift on yaw axis, and/or long settling time


    Thank you.

  • Moderator
    @Nima great work as usual, when are we going to see some test flights?

    @Curt thanks for sharing info about the book I think i will find that book usefull to help me learn. Are you allowed to share any details about the project you are working on?
  • Hi Nima,

    Maybe the quickest way to see our 15-state EKF in action is to search for clolsonus on youtube and look at some of my more recent videos. It's still a work in progress ... gains, update rates, sensors, etc. etc., but at least I have a reasonable working baseline and can make improvements from here.
  • Curt,

    No apology necessary. I am pursuing the same outcome myself. I have however taken a different route. I have a 7 state EKF that I have demonstrated above, which only calculates the attitude (it includes magnetometers, obviously). This attitude is corrected for centripetal acceleration.

    Then there is another 5 state EKF which runs separately, and uses the GPS, attitude information and airspeed to provide a dead reckoning solution and also wind estimation.

    I'm going to post these in a future update soon, as I am still putting the finishing touches on them. But I'd be interested to see your EKF in action if you wouldn't mind posting some info about it.
  • Hi Felipe, I am running a 15 state kalman filter. I haven't been given permission to share the actual C code, but the algorithm is published in a text book that includes matlab and octave versions of the filter. The cool thing about this particular filter (compared to some of the other filters I've seen people working on) is that it uses gps position and velocity information to converge to the "true" attitude of the aircraft. It currently doesn't incorporate magnetometers into the filter, it doesn't use airspeed to compensate for centripetal forces, it uses a more generic system model.

    ISBN-13: 978-1-59693-329-3

    Just to put in another plug for this algorithm (and algorithms that do the same sort of thing.) Knowing "true" heading allows to do things like accurately estimate the wind vector, accurately point a pan/tilt camera at a fixed gps coordinate (you need to know the true heading in the NED frame to compute the math.) Plotting the "true" heading on your ground station shows you accurately crabbing into the wind. I apologize for jumping in on another thread ... I just wanted to point out the vectornav as a possible alternative to the AD iSensor cube, and then got distracted answering a few questions about it.
  • Curt Olson: Thanks a lot for your answer.

    I have been trying to tune the kalman filter of the VN-100 and I havent been able to obtain a acceptable behaviour, at least good enough for the quadrotor Im building.

    What you are saying is that you are using your own Kalman filter using the magnetometer, accelerometer and gyro raw data of the VN-100?

    Is there any way you can share with me the Kalman filter you are using?

    Thanks a lot
  • Felipe: The vectornav by default doesn't know velocity or have gps information so it doesn't have any way to compensate for motion induced acceleration. There is an undocumented CMV string that returns the raw sensor data without any internal bias compensation. This is what I'm using, and I feed the raw data into our own 15-state kalman filter and do our own bias estimation.

    I haven't explored the details of this, but I think I recall one of the vectornav engineers mentioning that there is a way you can send it the velocity so that it can account for that in it's internal kalman filter. Also the vectornav's filter is *very* tunable if you know a little bit about kalman filters and understand how the gains and parameters interact.
  • @Nima, it's very cool
  • Hi Curt Olson,

    I also have the VN-100 from Vectornav, but I have been having some problems with it, I was wondering if you could help me a bit with it. Are you using the default parameters of the kalman filter? or did you use your own?

    The issue that Im having is the following. When I do, for example, only roll movements, the unit also measures some pitch, and a lot of yaw, which shouldnt happen.
This reply was deleted.