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

31 commits

Author SHA1 Message Date
pichim
13d1dc81ce
Additional TPA breakpoint for low Throttle (#13006)
* Removed white spaces and everything that is not new

Rebase on master and update comment

Make TPA lower independent from air mode

Included tpa_breakpoint_lower_vanish option

Changes according to PR comments

Corrected comment for API version

Bugfix in msp.c

Additional TPA breakpoint for low throttle

* Changes according to PR comments

* Update src/main/cms/cms_menu_imu.c

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

* Update src/main/flight/pid_init.c
2023-12-04 16:35:27 +01:00
ctzsnooze
05f70a80da
bug fix for DMax Setpoint Factor (#13145)
fix too high DMax Setpoint Factor
2023-10-29 16:37:27 +01:00
ctzsnooze
10067ad6ad
TPA optimisations (#12721)
* TPA optimisations

* improvement, thanks @ledvinap

* update following review comments, thanks karatebrot and ledvinap

* include rx.h in pid_init.c to get PWM_RANGE_MIN

* review suggestion
2023-05-11 18:38:15 +02:00
ctzsnooze
68dd061c51
Minor pid.c refactoring (#12722)
* Minor pid.c refactoring

* Only calculate unfiltered gyro delta for that debug

Remove unnecessary comment
Change multiplier to factor of 10

* remove some archaic comments

* clarify name of D_LPF_PRE_TPA_SCALE, use inverse in define

* Remove some blank lines

* undo conversion to division thanks -ffast-math
2023-05-11 17:06:36 +02:00
Jan Post
460e4d00fe
Lead-Lag Compensator (#12730)
* Implement Lead-Lag-Compensator

* Refactoring / Clean up

* Remove trailing whitespaces
2023-05-03 10:01:36 +02:00
ctzsnooze
34057bfbc2
Refactor Feedforward Angle and RC Smoothing - mashup of 12578 and 12594 (#12605)
* Refactor Feedforward Angle and RC Smoothing

* update rc_smoothing at regular intervals

* add Earth Ref to OSD, update pid and rate PG

* Initialise filters correctly

* refactoring to improve performance

* Save 24 cycles in Horizon calculations, other optimisations

At a cost of 40 bytes

* save 25 cycles and 330 bytes in rc_smoothing

* feedforward max rate improvements

* typo fix

* Karatebrot's review suggestions  part one

* Karatebrot's excellent suggestions part 2

* more efficient if we calculate inverse at init time

Co-Authored-By: Jan Post <post@stud.tu-darmstadt.de>

* Horizon delay, to ease it in when returning sticks to centre

* fix unit tests after horizon changes

Co-Authored-By: 4712 <4712@users.noreply.github.com>

* horizon_delay_ms, default 500

* fix unit test for feedforward from setpointDelta

* Final optimisations - thanks @Karatebrot for your advice

* increase horizon level strength default to 75 now we have the delay

* restore Makefile value which allowed local make test on mac

---------

Co-authored-by: Jan Post <post@stud.tu-darmstadt.de>
Co-authored-by: 4712 <4712@users.noreply.github.com>
2023-04-23 22:03:18 +02:00
ctzsnooze
241e9a9b94
Angle and Horizon Mode improvements (#12231)
* Angle and Horizon Update for 4.5

* BugFix FF noise Angle Mode on yaw and in level _race mode

* use time constant in ms for angle feedforward smoothing

* refactor to remove unnecessary definition

---------

Co-authored-by: ChrisRosser <chrisrosser91@gmail.com>
2023-03-15 09:46:24 +11:00
Jan Post
931c982a3b
Refactor RPM Filter (#11765)
* Refactor RPM Filter

* Refactor RPM Filter parameter group
2022-11-12 20:39:21 +11:00
ctzsnooze
6aaaf727ff update antigravity for 4.4, no boost on yaw
Update to anti-gravity, including removal of the old Step mode, ability to adjust the P contribution (thanks @Limon), PT2 smoothed derivative model, inherent limiting of P boost during extremely fast stick travels to minimise P oscillations, less I during the middle of a throttle up, no I boost on yaw, add hz to cutoff labels

No antigravity on yaw, fix longstanding typo

h
2022-07-25 11:37:07 +10:00
Štěpán Dalecký
f85ebba6a4 Refactoring of IMU and ACC 2022-06-28 18:26:10 +02:00
Mathias Rasmussen
1b95e3c20f Use macros for power with integer exponents 2021-12-14 11:53:09 +01:00
ctzsnooze
99a7479b8c consistent gyro and dterm filter names 2021-09-27 09:12:00 +10:00
Michael Keller
7a8b40a670
Merge pull request #10777 from ctzsnooze/move-feedforward-transtion-calculation 2021-09-04 16:56:37 +12:00
ctzsnooze
ff19f3fecb D_min smoothing changed to PT2 and re-tuned 2021-08-31 11:37:33 +10:00
ctzsnooze
5863015354 ifdef condition consistently applied, field names consistent, pg ID updated 2021-08-30 09:33:12 +10:00
ctzsnooze
28d9d778a6 feedforward transition moved to feedforward.c 2021-08-30 02:07:36 +10:00
ctzsnooze
45ff9ea1e5 fixes for feedforward for 4.3 2021-08-03 23:32:34 +10:00
KarateBrot
48f14686d5 Add biquad crossfading
+ RPM filter fix (oscillations on throttle chops)
2021-06-27 23:46:45 +02:00
ctzsnooze
3b62b2e5d4 add PT2 and PT3 lowpass filter options 2021-05-18 09:59:27 +10:00
ctzsnooze
636d563abe major rc changes ctzsnooze 2021 2021-05-07 14:40:43 +10:00
Michael Keller
a53f2a60a5
Merge pull request #10711 from mikeller/remove_powerf
Remove unneeded library function 'powerf()'.
2021-04-28 01:28:43 +12:00
ctzsnooze
d4f0ec2d0a feed forward jitter improvements 2021-04-27 12:47:06 +10:00
mikeller
6b87b3685c Remove unneeded library function 'powerf()'. 2021-04-26 16:50:54 +12:00
ctzsnooze
a096c99664 PT2 and PT3 filter maths PT3 for RC smoothing 2021-04-26 14:12:54 +12:00
ctzsnooze
8050ecd1e7 Mixer update: dynamic idle and throttle logging improvements
- all CLI parameters related to dynamic idle alone re-named with the `dyn_idle_` prefix
- when linear throttle scaling is active, the user's set idle value is now correct whether dynamic idle is on or off. Previously, the idle value fell when dynamic idle was activated at the same time as linear throttle scaling.
- enabling dynamic idle no longer causes a deadband at full throttle
- the setpoint throttle value sent to Blackbox does not include the dynamic idle offset
- the throttle value sent to the antigravity and dynamic lowpass code includes throttle scaling, but no other modifiers, to avoid false elevation of the apparent throttle position from dynamic idle and unnecessary transient changes in their filter cutoffs
- Dynamic Idle now uses a modified PI controller during active rpm control phase
- the D factor provides early detection of rapid falls in rpm, e.g. in hard chops. It is filtered heavily. Inadequate `dyn_idle_d_gain` may lead to a transient drop in rpm immediately after cutting throttle. Default is 50.
- the P factor provides fast control over rpm during the active control phase. Too much `dyn_idle_p_gain` may cause oscillation in that phase. Note enough and a slow drop in rpm will be inadequately corrected. Default is 50. Needs to be higher with heavier larger props.
- An integral element does most of the work.  It prevents enduring offsets from the set rpm. The I gain is high when increasing responding to low rpm, and slow to release.  The slow release makes a huge difference and avoids I oscillation. Not enough `dyn_idle_i_gain` and there may be wobble in rpm during the control phase, or the idle value may rise too slowly; too much may cause wobble. Default is 50. Needs to be higher with heavier larger props.
- The DYN_IDLE debug shows idle P, I and D in debugs 0, 1 and 2. minRps stays in debug 3.
- Interactions between throttle and thrust linear, dynamic idle, throttle scaling and throttle boost have been checked and work as they should.
2020-11-09 09:09:17 +11:00
ctzsnooze
d1bf5d0d11 Add late P boost to antigravity 2020-09-20 12:42:09 +10:00
ctzsnooze
73663f7fae FF update including second order fitlering of boost, tidying up etc
Include default to no averaging
2020-09-12 17:08:14 +10:00
ctzsnooze
1fbf0ba816 Further refactoring
Thanks, Mike!
2020-07-07 22:59:58 +10:00
ctzsnooze
9a65b766a2 refactor Thrust Linear to initialise throttleCompensateAmount in pid_init.c
Maybe this could avoid recaculating throttleCompensateAmount every PID loop?
2020-07-07 15:11:17 +10:00
ctzsnooze
7cd83464d6 Power 2 thrust compensation with 50% throttle compensation
^2 gain curve after discussions with Markus
Variable throttle compensation, more with higher TL for whoops
Calculator https://www.desmos.com/calculator/1rhq0pqoug
2020-07-05 14:01:42 +12:00
Bruce Luckcuck
c06106e2d1 Split initialization from pid.c for flash savings
Move low performance requirements initialization code into pid_init.c and optimize that for size.

Saves 2688 bytes for target STM32F7X2.
2020-05-03 13:58:55 -04:00