FreeIMU: an Open Hardware Framework for Orientation and Motion Sensing

FreeIMU is an ongoing research project which aims to design Open Hardware 9/10 DOM/DOF Inertial Measurement Units as well as easy to use Orientation and Motion Sensing libraries, built on top of the Arduino platform.
The goal of the FreeIMU Framework is to simplify the development of projects based upon the most powerful and new consumer grade inertial, magnetic and pressure sensors.

FreeIMU version 0.2 (left) and version 0.1 (right)

The main application of FreeIMU is orientation sensing: by reading the data from the various sensors is possible to compute precisely the orientation of FreeIMU in the space. Recent boards also feature an high resolution barometer allowing to precisely track the device altitude. This can be useful in many applications: human-computer interaction device prototyping, flying machines, robots, human movement tracking and everywhere orientation sensing is a key aspect.

As FreeIMU breakout the sensors interrupt pins, it's also possible to detect per axis single and double taps, free fall as well as activity or inactivity. This makes FreeIMU a very good choice for Human-Computer devices prototyping. Interrupts pins are also very useful if you are into interrupt based reading of the sensors, useful to develop high frequency interrupt based sensor reading.

Video presentation of FreeIMU

Older video presentations: FreeIMU v0.3, FreeIMU v0.1 and 0.2.

A true Open Hardware project

Open Hardware Logo

FreeIMU is a true Open hardware, released under the CC-BY-SA. You are free, actually encouraged, to use it for any purpose, to study and modify its designs, to make your own copies of FreeIMU and even sell your own FreeIMU based hardware. But, you will have to share your designs based on FreeIMU keeping attribution and sharing them using the same libre license.

On FreeIMU repository (see development section below) and from the downloads on this page, you have access to everything you need to build your own FreeIMU board. You have access to the schematics, the PCB designs and even the bill of material so that you can build your own FreeIMU.

Moreover, FreeIMU has been designed using KiCAD, an excellent libre PCB design software, so you don't have to rely on proprietary software to study or modify FreeIMU.

Getting FreeIMU

An assembled, tested and ready to use FreeIMU board can be bought from:

The FreeIMUs boards bought from the above shops financially support the project. The boards have been produced and assembled in Italy by reasonably paid workers in a safe environment in respect with European and Italian laws.

Build your own FreeIMU

If you have SMD soldering experience (or if you are up for experimentation) you can build your own FreeIMU. From the downloads below you have access to all the designs needed to have your FreeIMU PCB manufactured.

You can get cheap PCB with awesome quality from Dorkbot PDX and order the various components needed from you favorite electronic distributor: the Bill of Materials (BOM) files will tell you exactly which components you'll need for your FreeIMU.

The are various ways of soldering the board. If you only need a couple of boards done, tack flux, solder wire and hot air reflow station are enough to build your boards (Remember not to use hot air over the pressure sensor). See this video for good instructions. In case you are building more units, an SMD stencil with solder paste is the suggested method.

In case you need help, just post a comment below.

FreeIMU versions

FreeIMU version 0.1

FreeIMU v0.1

WARNING: Discontinued due to the phasing out of the HMC5843.

FreeIMU v0.1 is the simplest FreeIMU available. It contains the ADXL345 accelerometer, the ITG3200 gyroscope and the HMC5843 magnetometer, their respective capacitors and an additional 10uF capacitor to help keeping the power to the sensors stable. It doesn't have any voltage regulator nor any level translator so it needs to be connected to a 3.3V power source and the I2C level signals have to be 3.3V. When used on a 5V microcontroller, an I2C level converter and a voltage regulator are needed.

FreeIMU version 0.2

FreeIMU v0.2

WARNING: Discontinued due to the phasing out of the HMC5843.

FreeIMU v0.2 has the same sensors (ADXL345, ITG3200 and HMC5843) and size of v0.1 but I added an integrated voltage regulator (MIC5205) and a logic level converter (PCA9306). With these components it's extremely simple to use FreeIMU v0.2 on 5V boards like 16MHz Arduinos, just connect FreeIMU to the 5V, GND, SDA and SCL on Arduino and you are ready to go!

IMPORTANT: in version 0.2 sent to production there is a bug in the drill size of the connectors. The drill hole should have been 0.04" while it is actually 0.032". Consequence of this is that only rounded pins will fit inside the drill and standard squared pins won't fit. This is not really a problem as the big oval pad makes actually possible to use 90 deg squared pin arrays using the pad as a smd connector. The Kicad sources above and the gerbers marked with "Fixed" have this issue fixed. However they haven't been tested on production so double check them before send them to fabrication.

FreeIMU version 0.3

FreeIMU v0.3

FreeIMU version 0.3 replaces the accelerometer and magnetometers used in v0.1 and v0.2 with the ADXL346 as accelerometer and the HMC5883L as magnetometer. The gyroscope is still the ITG3200. FreeIMU v0.3 integrates a voltage regulator (MIC5205) and a logic level translator (PCA9306) as well as all the pullups resistors needed.

FreeIMU version 0.3.1

FreeIMU v0.3.1 is a minor revision of FreeIMU v0.3. There have been some corrections in the silkscreen and the footprint of the HMC5883L have been made slightly bigger to make assembly easy. Everything else is just as in FreeIMU v0.3.

FreeIMU version 0.3.5

FreeIMU 0.3.5 top view

FreeIMU 0.3.5 is a small (22x20 mm) 9 degrees of measurement IMU MARG sensor featuring the BMA180 accelerometer, the ITG3200 gyroscope and the HMC5883L magnetometer.

FreeIMU 0.3.5 also has two additional subversions, FreeIMU 0.3.5_MS which features the MS5611-01BA high resolution pressure sensor and the FreeIMU 0.3.5_BMP which features the BMP085 pressure sensor.

FreeIMU v0.3.5 has an integrated voltage regulator (MIC5203) allowing you to plug it from 3V3 to 16V providing you 80mA of current which you can use to chain it to other 3V3 sensors or devices. By using the MIC5203, no tantalum caps are used in the whole design. Tantalum is not a good idea socially and environmentally.

The board has integrated 2K2 pullups resistors (which can be enabled or disabled by means of a solder switch) but doesn't have an integrated logic level converter. We decided to not include the LLC (which is present in my FreeIMU v0.2 and v0.3) as it adds considerable complexity in the design and schematics without being strictly necessary. In fact, given a properly configured software, it's a redundant part. Moreover the upcoming development of many 3V3 based control boards (eg: Multipilot 32) makes adding an LLC not a very far-seeing choice.

The IMU board is however compatible with my LLC board which can be stacked above the IMU, so that you can easily add the LLC protection keeping the amount of additional wires at the minimum.

The board, a part from the usual power and I2C connectors, breaks out the interrupt pins for all the three sensors. This should empower software developers to design interrupt based sensor reading and sensor fusion algorithms (opposed to the currently common polling based approach) which should provide possibility to shorten the cycle path of our algorithms.

FreeIMU version 0.3.5_MS

FreeIMU v0.3.5_MS

FreeIMU v0.3.5_MS is a variation of FreeIMU v0.3.5 which features the BMA180 accelerometer, the ITG3200 gyroscope, the HMC5883L magnetometer and the MS5611-01BA high resolution pressure sensor.

The board comes with a voltage regulator (MIC5203) and 2K2 pullups optionally disabled by using of a solder switch.

FreeIMU version 0.3.5_BMP

FreeIMU v0.3.5_BMP top view

FreeIMU v0.3.5_BMP is a variation of FreeIMU v0.3.5 which features the BMA180 accelerometer, the ITG3200 gyroscope, the HMC5883L magnetometer and the BMP085 pressure sensor.

The board comes with a voltage regulator (MIC5203) and 2K2 pullups optionally disabled by using of a solder switch.

FreeIMU version 0.4

FreeIMU v0.4.1

FreeIMU v0.4 features the MPU6050 gyroscope+accelerometer, the HMC5883L magnetometer and the MS5611-01BA high resolution altimeter.

The magnetometer is attached to the AUX I2C bus of the MPU6050 thus allowing it to be read directly by the MPU6050.

FreeIMU library

FreeIMU can be easily used on Arduino compatible boards using the Arduino FreeIMU library which implements sensor fusion MARG orientation filter enabling you to do easy and straightforward orientation sensing.

FreeIMU library - 2012/11/22
Use Arduino 1.0.1 IDE or later version.

Install the libraries as explained in the Arduino Libraries Reference section Contributed Libraries.
The FreeIMU library now supports all the versions up to v0.4. By default it's configured to be used on v0.4. In order to use on different boards, open the file FreeIMU.h and uncomment the correct version of your board.

The FreeIMU library also supports the following 3rd parties boards:

  • Sparkfun IMU Digital Combo Board - 6 Degrees of Freedom ITG3200/ADXL345 SEN-10121
  • Sparkfun 9 Degrees of Freedom - Razor IMU SEN-10736
  • Sparkfun 9 Degrees of Freedom - Sensor Stick SEN-10724
  • Sparkfun 9 Degrees of Freedom - Sensor Stick SEN-10183
  • DIYDrones ArduIMU+ V3
  • Generic MPU6050 Breakout boards (eg: GY-521, SEN-11028 and other MPU6050 wich have the MPU6050 AD0 pin connected to GND.)

