-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
STMicro LSM6DSV16X IMU support #13046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Do you want to test this code? You can flash it directly from Betaflight Configurator:
WARNING: It may be unstable. Use only for testing! |
AUTOMERGE: (FAIL)
|
// TODO this pulse lasts 66us followed by a low of 66us, so we get 132us cycle time, not 125us | ||
spiWriteReg(dev, LSM6DSV_CTRL4, LSM6DSV_CTRL4_DRDY_PULSED); | ||
|
||
gyro->scale = GYRO_SCALE_2000DPS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the data sheet (section 4.1 symbol G_So) the LSM6DSV16X should use a sensitivity of 70 milli-degrees / LSB.
IIRC GYRO_SCALE_2000DPS
is about 63.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting observation. Thank you.
2000 / 0x8000 = 0.061 deg/LSB. So that would be the ideal.
From https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf I see that the MPU6000 has a figure of 0.066, for example, but no other driver set this figure according to their datasheet.
#define GYRO_SCALE_2000DPS (2000.0f / (1 << 15))
That said I've set the scale for this device according to the datasheet and will raise a PR to improve calibration for all others.
On a similar note the acc has a sensitivity of 0.488 mg/LSB with FS = ±16 g. 0x8000 * 0.488/1000 = 15.99, so that is not in need of special consideration.
#define LSM6DSV_DECODE_BITS(val, mask, shift) ((val & mask) >> shift) | ||
|
||
// Enable embedded functions register (R/W) | ||
#define LSM6DSV_FUNC_CFG_ACCESS 0x01 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(multiple occurrences of) nonaligned indentation 👾
I reckon @KarateBrot will complain too 😛
Isn't the highest supported data rate supposed to be 7.68 kHz / ~130 us (section 4.1, symbol G_ODR)? O a'm I missing something? |
6154665
to
0c67c4f
Compare
See section 6.5, High-accuracy ODR mode. |
im getting some aios next week @SteveCEvans that have this gyro.. what do we do about the ODR mode |
Hi,Don’t quite understand the question. The ODR is 7.68kHz.SteveOn 29 Nov 2023, at 00:52, SugarK ***@***.***> wrote:
im getting some aios next week @SteveCEvans that have this gyro.. what do we do about the ODR mode
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@SteveCEvans if this is good to go we should merge it now so it’s in rc1 and mess with the ODR modes if needed in the next RC. As far as I know there are no production hardware using the gyro and only the team have any usable hardware that they should receive in the next week or so |
0c67c4f
to
eddd6ff
Compare
Add support for LSM6DSV16X
Add support for LSM6DSV16X
This PR adds support for the STMicro LSM6DSV16X IMU.
Filter settings are at default and may need adjustment.
Outstanding issue is that use of the High-accuracy ODR mode should enable selection of 8kHz gyro data rate, however use of the
DRDY_PULSED
bit in theCTRL4
register results in a pulse of 66us followed by a low of 66us which gives a cycle time of 132us rather than the desired 125us.Driver developed using a MATEKH743 with the following config.h changes.