Go to Post It is amazing how much a person's participation in FIRST can shape his/her character. - Jupee [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2015, 19:54
bussell bussell is offline
Registered User
AKA: Joe Bussell
FRC #2521 (SERT)
Team Role: Mentor
 
Join Date: Oct 2014
Rookie Year: 2009
Location: United States
Posts: 7
bussell is an unknown quantity at this point
Lightbulb FRC Java Implementation of the SparkFun 6 Degrees of Freedom IMU Digital Combo Board

SERT Team 2521 has been experimenting with the new SparkFun 6 Degrees of Freedom IMU Digital Combo Board. Following an excellent article at http://bildr.org/2012/03/stable-orie...-6dof-arduino/ and sample code from here: http://wiki.oz9aec.net/index.php/6DOF_Digital_IMU we are now able to obtain both Gyro and Accelerometer data from this board.

The classes can be found here:
https://github.com/bussell/SparkFun6Dof

The big lesson learned was "correct addresses are key". The code in WPILIB for the ADXL345 had a hard-coded address that was not correct for this combo board. The only change I made to this file was the address. The gyro took some more care as it uses partial bytes for control data. My hack of a method for setting up the masks is nothing to be excited about, but it works.

Many thanks to the author of the original work published 7/31/2011 by Jeff Rowberg <jeff at rowberg dot net>. https://github.com/jrowberg/i2cdevli...rduino/ITG3200

- Joe Bussell
- Mentor Team 2521
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2015, 20:01
bussell bussell is offline
Registered User
AKA: Joe Bussell
FRC #2521 (SERT)
Team Role: Mentor
 
Join Date: Oct 2014
Rookie Year: 2009
Location: United States
Posts: 7
bussell is an unknown quantity at this point
Re: FRC Java Implementation of the SparkFun 6 Degrees of Freedom IMU Digital Combo Bo

Usage:

In our Sensors class:
private ADXL345_I2C_SparkFun m_accel;
private GyroITG3200 m_gyro;

In our Sensors() constructor:
m_accel = new ADXL345_I2C_SparkFun(I2C.Port.kOnboard, Accelerometer.Range.k16G);

m_gyro = new GyroITG3200(I2C.Port.kOnboard);
m_gyro.initialize();
Methods to get Gyro data:
public double getAngleX() {
return m_gyro.getRotationX();
}

public double getAngleY() {
return m_gyro.getRotationY();
}

public double getAngleZ() {
return m_gyro.getRotationZ();
}
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2015, 21:10
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: FRC Java Implementation of the SparkFun 6 Degrees of Freedom IMU Digital Combo Bo

Were you able to get the gyro to work and return an angle?

From what I understand from your code, its seems like you are just getting the rate of rotation. According to the datasheet, the GYRO_*OUT_* registers contain the rate of rotation. The gyro rate needs to be converted to degrees per second and then integrated to get the angle.

I also worked on a driver for this gyro, but it seemed to be filtering out a lot of the readings, so I ended up with a lot of drift. This is how I did it: https://gist.github.com/lopsided98/ef6c0f8cacacad9d398b
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists

Last edited by Ben Wolsieffer : 31-01-2015 at 21:13.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2015, 00:48
bussell bussell is offline
Registered User
AKA: Joe Bussell
FRC #2521 (SERT)
Team Role: Mentor
 
Join Date: Oct 2014
Rookie Year: 2009
Location: United States
Posts: 7
bussell is an unknown quantity at this point
Re: FRC Java Implementation of the SparkFun 6 Degrees of Freedom IMU Digital Combo Bo

We are still pretty early in our progress with this. What we do have is raw values from the registers for all three gyro orientations and all three acceleration vectors from this combo board showing up on our Smart Dashboard. When I change the orientation of the device I see a '~reasonable' change in the data. We still need to perform some test runs, gather data, and make sense of what we have.

I really appreciate your link. There are several concepts in your code that we will review and likely adopt. On one hand I wish I had your source three days ago. On the other hand it was a fun tour through an engineering problem with our students.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:44.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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