Note for FreeIMU v0.1 and 0.2 users: from April 2011 the default magnetometer configuration is for HMC5883L. In order to use the library with HMC5843 (v0.1 and v0.2) edit the file HMC58X3.h and uncomment the line #define ISHMC5843.

FreeIMU Processing Programs
The FreeIMU library comes with Processing visualization demos. In order to use them, Download and install Processing. Copy the folders within the processing folder of the FreeIMU library archive into your Processing sketchbook.
Remember to change the Serial port address in the Processing code to match the address used by arduino on your system.

Ports to Other platforms

FreeIMU library on PIC 24 microcontroller by Hari Nair hair [dot] nair [at] gmail [dot] com. Author notes: 1. assumes a 6MHz crystal is attached and x4PLL internally, so Fosc = (6x4)/2 = 12 Mhz 2. trivial to use the internal FRC oscillator, instead of FNOSC_PRIPLL in the configuration words, use FNOSC_FRCPLL. This will give you Fosc = (8x4)/2 = 16MHz, but of course with less precision. 3. transmits ascii quaternion data at 38400baud. This does slow down the sampling rate. Without the quaternion print, the code completes in less than 10mS, so the sampling rate is exactly 100Hz as set by the timer.

FreeIMU library on NXP LPC1343 Cortex m3 processor by Hari Nair hair [dot] nair [at] gmail [dot] com. More details and possibility to contact the author on the FreeIMU community development forum.

Have you ported the FreeIMU library to other platforms? Please let me know and I'll list your work here!

Calibration

A calibration GUI application is available. The software is currently in alpha state, however many people are already using it.

The calibration, when properly executed, drastically improve the orientation sensing performance of the FreeIMU framework. If you are experiencing drifting or inconsistent results, your sensors may need to be calibrated using the Calibration GUI.

Community

There is now a FreeIMU Community website, which has been set up to become the central point of interaction between users of the FreeIMU framework. This is the place where you can get help, join others in developing new features, discuss IMUs applications and much more.

Previously we used FreeIMU answers on Launchpad as well as comments on Fabio's website for supporting users, however we decided to create an ad-hoc website to facilitate information gathering and collaboration between people.

Development, Bug Reports and Suggestions

Development of FreeIMU boards and libraries can be followed on FreeIMU project page on Launchpad which also hosts our software and hardware repository.

Suggestions or bug reports can be made on the FreeIMU Community, in the development forum.Previously bug reports were posted on the Launchpad bug reporting interface but that's not used anymore.

FreeIMU repository holds all the various library sources as well as design files and schematics. Everything is revisioned meaning that all the changes are logged and annotated.

The contents of the repository are available using Bazaar (bzr) with the command:
bzr co lp:freeimu

Never used bzr before? Not a big deal, it's very similar to git, svn or others. You may wanna have a look at the cheatsheet to have an overview of the commands available or read more documentation on bzr.

Alternatively, in case you have problems setting up bzr on your system, you can simply get the latest repository contents from here. The resulting file is a .tar.gz archive which can be opened with the excellent 7zip under Windows. Mac and Linux users shouldn't have problems opening such files.

The files on the repository can also browsed from a browser here. A list of recent changes is available here.

FreeIMU users videos

Here some videos made by FreeIMU users on their projects using FreeIMU.

rtsdrums flies like crazy with FreeIMU on his quadcopter.. check out the triple flip!

Warthox testing indoor FreeIMU v0.4r3 on one of his quadcopters.

Warthox stress test FreeIMU v0.3.5_MS on one of his quadcopters.

Chris uses FreeIMU on his VTOL EDF Tricopter powered by the MultiWii software.

Danilo Del Console uses FreeIMU in a 2 wheels self balancing robot.

Francesco Ferrara uses FreeIMU for a camera stabilization system.

Francesco Ferrara with his super fast implementation of the AHRS algorithm capable of displaying the rotating cube at 333Hz with FreeIMU! Great work!

Marchino65 with his first test with FreeIMU and the FreeIMU library on Arduino. The cube is spinning pretty good!

Francesco Ferrara in his first flight with FreeIMU on his very young quadcopter project called Simplo.

Pullups are not required for

Submitted by fabio on Sun, 2012-10-28 23:37.

Pullups are not required for tha aux i2c of the mpu. See it's datasheet.

First person game using sensors

Submitted by Edgaras (not verified) on Wed, 2012-10-24 14:56.

