Skip to content
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

switch remaining boards to new InvenSense IMU drivers #14473

Merged
merged 2 commits into from
Apr 7, 2020

Conversation

dagar
Copy link
Member

@dagar dagar commented Mar 25, 2020

A lot of this has already received testing in one form or another. This PR finally makes the switch to the new InvenSense drivers (almost) everywhere.

  • 8 kHz gyro, 4 kHz accel using FIFOs and SPI DMA (mpu6000 accel is 1 kHz)
  • significantly reduces jitter in the system (regular driver scheduling synchronized with sensor, no more timer correction fudge factor)
  • clip counters
  • sensor side DLPF completely disabled (other than mpu6000)
  • with IMU_GYRO_RATEMAX drivers can run both faster (up to 4 kHz on new boards) or slower (down to 250 Hz) while still fetching and processing all raw data (8 kHz)
    • this let's you configure the system for high performance racing setups or optionally significantly lowering cpu usage when a high rate inner loop isn't necessary
  • it's much easier to see at a glance if the sensor and driver are working correctly together
    • sensor setup and driver are internally consistent (configured ODR, data ready interrupt, etc), so if something isn't configured or operating correctly it becomes extremely obvious
  • drivers have simple data consistentcy check (duplicated accel data) that can be used to set the max SPI speed safely (eg mpu6000, mpu6500, mpu9250 capable of 20 MHz SPI, but have been limited to 10 MHz to reduce transfer errors)
  • mpu9250 mag disabled by default (it weirdly impacts the data output rate)
  • Note: in many cases the secondary IMUs are still unchanged
    • fmu-v2/v3 (lsm303d + l3gd20)
    • fmu-v5 bmi055
    • fmu-v5x bmi088
    • modalal_fc-v1 bmi088
    • holybro_durandal-v1 bmi088

TODO: board rotations + testing

@dagar dagar force-pushed the pr-new_invensense_drivers branch from 2c33be1 to ef59d62 Compare March 25, 2020 05:50
@dagar dagar requested a review from a team March 25, 2020 05:51
@dagar dagar force-pushed the pr-new_invensense_drivers branch 6 times, most recently from 7a89489 to 54ccf9b Compare March 25, 2020 15:50
@dagar dagar changed the title [WIP] switch remaining boards to new InvenSense IMU drivers switch remaining boards to new InvenSense IMU drivers Mar 25, 2020
@dagar dagar marked this pull request as ready for review March 25, 2020 15:51
@mrpollo mrpollo mentioned this pull request Mar 25, 2020
@dagar dagar force-pushed the pr-new_invensense_drivers branch 4 times, most recently from a03e332 to 827ef02 Compare March 25, 2020 20:21
@jorge789
Copy link

jorge789 commented Mar 25, 2020

Tested on PixRacer V4

Flight Card 1

Modes Tested:
Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.

Procedure:
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode.

Notes:
The vehicle continues with the same error.In altitude mode, the vehicle did not respect the height that continued to increase in pitch forward

Logs:
https://review.px4.io/plot_app?log=ee54b708-acca-41fe-9025-6aaa34ddb7de

https://review.px4.io/plot_app?log=51962f3f-cd86-4bc1-ae74-2515d7ceb3f9

Flight Card 2

Modes Tested
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.

Procedure

Armed form QGC.
Took-off on mission plan mode
. Note that commands were sent form QGC (Armed and takeoff)
Once all waypoint completed vehicle switched to RTL and landed as expected.
Note:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=282ca1ff-f02a-46e1-96bf-b7fcbddf3ff3

https://review.px4.io/plot_app?log=d5586104-f4d6-477f-8b57-f455ba7a6604

Flight Card 3

Modes Tested
Position Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC,once completed all waypoint then swith RTL.
Note:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=e7192025-8ac9-4e06-a97c-c66df95b93b0

https://review.px4.io/plot_app?log=c94cd0bd-f694-4789-ba9c-b8d302bfc045

Tested on CUAV nano V5

Flight Card 1

Modes Tested:
Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.

Procedure:
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode.

Notes:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=29b7ed00-5609-4981-8fa0-bbefae5cebbe

https://review.px4.io/plot_app?log=b37b1c05-d890-4b94-ac49-2acb707c0be1

Flight Card 2

Modes Tested
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.

Procedure

Armed form QGC.
Took-off on mission plan mode
. Note that commands were sent form QGC (Armed and takeoff)
Once all waypoint completed vehicle switched to RTL and landed as expected.
Note:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=0b75b810-8060-465e-acec-861691fa274e

