Adafruit 9-DOF breakout for quads?
FireNWater
Posts: 93
.
Anybody know if this sensor (https://www.adafruit.com/products/2472) would work in the flight controller of a quad? I use it as a telemetry downlink for my R/C airplanes, but don't know enough about the control loops for quads (yet).
.
The breakout board has a built-in microprocessor that does all of the number crunching for you. All you do is download the numbers using I2C.
.
Anybody know if this sensor (https://www.adafruit.com/products/2472) would work in the flight controller of a quad? I use it as a telemetry downlink for my R/C airplanes, but don't know enough about the control loops for quads (yet).
.
The breakout board has a built-in microprocessor that does all of the number crunching for you. All you do is download the numbers using I2C.
.
Comments
It's totally possible to do all that work (and more) in two cogs on a Prop. You might want to look at the new Elev8 Flight Controller - the code is in GitHub and open source. It implements a full quaternion based IMU on the prop, and will produce quaternion, matrix, and Euler angles at 250hz.
I think it's a really cool sensor. I don't recall the refresh rate but I think it was around 100Hz.
I should have some Propeller code (Spin) for the sensor soon.
I think this is a better argument for using a Propeller than it is for using the BNO055.
This was a really simple project to do... took a couple of hours, mostly because recently I have been working with nearly-java
and found myself slipping into the wrong syntax frequently.
This sample uses Chris Gadd's "I2C SPIN driver v1.4od"
The data sheet from Bosch is excellent. And I found playing with the BNO055 an absolute hoot.
Really sweet engineering and a device that actually seems to live up to its hype.
The sample code exercises only a tiny fraction of the BNO055's functionality.
It is slow, mostly because of the way I am using I2C. Chris's library could be greatly hacked and it could all be put into one cog.
The quaternions are not scaled... the values seen in the serial terminal are the raw outputs. The Euler stats are scaled to the degree, although it could be further scaled down to less than a tenth.
The only testing that I have done is to look for drift while the unit is stationary... there isn't any:)
Even this limited sample should be good for orienting cameras(or Kinects, which is what I am doing next) and for land or sea bound robots. One thing that interests me is that the unit tends to lose calibration during certain kinds of motion.
What I find amazing is that it regains calibration and after returning to a stationary position, no drift seems to have occurred.
I don't know how they do it... and I could be wrong... but it looks really good so far.
With lesser sensors you have to do all that "sensor fusion" yourself in software.
I can't wait to get hold of one.
I've just spent an hour trying to scale the linear acceleration data... it is like a monkey at a typewriter.
I just got fascinated with the whole problem of sensor fusion for IMUs. Ended up porting Sebastian Madgwick's quaternion algorithms to Javascript. I know, that's crazy.
https://github.com/ZiCog/madgwick.js
The Bosch chip does all that for us. Brilliant!
I stopped here because I am seeing too much drift in the fused acceleration data.
For what I am doing orientation is enough and it appears to be rock solid. The corrected gravitational data is solid. Heading data is more reliable than my iPhone:)
Roll data right now goes from 90 to -90 but beyond this, the roll angle gets confused... this is probably my implementation. Beyond these limits the roll angle gets lost... can't tell 91 from 89 for example.
If this was an issue for me, it appears that logic which evaluates the gravitational vectors and uses them to correct the roll vectors would be pretty simple and should work.
It isn't an issue for me, so I haven't done that.
Pitch seems to be perfect.
NICE little board.
Rich
This is clearly true... so, when I am talking about "rock solid" I mean near primary orientation.
As with any sensor, what you want to do and how you do it has to be tempered by the strengths and limitations of the sensor. There is a lot of room for developer creativity here.
So, this isn't a black box that will solve every problem, but it is definitely a black box that is a nice step forward and should give developers a nifty new set of issues to think about.
Using the quaternions and doing all the math in that space will avoid these problems, but it's harder to wrap your brain around. The quaternion version will also have the nice benefit of displaying the same stability regardless of orientation.
There is a good point. As far as I can tell the Bosch chip is supposed to handle all that messy stuff internally. I have no idea how well it does. Does it use quaterion math? Does it suffer gimble lock?
Anyone have an idea?
The Elev8-FC does all of this with quaternion math and outputs all the same data (+ altitude), so I imagine their internals are very similar. No gimbal lock issues whatsoever with quaternion or incremental matrix math. You generally only run into problems when using Euler angles, even if they came from a system using quats or matrices internally.
The lag is just the transmission / rendering time from the Prop to the PC. The internal update rate for the IMU is 250hz, though I've run it at 320hz with no issues. This is one cog reading all sensors, and one FPU cog running all the math.
It looks like this board can be added to the ELEV-8 V2 without much pain and suffering. I haven't flown my V2 yet. Would this board give the quad any new capabilities? (With the proper software mods, of course)
.
.
Does the V2 have auto-level, or does the controller basically function to maintain the last set attitude?
.
.
Does the V3 board have those options?
.
The HoverFly sport and open boards only have a gyroscope, so it's impossible for them to implement auto-level without additional sensors. They did have the option to do altitude hold with an ultrasonic sensor add-on, but we're never auto-leveling. It would be possible if they required an add-on accelerometer.
Mine is one of the closeouts from before Christmas and has the HoverflyOpen board. I plan on installing Jason's open software once I get a few flights on it.
.
@_rjo (or anyone else who's used the code above and had it working)
Was your code tested with the Adafruit module or another make?
I'm trying to get one working but have so far been unsuccessful. I started trying to write a driver for these a few months back, and found you'd already written some code. I've had no luck getting a peep out of mine (Adafruit branded module).
Cheers
I really admire your excellent Github SPIN library.
If you are talking about the BNO055 module, I am glad you are turning your formidable coding talent to it.
I continue to believe the BNO055 has great potential for high-level IMU applications.
I found -rjo's drivers for the BNO055 worked quite well, and I was able to get an experimental gimbal apparatus working.
If it is the BNO055 you are interested in then I may be able to give you some pointers on implementation.
https://www.parallax.com/product/28065
Thanks...very nice of you to say! I wish I knew who started it...I just forked it a few years ago and kept going with it. Many of the objects in it were written by some of the greats, and someone re-wrote or re-formatted them in a different way. It's been a lot of fun working on it and incorporating new things into it. I'm only just now, I think, focusing on making it more consistent. It's one thing to write a bunch of drivers or other objects, but it's another thing to have them all work in a common way. I have a little more focus on that, now. I'd be grateful for any help you can give...after trying many different ways of connecting it and a few different I2C engines, I thought for sure rjo's code would be the holy grail...but I still can't talk to it...never had this kind of trouble with a sensor before. I'm missing something trivial, I'm sure.
@VonSzarvas
Thanks - I have two of those actually They're nice...just wanted to give this one a try since it does some of the math on chip...
Cheers