Magnetic North with BNO055 and Teensy 3.5

Status
Not open for further replies.

Astronautical97

New member
Hello everyone, I will participate in a competition this summer with my team, and mission expects us to do a camera stabilizer. Especially, this camera stabilizer takes magnetic north as the reference point, and stabilize the initial angle with respect to the magnetic north between +10/-10 degrees deviations. We decided to use BNO055 sensor and Teensy 3.5 microcontroller to build camera stabilizer. However, the code prepared by Adafruit gives us roll, pitch and yaw angles. We want to hold roll, pitch and at the same time take magnetic heading instead of yaw angle. We do not understand how we edit the library for this purpose. Can you give any advice or tutorial for this situation? Thanks in advance.
 
Learn C and read the sourcecode, maybe? :)
If we win your competition.. what will we get? :)


ok, kidding..

No, just with copy&paste and a little editing, you will not win..
 
We do not understand how we edit the library for this purpose. Can you give any advice or tutorial for this situation?

Well, I can give you some general advice. The first and most important part of that advice is this project will involve much more than a small edit to one of Adafruit's libraries. Maybe I'm reading too much into your question, but I can't shake the impression that you're hoping to complete this project without much design work or problem solving. That's not how things work....

Usually projects like this involve several components. Usually a path to success involves getting each component working and tested, then you try to put them together only after you've gained some experience and confidence using each part by itself.

Obviously the sensor is one part. If you only need Yaw, and Adafruit's code projects Roll, Pitch and Yaw, why would you do anything other than simple discard the other 2 and use the one you want?

You're going to need 2 other things besides the sensor. Some sort of motor is the other obvious piece. The motor is going to need to be able to turn both ways and be able to stop if needed. There too, it's important to build and test this part and know that it works before you try to use it in the system.

The 3rd part that might not be so obvious is some sort of control algorithm, which takes the sensor data and the designed yaw as 2 inputs, and gives you the motor control. The most popular algorithm is called PID, for proportion, integral, derivative. (knowing this name can help you search for info...) I know there's at least one very good PID library for Arduino which will work fine on Teensy. Like the sensor, PID involves some learning and testing, especially to figure out the tuning parameters. You'll probably do this PID part last, so you can use it with the sensor and motor.

Ultimately, your code will probably end up looking like a loop() function which reads the sensor, maybe does some math (or just uses yaw without roll & pitch), then gives the current angle and designed angle to the PID library, then uses that result to update the motor.

If you ask this question on Adafruit's forum, I hope you'll give us a link to the thread over there. It's always interesting to see how their answers compare...

I know this isn't the code edit you wanted, but hopefully this general advice will help you better plan your project and set your expectations realistically for the work you'll need to do to accomplish your goals.
 
We decided to use BNO055 sensor and Teensy 3.5 microcontroller to build camera stabilizer

Don't want to sound pessimistic and sure don't want to discourage you, but I NEVER got the Adafruit BNO055 board to work (using Teensy 3.5 as well).
Yes, it puts out values, but expecially Yaw is totally unreliable. A random generator would be just as useful.

Not that I had better luck with other sensors (including, sorry to say, PJRC's own Motion Prop Shield):

https://forum.pjrc.com/threads/48450-uNav-AHRS?p=197159&viewfull=1#post197159
https://forum.pjrc.com/threads/5520...eensy-3-5)-how-to-get-reliable-heading-values

Looks like getting a proper, reliable heading is very difficult, unfortunately.
 
Status
Not open for further replies.
Back
Top