quietlychris / quadcopter

Early work on an embedded Linux-only flight controller for a quadcopter in Rust
GNU General Public License v3.0
12 stars 3 forks source link

Consider these other sensor-fusion-combo boards #2

Open braincore opened 3 years ago

braincore commented 3 years ago

My quadcopter used this board: https://www.tindie.com/products/onehorse/ultimate-sensor-fusion-solution-lsm6dsm-lis2md/

The creator has spent a good amount of time characterizing the performance of ST's line of accelerators, gyroscopes, magnetometers, and pressure sensors. He combines these on one board with a dedicated sensor fusion chip which can run the iterative attitude-estimation algorithm at 400 Hz. Even if you don't use it, it's educational reading through all his material.

He also released a new board that I'd try using if I were starting my project today: https://www.tindie.com/products/onehorse/max32660-motion-co-processor/

quietlychris commented 3 years ago

I'm definitely open to other state estimation boards! And I'm definitely adding some of his work to my reading list--it looks like great material. From what I saw, though, it looked like the existing driver code was written in C++. Did I miss a link to a Rust API somewhere, or did you code it from scratch/write bindings to the provided ones? It's not a dealbreaker if the second one, but I would need to think about the cost/benefit on the time trade-off a little harder. Honestly, one of the reasons why I went with the BNO055 instead of even the newer BNO085 is because the Rust bindings seemed well-maintained.

Ultimately, I'm hoping to come up with a way to easily abstract most device-specific code away, by having some sort of message-passing middleware for syncing various threads/processes so that switching out hardware doesn't necessarily mean needing to change the code in the control loop.

braincore commented 3 years ago

As I got into this, I wrote bindings for a whole host of i2c & spi devices:

https://github.com/braincore/ms5611-rs (barometer) https://github.com/braincore/vl53l1x-rs (time-of-flight sensor) https://github.com/braincore/mpu9250-dmp-rs (9-axis: accelerometer + gyroscope + magnetometer) https://github.com/braincore/ak8963-rs (magnetometer) https://github.com/braincore/pmw3901-rs (optical flow sensor)

The one specifically for his sensor fusion board isn't broken out, however, and is embedded in my quadcopter repository. It's very easy once you get the hang of it.

Your intuition to use message-passing to create a nice boundary between the devices and the control system is what I landed on as well!