GUI for tuning Kalman Filter



Fine tuning of our Kalman IMUs is one of the most important step to be done in order to get the IMU ready to fly.
And a good tuning begins from "the table"...

Since one month I created a small application, written in java, multi-os, open-source, ready-to-use intended for studying, tuning, debugging your kalman application without any particular need.
It is able to getdatas from the serial port (incoming data from the micro) and visualize
them on two separately artificial horizon displays.

I put my effort in creating an application platform independent since the linux and OS X community are getting bigger and bigger.

New version: Artificial Horizon AH-3+ (graphic improved!)
Download the tar archive containing the application directly from here:

ArtificialHorizon AH-3+

untar it and double click for launching the application or much better open a console or a prompt in win and digit:

$java - jar <file_name>.jar

You get messages on the background helpful for "debugging" porpouses.


Only 2 steps must be taken in advance to get it working with your system:
  • Install and configure at least Jave Runtime Environment JRE 6, available for download on Sun's site.
    After installation configure your environment path variables, this is even important in windows;
  • This program does use the RXTX package to deal with the serial port on your system.
    The library is an open-source project available at: http://www.rxtx.org it supports 32 different platforms. No need to be installed, open the binary package and copy the library into your java folder according to the instruction here: http://rxtx.qbang.org/wiki/index.php/Installation;

[Warning
: be aware that the application will fail or crashes in case it doesn't recognize the RXTX installed on your system. I strongly suggest to test the rxtx library after installation running one of the program available in this link: http://rxtx.qbang.org/wiki/index.php/Using_RXTX
Doing so your are sure the library is running along your JRE and prevent the application to frezz or crash]

---------
Usage
---------
The usage is really simple, select your baudrate, serial port and click on Open Serial to start getting incoming data from your microcontroller :)
As soon new data are available, they will be displayed on the screen moving your the artificial horizon up-downwards, bank left, right...(I 3th axis will be added soon for yaw :) )

The only thing you must be aware is how to send data from your micro.
Those are collected at your serial port following a simple packet protocol (I wanted to keep it as shortest as possible and easy, since serial communications can take much resources from our micros).

Somewhere in your code or firmware put an output routine able to send one string accordingly to this rule:

<angle_value><type_info> (followed by the carriage and return)

where:
<angle_value> is whatever number in DEGREES along any axis
<type_info> specific information whether the previus angle number refers to pitch, roll, yaw and whether it is filtered (processed by your Kalman filter) or is a pure angle (the "reading" by your sensors)

<type_info> can only contain those string informations:
kp : pitch angle computed by your Kalman algorithm;
kr : roll angle computed by your Kalman algorithm;
pp : pitch angle, pure data, directly from your sensors;
rr : roll angle, pure data, directly from your sensors;

Here same examples to figure out how datas are sent by the microcontroller:
34kp 34 degrees filterd by Kalman, pitch
-23rr -23 degrees not filtered, readed directly from the sensors
178pp 178 degrees pure pitch, not filtered
-1kr -1 degree along roll axis, filtered

You can find further info on how to write your firmware in the README file in the archive.

That's all...I wish this application can help you in understanding what's going on in your application and let your drone to start with a fiiiiiine tuned IMU :) :) :)

Enjoy!
Dave

PS: for any problem let me know ;)

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Thanks a lot guys :)
    it s a pleasure for me...
    Right now I m working on the code to add yaw readings above the horizons

    @Paul: I didn't know about that project even if I know the Universität here in Bremen...
    I ll investigate...

    @Jose: java compiles a project. In other word, downloading the jar archive and unzipping it you fine the whole source code... the source code is already there I don't to publish it :) !
    Anyway, I created a class that using a event-based system (every time new data are available on the serial port) updates some variables.
    If you have troubles understanding it I will help you!

    Cheers
    Dave
  • Good application ; could you post the Java source code ? I am interested on understanding how you read / decode the string coming to the serial port.

    Thanks -- Jose
  • Jonathan,

    What is an inverse pendulum filter, if you don't mind my asking? I am working on something which may be similar - not unlike "DCM lite" where I only track the gravity vector

    - Roy
  • Hi Dave, thanks for your excellent work. I'll try this out with my inverse pendulum filter.
  • Hi Dave,

    Nice job !
    Do you have something to do with the HB-Autopilot ?

    Cheers,
    Paul
  • 3D Robotics
    Dave,

    Excellent post. May I suggest you re-edit it to put the image at the top? That way it the image will show up on the front page and you'll get the clicks you deserve.
  • Admin
    Good work dave , i agree , good setup and testing starts from table,
This reply was deleted.