Hello fabio,

I'm interested in your second video (FreeIMU v0.1 and 0.2:) from 7:23 where you talk about first person kinda game :). Maybe you have a sample code of it and could share it with us? Or maybe you know some webpages that writes something about it, how to look around in the virtual environment using sensor data?

Thank You in advance

By the way your blog gives me inspiration, keep up the good work

Regards, Edgaras

Check this out

Submitted by fabio on Wed, 2012-10-24 21:24.

Check this out http://magma-software.blogspot.it/ they are using FreeIMU to augment a helmet screen.

That software I showed sucks pretty much.. so I'm not going to publish but if you really want it just get in touch by mail and I'll send you a copy.

Acceleration in g's

Submitted by tussh13 (not verified) on Tue, 2012-10-23 22:00.

I want to get acceleration in g's from my free IMU ie dynamic acceleration...pointers?

On the repository, you have

Submitted by fabio on Tue, 2012-10-23 22:25.

On the repository, you have calibration code which will allow you to return data in G by default. Then, you simply have to do this http://www.varesano.net/blog/fabio/simple-gravity-compensation-9-dom-imus

How to download libary.zip until revision 15 from Launchpad.net

Submitted by Ronnie (not verified) on Mon, 2012-10-15 10:33.

Dear Fabio,

Firstly, i admire your excellent work!!

Secondly, i was wondering how or when to download your latest library(until rev.15) from launchpad.net? (http://bazaar.launchpad.net/~fabio-varesano/freeimu/trunk/files)

Last, is the 9DOF IMU you deliver really drift-free @ all axes after calibration? We want to accurately measure roll-angles for a duration of 8 hours non stop.

with kind regards,

Ronnie (Netherlands)

Ops Ronnie, sorry I lost your

Submitted by fabio on Sat, 2012-11-10 12:09.

Ops Ronnie, sorry I lost your message! Some days ago I updated the downloadable library from this page so there's no need to download the library from bzr currently.

However, if you want to do this in the future, you have to install bzr for your operating system.

The only angle which may be affected by drift is yaw, pitch and roll aren't. With a properly calibrated IMU, I'm able to get very stable estimation with a drift below 2 degrees on yaw. See this video.

porting FreeIMU to PIC24 mcu + GY-80, FreeIMU-Cube nitpick

Submitted by Hari (not verified) on Sat, 2012-10-13 04:35.

Hi Fabio,

I am trying to get IMU code working on a 16bit PIC24FJ mcu interfaced to a GY-80 board. I have basic configuration, sampling and calibration routines working and am satisfied the data is as expected.

For the IMU i started looking for example code and found FreeIMU. Many thanks for your work!

I have the pic mcu sampling at 100 Hz and confirmed that the sampling+filtering+imu_getQ code runs within 10mS. But adding the serialport quaternion printout slows things down considerably. Besides, I have not been able to get the pic uart to run at more than 38400baud reliably.

Running FreeIMUCube talking to the pic via a USB-uart dongle. I can see the cube jittering between two somewhat orthogonal positions, both slowly drifting. There is very slow response to my changing the board orientation. So now i need to dig into the code and understand what its doing :-).

Small nitpick. The FreeIMU-Cube source has an inbyte[22] buffer for holding a lines worth of data. But we are sending 8 ascii chars per quaternion, plus 4 commas, plus /r/n, thats 38 characters per line ?

update - PIC24 +GY-80 port

Submitted by Hari (not verified) on Sat, 2012-10-13 05:55.

Fabio,

Much better results now. I set the sampleFreq variable incorrectly, you use a current and previous time tick to compute sampleFreq. But I have a timer driven sampling frequency, which (in the absence of serial port printouts :-)) is accurately 100Hz, i.e. 10mS sampling interval.

The comment for the declaration of sampleFreq is a bit unclear, you describe it as half the sampling period in seconds. So I had set it to 0.005f.

That didn't look right on revisiting the code, so I changed it to 100.0 and voila, I have a non-jittery cube that responds instantly on all axes to orientation changes ! It still drifts, but that I need to fix with the gyro calibration, that is currently static and I think i need to threshold slow motion better.

I also added a ferrite bead and a 22uF ceramic capacitor to isolate the GY-80 board VCC from the PIC mcu board. If I had designed the board I would have added more of these ferrite beads. I have previously designed my own BMP085 and MS5611 altimeters, and isolating the analog supplies and grounds from the noise on the digital VCC/ground makes a measurable difference.

Progress ! Thanks again for the IMU source code. Now I need to get in and understand what its doing ...

update - PIC24+GY-80 all axes stable, responsive !

