1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 09:16:07 +03:00
Commit graph

172 commits

Author SHA1 Message Date
Petr Ledvina
141d6ec30a Higher-order gyro filter (#5257)
* Implement nth order Butterworth

Uses biquad sections

* Purge RC+FIR2

* Add butterworth LPS as gyro filter

Replaces RC+FIR

* Make FKF code conditional

* Add USE_FIR_FILTER_DENOISE

Denoise is almost useless anyway ...
2018-03-15 01:45:20 +13:00
adrianmiriuta
3855d254b0 move from CALIBRATING_GYRO_CYCLES to CALIBRATING_GYRO_TIME ... absolu… (#5320)
* move from CALIBRATING_GYRO_CYCLES to CALIBRATING_GYRO_TIME ... absolute calibration time

* DieHertz requested changes

* cleanup indentation
2018-03-04 11:46:15 +13:00
Dominic Clifton
cde9a9517b SPRacingF7DUAL - Dual SIMULTANEOUS gyro support. (#5264)
* CF/BF - Set STM32F7 SPI FAST clock to 13.5Mhz - Gyros not stable at
27mhz.

* CF/BF - Initial SPRacingF7DUAL commit.

Support two simultaneous gyro support (code by Dominic Clifton and Martin Budden)
There are new debug modes so you can see the difference between each gyro.

Notes:
* spi bus instance caching broke spi mpu detection because the detection
tries I2C first which overwrites the selected bus instance when using
dual gyro.
* ALL other dual-gyro boards have one sensor per bus.  SPRacingF7DUAL is has two per bus and thus commit has a lot of changes to fix SPI/BUS/GYRO initialisation issues.

* CF/BF - Add SPRacingF4EVODG target.

This target adds a second gyro to the board using the SPI pads on the back of the board.

* CF/BF - Temporarily disable Gyro EXTI pin to allow NEO target to build.
2018-03-04 11:29:31 +13:00
Dominic Clifton
c7f7846d39 Use GYRO_1/2 defines instead of GYRO_0/1 to make things less confusing. (#5274) 2018-03-04 02:00:28 +13:00
Bruce Luckcuck
e9686c0ef8 Change gyro_overflow_detect to use filtered instead of raw gyro data - 2nd try
Noise and momentary spikes in gyro data (particularly in 32K mode) were causing false triggering of the gyro overflow detection. Changing to using filtered instead of raw gyro data eliminates the false triggering.

Also adjusted the trigger and reset rates slightly (approx. 1950dps and 1850dps respectively).

Fixed bug for gyros that may not be +-2000dps full scale. The trigger threshold will be 97.5% full-scale and reset at 92.5% (corresponds to 1950 and 1850 for 2000dps gyros).
2018-02-22 18:56:15 -05:00
Bruce Luckcuck
9ea965c549 Add gyro rate checking to runaway takeoff activation to improve bench testing
Changed the triggering phase so that in addition to the pidSum needing to exceed runaway_takeoff_threshold, the gyro rate on any axis must exceed a threshold value to indicate the quad is actually moving. The threshold for the yaw axis is much higher since the torque of the motors can still yaw the craft without props.
2018-02-19 17:22:04 -05:00
Michael Keller
e5364ee764
Revert "Change gyro_overflow_detect to use filtered instead of raw gyro data" 2018-02-18 09:25:04 +13:00
Bruce Luckcuck
b49a9ec928 Change gyro_overflow_detect to use filtered instead of raw gyro data
Noise and momentary spikes in gyro data (particularly in 32K mode) were causing false triggering of the gyro overflow detection.

Also adjusted the trigger and reset rates slightly (approx. 1950dps and 1850dps respectively).

Optimized the gyro loop slightly by eliminating 3 floating point multiplies.

Fixed bug for gyros that may not be +-2000dps full scale.
2018-02-14 17:50:09 -05:00
AJ Christensen
4dd65a2876 Biquad RC+FIR2: Allow user to specify cutoff Hz parameter directly
* Generate 'k' per the code for the PT1
* Adjust function prototypes/functions to accept f_cut/dT where applicable
* Adjust gyro configuration, parameter group, interface settings to suit
2018-02-14 12:09:49 +13:00
Adrian Miriuta
b21d681153 Introduced cli parameter <gyro_offset_yaw>
It allows to manually compensate gyro drift over time.
rebased squashed.
2018-01-25 12:45:38 +01:00
AJ Christensen
17bd318ec1 Biquad RC+FIR2 Filter: Prototype of ledvinap's suggestion on #4890
https://github.com/betaflight/betaflight/pull/4890#issuecomment-356636997
2018-01-16 15:37:19 +13:00
Kalyn Doerr
6e6aafe6d5 Fast Kalman Gyro Filter: Implementation and parameter groups only
Signed-off-by: AJ Christensen <aj@junglistheavy.industries>
2018-01-08 08:15:20 +13:00
Martin Budden
3125ae252b Tidied gyro filter code 2018-01-03 12:27:53 +00:00
Martin Budden
7af079d5a7 Added gyro unit test 2017-12-29 12:04:05 +00:00
Martin Budden
671382234a Enabled switch fallthrough checking by compiler 2017-12-23 19:46:40 +00:00
Martin Budden
2281c9ab8c Add option to check gyro overflow on yaw or all axes 2017-12-23 16:51:08 +00:00
Martin Budden
eccdf2d4a5 Set gyro overflow checking default to true (#4826) 2017-12-23 18:47:56 +03:00
Bruce Luckcuck
96f0cff924 Changed slew filter to work for all axis instead of just yaw. 2017-12-22 12:17:27 -05:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
Martin Budden
b26ff88fd9 Added gyro overflow checking and handling. Helps avoid YSTTM 2017-12-18 05:21:02 +00:00
Michael Keller
82e289c1eb
Merge pull request #4770 from martinbudden/bfa_gyro_sync
Moved gyro_sync into drivers/accgyro directory
2017-12-18 15:58:35 +13:00
Martin Budden
ed30e9f5c7 Moved gyro_sync into drivers/accgyro directory 2017-12-17 16:01:50 +00:00
Martin Budden
0153b1d369 Changed gyro integration to use trapezium rule 2017-12-17 13:24:09 +00:00
Martin Budden
a33a82725e Add fast RAM support, CCM or TCM depending on processor 2017-12-16 17:42:35 +00:00
Martin Budden
12640972a9 Preparation for using instruction cache on F7 2017-12-15 10:07:19 +00:00
Martin Budden
c0b1572175 Fix to acc gyro accumulation code 2017-11-28 16:04:00 +00:00
Martin Budden
22c672fa7d Add acc and gyro accumulators to improve attitude estimation 2017-11-28 06:26:57 +00:00
mikeller
814597ae9f Enabled gyro slew filter for gyros using the MPU6500 driver (needed for ICM20608G). 2017-10-21 13:15:43 +13:00
mikeller
c9e8bae51d Fixed beeping for 'gyro_cal_on_first_arm'. 2017-09-10 13:55:56 +12:00
Martin Budden
fb04fb1216 Remove gyro runtime slew filter check 2017-09-08 13:13:34 +01:00
Martin Budden
cbaad53c46 Do runtime check for gyro slew filter 2017-09-08 00:14:30 +01:00
Martin Budden
534b447b6f Remove gyro overflow protection on MPU6500 and MPU9250 2017-09-07 21:55:24 +01:00
Martin Budden
2f674972e3 Merge pull request #4087 from martinbudden/bf_pg_versions
Update PG version numbers
2017-09-07 21:49:57 +01:00
Martin Budden
c97c8998b1 Update PG version numbers 2017-09-07 21:35:37 +01:00
gke
13308883b2 Yaw rate change limiter solution for YTTM (#4058) 2017-09-07 14:07:07 +01:00
brianlbalogh
b295a159b0 Add gyro rates and configurable FSR for ICM20649 (#4077) 2017-09-07 14:05:11 +01:00
Brian Balogh
afec0258c7 Add support for ICM-20649 acc/gyro 2017-09-01 10:57:54 -04:00
Martin Budden
4e68bc5895 Fixed gyro debug output 2017-08-30 23:45:37 +01:00
Martin Budden
c103e3074e Fix gyro debug raw initialisation 2017-08-29 05:38:20 +01:00
Martin Budden
6c0f147040 Improved gyro update efficiency when debug off 2017-08-28 09:12:50 +01:00
Martin Budden
ee1e008a80 Added gyro raw output debug mode 2017-08-28 08:21:55 +01:00
Martin Budden
ef00cc45cf Changed DEBUG_NOTCH to record unfiltered gyro output (#3965) 2017-08-27 07:45:22 +01:00
Steffen Windoffer
25e9270395 remove unused gyro isr setting 2017-08-10 12:21:13 +02:00
Martin Budden
6e52b82e1c Check if notch cutoff is zero in filter init 2017-08-01 09:23:22 +01:00
jflyper
a88729b4df Minor touch up on gyro.c 2017-07-16 03:38:26 +09:00
jflyper
52d447d2ef Configurable baro (BMP280)
- busDevice_t is now has a discriminator.
- busDevice_t is added to baroDev_t.
- BMP280 I2C and SPI drivers are consolidated.
2017-07-15 18:05:56 +09:00
Martin Budden
1bd7afc902 Renamed gyroSensor0 to gyroSensor1 2017-07-12 16:22:05 +01:00
Martin Budden
3d4f0bb137 Whitespace tidy 2017-07-05 06:36:22 +01:00
mikeller
67acc6c7ec Added beeps to indicate the reason for arming being disabled. 2017-07-04 01:38:04 +12:00
Martin Budden
23f158913e Moved time functions out of system.h into time.h 2017-05-26 14:03:28 +01:00