1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00
Commit graph

69 commits

Author SHA1 Message Date
Bruce Luckcuck
ab0e1260be Launch Control: increase throttle trigger percent max to 90
Per user request. Apparently the previous max of 50% wasn't providing agressive enough launches for some users.
2018-12-08 11:25:28 -05:00
Bruce Luckcuck
9830681158 Add throttle limit settings to CMS
There have been a number of requests for this as it seems to be common for racers to tune these values and adjust the settings as they become more comfortable with a track. Previously the settings could only be adjusted in the CLI and required a computer. Adding them to the CMS makes it easy to adjust in the field.
2018-11-23 09:25:00 -05:00
mikeller
570a0f7882 Changed RC rate minimum to be 0.01. 2018-11-05 23:27:42 +13:00
Bruce Luckcuck
b723d2976d Changes from review and add unit tests
Stylistic updates and add tests to the PID unit tests to verify launch control behavior
2018-10-30 18:14:49 -04:00
Bruce Luckcuck
e4dc93b128 Launch Control
Adds a race start assistance system that allows the pilot to pitch forward and then release the sticks with the quad holding position for the race start.
2018-10-27 11:50:37 -04:00
Miguel Angel Mulero Martinez
db133032a6 Fix CMS Throtle Boost 2018-08-01 16:00:32 +02:00
Miguel Angel Mulero Martinez
e0d17a5e2f Hide LPF2 and Throttle Boost from CMS if not available 2018-07-31 10:15:25 +02:00
Miguel Angel Mulero Martinez
df4b893d61 Add Throttle Boost to CMS 2018-07-31 09:18:06 +02:00
Miguel Angel Mulero Martinez
9d77c05d1f Add DTerm LPF2 to the CMS menu 2018-07-24 15:51:01 +02: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
jflyper
1126159243 Change CMS menu page title for PROFILE from IMU to PROFILE 2018-07-04 11:04:44 +09:00
supiiik
cc12dddedb Indentations repaired 2018-05-23 15:55:07 +02:00
supiiik
8a1c5e5e74 small fixes, MIN for 8bit MSP 2018-05-23 14:36:23 +02:00
supiiik
4312513a77 MSP changed
Changed MSP, all new data are at the end
2018-05-23 13:33:43 +02:00
supiiik
76e3e7aded dterm_setpoint_weight to uint16_t
dterm_setpoint_weight changet to uint16 with limit 0-2000
2018-05-23 08:39:45 +02:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
Míguel Ángel Mulero Martínez
efef50ced1 Increment AG GAIN step in CMS (#5568) 2018-03-30 16:54:55 +13:00
joelucid
98a77dcd96 Discontinuity fix (#5509)
* use continuous feed-forward

* use continuous feed-forward

* formatting
2018-03-23 14:13:32 +13:00
Dan Nixon
bc283cf5b9 Refine extended CMS menu toggles (#3601) 2018-03-22 00:07:53 +13:00
AJ Christensen
46291a8374 Dual-stage Gyro Filtering: PT1, Biquad, Butterworth, Denoise (FIR), FKF (fixed K), and Biquad RC+FIR2 (#5391)
* Dual-stage Gyro Filtering: PT1, FKF, and Biquad RC+FIR2

* Builds on the previous work of apocolipse.
* Fixes 'stage2'/'stage1' mis-naming to reflect where it is applied in the loop.
  That is, the older Biquad, PT1, Denoise (FIR) filters are 'stage2' - applied
  after dynamic and static notches (if enabled), and the controversial PT1,
  'fast Kalman' filter, and Biquad RC+FIR2 filters, are 'stage1'. e.g. before
  dynamic notch.
* FKF bruteforce Kalman gain removed. Calculate from half of PT1 RC constant,
  automatically taking loop-time into account.
* New union type definition for stage1 filtering.
* New gyro sensor members for stage1 filter application function and states for
  all three supported filter types
* New enum types for stage1 v. stage2. dterm lowpass type references 'stage2'.
* updates to CMS/MSP/FC to allow compilation (untested, probably breaks
  MSP, Lua, and ~comms with BFC~).
* Refactors FKF initialization, update and associated structures to be faster by
  not continuously calculating 'k'. Filter gain is calculated once during
  initialization from RC constant as per PT1 and Biquad RC+FIR2. It was
  discovered this converges to static value within 100 samples at 32kHz, so can
  be removed. Remove related interface (CLI) settings.
* update dterm_lowpass_type to use new 'TABLE_LOWPASS2_TYPE' (biquad/pt1/FIR)
* Stage 1 defaults to PT1, 763Hz (equivalent to Q400 / R88 from quasi-kalman
  filter) - suitable for 32kHz sampling modes. Can be switched to Biquad
  RC+FIR2, and FKF.
* Update `#if defined(USE_GYRO_SLEW_LIMITER) to `#ifdef`.
* Includes optional Lagged Moving Average 'smoothing' pipeline step, applied (in
  code) after the output of stage1.
* (diehertz): Removed redundant pointers from gyro filtering

* blackbox: fix indentation

* cms IMU menu: fix indentation

* filters: remove USE_GYRO_FIR_FILTER_DENOISE in filter type enum

* gyro sensors: go back to `if defined()` form. for slew limiter

* gyro sensors: increment parameter group version

* due to non-appending changes, the version must be bumped.
2018-03-21 15:52:59 +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
mikeller
ee65eba88d Added selectable RaceFlight rates. 2018-01-19 00:38:14 +13:00
mikeller
018c24fec2 Fixed range for setpoint_relax_ratio to avoid division by zero. 2018-01-14 12:12:54 +13:00
Martin Budden
3747d6742b Whitespace tidy 2018-01-10 16:56:54 +00:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
Michael Keller
364afcbf25
Merge pull request #4521 from martinbudden/bf_cms_onglobalexit
Remove almost entirely unused CMS ononGlobalExit function
2017-11-10 10:35:13 +13:00
Martin Budden
243e8390a2 Removed CMS menu guards when not debugging 2017-11-09 19:09:17 +00:00
Martin Budden
9a9884e4af Remove almost entirely unused CMS ononGlobalExit function 2017-11-09 19:06:25 +00:00
mikeller
a8d34dabb0 Changed defines for GYRO/ACC/MAG/BARO/GPS/SONAR/OSD/BLACKBOX/CMS to conform to the USE_ convention. 2017-11-05 10:15:24 +13:00
Martin Budden
74c8fefd63 Merge pull request #4252 from McGiverGim/bf-add_antigravity_cms
Add antigravity config to the CMS
2017-10-09 13:04:55 +01:00
Dan Nixon
f087730035 Add throttle mid and expo to CMS 2017-10-06 18:15:13 +01:00
Miguel Angel Mulero Martinez
05fb653a8e Add antigravity config to the CMS
Added the antigravity gain and threshold to the CMS menu.
2017-09-28 17:44:56 +02:00
Martin Budden
c1a99817f4 Minor tidy of PID code 2017-09-09 07:03:15 +01:00
Bas Delfos
ec4ce2bbd6 Changed condition to USE_COPY_PROFILE_CMS_MENU 2017-08-30 21:28:49 +02:00
Bas Delfos
04d08cb033 Made CMS code conditional 2017-07-29 22:26:53 +02:00
Bas Delfos
d32abc69f8 Copy profile to another profile (CLI, MSP and CMS) 2017-07-29 22:10:14 +02:00
Dan Nixon
334dbc3039 Ensure PID/rate profile is updated before editing values 2017-07-14 14:44:16 +01:00
Martin Budden
23f158913e Moved time functions out of system.h into time.h 2017-05-26 14:03:28 +01:00
Martin Budden
71546410de Rearrange PID array to be array of PIDs 2017-05-06 11:06:47 +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
1964362dce Removal of USE_PARAMETER_GROUPS 1 2017-03-09 22:03:59 +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
7ae57eb8cf Added PG config definitions 8 2017-02-27 07:25:48 +00:00
Martin Budden
a3ad97b0a4 Added profile macros and index functions 2017-02-25 07:37:53 +00:00
Martin Budden
051c9cca48 Moved rate profiles out of pid profiles 2017-02-24 23:25:43 +00:00
Martin Budden
faf1ecf0e2 Moved free standing items out of masterConfig into separate configs 2017-02-22 18:44:40 +00:00
Martin Budden
c67d6eb4f1 Preparation for conversion to parameter groups 14 2017-02-19 20:33:45 +00:00
Martin Budden
3275105127 Preparation for conversion to parameter groups 13 2017-02-19 17:46:46 +00:00