Go to Post I have long since given up on these hints, and come to the conclusion that they are designed to befuddle us all and amuse Dave. - Rickertsen2 [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 10-01-2012, 20:39
NeatNit's Avatar
NeatNit NeatNit is offline
Alumni Programmer
FRC #1577 (Steampunk)
Team Role: Teacher
 
Join Date: Sep 2011
Rookie Year: 2011
Location: Israel
Posts: 60
NeatNit is an unknown quantity at this point
ADXL345 Accelerometer Troubles (examples give errors)

For some reason (being mainly my own stupidity) we never tried to use an accelerometer before kickoff for practice. As it turns out it's a vital part of what we're planning to do (No bonus points if you guess - it's too obvious!), so it certainly doesn't help that nothing I try to do works.


We're using a cRIO-FRC2. We have the digital sidecar connected to the digital module on slot 2, and we connected the ADXL345 accelerometer to the sidecar exactly as shown in the examples. We have tried both examples (I2C and SPI) several times, and neither worked. We've also tried two different accelerometers, both reacting the same.
We've checked, double-checked, triple-checked, and then checked a bunch more times - everything is connected correctly. I am completely baffled as to why it's not working.

When we run the I2C example, it spits up an error, immediately stopping the VI. I'm afraid I can't copy-paste it at this moment, but generally (from memory): it expected something like "Address 58" (not 100% sure about the number) but instead received "The sensor did not respond" (or something to that effect). The error text then goes on about the error code being undefined, and the rest of that annoyingly long message. Error code was was -44xxx (xxx being your best guess!)
I tried to go deeper and see the source of the error. I've found the oddest thing - a devref entering a Read VI was probed error-free, but when probing the input when going inside the read VI, it has the error in it.


The SPI example, on the other hand, DOES run, but returns 0 for all axis's at all times. I made sure that earth's gravity was in fact turned on, and even tried moving the sensor myself - it did not output anything. We've given this one less attempts though.


I am not a very experienced programmer but I'm skilled enough so you don't have to dumb down your replies for me.



Side question: Is either protocol better than the other for the accelerometer? For what reason?
Reply With Quote
  #2   Spotlight this post!  
Unread 10-01-2012, 23:27
gerberduffy gerberduffy is offline
Registered User
FRC #0192
 
Join Date: Jun 2011
Location: California
Posts: 8
gerberduffy is an unknown quantity at this point
Re: ADXL345 Accelerometer Troubles (examples give errors)

I've had a similar issue to you.

We access the ADXL345 through I2C:

Code:
        i2c = DigitalModule.getInstance(2).getI2C(slot);
Every time we try to read the ADXL345, we get this output:

[frcrun] [cRIO] Digital module 2 is not present.
[frcrun] [cRIO] DIO LoopTiming: 260, expecting: 261


We've updated the cRIO to the 2012 image, and updated the frc netbeans libraries.

I was looking through SensorBase, and this javadoc on SensorBase.checkDigitalModule() looked interesting:
Module numbers are 1 or 2 (they are no longer real cRIO slots).

I'm not sure how to deal with this, and any help would be greatly appreciated.
Reply With Quote
  #3   Spotlight this post!  
Unread 11-01-2012, 01:12
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,112
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: ADXL345 Accelerometer Troubles (examples give errors)

Quote:
Originally Posted by gerberduffy View Post
Code:
        i2c = DigitalModule.getInstance(2).getI2C(slot);
What is "slot"? If you're trying to specify a digital module, don't refer to it by its cRIO slot number. The first installed module (in slot 2) is module 1.

Quote:
Every time we try to read the ADXL345, we get this output:

[frcrun] [cRIO] Digital module 2 is not present.
That's a pretty specific error message. Do you indeed have a second digital module installed?

Quote:
I was looking through SensorBase, and this javadoc on SensorBase.checkDigitalModule() looked interesting:
Module numbers are 1 or 2 (they are no longer real cRIO slots).

I'm not sure how to deal with this, and any help would be greatly appreciated.
I know what it means, so I can't be sure it's as self-explanatory as it looks, but you deal with it by addressing the digital module as either number 1 or number 2, depending on whether it's the first module (in slot 2) or the second (in slot 4 of a 4-slot or slot 6 of an 8-slot cRIO).
Reply With Quote
  #4   Spotlight this post!  
Unread 11-01-2012, 17:16
NeatNit's Avatar
NeatNit NeatNit is offline
Alumni Programmer
FRC #1577 (Steampunk)
Team Role: Teacher
 
Join Date: Sep 2011
Rookie Year: 2011
Location: Israel
Posts: 60
NeatNit is an unknown quantity at this point
Re: ADXL345 Accelerometer Troubles (examples give errors)

After spending nearly all day trying different things, I am forced to reach the conclusion that the ADXL345 drivers used in the examples are simply wrong. It doesn't work, nor does it show any signs of working. I've tried with two cRIOs (one 8-slot and one 4-slot), made absolutely sure EVERYTHING is connected as it should. This makes no sense. I give up.


If anyone gets the ADXL345 working using either protocol in LabView, please show me your code.

So now I have to go look around for an analog accelerometer... :/
Reply With Quote
  #5   Spotlight this post!  
Unread 11-01-2012, 17:25
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,559
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: ADXL345 Accelerometer Troubles (examples give errors)

Quote:
Originally Posted by NeatNit View Post
After spending nearly all day trying different things, I am forced to reach the conclusion that the ADXL345 drivers used in the examples are simply wrong. It doesn't work, nor does it show any signs of working. I've tried with two cRIOs (one 8-slot and one 4-slot), made absolutely sure EVERYTHING is connected as it should. This makes no sense. I give up.


If anyone gets the ADXL345 working using either protocol in LabView, please show me your code.
Take a look at the other ADXL345 thread. http://www.chiefdelphi.com/forums/sh...hlight=ADXL345
Reply With Quote
  #6   Spotlight this post!  
Unread 11-01-2012, 17:31
NeatNit's Avatar
NeatNit NeatNit is offline
Alumni Programmer
FRC #1577 (Steampunk)
Team Role: Teacher
 
Join Date: Sep 2011
Rookie Year: 2011
Location: Israel
Posts: 60
NeatNit is an unknown quantity at this point
Re: ADXL345 Accelerometer Troubles (examples give errors)

Quote:
Originally Posted by Joe Ross View Post
Take a look at the other ADXL345 thread. http://www.chiefdelphi.com/forums/sh...hlight=ADXL345
o_0

I swear I made a forum search before posting this thread. No idea how I missed that one.
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 08:10.

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