Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

pmodacl acceleration data

Hello everybody, I connected the external accelerometer pmodacl (came with the mechatronics kit) to myRIO 1900, and ran the accelerometer demo. the data I get is plotted on a graph which represent the amplitude that is read from the registers number 32 up to 37 (shown in the picture below)

Unbenannt.JPG

what I am trying to do is do read the acceleration (in g) and plot it instead of the amplitude, I have searched for the other registers to see which has the acceleration reading but could not find anything (the registers table is in the picture below), is there anyway to retrieve the acceleration data directly or should I make some calculation from the amplitude data? any help would be much appreciated.

Unbenannt1.JPG

0 Kudos
Message 1 of 4
(4,972 Views)

Hi AbuShaqra

 

That's a great question.  I've been perusing through the datasheet for the pmodacl as well, and there doesn't seem to be a register that will provide straight accelerometer data.  Unfortunatley , the best solution is likely to manipulate the registers you're reading, as you suggested.  Support for the pmodacl may be able tomake another suggestion, however.

Andy G
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(4,945 Views)

Hi Andy G,

 

I was looking up the datasheet and found this in the section of "Offset Calibration":

 

"In a no-turn or single-point calibration scheme, the part is oriented such that one axis, typically the z-axis, is in the 1 g field of gravity and the remaining axes, typically the x- and y-axis, are in a 0 g field. The output is then measured by taking the average of a series of samples. The number of samples averaged is a choice of the system designer, but a recommended starting point is 0.1 sec worth of data for data rates of 100 Hz or greater. This corresponds to 10 samples at the 100 Hz data rate. For data rates less than 100 Hz, it is recommended that at least 10 samples be averaged together. These values are stored as X0g, Y0g, and Z+1g for the 0 g measurements on the x- and y-axis and the 1 g measurement on the z-axis, respectively.

 

The values measured for X0g and Y0g correspond to the x- and y-axis offset, and compensation is done by subtracting those values from the output of the accelerometer to obtain the actual acceleration:
XACTUAL = XMEAS − X0g
YACTUAL = YMEAS − Y0g
Because the z-axis measurement was done in a +1 g field, a no-turn or single-point calibration scheme assumes an ideal sensitivity, SZ for the z-axis. This is subtracted from Z+1g to attain the z-axis offset, which is then subtracted from future measured values to obtain the actual value:
Z0g = Z+1g − SZ
ZACTUAL = ZMEAS − Z0g
The ADXL345 can automatically compensate the output for offset by using the offset registers (Register 0x1E, Register 0x1F, and Register 0x20). These registers contain an 8-bit, twos complement value that is automatically added to all measured acceleration values, and the result is then placed into the DATA registers. Because the value placed in an offset register is additive, a negative value is placed into the register to eliminate a positive offset and vice versa for a negative offset. The register has a scale factor of 15.6 mg/LSB and is independent of the selected g-range."

 

Can you please give me any help on how to do that using LabVIEW? as I am still a beginner in using it and running out of time for my project! thanks in advance

 

Albara 

0 Kudos
Message 3 of 4
(4,932 Views)

The Offset Calibration functionality is automatically taken care of by the offset registers, as the manual states: "The ADXL345 can automatically compensate the output for offset by using the offset registers (Register 0x1E, Register 0x1F, and Register 0x20). These registers contain an 8-bit, twos complement value that is automatically added to all measured acceleration values, and the result is then placed into the DATA registers."

 

If you're asking about how to read the acceleration off of the DATAx0 and DATAx1 registers, it's likely that the number you read off of them will not be the value in g's, but some number that can be correlated to the g value. Do you know what format the number that is read off the registers is? With common accelerometers, the number read off is resolution value, and you can use the range to scale that value to a meaningful number. For example, if you know that the resolution range is 50000 to -50000 and the range of the acceleration is +/- 2g, you can make a linear scale where +2g corresponds to 50k and -2g corresponds to -50k. However, I'm not clear how your accelerometer works. I would suggest reading the manual to find that information (or, for a quick test, you could just drop the device on the floor and see what value is read out from that register, as that would correspond to 1g).

0 Kudos
Message 4 of 4
(4,883 Views)