Submitted by Hari (not verified) on Sat, 2012-10-13 11:48.

As expected it was an issue with the calibration, but the compass, not gyro. I had not done a 3D calibration to get the max,min on all axes :-(.

With that done, FreeIMU-Cube is displaying a stable cube, with fast response and correct orientation. If the board is held stable, the roll, pitch and yaw angles oscillate very slowly about their stable position by +/- 1-2 degrees. That is impressive to me !

I still have to understand the AHRS algorithm and code, though. :-)
Have downloaded the papers I could find, will try to understand more before tweaking. Thanks again.

Glad to hear you finally made

Submitted by fabio on Mon, 2012-10-15 00:23.

Glad to hear you finally made it and that you are happy with the results.

Did you used the calibration code in the FreeIMU repository?
I'll be having more calibration stuff published soon.

Please consider releasing the FreeIMU library modifications for PIC24.. I'm sure some people would enjoy.

Fabio, I have emailed you the

Submitted by Hari (not verified) on Mon, 2012-10-15 11:57.

Fabio,

I have emailed you the source code, its in MPLABX 1.40 project. No, I did not use your calibration code, will check it out. But it seems to be working pretty good with whatever I have already ! As I emailed you, am now migrating to cortex m3 as i would like to be able to play with the algorithms without affecting sampling rate because of sloppy math code (:-)).

Hi Hari, I am starting to

Submitted by vincent (not verified) on Fri, 2012-10-19 10:27.

Hi Hari,
I am starting to port the library for the v4.3 the mbed which has a cortex m3. if you have any work done that will speed this up for me I would appreciate that very much.

porting to cortex m3

Submitted by Hari (not verified) on Fri, 2012-10-19 11:19.

Vincent,

Have not started on this yet. I am working on an RF link first for my experiments (headtracker).

When I get back to the imu, I will be using an NXP LPC1343, compiling with lpcxpresso. Will post when I have something stable.

Guys, don't forget to share

Submitted by fabio on Fri, 2012-10-19 10:44.

Guys, don't forget to share your outcomes with us.. I'll be happy to include your modified code into the Other Platforms section of the FreeIMU library.

Thanks, I published your work

Submitted by fabio on Mon, 2012-10-15 12:12.

Thanks, I published your work just below my FreeIMU library.

Slow Imu readout

Submitted by Arend (not verified) on Tue, 2012-10-09 16:52.

Hello,

I have some strange behaviour with the 0.4 sensorboard connected to a Leonardo.
I use a .ino file that waits for a character from the serial port and then, in return sends the ypr values. This polling prevents the pc application from becoming flooded with data.
When I first start the program data is send to the pc in an unregular timing that prevents proper tracking.
When I upload the ino file to the Leonardo the update rate is fine and tracking goes smoothly.

Then after reconnecting update is slow, until I reload the firmware again.

Can anyone explaing this? The Leonardo shows itself in device manager as Arduino Leonardo on com9, No other com ports visible.

regards,
Arend

Range

Submitted by tussh13 (not verified) on Tue, 2012-10-09 15:40.

Hie there,

I want to change the range of pitch and roll from(90,-90) to (180,-180)?

You'll have to find better

Submitted by fabio on Tue, 2012-10-09 20:07.

You'll have to find better math to get out the yaw and pitch roll angles.

arcTan but where

Submitted by tussh13 (not verified) on Wed, 2012-10-10 06:20.

I know i can do it using arcTan but where in the library should I change the code?

Have a look at the

Submitted by fabio on Wed, 2012-10-10 10:11.

Have a look at the getYawPitchRoll function in the FreeIMU.cpp file.

Basic Quadcopter instructions for the FreeIMU v0.4

Submitted by Rick Eis (not verified) on Fri, 2012-09-14 03:28.

Hi Fab,

I just received my first FreeIMU v0.4 from Flyduino.net today.
I'm wondering if you have some basic instructions on creating a quadcopter anywhere? Maybe someone else has? If not no big deal, I'll figure it out, but if you have all the info in one place from mounting to tuning, that would be great.
Thanks again Fab for sharing your work.

Rick
USA

Some help.

Submitted by Anonymous (not verified) on Fri, 2012-09-21 00:44.

I'm currently developing a quadcopter myself along with some friends, the project is still no finished but we blog advances in a weekly basis and in the first posts, materials used and code are discussed,I hope you find it helpfull or at least interesting. Constructive criticism will be well received.
http://mytecprojects.wordpress.com/
Best wishes

Hello Rick, unfortunately I

Submitted by fabio on Sun, 2012-09-16 07:49.

