Go to Post You know, I love the fact that FIRST has always got your back. :D - Beth Sweet [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 16-02-2016, 10:19
fireXtract fireXtract is offline
MegaHertz_Lux
FRC #2847 (Mega Hertz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: fmt
Posts: 42
fireXtract is an unknown quantity at this point
Using the ADXL345

I cant find any links that are not broken in reference to the KOP accelerometer from a few years back. I was going to use a gyro but drift is to irritating to compensate for, so a digital accelerometer is the next best thing. Does anyone know how to program for these ( no examples could be found in this years software) and how to wire it? I see a 0v SDA and SCL and 5v, how is this wired?

EDIT: I found an up to date 2016 screensteps page, but it still has broken links to the wiring page. the I2C has a 3.3v port and the accel I have says 5v on it, will this work? Also my electrical guy thinks I can use this accelerometer to measure angle. Is this true?

Last edited by fireXtract : 16-02-2016 at 10:29.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2016, 10:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Using the ADXL345

Quote:
Originally Posted by fireXtract View Post
I was going to use a gyro but drift is to irritating to compensate for, so a digital accelerometer is the next best thing.
Next best thing to do what, exactly?

If you're thinking about double-integrating acceleration to get yaw angle, you'll be disappointed.



Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2016, 14:46
fireXtract fireXtract is offline
MegaHertz_Lux
FRC #2847 (Mega Hertz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: fmt
Posts: 42
fireXtract is an unknown quantity at this point
Re: Using the ADXL345

What do you suggest? I was planning on using limit switches if not gyro. I have a mechanism in the center of the robot that has 2 windows motors that rotate the shooter scoop, on the end of this rotatable shooter scoop I have the gyro. I have also put 2 limit switches at the upper and lowermost positions that are preferred to this device.
Visual aid:
This isnt the bot I have but its similar to that mechanism in the middle.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2016, 14:53
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Using the ADXL345

Are you trying to tell what angle the shooter is at? You could just use an encoder to tell you what angle the shooter is at relative to the robot. An accelerometer isn't going to work very well to detect what angle you are at, you'd be better off using the gyro.
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2016, 15:10
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Using the ADXL345


Can you clearly describe what you are trying to accomplish? You will get more accurate advice that way.


Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2016, 16:13
fireXtract fireXtract is offline
MegaHertz_Lux
FRC #2847 (Mega Hertz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: fmt
Posts: 42
fireXtract is an unknown quantity at this point
Re: Using the ADXL345

I want to be able to click a button on my joystick and have my mechanism rotate to a high point, then also be able to click a second button to set the rotation to a low point. I could do this with time, problem is, the mechanism is quite heavy on the far ends, so the drop time is largely influenced by gravity, but the lift time is much more reliable.
Reply With Quote
  #7   Spotlight this post!  
Unread 17-02-2016, 19:15
dlsmith dlsmith is offline
Registered User
FRC #5268
 
Join Date: Feb 2016
Location: BioMech Falcons
Posts: 15
dlsmith is an unknown quantity at this point
Re: Using the ADXL345

I would suggest trying the accelerometer and see how well it works out, but without any integrating etc. To calculate the angle just use atan2( y, x ) where the two accelerometer axes are in the plane of rotation. Turns out that gravity is a very well-defined "down" vector that will move along the axes. Of course this will only work accurately when the arm is relatively stationary (not experiencing other accelerations relative to g) so you might need to move the arm more slowly when taking measurements. I'll be curious to hear if it works.
Reply With Quote
  #8   Spotlight this post!  
Unread 19-02-2016, 01:19
Breadbocks Breadbocks is offline
Registered User
FRC #1002
 
Join Date: Oct 2013
Location: United States
Posts: 39
Breadbocks is on a distinguished road
Re: Using the ADXL345

For what it's worth, gyros are much more accurate in the pitch rotation, which you're attempting to do, at least if you have a smart gyro.
Reply With Quote
  #9   Spotlight this post!  
Unread 19-02-2016, 01:36
mehnadnerd mehnadnerd is offline
Registered User
AKA: Brendan
FRC #1458 (Red Tie Robotics)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2009
Location: Danville
Posts: 5
mehnadnerd is an unknown quantity at this point
Re: Using the ADXL345

The best option is to use an encoder. You would attach an encoder to the shaft that rotates, and would not only be able to tell when it is at the endpoints, but exactly where it is, to a far higher degree of accuracy than would be possible with a gyro or accelerometer. You could even pair this with a PID loop to get it to hold position, we implemented something similar here: https://github.com/FRC1458/turtleshe...wigIntake.java.

If you would like additional information about the ADXL345, the original data sheets can be found here: http://www.analog.com/en/products/me...oduct-overview.
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 12:03.

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