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

351 commits

Author SHA1 Message Date
Krzysztof Matula
078e7fc0a5 improved fix 2019-04-15 19:05:30 +02:00
Krzysztof Matula
e256639909 OSD timers safety checks 2019-04-15 18:57:49 +02:00
Krzysztof Matula
36c8f1e224 Flight statistics (odometer) added.
Supported counters:
- total flights count
- total flight time
- total flight distance (if GPS available)
2019-04-05 23:43:09 +02:00
Bruce Luckcuck
96ee9e3103 Unify lowpass settings regardless of whether USE_DYN_LPF is defined
Defaults will be the same regardless of whether the target has `USE_DYN_LPF` included. Previously the defaults would vary and it wouldn't be obvious why.

Defaults are as follows:
gyro lowpass 1: 150/BIQUAD
gyro lowpass 2: OFF
dterm lowpass 1: 150/BIQUAD
dterm lowpass 2: 150/BIQUAD

Nothing has changed int eh dynamic lowpass logic. If it's enabled those settings will be used in place of the static lowpass cutoff.

Needs coordination with the Configurator to change the defaults used when re-eanbling the lowpass filters as they are currently based on previous version settings and will dfault to inappropriate values.
2019-04-02 20:18:19 -04:00
Michael Keller
72d0117278
Merge pull request #7895 from etracer65/dshot_bidir_disable_dual_gyro
Disallow dual gyro in "BOTH" mode if RPM filter enabled
2019-03-31 16:08:59 +13:00
Bruce Luckcuck
3fdb0e2b2e Disallow dual gyro in "BOTH" mode if RPM filter enabled
RPM Filter currently doesn't support dual-gyro running in "BOTH" mode. Switch to the "FIRST" gyro if configured for "BOTH" and RPM filter is enabled.

Once RPM filter is updated to support dual-gyro using both sensors then this check should be removed.
2019-03-29 09:30:42 -04:00
mikeller
d16f35d9cb Fixed defaults for lowpass filters. 2019-03-28 22:58:22 +13:00
Bruce Luckcuck
c82d0dbf19 Disable dshot_bidir if motor protocol is not DSHOT or PROSHOT 2019-03-15 12:28:17 -04:00
Dave Huber
6a67972c6c Updated linked mode processing
Allows links and ranges in a single mode.
Code styling changes.
Add config validation for chained links (not allowed).
2019-02-21 14:45:52 -06:00
Michael Keller
c73a2787ee
Merge pull request #7567 from fujin/RIP-32kHz-mode
Gyro Sensors: Remove 32kHz gyro sampling mode(s) and associated code
2019-02-14 19:45:14 +13:00
AJ Christensen
4fdee6ec1c Gyro Sensors: Remove 32kHz gyro sampling mode(s) and associated code 2019-02-13 22:41:21 +13:00
Thorsten Laux
ceabd5098d disable dshot telemetry if scheduler policy not set 2019-02-12 12:54:21 +01:00
Thorsten Laux
81a514c9ac increase possible Q to 30, default Q to 10 and set scheduler optimize rate policy by default 2019-02-12 11:25:48 +01:00
Michael Keller
59ea4becb3
Merge pull request #7516 from mikeller/add_automatic_pid_profile_switching
Added battery cell count based automatic PID profile switching.
2019-02-08 09:28:07 +13:00
Michael Keller
7393d5fdac
Merge pull request #7529 from jflyper/bfdev-stronger-USE_ACC
[REFACTOR] More application of USE_ACC
2019-02-06 10:08:49 +13:00
mikeller
e121e1e92b Separated LED_STRIP parameter groups, separated out LED_STRIP status mode code. 2019-02-05 08:39:42 +13:00
jflyper
cc0e689bb5 Add USE_ACC conditionals 2019-02-04 20:37:43 +09:00
mikeller
299d96fdc7 Added battery cell count based automatic PID profile switching. 2019-02-04 13:15:43 +13:00
Michael Keller
fd297b6b2c
Merge pull request #6924 from smoriarty21/pilot_name
Pilot Name
2019-02-02 21:20:08 +13:00
mikeller
f7134580f8 Fixed missing conditional, incremented parameter group version, added
config reset.
2019-02-01 07:53:09 +13:00
mikeller
a3cf7e0cf7 Added motor output limiting per profile. 2019-01-28 00:37:00 +13:00
Michael Keller
8740e484f7
Merge pull request #7393 from kmitchel/dyn_filt_init
Allow dyn lpf to initialize if static lpf config is 0.
2019-01-21 11:32:20 +13:00
Kenneth Mitchell
f6e456cd06
Allow dyn lpf to initialize if static lpf config is 0.
Change min > max per review.