Hello Rick, unfortunately I don't have complete instructions on how to setup a quadcopter from scratch... this is not a very easy topic considering how hugely different a 4copter can be made.. You may wanna have a look at my various quadcopter posts, especially this one where I list all the components I used to build mine.

Thanks Fabio for all your work

Submitted by Rick Eis (not verified) on Tue, 2012-09-18 04:12.

Fabio,
Thank you for all your work and answering all our questions. I did get your board to work with a few of your tests as in the video you created. And now I connected everything up as I work toward building a little quad. Please see links for a couple pictures. Don't worry I did not ruin your board :) I used a little epoxy which I could take off if I decide to change things later. :)

https://docs.google.com/open?id=0BxZaXMn-BrzEQU9OVWJRT2NZTU0
https://docs.google.com/open?id=0BxZaXMn-BrzENVRNXzQ4ZHMtdm8

Thanks again,
Rick
Arizona USA

Looking neat! I like all

Submitted by fabio on Tue, 2012-09-18 10:30.

Looking neat! I like all those colored wires.. my prototypes always look grayer.. :-)

Thanks to you for supporting the project.

Pitch..Roll...Yaw

Submitted by Anonymous (not verified) on Thu, 2012-09-13 11:08.

hey Fabio! when i uploaded the example PitcH_Roll_Yaw i get Zero reading but the other examples are OK...i have an ITG3200 and ADXL345 combo board.. please help!!!

That is very strange! Is

Submitted by fabio on Tue, 2012-09-18 10:32.

That is very strange! Is there anything more you can tell me to debug this?

Its ok now....

Submitted by Anonymous (not verified) on Thu, 2012-09-20 07:11.

BTW... what reading should i get when im not moving the YAW,PITCH,ROLL reading when stationary and // to the ground thank you.....such a newbeee

With a properly calibrated

Submitted by fabio on Thu, 2012-09-20 12:01.

With a properly calibrated device and in presence of a magnetometer, you would get near 0 for Pitch and Roll and an angle for the Yaw which should be the angle from the X to the Earth magnetic north. If you point your IMU X axis to the north you would get 0 for Yaw, pitch and roll.

Since you don't have a magnetometer you can't know the Earth north, so the algorithm will simply take the board starting position as Yaw=0. Unfortunately, due to gyro drifting, that yaw=0 position will slowly drift away over time.

Automatic Balancing of Air-Bearing-Based 3-Axis Rotational

Submitted by Vahdat (not verified) on Tue, 2012-09-11 08:01.

Hi,

Thank you for this good project.
I am going to balance a air-bearing 3-axis rotational simulator. could you please tell me whether FreeIMU can be used for this purpose or not? If yes so which version will be suitable for balancing.

Balancing with FreeIMU?

Submitted by zencuke (not verified) on Tue, 2012-09-11 10:31.

Vahdat,

It is hard to know exactly what you mean by a rotational simulator. That is too vague. What is being simulated? Can you give more details? On the other hand a substantial part of what a quadcopter controller does is simply balancing, i.e. keeping the craft in a generally upright position and a FreeIMU has been shown to be a good sensor for a quadcopter controller. Unlike an airplane a quadcopter is a neutrally stable device, i.e. it is as happy pointing in any direction as any other, upside down, sidewise etc. If you just turn the motors on it will likely flip and crash in a very short time, probably less than a second, maybe much less. Only the control system keeps it pointing where it should. Wether this is a comparable application to yours would depend on the physical parameters of your device, i.e how does it tend to fall off balance, as well as the available torque and response time of whatever is used to keep it upright. The FreeIMU (and associated software) part of the job is to estimate the current orientation and what that orientation will be in the near future, i.e. how fast and in what direction is it rotating. That is certainly what you need to know in order to balance something. Whether it could do your job depends mostly on whether it is fast enough, accurate enough and precise enough to keep up with the device as it falls off of vertical. You haven't given enough information to decide. Without knowing more I would guess that the FreeIMU could handle it but that is just a guess. Events can happen very quickly on a quadcopter but the FreeIMU is faster. However it is easy to imagine applications that it couldn't handle because they get out of control too quickly for the FreeIMU to track.

-steve

Automatic Mass Balancing

Submitted by Vahdat (not verified) on Tue, 2012-09-11 10:43.

Thank you for your reply.
I wanna do a mass balancing in a air-bearing 3-axis simulation.
you can get more information from this paper:
"Automatic Mass Balancing of Air-Bearing-Based Three-Axis
Rotational Spacecraft Simulator" by Jae Jun Kim and Brij N. Agrawal.
In fact, in our project we did all of the needed infrastructure but we need a IMU for mass balancing.
This is my main goal for using IMU.

