2024-11-18 05:45 PM
Hi all
I am trying to debug an issue at work where we use the LSM6DSV accel/gyro IMU chip and I am running into a little problem
The result registers for the accelerometer and gyroscope both say that they return a 16-bit two's complement result, and I get the following
Gyro / Accel | Raw unsigned value (LOW | (HIGH << 8)) | Two's complement value (Signed) | Result (mG or mDPS) |
Accelerometer X | 65524 | -12 | -0.732 |
Accelerometer Y | 13347 | 13347 | 814.167 |
Accelerometer Z | 111 | 111 | 6.771 |
Gyroscope X | 32772 | -32764 | -143342.5 |
Gyroscope Y | 32764 | 32764 | 143342.5 |
Gyroscope Z | 37149 | -28387 | -124193.125 |
My system is sitting very still and on a somewhat level surface. The accelerometer seems correct. For a value close to 0, we see the unsigned value close to 0 or very high around 65535 which is what I would expect.
The gyroscope values for a zero rate I would expect to also be similar given the datasheet says this "The value is expressed as a 16-bit word in two’s complement"
My basic thinking is that these are expressed as a 15-bit word in two's complement.
I have double checked that the device is indeed an LSM6DSV chip as the WHOAMI register returned a value of 0x70
Just for additional reference, the gyro is configured in
high performance, 120Hz ODR and the sensitivity is set to 125 DPS
Any help would be much appreciated