1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 19:10:32 +03:00
Commit graph

13 commits

Author SHA1 Message Date
Kevin Plaizier
078ffafec1
Add 3+ IMU support (Gyro Fusion) (#14383)
* Allow for 3 gyros to be fused at once.

* Handle the case where no GYRO_COUNT is defined

* Fix accel init bug

* Fix bugs found by AI

* Fix compile time assert message

* Move to picking which IMU you want to enable, allow IMU that have the same scale and looprate to run together even if they aren't identical IMU.

* Fully support 8 IMU

* Fix suggestions, except for MSP all suggestions

* Fix bugs found by AI

* Update gyro_init

* Fix unit tests (feels wrong though)

* Allow MSP to update all gyro alignment

* resolve comments

* Only auto set up to 4 gyros in a config.

* Update MSP implementation

* Fix divide by 0 error

* Update src/main/target/common_post.h

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* Handle case where gyro 1 does not exist

* Fix 426XX driver

* fix = logic in if statement

* Update src/main/msp/msp.c

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* Update src/main/drivers/accgyro/accgyro_spi_icm426xx.c

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* Apply ledvinap suggestions

* Fix detectedSensors initialization

* fix getGyroDetectedFlags

* Automatically handle GYRO_COUNT for up to 4 IMU

* better handle unit tests

* Backwards compatible with older config.h files

* Update src/main/sensors/gyro_init.c

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* Update src/main/target/common_pre.h

Co-authored-by: nerdCopter <56646290+nerdCopter@users.noreply.github.com>

* Update src/main/sensors/gyro_init.c

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* Update src/main/sensors/gyro.c

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* This needs to be the case or unit tests fail, without this we cannot choose default gyro either.

* ledvinap suggestions

* whitespace

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
Co-authored-by: nerdCopter <56646290+nerdCopter@users.noreply.github.com>
2025-06-23 21:35:11 +02:00
Mark Haslinghuis
c188a03beb
Fix missing ACCGYRO custom alignment defines (used in config) (#14092) 2025-01-18 06:37:26 +11:00
cvetaevvitaliy
715c1671a8
Add support external clock for gyro ICM42688P (#13912) 2024-10-24 06:49:18 +11:00
J Blackman
799e0c1e50
FIX: Multi gyro and SDIO hard fault (#12446) 2023-03-04 12:43:25 +11:00
J Blackman
fbca7f06f3
Remove GYRO defines from common_post_defaults (#12406) 2023-02-27 20:59:47 +11:00
J Blackman
c4ab98258e
FIX: Multi-gyro enabled but not configured at compile time. (#12404) 2023-02-22 22:36:18 +01:00
Steve Evans
87c8847c13 New SPI API supporting DMA
Call targetConfiguration() once before config is loaded and again afterwards in case the config needs to be changed to load from SD card etc

Drop SPI clock during binding

Remove debug

Add per device SPI DMA enable

Fix sdioPinConfigure() declaration warning

Reduce clock speed during SPI RX initialisation
2021-07-25 12:40:25 +12:00
Bruce Luckcuck
3da40f7ec3 Fix default axis values for arbitrary gyro alignment
Prevents clean installs from displaying the sensor alignment as changed values in the `diff`.

Sets the default values for the sensor alignment axes to match the selected sensor alignment. Previously the axis values defaulted to 0 so when the active value was set based on the sensor alignment these values would appear as changes in the `diff` even though they were actually the default values. Corrected the default values to be based on the selected sensor alignment default.
2019-07-29 17:19:46 -04:00
Dominic Clifton
980df1536f Refactored arbitrary gyro and mag alignment.
The original implementation:

* removed the old 'alignment' variable
* did not require 'ALIGN_CUSTOM'
* always used rotation matrix
* had no additional per-pid-loop conditional logic.

Extract currently unused code into tests.
In preparation for either deleting or re-using in validateAndFixConfig.

Fix code style of some old boardalignment code.

De-duplicate vector rotation code.

Now that rotation code is exacted from `alignBoard` and now  doesn't use
`boardRotation` some if it was similar to the code in `rotateV` in
maths.c

Use DECIDEGREES for mag and gyro/acc custom alignments.

Use unnamed structure instead of `values`.

Redefine what 'custom' orientation means.

Move alignment test-only code into the tests.

Ensure gyro/mag custom alignment settings follow the enum variations.

This can't be applied to ALIGN_DEFAULT because, in the case of the MAG,
the default isn't actually known until the gyro is detected, see
`compassDetect`.

OMNIBUSF4/F7 - Don't use ALIGN_DEFAULT in target.h,
common_defaults_post.h does this now.

Comment cleanup.

Delete unused alignment code left from various tests/refactoring
efforts.

* Please do not squash this commit.

Fix SITL build by avoiding structure assignment with anonymous inner
struct.

The error from the build server was as follows:

```./src/main/common/sensor_alignment.c:49:5: error: missing initializer
for field ‘yaw’ of ‘struct <anonymous>’
[-Werror=missing-field-initializers]
     *sensorAlignment = CUSTOM_ALIGN_CW0_DEG;
     ^
In file included from ./src/main/common/sensor_alignment.c:27:0:
./src/main/common/sensor_alignment.h:80:17: note: ‘yaw’ declared here
         int16_t yaw;
                 ^
```

Cleanup sensor_alignment API.
2019-07-13 11:51:20 +12:00
MJ666
3ca69b7b53 Update STM32F7X2 generic target
Add more sensor drivers
Update NERO.config
Add ALIENFLIGHTNG F7 generic target config
Add AlienFlightNG F7 Dual generic config
2018-12-16 08:40:30 +01:00
mikeller
c927a65024 Fixed define dependency of gyro device parameter group, gyro EXTI CLI support. 2018-11-27 22:20:04 +13:00
jflyper
9ef9f98310 Various fixes based on mikeller's comment. 2018-09-10 17:55:55 +09:00
jflyper
fc6c24c38e Configurable acc/gyro 2018-09-10 17:55:52 +09:00