Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Using the ADXL345 (http://www.chiefdelphi.com/forums/showthread.php?t=143957)

fireXtract 02-16-2016 10:19 AM

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?

Ether 02-16-2016 10:42 AM

Re: Using the ADXL345
 
Quote:

Originally Posted by fireXtract (Post 1541110)
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.




fireXtract 02-16-2016 02:46 PM

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.

kgzak 02-16-2016 02:53 PM

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.

Ether 02-16-2016 03:10 PM

Re: Using the ADXL345
 

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



fireXtract 02-16-2016 04:13 PM

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.

dlsmith 02-17-2016 07:15 PM

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.

Breadbocks 02-19-2016 01:19 AM

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.

mehnadnerd 02-19-2016 01:36 AM

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.


All times are GMT -5. The time now is 08:02 AM.

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