I am trying to read the linear velocity measurements from the ADIS16480 which are internally derived from the accelerometer values. My ADIS16480 is connected through a custom built interface board to a BeagleBone Black (running Angström) and I am using the SPIDEV driver to control the SPI bus.
I can read the product_id, attitude and accelerometer values fine, but when I read the line X_DELTVEL_OUT register (and its y,z neighbours) the values seem to be 'stuck' in between 0xffff to 0x0009. After converting to m/s I get values around the -0.006m/s (0xffff). The graph shows the output after letting it sit for a while and then moving it up and down once quickly. There is basically no change in velocity for small movements.
I am using the following code to convert the 2's complement into a float:
<code>
if(x_vel_raw & BITMASK_TEST_2s_NEG){ //if number is negative
x_vel_raw = ~x_vel_raw;
x_vel_raw = x_vel_raw + 1;
*x_vel = (-1)* ((double) x_vel_raw) * LINEAR_VEL_COUNT_TO_mpsec; //convert it to m/s
}else{
*x_vel = (double) x_vel_raw * LINEAR_VEL_COUNT_TO_mpsec; //convert it to m/s
}
</code>
My raw data output from a similar test as the figure above can be found in the attached file.
----
Are there any prerequisites to using the delta_vel data? Do I need to set a value >0x0000 for the decremention rate (DEC_RATE)?
How do I get proper values out of these registers?
Thanks a lot,
Rapha