1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00
Commit graph

150 commits

Author SHA1 Message Date
joelucid
ee8daac41d ITerm rotation (#5469)
* ITerm rotation

* address requested changes

* now counting up

* scale errors according to Ki while rotating

* iterm_rotation profile setting

* revert to non scaled version, style related fixes

* Triggering a CI build.
2018-03-26 10:50:21 +13:00
joelucid
efda704ee5 Throttle boost (#5508)
* throttle boost which temporarily boosts throttle in both directions to improve response

* fix comment and use pt1FilterGain

* incorporate review suggestions

* incorporate review suggestions

* use float constant to avoid double promotion

* formatting changes

* formatting change

* hopefully last style changes
2018-03-25 11:33:22 +13:00
ctzsnooze
ab231b7c84 Second dterm pt1 (#5458)
* Second PT1 on DTerm

This PR replaces the default biquad filter with a second PT1 set to
200Hz.

Basically allows the user to enable a second, set point configurable,
PT1 type first order low-pass filter on DTerm.

This is useful because most noise in most logs arises from D, not P.

The default is set to on, at twice the normal Dterm setpoint.  This
provides greater Dterm cut than a single PT1, and twice the steepness
of cut above the second setpoint.  Modelling shows significant
reductions in higher frequency Dterm noise with only minor additional
delay.

The improvement in noise performance will be less than for biquad, but
the delay is considerably less.

If with the default settings the overall noise improves a lot, it may
be possible bring D both filtering set points to higher numbers (e.g.
140/280), or alternatively remove other filters such as the notch
filters, while maintaining an adequate level of control over noise.

* Update names, old defaults, fix whitespace

Defaults restored to biquad with second PT1 off.  ‘lpf’ retained as
abbreviation for values, otherwise generally remove ‘Filter’ where
redundant, replace ‘FilterLpf’ with ‘Lowpass’, etc, thanks Fujin and
DieHertz

* Remove underscore in lowpass_2, add hz to setpoint for lowpass

Thanks DieHertz

* completed replacing lpf with lowpass, added _hz to all lowpass set points in profile

Thanks DieHertz

* fix whitespace

fixed whitespace in settings.c

* whitespace attempt #57

* change lpf to lowpass where appropriate elsewhere

Note did not change OSD abbreviations, they are still LPF, and did not
change gyro_lpf anywhere.

* second attempt at a simple PT1 implementation

Basically copied from the DtermNotch implementation

* Second PT1 on DTerm

This PR replaces the default biquad filter with a second PT1 set to
200Hz.

Basically allows the user to enable a second, set point configurable,
PT1 type first order low-pass filter on DTerm.

This is useful because most noise in most logs arises from D, not P.

The default is set to on, at twice the normal Dterm setpoint.  This
provides greater Dterm cut than a single PT1, and twice the steepness
of cut above the second setpoint.  Modelling shows significant
reductions in higher frequency Dterm noise with only minor additional
delay.

The improvement in noise performance will be less than for biquad, but
the delay is considerably less.

If with the default settings the overall noise improves a lot, it may
be possible bring D both filtering set points to higher numbers (e.g.
140/280), or alternatively remove other filters such as the notch
filters, while maintaining an adequate level of control over noise.

* Rebase

* Remove underscore in lowpass_2, add hz to setpoint for lowpass

Thanks DieHertz

* completed replacing lpf with lowpass, added _hz to all lowpass set points in profile

Thanks DieHertz

* fix whitespace

fixed whitespace in settings.c

* whitespace attempt #57

* change lpf to lowpass where appropriate elsewhere

Note did not change OSD abbreviations, they are still LPF, and did not
change gyro_lpf anywhere.

* second attempt at a simple PT1 implementation

Basically copied from the DtermNotch implementation

* Whitespace fix - thanks, Ledvinap

* Fix PG issue

by moving added dterm_lowpass2_hz to bottom of struct

* Got rid of redundant indirection

* Fixed indentantion shifts
2018-03-21 01:40:23 +13:00
Bruce Luckcuck
449f5f2f5c Runaway Takeoff remove unneeded parameters and enhance deactivate logic
Removed parameters runaway_takeoff_threshold (hardcode to 60) and runaway_takeoff_activate_delay (hardcode to 75).  The previous default values worked well and required no tuning.

Enhance the deactivate logic to remove the R/P/Y stick activity condition once throttle reaches 2X runaway_takeoff_deactivate_throttle_percent.  Additionally reduce the runaway_takeoff_deactivate_delay by 50% when throttle exceeds 75%.
2018-02-27 19:22:33 -05:00
Bruce Luckcuck
a32b05c284 Initial implementation of Runaway Takeoff Prevention (anti-taz)
Detects runaway pidSum values on takeoff and auto-disarms to prevent the "Tasmanian Devil" caused by incorrect props, wrong motor order/direction, incorrect flight controller orientation, etc.  After a successful takeoff and normal flight is detected the feature is disabled for the remainder of the battery.
2018-01-31 07:36:16 -05:00
Bruce Luckcuck
fba0b2cea3 Optimze pidSum calculation by storing the value rather than recalculating in multiple places.
Saves 72 bytes. Will save at least that additionally when incorporated into Runaway Takeoff Prevention (which also calculates the pidSum in two places).

Additionally adds a slight performance improvement by not repeating the floating point additions to calculate the pidSum in multiple places.  Effectively replaces 2 calculations with 1 (4 with 1 with Runaway Takeoff Prevention).
2018-01-30 09:58:41 -05:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
Martin Budden
9060ecb302 Reset ITerm on motor reversal 2017-12-01 07:06:20 +00:00
Blaine
9556ea6bf5 Squash and rebase 2017-10-18 00:38:13 -07:00
Martin Budden
a983f4b325 Tidy use of USE_OSD_SLAVE 2017-10-09 13:30:26 +01:00
Martin Budden
c1a99817f4 Minor tidy of PID code 2017-09-09 07:03:15 +01:00
Martin Budden
0485d5ece7 Merge pull request #4013 from martinbudden/bf_anglelimit
Fix to angle mode limit
2017-09-03 20:02:55 +01:00
Martin Budden
e3a921b762 Merge pull request #3636 from basdelfos/copy-profile
Copy profile to another profile (MSP and OSD)
2017-08-31 19:59:08 +01:00
Martin Budden
877c82bc3f Fix to angle mode limit 2017-08-30 09:52:07 +01:00
Martin Budden
f8faf242fa Added ITerm limit 2017-08-23 15:16:14 +01:00
Martin Budden
cd757c8a89 Use crash detection to limit yaw 2017-08-23 07:12:33 +01:00
Martin Budden
be8391e3db Add gyro yaw limit 2017-08-23 07:12:33 +01:00
Bas Delfos
d32abc69f8 Copy profile to another profile (CLI, MSP and CMS) 2017-07-29 22:10:14 +02:00
Martin Budden
d180266f7d Improved rx, failsafe and pid structure alignments 2017-07-29 17:35:43 +01:00
Vidalcris
69f4008944 Crash Recovery Delay - Against false positive. (#3640)
Delay detection setting - crash_delay added.
2017-07-29 06:37:02 +01:00
Martin Budden
1ee034c38a Added setpoint check to crash detection 2017-07-23 07:10:14 +01:00
Martin Budden
6869d78941 Better structure alignment to avoid padding 2017-07-18 11:32:05 +01:00
Martin Budden
71546410de Rearrange PID array to be array of PIDs 2017-05-06 11:06:47 +01:00
ethomas999
8167892604 Added horizon_tilt_effect command
and horizon_tilt_expert_mode command.
Modified 'calcHorizonLevelStrength()' function.
Changed 'd_level' (D8[PIDLEVEL]) default from 100 to 75
Added horizon static float vars
2017-04-12 10:41:54 -04:00
Martin Budden
a9bb3fb8f6 Merge pull request #2783 from martinbudden/mb_crash_recovery
Added experimental crash detection and recovery
2017-04-12 07:57:52 +01:00
Hydra
be063ebbbf CF/BF - Remove usage of USE_FC based on PR discussion decisions. Add
USE_VIRTUAL_CURRENT_METER.
2017-04-12 00:39:27 +01:00
Hydra
2b1dac4c6d CF/BF - First cut of allow building of the OSD SLAVE board without all
the flight controller code.

Likely the dependencies can be further improved.  This is a
minimal-impact solution while there are a lot of other Betaflight PR's
still pending.
2017-04-12 00:39:27 +01:00
Martin Budden
1dc5f88820 Added crash detection and recovery 2017-04-11 22:58:18 +01:00
Michael Keller
9c29475ba4 Changed float parameters to int16 in 'cli.c'.
Fixed buffer length used for 'ftoa'.

Got rid of magic numbers, replaced 'digitalIdlePercent' with 'digitalIdleValue'.
2017-04-10 13:11:01 +12:00
borisbstyle
6899c66a05 Add anti gravity as feature and mode
3.1.7 mergebacks
2017-04-05 15:27:52 +02:00
Martin Budden
f1ce19167f Converted target config.c files to PG - PG CLI 6 (#2578)
Converted CLI and target config.c files to PGs
2017-03-08 23:26:37 +00:00
Martin Budden
9e4de2ea3b Added separate yaw pidsum limit 2017-03-07 11:25:21 +00:00
Martin Budden
aa561d542b Updates to support parameter groups 2017-03-06 13:48:14 +00:00
Martin Budden
5e5fc09b1d Added PG config definitions 9 2017-02-27 08:43:17 +00:00
Martin Budden
7ae57eb8cf Added PG config definitions 8 2017-02-27 07:25:48 +00:00
Martin Budden
051c9cca48 Moved rate profiles out of pid profiles 2017-02-24 23:25:43 +00:00
Martin Budden
4c435fccae Preparation for conversion to parameter groups 6 2017-02-15 08:05:37 +00:00
borisbstyle
ecb104b1f1 Merge branch 'master' into patch_v3.1.4 2017-02-07 13:47:12 +01:00
borisbstyle
89527df273 Simplify anti gravity 2017-02-07 10:26:21 +01:00
blckmn
9f17bae3e4 Fixed possible pid process denom exceeding allowed values 2017-02-06 16:06:49 +01:00
Martin Budden
f6c8319361 Removed a number of static config pointers 2017-02-02 10:41:19 +00:00
Martin Budden
79d4b2146d Preparation for conversion to parameter groups 2017-02-01 08:46:19 +00:00
borisbstyle
a112c1d7d0 Separate fc_core.c from RC processing 2017-01-30 23:46:04 +01:00
borisbstyle
cf04294f70 Prevent ItermAccel and windup to clash with each other 2017-01-30 15:02:10 +01:00
borisbstyle
ad892400e5 Cleanup and optimize new anti windup // Simplify relaxFactor to Dterm 2017-01-29 02:35:11 +01:00
Martin Budden
9dfb3e45ee Add ITerm anti-windup based on motor output saturation
Added noise threshold for PID ITerm accumulation

Removed ITerm setpoint scaler. Added CLI and MSP settings

Made default ITerm noise threshold zero. Added CLI setting.

Removed itermWindupPointPercent from MSP
2017-01-29 01:30:35 +01:00
borisbstyle
38abced6a9 Fix truncated blackbox logging by restoring PID scale 2017-01-24 22:33:18 +01:00
borisbstyle
093115a2a0 Add anti_gravity_gain // new defaults 2017-01-19 00:00:33 +01:00
mikeller
005731cfe5 Adjusted PID scaling for the servo mixer. 2017-01-14 01:23:55 +13:00
Martin Budden
d8faab6539 Minor optimisations to PIDLOOP 2017-01-08 11:50:43 +00:00