Fix missing ifdef.
2019-01-15 16:48:21 -05:00
Bruce Luckcuck
e0d81c4c2b Validate and reset invalid blackbox device selections
Since we really can't conditionally build the list of options, it's possible to select an invalid blackbox device type using CLI `set blackbox_device =`. This change validates that the selected device is included in the code and if not resets to "no logging".
2019-01-15 11:17:39 -05:00
Thorsten Laux
d441955391 more renaming to accomodate review feedback 2019-01-15 22:10:34 +13:00
Thorsten Laux
33741dce75 Add option for scheduling policy targeting constant average task rates 2019-01-15 22:10:34 +13:00
Thorsten Laux
816da6cbf5 Dshot erpm telemetry on the signal line 2019-01-03 14:42:52 +01:00
jflyper
feab0bcb81 Speed up the first boot on generic firmware 2018-12-19 16:56:31 +13:00
mikeller
53278c08f8 Fixed PID profile switching. 2018-12-15 22:53:12 +13:00
jflyper
569f0bae62 Implement configurable system clock generation
PLL-HSE working

PLL-HSI working

Move SystemCoreClockUpdate in SystemInit to end

Switching from HSI-PLL to HSE-PLL (and back) is working

It works during various levels of overclocking.

Renamed CLI variable hse_mhz to system_hse_mhz

Restored the original position of the spectrum bind code

The internal logic of the spectrum bind code will prevent binding
process to fire if executed after soft reset.

Remove stale call to delay

Add a comment about call to spektrumBind placement

Declared SystemXXXSource functions, handled sign-ness warning.

Cleaned up commented out sections

USB clock generation for F446

Default HSE value for backward compatibility

Cleaned up more unused stuff

Handle non-F4 targets

Added comment about PLL_M selection

Removed fake gyro/acc from test target
2018-11-23 15:36:10 +13:00
mikeller
2ecfb1d183 Completely drop suspension for serial RX - there is no point since we do not use preemptive multitasking. 2018-09-04 01:09:57 +12:00
Alex Wolf
7115ab4047 GPS over MSP related fixes 2018-08-31 22:31:56 -04:00
mikeller
0bce8549ee Renamed 'fc/fc_' files to remove the double 'fc'. 2018-08-26 14:07:06 +12:00
mikeller
6a77c5f576 Removed OSD_SLAVE defines. 2018-08-23 23:03:22 +12:00
Michael Keller
c12981f732
Merge pull request #6617 from etracer65/gyro_lpf_updates
Disable DLPF EXPERIMENTAL mode for MPU60x0; remove experimental support from F3
2018-08-23 22:25:48 +12:00
Bruce Luckcuck
0e8e5b3c16 Disable DLPF EXPERIMENTAL mode for MPU60x0; remove experimental support from F3
Officially Invensense lists the experimentl mode as "unsupported" on the MPU60x0 series. Previously it was added to allow testing.  It's been determined that it's not a viable gyro filtering operational mode.

Also change "experimental" DLPF support available for F4 or higher. Few F3 boards have gyros that can use this mode anyway.  Saves 200 bytes.
2018-08-22 09:50:10 -04:00
mikeller
8a72362a67 Fixed tests. 2018-08-21 00:36:47 +12:00
mikeller
6de1c32d9d Added shadow copies for CLI and MSP. 2018-08-21 00:36:47 +12:00
Bruce Luckcuck
382ad2ad8f More changes from review & rebase
Simplified disable logic to only use the feature() check in the gyro loop.

