Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Gyro/Accelerometer Fusion (http://www.chiefdelphi.com/forums/showthread.php?t=113052)

jwakeman 08-02-2013 16:44

Gyro/Accelerometer Fusion
 
3 Attachment(s)
I would like to compensate for drift in my gyro using an acceleromoter. I collected some data from the accelerometer and gryo and I am looking for some help in designing a filter.

1. My first question is if the accelerometer data looks reasonable since this is the first time I have used an accelerometer. The accelerometer is lying flat on the robot.

- The first attachment (acc_data_1.bmp) shows readings while the robot was stationary (first half) and then moving. I don't understand why the z-axis is jumping around while the robot is stationary (or why it is moving at all even when the robot is driving around).

- The second and third attachements (acc_data_2.bmp and acc_data_3.bmp) show the acceleromoter data and gyro data during a sequence of motions.

Time 368.5-373: Robot turns 90 degrees
Time 373-375: Robot drives 5 feet
Time 375-378.5: Robot turns 90 degrees
Time 378.5 - 381.5 Robot drives 10 feet
Time 381.5-384.5: Robot turns 90 degrees

If I am correct the x-axis is forward/reverse motion of the robot and the y-axis is side to side motion of the robot. I think I can see reasonable correlation from the accelerometer data (for example acceleration followed by deceleration in the x-axis when making the 5' and 10' position moves).

I would like other opinions on the quality of this data and if I should proceed with trying to create a filter.

2. If the data is correct I would then appreciate any suggestions for a filter design. I attempted to implement the suggestion here but I don't really understand it enough to get it working. One of the main sticking points is how to convert the G's from the accelerometer to degrees.

Some theory may be helpful, some practical pointers would be nice, some code or psuedo-code would be awesome! I will leave this sort of open ended and see where it goes.

lemiant 08-02-2013 18:58

If you intend to use this to track your robots position it will not work. I have tried this before with FIRST grade sensors and they aren't even close to accurate enough. A commercial inertial measurement unit (IMU, google it) would do the job, but it's orders of magnitude too expensive for an FRC robot.

jwakeman 08-02-2013 19:17

Re: Gyro/Accelerometer Fusion
 
Quote:

Originally Posted by lemiant (Post 1230128)
If you intend to use this to track your robots position it will not work.

I'm not looking to maintain an absolute heading/field position. I am only doing relative moves, i.e. reset the gyro and move X degrees. It already works well and the gyro filtering is not really required but I thought it would be nice to have and would be a good learning experience.

Quote:

Originally Posted by lemiant (Post 1230128)
I have tried this before with FIRST grade website

website?

lemiant 08-02-2013 20:01

Quote:

Originally Posted by jwakeman (Post 1230139)
I'm not looking to maintain an absolute heading/field position. I am only doing relative moves, i.e. reset the gyro and move X degrees. It already works well and the gyro filtering is not really required but I thought it would be nice to have and would be a good learning experience.



website?

Oops, I meant sensors. Smartphones and autocorrect :P. In this case, why is it necessary to have the accelerometer at all? Translation should affect gyro readings at all.


All times are GMT -5. The time now is 12:56.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi