|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
please help in adxl345
hi am a new user to adxl345 accelerometer and i use it in graduation project to give output displacement i am really cant know a lot of things about it
first i use spi interface so i use only 4 pins cs ,sdio,sdo,sclk,i think 4 wire second i want to know if the registers in the accelerometer is defoult cofigured that i can use to connect it directly to pic as i use 18f448 and make operation in pic third the operation in pic is to convert the digital bits to coresponding current and then double integeration am i write ???? please help me if you have any codes can help me in either configuring the accelerometer or in other operations finally i am very sorry to disturb you all but really i am new in using this and i am really in great problem due to time limited !!!!!plz help me [/b][/b] |
|
#2
|
||||
|
||||
|
Re: please help in adxl345
Quote:
Quote:
Quote:
Quote:
Good luck, --Ryan |
|
#3
|
||||
|
||||
|
Re: please help in adxl345
We have written code to double integrate the ADXL345.
You can find the code here for the cRIO (http://proj.titanrobotics.net/hg/Frc...inc/TrcAccel.h) But as Ryan said, it will cumulate error when you integrate it over time. Therefore, you must use caution when doing it. We reset the accumulator right before we start the PID control (which is what we use the accelerometer for). This will clear the cumulated error and start fresh. It works reasonably well for us. We also implemented Zero-G calibration to eliminate DC offset of the outputs. |
|
#4
|
|||
|
|||
|
Re: please help in adxl345
thankssssssssssssssssssssssssss a lot really you both helped me alot i was really in a trouble and i will work on this data and hoping to acheive the result soon and sorry if i make a disturbance again as i will of course face trouble
but in adxl345 i found delay time between samples is 5us between two samples i think this is the time use in the integeration (base) to calculate area under the curve ... is this right or i use some of pic timer as rayan said to know exactly the time between samples .. |
|
#5
|
||||
|
||||
|
Re: please help in adxl345
Quote:
the challenge is synchronizing the PIC and the accelerometer. if you configure one of the interrupt out lines of the accelerometer to assert each time a new sample is ready, and run the SPI at a high enough data rate to be able to transfer each sample and then process it on the PIC in less time than it takes the accelerometer to read one sample, then you can use the accelerometer's timing. If you don't get the timing fast enough, you risk dropping samples, and then your integration will be off. It would be even better to make use of the ADXL345's FIFO buffer, but you still have to make sure you can process the samples fast enough otherwise the buffer will overflow. My suggestion to use the PIC's timer was in response to your question about using the accelerometer with its registers in their default state, as neither the interrupts or FIFO are enabled by default. So I was assuming that you would just be reading from the accelerometer periodically, and as such you wouldn't have an accurate timing from the accelerometer, so you would have to use timing from the PIC. --Ryan |
|
#6
|
||||
|
||||
|
Re: please help in adxl345
The code I quoted was designed to be independent of sample loss. Since it is determining the time between samples and use it as the interval for each integration, if you lose a sample, it will integrate with double the interval the next time. So it won't throw you off. I wouldn't assume a fixed sampling rate. I would figure out if the system has a hardware timer that you can read that will give you an accurate timestamp.
|
|
#7
|
||||
|
||||
|
Re: please help in adxl345
Quote:
--Ryan |
|
#8
|
|||
|
|||
|
Re: please help in adxl345
thanks for all your efforts to help me and i will put all your point infront of me and i will care about it of course that i think i couldnt have been able to start the project without your help ryan and mikets ... and i wish god help me in my first and important project
|
|
#9
|
|||
|
|||
|
Re: please help in adxl345
Hi,
I am developing a buoy to measure the ocean wave heights with the ADXL345 and a dsPIC. Until now i was not able to communicate with the adxl345 via the SPI interface. Can anyone tell the correct SPI configuration for the dsPICs or PICs? Any help will be much appreciated. Best regards. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ADXL345 Programming | enrique | C/C++ | 2 | 18-02-2010 15:56 |
| ADXL345 using I2C | tdidi | C/C++ | 1 | 29-01-2010 21:02 |
| hook up ADXL345 to cypress breadboard at driver station | erichahn525 | Programming | 4 | 23-01-2010 12:22 |
| pic: please help us please mortals | CD47-Bot | Robot Showcase | 5 | 25-01-2004 11:03 |
| please help us, pretty please :) | archiver | 2001 | 0 | 24-06-2002 03:13 |