Changed 2000hz loop time constant to a define.
2018-08-01 12:20:32 -04:00
Bruce Luckcuck
25c6b038d9 Changes from review
Used HZ_TO_INTERVAL_US() instead of hardcoded 500us.

Moved tests into a dedicated function.
2018-07-31 10:37:01 -04:00
Bruce Luckcuck
f411b82eb6 Disable DYNAMIC_FILTER feature if gyro loop is less than 2KHz
The dynamic filter is not usefull with gyro loop times less than 2KHz so disable the feature and prevent the code from running in this circumstance.

In `isDynamicFilterActive()` we can't just rely on the feature because the feature will be disabled after the gyro has initialized and is running - possibly running into the underflow/wedging problem. And unfortunately we can't disable the feature earlier because we need to know the `targetLooptime` which is determined during gyro init.
2018-07-31 10:37:01 -04:00
Bruce Luckcuck
17e76e48f6 PID controller feedforward
Restructures the PID controller to decouple feedforward from D.

Cleaned up the structure of the PID controller; moved some feature-based enhancements out of the main structure.

Feedforward becomes a separate component of the PID controller and there is now:
f_pitch
f_roll
f_yaw

The default values of 60 for pitch and roll matches the default setpoint weight used in BF3.4.  Yaw previously had no setpoint weight capability so the default here needs to be discussed.  Currently it's also set to 60 and flight testing seems positive.  Feedforward on yaw adds a lot of value so I don't think we want to default to 0.  Instead we need decide on the default.

All occurences of setpoint weight have been replaced by feedforward. "setpoint_relax_ratio" has been renamed to "feedforward_transition".

The pidSum now consists of P + I + D + F.

D has been added back for yaw (disabled by default with d_yaw = 0). We've found little need for D for normal quads but it may have value for other configurations - particularly tricopters.

Updated CMS menus to support adjusting the feedforward for each axis.

Changed the default for "rc_interp_ch" to be "RPYT".  Need yaw to be smoothed to support feedforward.

Open issues:

Needs BFC support
- Need to add support for the axis "F" gains.
- Remove "setpoint weight" slider.
- Rename "D Setpoint transition" to "Feedforward transition"

Needs BBE support
- Header "setpoint_relaxation_ratio" has been renamed "feedforward_transition"
- Header "dterm_setpoint_weight" has been replaced with an array named "feed_forward_weight".
  example: H feed_forward_weight:65,60,60    (R,P,Y)
- PID component "AXISF" has been added for all axes. Should be handled like P, I and D values.
- PidSum calculation needs to include F.

Needs LUA script support
- Support the renamed "setpoint_relax_ratio".
- Support for feedforward weight on all 3 axes.

Open code issues:
- rc_adjustments.c - support for adjusting feedforward weight for all axes. Currently only supporting roll - needs coordination with BFC.
2018-07-21 10:26:23 -04:00
mikeller
3f082b569b Fixed broken targets. 2018-07-01 21:37:40 +12:00
mikeller
93ab648183 Added disabling of GPS_RESCUE when 3D is enabled. 2018-07-01 21:33:32 +12:00
mikeller
b308eef6e9 Made it more positive. 2018-07-01 19:14:31 +12:00
mikeller
fb83ea4b52 Fixed conditions for RC smoothing validation. 2018-07-01 16:35:05 +12:00
Bruce Luckcuck
5cd886017d Fix throttle angle correction when smoothing throttle; reduce processing overhead
Change the logic to not modify rcCommand directly and instead apply the additional throttle directly in the mixer.

Also move the logic to the attitude task instead of having it calculate in the PID loop. The logic relies on an angle that's only updated in the attitude task so there was no point in running the calculation every PID loop.
2018-06-28 15:56:01 -04:00
jflyper
8f65a79789 Remove RX_PARALLEL_PWM originated feature validation based on pins 2018-06-20 11:04:02 +09:00
mikeller
391d6a4185 Fixed SPRACINGF3OSD. 2018-06-05 21:43:17 +12:00
mikeller
f9cfa86378 Fixes from review. 2018-06-05 18:47:41 +12:00