Starting to Implement the RTIMULib Library

I’ve continued to work on the example sketch provided for RTIMULib (as referenced in my previous post). As stands, the sketch is quite cryptic and roundabout, so I’ve made an effort to clean it up and split the code up more.

The sketch used to just print off the fused pose data over serial, but now I’ve actually made a function that, when called, will return the current Euler angles, pressure and temperature recorded by (and fused from) the IMU.

Firstly, I had to find a way of setting all 5 of these values from inside a callable function. Now I could just use global variables – and may still do, if this seems easier – but that doesn’t seem like a very clean or efficient way to do it to me.
(continued)

Read More

RTIMULib Sensor Fusion Library

Right as mentioned in my last post I have decided not to stick to Polulu’s quite unreliable Arduino sketch that I assembled into a library, because of the significant drift in the results.

Rather, I’ve now (for the time being) settled on richards-tech’s RTIMULib-Arduino library which is a very complex but highly functional library designed specifically for use with the IMU board I’m using (and some others). What this means for me is that I can include the library in my sketch and not have to worry about the inner workings of it for now – although I’d like to produce my own algorithm at some point in the future.
(continued)

Read More

More Sensor Fusion

Right, I’ve spent the last few hours condensing and altering Polulu’s AHRS System, which I have been planning to use for getting orientation data from my IMU board. As it came, it was just one large sketch (actually a group of 7 files, I think) that took the raw data from the board and turned it into Euler angles for orientation. I had to put it all into a class and alter the function names, etc. etc. so that I could use it as a library with my main Arduino sketch.

The long and short of it is, I’ve finally got it working as a library but on further testing I’ve noticed a significant drift in the sensor values.
(continued)

Read More

IMU Readings and Sensor Fusion

I’ve been having a look at ways to read the raw sensor data from the IMU and translate it into an absolute orientation estimate.

Here’s the problem.

Accelerometers measure forces of acceleration, so that when the board accelerates, it knows. Gravity is a force of acceleration (9.8ms-2, or 1g, towards the earth), so by combining the X,Y and Z vectors of the reading of a stationary accelerometer we can work out the direction of gravity, and hence the orientation of the board.

But as soon as you start moving the accelerometer – as will, of course, happen a lot in a flying quadcopter – it picks up these lateral forces of acceleration as well as the force of gravity (and vibrations affect it too, which are just very fast lateral movements).
(continued)

Read More