https://review.px4.io/plot_app?log=71d64803-adba-4b86-a67f-c52e11aa96a0

Flight Card 3

Modes Tested
Position Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC,once completed all waypoint then swith RTL.
Note:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=b1b1c785-fbde-43fd-aed9-aea38a8034c9

https://review.px4.io/plot_app?log=b178c9d9-b05d-4cfe-bd93-38762f5710fb

@dannyfpv
Copy link

dannyfpv commented Mar 25, 2020

Tested on Pixhawk4 v5 f-450
Flight Card 1

Modes Tested:
Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.

Procedure:
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode.

Notes:
No issues noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=088b7b0a-9cdb-4aaf-a93c-fe10a1164f44
https://review.px4.io/plot_app?log=a878b84f-84a8-47c8-ad46-7ddf101540ef

Flight Card 2

Modes Tested
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.

Procedure

Armed form QGC.
Took-off on mission plan mode
. Note that commands were sent form QGC (Armed and takeoff)
Once all waypoint completed vehicle switched to RTL and landed as expected.
Note:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=8e5db87e-7c22-4d68-a577-6166e23fc115
https://review.px4.io/plot_app?log=39427796-3d93-4096-a957-bae736c61e8b

Flight Card 3

Modes Tested
Position Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC,once completed all waypoint then swith RTL.
Note:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=574ff5fa-6e61-452b-a9b0-feb3068a746c
https://review.px4.io/plot_app?log=6c74ed67-6d2c-43ec-b53d-139942b818dc

@dannyfpv
Copy link

Tested on Pixhawk4 mini v5 f-500
Flight Card 1

Modes Tested:
Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.

Procedure:
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode.

Notes:
The vehicle continues with the same error.In altitude mode, the vehicle did not respect the height that continued to increase in pitch forward

Logs:
https://review.px4.io/plot_app?log=d3043466-82e7-4aea-8aac-95a473d0eac7
https://review.px4.io/plot_app?log=6c7ca5a3-1228-47b5-97a2-876a41cf55da

Flight Card 2

Modes Tested
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.

Procedure

Armed form QGC.
Took-off on mission plan mode
. Note that commands were sent form QGC (Armed and takeoff)
Once all waypoint completed vehicle switched to RTL and landed as expected.
Note:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=5bcef2b4-6ef2-46ee-b745-b066de9ebd1c
https://review.px4.io/plot_app?log=6e9a490f-199a-4e63-8572-539f323f0aeb

Flight Card 3

Modes Tested
Position Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC,once completed all waypoint then swith RTL.
Note:
No issues were noted, good flight in general.

Logs:
https://review.px4.io/plot_app?log=e2e18799-5dd4-46f3-983f-8cf78216a6d1
https://review.px4.io/plot_app?log=ddde8f43-bd02-4edc-8f66-26f2894e4e3b

@@ -46,8 +46,8 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIDevice(DRV_GYR_DEVTYPE_L3GD20, SPI::CS{GPIO::PortB, GPIO::Pin2}, SPI::DRDY{GPIO::PortE, GPIO::Pin14}),
initSPIDevice(DRV_ACC_DEVTYPE_LSM303D, SPI::CS{GPIO::PortD, GPIO::Pin11}),
initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortC, GPIO::Pin15}),
initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin3}, SPI::DRDY{GPIO::PortC, GPIO::Pin0}),
initSPIDevice(DRV_IMU_DEVTYPE_MPU6500, SPI::CS{GPIO::PortE, GPIO::Pin3}, SPI::DRDY{GPIO::PortC, GPIO::Pin0}),
initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin3}, SPI::DRDY{GPIO::PortE, GPIO::Pin10}),
Copy link
Member Author

@dagar dagar Mar 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rolandash could you review this part? I tested it on the small mindpx quad I have (with an mpu6500) and it was working (including the data ready interrupt).

@limhyon
Copy link
Contributor

limhyon commented Apr 3, 2020

Tested with IFO-S, works ok. Board rotation is right as you commited.

@dagar dagar force-pushed the pr-new_invensense_drivers branch 2 times, most recently from 3b26711 to d021754 Compare April 7, 2020 03:01
@dagar dagar force-pushed the pr-new_invensense_drivers branch from d021754 to 6abc3e1 Compare April 7, 2020 03:35
@dagar dagar added the Drivers 🔧 Sensors, Actuators, etc label Apr 7, 2020
@dagar dagar requested a review from bkueng April 7, 2020 03:35
@dagar dagar merged commit 4e0441a into master Apr 7, 2020
@dagar dagar deleted the pr-new_invensense_drivers branch April 7, 2020 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants