Near-Perfect Gyroscope

This code enables you to make an accelerometer and gyroscope give the best results.

Mar 23, 2017

22643 views

16 respects

Components and supplies

1

Breadboard (generic)

1

Arduino UNO

1

SparkFun Triple Axis Accelerometer and Gyro Breakout - MPU-6050

1

Jumper wires (generic)

Tools and machines

1

Soldering iron (generic)

Project description

Code

Code version 1.2.1

arduino

The code now adds data to the gyroscope and accelerometer saved data arrays. This will allow the Kalman filter to make its predictions based on past data. very important! There are also some other small fixes. the filter will probably be added soon, but when is unknown. We're doing our best to implement the math.

code version 1.3.2

arduino

hurrah! the math for the complimentary filter is done, meaning that there is one filter left, the kalman filter, and then the final conversion math can be completed.

Code version 1.1.0

arduino

This is an updated version of the code, with a few improvements but no filter or math yet..

adaptive filter apha

arduino

here's a more active version of the complementary filter, making sure that the

adaptive filter version 0.8.2

arduino

the adaptive filter works! yay! it's not fluid, but values are set out. yay!

Adaptive filter version 1.1.2

arduino

Yay! its awful. --changelog-- -NEW! lots of random data to sort through! -FIXED! the data is relatively smooth -that's all

code version 1.4.2

arduino

complete revamp of the whole system. its now running an optimized version of the original code with an awesome complimentary filter! the data is still jumpy, however, and updates are sure to come soon. sorry it's been so long!

Code version 1.3.1

arduino

Basically version 1.3.0, but we did some cleaning up, making this thing easier to follow. once the code is done, we can post a version that has no comments, for those of you who understand the code, and only want the program to copy. also, as a note: the program uses 22,940 bytes, which is close to the old uno's limit. a stripped-down version can be added later for those with this chip. NOTE: we've found out that the code is missing one piece, the atan2 conversion for the accelerometer data. do not use this code yet!

WIP stablized gyroscope

arduino

Simply set up your gyroscope, plug the code in, and watch the fun on the serial monitor or serial plotter. Your numbers will be in degrees, but this is still WIP and may not work completely or at all.

code version 1.3.2

arduino

hurrah! the math for the complimentary filter is done, meaning that there is one filter left, the kalman filter, and then the final conversion math can be completed.

Adaptive filter version 1.1.2

arduino

Yay! its awful. --changelog-- -NEW! lots of random data to sort through! -FIXED! the data is relatively smooth -that's all

Code version 1.2.1

arduino

The code now adds data to the gyroscope and accelerometer saved data arrays. This will allow the Kalman filter to make its predictions based on past data. very important! There are also some other small fixes. the filter will probably be added soon, but when is unknown. We're doing our best to implement the math.

code version 1.4.2

arduino

complete revamp of the whole system. its now running an optimized version of the original code with an awesome complimentary filter! the data is still jumpy, however, and updates are sure to come soon. sorry it's been so long!

Code version 1.1.0

arduino

This is an updated version of the code, with a few improvements but no filter or math yet..

Code version 1.3.1

arduino

Basically version 1.3.0, but we did some cleaning up, making this thing easier to follow. once the code is done, we can post a version that has no comments, for those of you who understand the code, and only want the program to copy. also, as a note: the program uses 22,940 bytes, which is close to the old uno's limit. a stripped-down version can be added later for those with this chip. NOTE: we've found out that the code is missing one piece, the atan2 conversion for the accelerometer data. do not use this code yet!

Code version 1.3.0

arduino

Hurrah! now that we've found time, we've got a major update for you! the arrays didn't work, so they're gone, but now there is a complimentary filter, lots of thanks to Pieter-Jan of Pieter-jan.com for this math! next update should clean it up a little, it's getting long! NOTE: we've found out that the code is missing one piece, the atan2 conversion for the accelerometer data. do not use this code yet!

adaptive filter version 0.8.2

arduino

the adaptive filter works! yay! it's not fluid, but values are set out. yay!

adaptive filter apha

arduino

here's a more active version of the complementary filter, making sure that the

WIP stablized gyroscope

arduino

Simply set up your gyroscope, plug the code in, and watch the fun on the serial monitor or serial plotter. Your numbers will be in degrees, but this is still WIP and may not work completely or at all.

Downloadable files

Gyroscope wiring

This is a diagram of the wiring for this project. all 3 modes are filled in, so if you want you can use the breadboard, circuit or schematic view to wire your version!

Gyroscope wiring

Gyroscope wiring

This is a diagram of the wiring for this project. all 3 modes are filled in, so if you want you can use the breadboard, circuit or schematic view to wire your version!

Gyroscope wiring

Comments

Only logged in users can leave comments

oztechlab

0 Followers

0 Projects

+3

Work attribution

Table of contents

Intro

16

0