Go to Post I don't resent or envy them for being strong teams; I hope we can continue to learn from them and someday join their ranks. - dsmoker [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 20-01-2017, 11:18
FRCteam5837 FRCteam5837 is offline
Registered User
FRC #5837
 
Join Date: Jan 2016
Location: Waterloo
Posts: 9
FRCteam5837 is an unknown quantity at this point
I2C Andymark Gyro Constructor

We are using the Andymark Gyro and Accelerometer combo unit (am-2314) and programming with Java. Currently we have it connected to the I2C port on the RoboRio. What is the constructor for the accelerometer and the gyro? As well as how can I take the feedback and convert it to angles for the gyro and coordinates for the accelerometer?
Reply With Quote
  #2   Spotlight this post!  
Unread 20-01-2017, 12:15
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 118
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: I2C Andymark Gyro Constructor

We have used an ITG-3200 based sensor. This is not the exact AM-2134 model you are describing, but it uses the same chipset for gyro measurements.

It was a non-trivial exercise to get angle information out of this sensor to our robot Java code. We ended up using a background thread that kept reading and accumulating values from the sensor. The ITG-3200 sensor provides deg/sec measurements that you have to integrate (accumulate) over time if you want to get degrees.

We have some Java source code available for the ITG-3200 using an I2C chip out at github that you are welcome to look at, use, modify or experiment with:

https://github.com/frc868/lib-robot/...o/ITG3200.java

We have not used the ITG-3200 sensor for the past couple of seasons. We switched a BNO059 sensor from Adafruit that does the accumulation onboard. We have not decided what we will use this year yet. Here is a link to that sensor

https://www.adafruit.com/products/2472

WARNING: Neither of these sensors are directly supported in the standard robot libraries.

It takes a considerable amount of time to connect custom I2C circuits to the roboRIO and read through the data sheets and then create the Java code to make use of them. It's a great and often painful experience for both kids and mentors.

If you do not have a Java and electronics expert on your team, you might be better off in looking for a Gyro that is already supported.

Good luck.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2017, 18:01
SLAB-Mr.Thomas SLAB-Mr.Thomas is offline
Registered User
FRC #4237
 
Join Date: Jan 2015
Location: USA
Posts: 15
SLAB-Mr.Thomas is an unknown quantity at this point
Re: I2C Andymark Gyro Constructor

We have used this combo IMU successfully in the past season (2016) with I2C. We want to use it again this season but the same hardware and C++ software do NOT work anymore (2017).

The ITG-3200 portion doesn't seem to return values - the WPILib (actually the HAL method below it) returns bool 1 - failure - for commands.

The ADXL345_I2C portion returns the apparently correct Y axis acceleration with GetX(), the Z axis with GetY(), and zero (0) with the call to GetZ().

Haven't made any progress in tracking down the cause. Anybody have any ideas on what changed and what to do about it?

Thanks.

Last edited by SLAB-Mr.Thomas : 04-02-2017 at 18:30. Reason: added programing language
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 09: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