Go to Post Off season is a good way to go outside the district. - 346CADmen [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2012, 20:30
StephenNutt StephenNutt is offline
Registered User
FRC #0172 (Falgor)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Falmouth, ME
Posts: 37
StephenNutt is an unknown quantity at this point
Unable to read accelerometer

We've been trying for several days to read values from the accelerometer with no success. We have verified the accelerometer works correctly by accessing it using an Arduino. We have tried with both the round and flat DB37 cables to connect the digital breakout board, fixing our broken ribbon cable as described at the US First site. We have tried two I2C cables and two digital breakout boards.

Stepping through I2C::Transaction in I2C.cpp, aborted is always being set to true on line 102. There is no documentation as to what this means, but on lines 102 and 103 data and dataHigh are being set to 0. If anyone has any thoughts, or could step through ADXL345_I2C::GetAccelerations down into I2C::Transaction to see what they get we would be most grateful.

Thanks

Steve
  #2   Spotlight this post!  
Unread 13-02-2012, 23:49
Ernst's Avatar
Ernst Ernst is offline
Ernst
AKA: Ernst
FRC #1732 (Hilltoppers)
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2011
Location: Milwaukee, WI
Posts: 297
Ernst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond reputeErnst has a reputation beyond repute
Re: Unable to read accelerometer

The accelerometer is an analog device. Try hooking it up to the analog breakout instead of the D I/O board. You might have a bit more success.

Also, you may want to reference this PDF. It contains information on the 2012 Accelerometer and Gyro.
  #3   Spotlight this post!  
Unread 14-02-2012, 00:01
Cuog's Avatar
Cuog Cuog is offline
Registered Linux User: 390661
AKA: Alex
FRC #0422
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Richmond, Virginia
Posts: 852
Cuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond repute
Send a message via AIM to Cuog
Re: Unable to read accelerometer

Quote:
Originally Posted by ZehP View Post
The accelerometer is an analog device. Try hooking it up to the analog breakout instead of the D I/O board. You might have a bit more success.

Also, you may want to reference this PDF. It contains information on the 2012 Accelerometer and Gyro.
You should probably re-read the document you posted. The Accelerometer is read via SPI/I2C bus, and not via plain analog values like the gyro.
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.
  #4   Spotlight this post!  
Unread 14-02-2012, 00:51
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Unable to read accelerometer

FIRST Team 1296 is using the 2012 I2C accelerometer and we are getting data. It is very noisy and it drifts (almost too much to be usable) but the I2C link seems to work. We are in the middle of creating a derived class that filters the thing and resets it when the robot is sitting still (as determined by the encoders).

Is your sidecar powered properly? Did you connect it to the pins closest to the NXT connector (check the manual)? Are you sure your cable is good (check for end to end continuity and for an shorts from one pin to another)? Are you sure your cable is in the correct orientation (it is easy to plug in backwards on either side)?

HTH
__________________
Fast, cheap or working - pick any two!
  #5   Spotlight this post!  
Unread 14-02-2012, 01:21
Trevor_Decker's Avatar
Trevor_Decker Trevor_Decker is offline
Registered User
AKA: Trevor Decker
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: Pittsburgh
Posts: 42
Trevor_Decker is an unknown quantity at this point
Re: Unable to read accelerometer

Team 3504 had a similar problem we found that when the digital side card is connected to the C-rio by a DB37 Cable we could not get a reading. However when we switched to the DB37 ribbon we could get data from the accelerometer.

I believe that the DB37 ribbon was in the kit of parts this year.
  #6   Spotlight this post!  
Unread 14-02-2012, 01:43
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Unable to read accelerometer

Quote:
Originally Posted by Trevor_Decker View Post
Team 3504 had a similar problem we found that when the digital side card is connected to the C-rio by a DB37 Cable we could not get a reading. However when we switched to the DB37 ribbon we could get data from the accelerometer.

I believe that the DB37 ribbon was in the kit of parts this year.

I have seen that in so many posts that we tried both and both worked (and both were noisy). I wonder what makes the difference. Perhaps it depends on which molded cable one is using (though I'm confident we have never ordered one, all came from past KOPs).
__________________
Fast, cheap or working - pick any two!
  #7   Spotlight this post!  
Unread 14-02-2012, 02:28
Trevor_Decker's Avatar
Trevor_Decker Trevor_Decker is offline
Registered User
AKA: Trevor Decker
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: Pittsburgh
Posts: 42
Trevor_Decker is an unknown quantity at this point
Re: Unable to read accelerometer

Quote:
Originally Posted by wireties View Post
I have seen that in so many posts that we tried both and both worked (and both were noisy). I wonder what makes the difference. Perhaps it depends on which molded cable one is using (though I'm confident we have never ordered one, all came from past KOPs).
I think it might have to do with length of the cable. I2C is a serial signal so the extra latency may be casing problems. (this still doesn't make much sense to me).

How much noise are you getting, and is it evenly distributed on all three axis?
__________________
- Trevor

Team 3504 - The Girls of Steel 2011 - Present
2012 Pittsburgh Regional Engineering Inspiration, and website awards
Team 1743 - The Short Circuits 2009 - 2011
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2010 Won Autodesk Animation Competition
2010,2011 Pittsburgh Team spirit award
  #8   Spotlight this post!  
Unread 14-02-2012, 02:53
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Unable to read accelerometer

Quote:
Originally Posted by Trevor_Decker View Post
I think it might have to do with length of the cable. I2C is a serial signal so the extra latency may be casing problems. (this still doesn't make much sense to me).

How much noise are you getting, and is it evenly distributed on all three axis?
Our molded cable and ribbon cable are the same length so perhaps it is the length causing issues. Minimizing the length from the sidecar to the sensor becomes important I reckon.

The noise is everywhere. Some of it is just LSB noise, some of it is 'real' vibration and some may be power/ground related. We need to hard mount ours so the vibrations are beyond the bandwidth of the sensor. Hopefully this (and some filter caps) will help. I think we might filter the data to make it usable. The drift of the zero G setpoint is more troublesome. We plan on resetting the V and D sums when the wheel encoders say the robot is sitting still.
__________________
Fast, cheap or working - pick any two!
  #9   Spotlight this post!  
Unread 14-02-2012, 12:58
StephenNutt StephenNutt is offline
Registered User
FRC #0172 (Falgor)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Falmouth, ME
Posts: 37
StephenNutt is an unknown quantity at this point
Re: Unable to read accelerometer

Thank you everyone for all the suggestions.

The Digital break out board is powered - the LEDs are on. I will double check this though as it was not something that we verified.

We have tried with both the round and flat DB27 cables. Admittedly our flat ribbon cable has been damaged and then repaired as much as possible. I've checked the pins and it appears to be working correctly, but it does not hurt to re-check the cable.

From memory our I2C cable is around 50cm long, but I've never measured it. Checking with http://www.esacademy.com/en/library/...s/i2c-faq.html In typical applications, the <maximum> length is a few meters (9-12ft).

Currently noise is not an issue - the read values are all zero.

I'll follow up tomorrow evening after the meeting, until then please continue making other suggestions of things to check.

Again, thank you all for the help

Steve
  #10   Spotlight this post!  
Unread 15-02-2012, 20:13
StephenNutt StephenNutt is offline
Registered User
FRC #0172 (Falgor)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Falmouth, ME
Posts: 37
StephenNutt is an unknown quantity at this point
Re: Unable to read accelerometer

I borrowed a Total Phase Beagle I2C analyser from work and have some additional info.

When successfully reading the I2C bus from an Arduino the clock speed is 100kHz. When unsuccessfully using the cRIO the clock speed is 38.4kHz (the Beagle reports the clock as every 26us)

The accelerometer is not acknowledging with an ack - the SDA line is not going low after after the final bit is sent from the cRIO.

Does any team have an oscilloscope and can measure the clock speed for me. Our oscilloscope is giving us a clock speed of closer to 43kHz.

Additionally, we are currently using the old 8 slot cRIO. Has anyone managed to get the accelerometer going with last years cRIO rather than the new 4 slot cRIO?

Again, many thanks to all for any help

Steve
  #11   Spotlight this post!  
Unread 16-02-2012, 08:13
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Unable to read accelerometer

Quote:
Originally Posted by StephenNutt View Post
Additionally, we are currently using the old 8 slot cRIO. Has anyone managed to get the accelerometer going with last years cRIO rather than the new 4 slot cRIO?
Our programming testbed is an 8-slot cRIO. After we replaced the thick white 37-pin cable with the ribbon cable from the Kit of Parts, the accelerometer works fine with I2C.

You might have one of the boards that responds to the alternate address of 0xAC instead of the default 0x3A. Try changing that in the example code and see if it starts responding.
  #12   Spotlight this post!  
Unread 16-02-2012, 15:12
StephenNutt StephenNutt is offline
Registered User
FRC #0172 (Falgor)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Falmouth, ME
Posts: 37
StephenNutt is an unknown quantity at this point
Re: Unable to read accelerometer

Quote:
Originally Posted by Alan Anderson View Post
Our programming testbed is an 8-slot cRIO. After we replaced the thick white 37-pin cable with the ribbon cable from the Kit of Parts, the accelerometer works fine with I2C.

You might have one of the boards that responds to the alternate address of 0xAC instead of the default 0x3A. Try changing that in the example code and see if it starts responding.
Thank you for verifying the accelerometer works on the 8-slot cRIO. We've successfully used the accelerometer at address 0x3A with an Arduino so that does not appear to be our issue.
  #13   Spotlight this post!  
Unread 16-02-2012, 15:27
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Unable to read accelerometer

Quote:
Originally Posted by StephenNutt View Post
Thank you for verifying the accelerometer works on the 8-slot cRIO. We've successfully used the accelerometer at address 0x3A with an Arduino so that does not appear to be our issue.

Ours is also an 8-slot setup.

How long is your cable? I mean total length from cRIO to sidecar plus from sidecar to accelerometer. Our cable to the accelerometer is quite short, maybe that is the difference? I know I2C is designed to work over very short distances, it is more often used on the same circuit board or across a backplane. There are dedicated I2C drivers that work well over a couple meter long cable but more often the driver is really just some sort of logic port on a FPGA or a I2C peripheral and not as strong as the I2C spec recommends.


HTH
__________________
Fast, cheap or working - pick any two!
  #14   Spotlight this post!  
Unread 16-02-2012, 16:25
StephenNutt StephenNutt is offline
Registered User
FRC #0172 (Falgor)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Falmouth, ME
Posts: 37
StephenNutt is an unknown quantity at this point
Re: Unable to read accelerometer

Quote:
Originally Posted by wireties View Post
Ours is also an 8-slot setup.

How long is your cable? I mean total length from cRIO to sidecar plus from sidecar to accelerometer. Our cable to the accelerometer is quite short, maybe that is the difference? I know I2C is designed to work over very short distances, it is more often used on the same circuit board or across a backplane. There are dedicated I2C drivers that work well over a couple meter long cable but more often the driver is really just some sort of logic port on a FPGA or a I2C peripheral and not as strong as the I2C spec recommends.


HTH
I'll measure it tonight, and create a short cable to check. Thanks for the help.
  #15   Spotlight this post!  
Unread 16-02-2012, 17:26
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Unable to read accelerometer

Quote:
Originally Posted by StephenNutt View Post
I borrowed a Total Phase Beagle I2C analyser from work and have some additional info.

When successfully reading the I2C bus from an Arduino the clock speed is 100kHz. When unsuccessfully using the cRIO the clock speed is 38.4kHz (the Beagle reports the clock as every 26us)
That is the expected clock rate for I2C on the digital side car... 6.5us access period * 4 cycles to make the waveform.

Quote:
Originally Posted by StephenNutt View Post
The accelerometer is not acknowledging with an ack - the SDA line is not going low after after the final bit is sent from the cRIO.
This basically means that no device believes that it is being addressed. Possibly signal integrity, though at that speed I'd be surprised. Are you using the scope to watch the signals at the sensor or at the DSC?

-Joe
Closed Thread


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 00:48.

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