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

407 commits

Author SHA1 Message Date
Bruce Luckcuck
0a0add8c56 Yaw spin recovery optimize (#3)
* PID controller unittest

* Clean code for yaw spin recovery

* Yaw spin recovery optimizations

* Flash size optimizations, use 50% throttle when airmode is off, and override pidsum_limit_yaw

Also rebasing from betaflight/master
2018-04-24 14:02:36 +12:00
ctzsnooze
41fb37a264 Clean code for yaw spin recovery 2018-04-24 13:51:06 +12:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
Andrey Mironov
bf984f39b1 F7 optimizations (#5674)
* Revert "Revert "Rewritten F7 dshot to LL (draft)" (#5430)"

This reverts commit aa42a69d2f.

* Reworked F7 linker scripts to maximize performance of both F74x and F72x

* Some comments and changes from original F7 HAL DSHOT

* Prohibit inlining of some functions to place them in ITCM-RAM

* Fixed usartTargetConfigure implicit declaration

* Moved back to SRAM1 as main RAM

* Added SRAM2 attribute

* Fixed LL DSHOT FOR SPRF7DUAL and probably other adv TIM users

* Fixed SPRF7DUAL rev. A motor order

* Enabled CCM for data on F40x

* Fixed F7 startup assembly symbols

* Fixed KISSFCV2F7 linker script

* Added a quick way of building F7 targets only

* Got rid of the useless F7 target script

* Added NOINLINE and got rid of useless __APPLE__ define

* Added some important functions to ITCM

* Added NOINLINE macro for tests

* Copy to ITCM before passing execution into it

* Minimized cache footprint of motor output code

* Evicted low-impact functions from ITCM

* Switched MATEKF722 and SPRACINGF7DUAL to burst DSHOT

* Switched CLRACINGF7 to burst DSHOT

* Moved UART RX&TX buffers to DTCM-RAM to avoid cache incoherency

* Marked taskMainPidLoop for ITCM-RAM, disallowed inlining per-function

* Revert "Added a quick way of building F7 targets only"

This reverts commit 2294518998.
2018-04-20 08:37:32 +12:00
Miroslav Drbal [ApoC]
045557561d Optimized the PID loop a little bit (#5661)
* * Put PID variables into the structure
* Precalculate DTerm gyro filter outside the axis loop
* Removed unused variables PIDweight[3], airmodeWasActivated
* If zero throttle or gyro overflow, we can just set values and exit, this saves checks and jumps in axis loop
* Compute PIDSUM after the axis loop, this saves branching inside the loop because of Yaw has no D term

* * Incorporated review changes from DieHertz and fujin

* * Incorporated another review requests from DieHertz
  - PidSum renamed to Sum
  - pidData[3] redone to pidData[XYZ_AXIS_COUNT]
2018-04-11 08:22:51 +12:00
Bryce Johnson
588addd6dd added crashflip_motor_percent. This will use the other motors while doing a turtle. (#5600) 2018-04-06 20:24:48 +12:00
borisbstyle
194248f804 Cleanup mixTable 2018-04-06 07:16:39 +02:00
Bruce Luckcuck
7bc600d651 Throttle limit feature (#5608)
Adds new throttle_limit_type and throttle_limit_percent parameters that allow the pilot to limit the maximum commanded throttle seen by the flight controller by either scaling or clipping the maximum throttle.  The default is 100 representing no limiting.  So as an example, if a pilot was to set throttle_limit_type = SCALE and throttle_limit_percent = 80 the throttle input would scale from 0 to 80% based on full stick deflection from the radio.

This capability replaces the method of limiting throttle in the radio which some pilots are using to manage throttle on tight courses or reduce overall battery consumption when the extra power isn't needed.

There is no effect on the maximum throttle seen by the motors so the mixer still has full authority.
2018-04-05 16:01:28 +12:00
Teracis
45e64edb0b Removed mixer halving in 3D mode. (#5582) 2018-03-31 13:43:16 +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
Austin
4d3666b77b Fix for minthrottle when feature 3D and PWM enabled (#5102)
* Fix for minthrottle when feature 3d and pwm enabled

* add parameters for min and max 3d output

* bug fix

* remove new parameters from msp

* remove new parameters again

* fixed indentation
2018-03-09 06:44:17 +13:00
bkeinert
5d3c3b766b extend crash-flip mode (#5163)
* extend crash-flip mode

* size optimizations

* adjust cosine threshold

* adjust deadband to 15%
2018-03-04 11:37:01 +13:00
Michael Keller
3dddb17e35
Merge pull request #5179 from mikeller/unify_3d_switches
Unified `BOX3DDISABLE` and `BOX3DONASWITCH` switches.
2018-02-18 03:21:20 +13:00
mikeller
7192e9de19 Fixed parameter group violations in motorDevConfig_t, incremented EEPROM config version before 3.3.0 release. 2018-02-15 18:25:28 +13:00
mikeller
232fc4e8de Unified BOX3DDISABLE and BOX3DONASWITCH switches. 2018-02-13 20:02:02 +13:00
jflyper
9475988218 Make burst and non-burst runtime configurable 2018-02-11 23:24:07 +09: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
Martin Budden
ccb49583e9 Add hooks for triflight 2018-01-20 13:59:45 +00:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
Martin Budden
de5b0d53ff Enabled Instruction TCM 2017-12-17 13:41:51 +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
d0a77bc917 Keep ITerm zero for 250ms after motor reversal in 3D mode 2017-12-01 21:36:32 +00:00
Martin Budden
dd3a40f036
Merge pull request #4702 from martinbudden/bfa_3d_iterm
Reset ITerm on motor reversal
2017-12-01 08:16:22 +00:00
Martin Budden
9060ecb302 Reset ITerm on motor reversal 2017-12-01 07:06:20 +00:00
Martin Budden
ccb4f77ae2 Tidy of mixer and servo code 2017-12-01 06:07:32 +00:00
mikeller
4d30971e2d Fixed permissions on files. 2017-11-28 23:31:55 +13:00
mikeller
b78d8ad83e Converted more 'feature' type defines to use the 'USE_<x>' convention: LED_STRIP TARGET_CONFIG BRUSHED_ESC_AUTODETECT SERIAL_RX TELEMETRY TELEMETRY_CRSF TELEMETRY_FRSKY TELEMETRY_HOTT TELEMETRY_IBUS TELEMETRY_JETIEXBUS TELEMETRY_LTM TELEMETRY_MAVLINK TELEMETRY_SMARTPORT TELEMETRY_SRXL TELEMETRY_NRF24_LTM TELEMETRY_LTM SPEKTRUM_BIND NAV BUTTONS 2017-11-07 18:49:12 +13:00
Bryce Johnson
d1a197f99e 3d on a mode switch 2017-10-11 13:08:12 -05:00
Michael Keller
39c02c083e Merge pull request #3832 from martinbudden/bf_pidsum_limits
PID sum limits applied before scaling
2017-10-12 00:01:58 +13:00
RolandChen
f14574a222 Add Heli 120 Mixer
(Squashed)
2017-10-07 00:19:53 -07:00
mikeller
79651ec6c8 Improved mixer code for crash flip mode. 2017-09-22 08:07:26 +12:00
Martin Budden
d22fb0dde4 Merge pull request #4207 from brycedjohnson/TurtleRemovePidSum
Remove pid sum limit so crashflip gets 100% throttle
2017-09-21 17:51:50 +01:00
Bryce Johnson
1016ec146c Remove pid sum limit so crashflip gets 100% throttle 2017-09-21 11:19:34 -05:00
Michael Keller
8b0d848ce9 Fixed and cleaned up the conversion between Dshot and external PWM values. 2017-09-21 22:59:28 +12:00
Michael Keller
b20d5e6f80 Fixed mixer for non-3D mode. 2017-09-18 12:44:40 +12:00
Michael Keller
ce824a60d6 Fixed mixer for 3D / Dshot. (#4161) 2017-09-17 15:45:39 +01:00
Bryce Johnson
fd37566bc5 New turtle mode that only spins needed props 2017-09-07 07:59:59 -05:00
mikeller
c8f528c0af Inhibit Dshot motor beeping while motors are running (armed or motor test). 2017-08-25 09:16:43 +12:00
Martin Budden
6c8b0f3adf Avoid necessity for pidInitMixer 2017-08-24 17:34:31 +01:00
Martin Budden
533734a58d PID sum limits applied before scaling 2017-08-24 17:33:09 +01:00
mikeller
0854953cf0 Fixed yaw direction after #3873. 2017-08-17 23:32:21 +12:00
Martin Budden
8dd4a584c1 Fixed whitespace 2017-08-17 08:32:37 +01:00
borisbstyle
786343e2b2 Merge pull request #3873 from martinbudden/bf_mixer_efficiency
Improved mixTable calculation efficiency
2017-08-17 09:23:19 +02:00
Martin Budden
e4975d735d Improved mixTable calculation efficiency 2017-08-17 07:54:08 +01:00
KenImhof
36db92bcb3 Fixed 3D mode 2017-08-16 16:47:17 -07:00
Martin Budden
87ae1616d6 Further better use of pwmAreMotorsEnabled 2017-07-06 08:55:26 +01:00
borisbstyle
0a7a74965a Fix for #3466 2017-07-05 15:19:00 +02:00
borisbstyle
4ff7b9394b mixTable() separation for readability 2017-07-05 13:43:02 +02:00
borisbstyle
2cac202447 Merge pull request #3440 from betaflight/mixer_decoupling
mixTable() separation
2017-07-05 13:04:12 +02:00