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

258 commits

Author SHA1 Message Date
Štěpán Dalecký
f85ebba6a4 Refactoring of IMU and ACC 2022-06-28 18:26:10 +02:00
ctzsnooze
2262dfc60e use Throttle Setpoint, not rcDATA(throttle), for TPA 2022-01-25 18:37:01 +11:00
Ivan Efimov
d5c31accdf FW sliders: separate MSP commands for requesting calculations but not applying them into the FW 2021-12-19 04:00:50 -06:00
Michael Keller
643e2f72b3
Merge pull request #10986 from mikeller/fix_reset_pid_profile_header 2021-10-01 00:19:29 +13:00
ctzsnooze
99a7479b8c consistent gyro and dterm filter names 2021-09-27 09:12:00 +10:00
Michael Keller
95deb513b3 Fixed header declaration for 'resetPidProfile()'. 2021-09-27 03:08:26 +13:00
ctzsnooze
90a2057179 pid slider support with changed defaults 2021-09-26 15:05:05 +10:00
J Blackman
772891f96b
Merge pull request #10861 from woutput/master
Fix typo in comment
2021-09-06 08:57:10 +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
Wouter van der Put
3db1151ce7
Fix typo in comment 2021-07-26 10:24:12 +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
ctzsnooze
d4f0ec2d0a feed forward jitter improvements 2021-04-27 12:47:06 +10:00
ctzsnooze
a096c99664 PT2 and PT3 filter maths PT3 for RC smoothing 2021-04-26 14:12:54 +12:00
Michael Keller
7fc3c7cea6 Renamed 'tuning sliders' to 'simplified tuning'. 2020-12-26 14:26:56 +01:00
IvoFPV
cff19dc113 Implement tuning sliders, add to CMS, MSP 2020-12-26 14:26:50 +01: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
62ee1fd6cd Sets antigravity gain to 0 when the user wants none.
In the PR adding P to antigravity, the default value was changed so that zero now meant no antigravity, whereas before 1000 meant none.  Unfortunately, `ITERM_ACCELERATOR_GAIN_OFF` remained at 1000.  This was an oversight.
Note also that the default value of 3500 now results in more antigravity effect than previously; it is equivalent to 4500 in the previous system.
2020-10-20 23:54:50 +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
Nicola De Pasquale
d0fe84528a using same curve of dyn dterm lpf 2020-08-08 15:36:28 +02: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
Michael Keller
41fa8754bc
Merge pull request #9633 from mikeller/remove_vbat_pid_compensation
Remove vbat pid compensation
2020-07-06 13:41:27 +12: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
mikeller
b6689edc26 Removed VBat PID compensation. 2020-06-22 01:12:47 +12:00
Michael Keller
a8085bef8b
Merge pull request #9759 from etracer65/pid_init_separate
Split initialization from pid.c for flash savings
2020-06-22 00:35:42 +12:00
mikeller
9bace5b9d1 Fixed condition for the 'ANTI GRAVITY' mode switch to hide it wen anti-gravity is disabled. 2020-05-08 01:14:45 +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
ctzsnooze
ba7dc48732 Reduce default iterm_relax_cutoff to 15 from 20 2020-04-01 10:41:14 +11:00
ctzsnooze
d63ba914c6 motor output scale
First draft

Change method to percentage compensation

fast sag filter with fast battery updates

Renaming, moving factors to init where possible

Names changed, display update frequency reverted to 50hz as it was

50Hz ESC Voltage sampling, battery sag lowpass for PID compensation.

increment PG_PID_PROFILE, element added to end of batteryConfig_t

all HZ_TO_INTERVALs set back to 200 to match battery task frequency of 200hz.

Add a flag to control vbat comp

Flag vbat_sag_comp_enabled allows battery compensation to be enabled or
disabled from the CLI. When disabled the battery voltage task is run at
50Hz and the battery compensation code is not run. When enabled the
voltage task is run at 200Hz and the compensation code runs. Constants
for the fast and slow rates are added to tasks.h. The default value for
vbat_sag_compensation is changed to 100 as we no longer need to use it
to disable the feature.

Fixed variable task frequency setting.

Added config validation to disable sag compensation unless ADC is used as the voltage data source.

Added conditionals, fixed naming.

Fixed build.
2020-03-22 17:15:08 +13:00
jflyper
ff16686893 White space tidy 2020-02-17 23:54:57 +13:00
phobos-
8ce268d5f1 Implemented NFE Race Mode 2020-02-16 13:46:08 +01:00
Nicola De Pasquale
54f46c9327 antigravity gain decoupled from Iterm 2020-01-19 13:28:06 +01:00
Nicola De Pasquale
3ae5830eb0 added dterm lpf configurable curve 2020-01-14 20:24:56 +01:00
ctzsnooze
3c91da0e59 Interpolated feed forward smoothing 2019-11-20 11:29:37 +11:00
ctzsnooze
e381b27b9c Small modification to ff boost spike suppression
The feed forward boost concept improves stick response by adding a stick acceleration factor to feed forward. Generating spikes when there are steps in the RC signal is the main problem.
This PR makes one small change to how the spike suppression method is determined.
It no longer uses the 'jerk' signal to generate the spike suppression 'clip' value.  Instead it just uses the magnitude of the boost signal itself.
We originally used jerk because it is more sensitive to spikes. Detailed testing shows that jerk is that it has an unwanted impact one full RC step after the spike.
If we use the boost (acceleration) signal as the attenuator, that delayed impact does not occur, making the boost component more precise.
The threshold value for suppression needs to be a bit higher to achieve equivalence.
I've re-named the function to reflect it being related to spike suppression and removed 'jerk' since we aren't using that any more.
2019-09-07 11:22:06 +10:00
Thorsten Laux
5855b275f4 various ff2_0 improvements
simplify

double period averaging

fix calc

ff changes

in between

fixes

clip * clip and cleanup

address review feedback

more review feedback

10 to 100
2019-09-04 23:08:02 +12:00
Michael Keller
b5981109b5
Add iterm relax to CMS (#8677)
Add iterm relax to CMS
2019-08-09 09:39:54 +12:00
IvoFPV
596222055d add itermrelax to cms 2019-08-08 10:24:59 +02:00
Thorsten Laux
91ad2498ff ff from interpolated setpoint 2019-08-08 09:50:18 +02:00
Thorsten Laux
d033a8dc76 address code review 2019-08-02 14:20:37 +02:00
Thorsten Laux
293dc42710 address feedback 2019-08-02 13:51:44 +02:00
Thorsten Laux
d474df3149 idle 2019-08-02 13:51:44 +02:00
Bruce Luckcuck
f5bc673ada Revise PID/Rate profile names to use get/set and eliminate extra PG's
Removes the custom CLI commands to update or display the PID and Rate profile names. Moves the storage into the pidProfile and controlRateProfile PG's.

Names can now be set with:
set profile_name = NAME
set rate_profile_name = NAME

Also added profile name display to the profile and rate CMS menus.
2019-05-08 09:03:31 -04:00
Michael Keller
b468b94995
Merge pull request #7924 from mikeller/add_crash_recovery_disarm
Added 'disarm' option to crash recovery.
2019-04-14 21:49:05 +12:00
mikeller
247f759652 Added 'disarm' option to crash recovery. 2019-04-04 22:40:00 +13:00