You probably need quad sensors instead.

Submitted by zencuke (not verified) on Fri, 2012-09-14 06:03.

OK I read the paper (skimmed it actually) and that is still not enough information to decide whether FreeIMU will solve your problem. That paper talks about a general solution. A lot depends on what actuators are used and what they are connected to. FreeIMU is best for tracking something autonomous. A quadcopter is a perfect example. Another example is to attach several to different body parts (arms legs, various joints etc.) to track how someone (possibly an athlete) is moving. Your simulator is attached to the ground, i.e. it sits in one place. It you have a fixed reference it is better to measure motion directly. For example if something is rotating you would use a quadrature sensor to keep track of angle. If you have a motor pushing something and want to know how far it has used it is more precise to keep track of motor shaft rotation, again with a quad sensor. A properly designed quad sensor system can detect an unlimited number of rotations in either direction and any speed and be just as accurate on the 60 zillionth rotation as it was the first time around. The FreeIMU sensors strength is that they can basically figure out what is going on with no direct reference because they use gravity and the earths magnetic field as a reference. The downside is they don't measure what you need to know directly. It needs to be calculated indirectly and there are errors involved. That is why apparently redundant sensors are used. Each has a different kind of error but by merging the results (with a Kalman filter) you get a higher quality result. However it always an approximation and is never as good as actually knowing where your are which is what a quadrature sensor can tell you.

In my summary my best guess is that while it could be done there are better ways of controlling your 3D air bearing satellite simulator than with a FreeIMU or similar collection of sensors. In general if you have a machine that sits in one place with moving parts to keep track of it us usually better to measure position and angle of those parts directly. If you have something autonomous that moves around in a way you can't easily keep track of directly then the accel/gyro/magnetometer combination is a better solution.

I hope this helps.

zencuke, thanks for your

Submitted by fabio on Fri, 2012-09-14 11:15.

zencuke, thanks for your contributions.. I really appreciate your help...

You'll have to do some homework.

Submitted by zencuke (not verified) on Fri, 2012-09-14 06:03.

OK I read the paper (skimmed it actually) and that is still not enough information to decide whether FreeIMU will solve your problem. That paper talks about a general solution. A lot depends on what actuators are used and what they are connected to. FreeIMU is best for tracking something autonomous. A quadcopter is a perfect example. Another example is to attach several to different body parts (arms legs, various joints etc.) to track how someone (possibly an athlete) is moving. Your simulator is attached to the ground, i.e. it sits in one place. It you have a fixed reference it is better to measure motion directly. For example if something is rotating you would use a quadrature sensor to keep track of angle. If you have a motor pushing something and want to know how far it has used it is more precise to keep track of motor shaft rotation, again with a quad sensor. A properly designed quad sensor system can detect an unlimited number of rotations in either direction and any speed and be just as accurate on the 60 zillionth rotation as it was the first time around. The FreeIMU sensors strength is that they can basically figure out what is going on with no direct reference because they use gravity and the earths magnetic field as a reference. The downside is they don't measure what you need to know directly. It needs to be calculated indirectly and there are errors involved. That is why apparently redundant sensors are used. Each has a different kind of error but by merging the results (with a Kalman filter) you get a higher quality result. However it always an approximation and is never as good as actually knowing where your are which is what a quadrature sensor can tell you.

In my summary my best guess is that while it could be done there are better ways of controlling your 3D air bearing satellite simulator than with a FreeIMU or similar collection of sensors. In general if you have a machine that sits in one place with moving parts to keep track of it us usually better to measure position and angle of those parts directly. If you have something autonomous that moves around in a way you can't easily keep track of directly then the accel/gyro/magnetometer combination is a better solution.

I hope this helps.

You'll have to do some homework.

Submitted by zencuke (not verified) on Sat, 2012-09-15 23:50.

Of course when I said quadrature sensor what I meant was a quadrature encoder. A quadrature encoder is made with two light sensors and an up/down counter plus a suitable target to look at. Light sensors can be very cheap. Quadrature encoders are usually used to measure angle but they have their own downside. For various reasons it is hard to get them to measure very small angles. There are tricks but they add to the complexity and cost.

Industrial grade commercial Rotary Encoder

Submitted by Anonymous (not verified) on Wed, 2012-11-07 12:39.

http://en.wikipedia.org/wiki/Rotary_encoder

If money allowing, you may want to look at industrial grade commercial units,

Low resolution unit are a few tens pulse per revolution.

For high resoultion, example, this company has sensor that ranges from a few hundred to a few thousand pulse per revolution.

