Dave's Posts (1)

Sort by

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 ;)

Read more…