1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00
Commit graph

67 commits

Author SHA1 Message Date
Bruce Luckcuck
bb834bb126 Prevent crash recovery detection immediately after entering self-level modes
If the quad is in an extreme orientation (like upside down) the transition to self-level modes can cause enough motion to trigger crash recovery. Added a 1 second delay during which crash recovery detection is blocked immediately after entering a self-level mode.

This also addresses an issue with GPS Rescue as when it activates it enables self-level. If in the above scenario this triggered a crash recovery detection then GPS Rescue would interpret this as a crash and immediately disarm.
2018-11-02 23:43:41 -04: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
borisbstyle
87b2eeb2fd More isolated pid_unittests
Refactor iterm_relax to iterm_relax_axis

Isolate pidLevel test

Isolate pidHorizon tests

remove if UNIT_TEST

revert to iterm_relax from iterm_relax_axis
2018-09-19 08:15:32 +02:00
borisbstyle
afccf50d96 Add Iterm Relax unittest // refactor
Refactor PID code Iterm Relax and Absolute control

Move defines for unittest to Makefile

Fix unittest isAirmodeActivated()

Absolute control unittests + optimizations

Fix dead code absolute control // unittests

Further optimizations to absolute control switch logic
2018-09-12 08:09:21 +02:00
borisbstyle
aa44fd6bbd Change default iterm_windup 2018-09-10 23:38:40 +02:00
borisbstyle
00dbaf9fa7 Cleanup code // add unittestst for iterm windup 2018-09-10 23:38:39 +02:00
borisbstyle
864a2d6a2b Fix bug with antiwindup inversion 2018-09-10 09:08:36 +02:00
borisbstyle
a85eecf42d Add feedforward tests 2018-08-28 10:06:48 +02:00
borisbstyle
5b7209329b Add tolerance for feedforward 2018-08-28 08:44:06 +02:00
mikeller
0bce8549ee Renamed 'fc/fc_' files to remove the double 'fc'. 2018-08-26 14:07:06 +12: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
ctzsnooze
4c917efa50 Smooth anti gravity 2018-07-21 23:49:41 +12:00
mikeller
00228427da Set yaw D default to 0 since it is unused anyway. 2018-06-30 15:25:50 +12:00
Thorsten Laux
7e12e9da18 don't link debug.c to pid unit test 2018-05-28 16:40:09 +02:00
s0up
de5fa47c4c navigation feature / reference removal 2018-05-09 10:28:36 -07:00
borisbstyle
8fab0fee11 PID controller unittest 2018-04-22 16:10:17 +02:00