Many different output data formats, from different brands and models too.

Hope this helps

Example industrial commercial products

Submitted by Anonymous (not verified) on Wed, 2012-11-07 12:42.

missed the link, the example products is: http://www.ia.omron.com/products/family/487/

You'll have to do some homework.

Submitted by zencuke (not verified) on Sat, 2012-09-15 23:56.

A cheap source of quadrature encoders is old computer mice. Each mouse usually has two of them.

thanks

Submitted by Anonymous (not verified) on Sat, 2012-09-15 19:51.

Dear zencuke,
Thanks for you good reply.
I will apply your mentioned points.
I will publish my results here later.

Unfortunately, I'm not

Submitted by fabio on Tue, 2012-09-11 09:13.

Unfortunately, I'm not familiar with that kind of application. I think a FreeIMU v0.4.3 can do the job just fine.. but I can't be sure.

Madgwick AHRS C versus MATLAB

Submitted by Rob (not verified) on Mon, 2012-09-10 07:42.

Hi Fabio,

I've been playing around with the FreeIMU v 0.4, both recording the raw data and the data processed through the C implementation of the Madgwick algorithm. I processed the raw data through the MATLAB implementation of the Madgwick algorithm and found that the results differ quite dramatically between the two. The difference is on the order of 20 or degrees in some instances, which seems too large to be rounding error. Any thoughts on what it could be?

Thanks.

another vague question?

Submitted by zencuke (not verified) on Tue, 2012-09-11 11:40.

Poor Fabio ;-) This seems to be the week of vague unanswerable questions.

If the results are different that means that the computations are somehow different. This would either be a bug, roundoff error, a parameter (gain?) difference or an intentional algorithm difference. I know of two or three updates to the original Madgewick algorithm. Do you know which version you are running and how it compares to the one in FreeIMU lib? This algorithm is not that complex. I suggest that you compare the code line by line. If that doesn't show the difference try printing intermediate results to see exactly which part of the computation is different.

Whether 20 degrees could be explained by roundoff errors depends on what the raw data measured. How much and how fast was the sensor orientation changing when you collected the data. If it was moving very slowly 20 degrees would be a lot. If it was moving quickly that might not be such a big difference.

The term "differ dramatically" is not helpful. That is a subjective expression. Please quantify. Does one lag or lead the other or are the differences random? Is there a pattern? I suggest you publish the raw data and the two result sets. Even better plot all three and show the difference visually.

-steve

Excuse me if I overread it,

Submitted by Christoph (not verified) on Sat, 2012-09-08 11:04.

Excuse me if I overread it, but it stays unclear to me:
What ist the software you use for visual demonstrating (the rotating box). Is it part of the Arduino-Software (I'm unfamiliar with it).

Regards
Christoph

Is in the Processing download

Submitted by fabio on Sat, 2012-09-08 11:55.

Is in the Processing download link, just below the FreeIMU library. The code there should be run on the Processing IDE which you can download from processing.org.

Ok thanks for making this

Submitted by Christoph (not verified) on Sun, 2012-09-09 20:19.

Ok thanks for making this clear to me.
I must admit Processing is really neat. Taking your code it was really easy and straightforward to get a rotating cube controlled by a MEMS on a cortex M4 Board.

Anyway nice work here. I am exploring options for a suitable IMU for a Quadcopter, maybe FreeIMU will be my choice.

Christoph

Hi Fabio, I am testing the

Submitted by Anonymous (not verified) on Fri, 2012-09-07 11:35.

Hi Fabio,
I am testing the board 0.4 with an Arduino UNO and the sketch FreeIMU_raw and I am only getting data on the temperature sensor and the barometer, the rest of the parameters (gyro, accel and mag.) are zero. Do you know what could happen here?
Thanks in advance

Fab, I'm having the same

Submitted by Rick Eis (not verified) on Fri, 2012-09-14 05:33.

Fab, I'm having the same problem ~ just received it today - did the test exactly like you did and am getting the same result ~ All zero except the last 2 columns ?
Rick
USA

Have you read the install

Submitted by fabio on Fri, 2012-09-14 11:12.

Have you read the install instructions in the FreeIMU library download page? They tell you to modify the FreeIMU.h to enable the board you are using...

Post new comment

The content of this field is kept private and will not be shown publicly.
If you have a personal or company website insert its address in the form http://www.example.com/ .
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <small> <del> <img> <h2> <h3> <h4> <b> <video> <sub> <sup>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.
  • You may use [inline:xx] tags to display uploaded files or images inline.
  • You may insert videos with [video:URL]
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.

More information about formatting options