* TPA_CURVE_HYPERBOLIC (for wings)
* typo fix: tpa_rate_stall_throttle
* ledvinap's review
* fix tpa_curve_expo divider (10 instead of 100)
* Define fixes
* whoops, 16 instead of 1600 for PWL points
* if case for when dividing by zero for hyperbolic expo
* More ledvinap's review
* pow instead of pow_approx + unit tests for hyperbolic TPA
* basic unit tests for classic TPA
* pow was for double. pow_approx for floats is enough
* remove #else from comments
* pow_approx -> powf for hyperbolic TPA
* PWL: brigning back static assert after #13818 PR
* removed extra line per haslinghuis's review
* feedforward update for 4.6
improve jitter reduction method
don't interpolate CRSF protocol
replace 'boost' with highpass element for yaw FF
make yaw highpass element CLI adjustable
add yaw feedforward sustain params to CLI and BBE
refactoring and unit test fix
* implement review suggestions, start on the filter struct
* Attempt PT1 filter init method
* fix silly error, scale time constant correctly
improve gain linearisation at shorter time constants
* fix averaging init
* Review suggestions from PL
* Improve filter initialisation
much better :-)
* re-name prevPacketDuplicate to prevPacketWasADuplicate
* Add review comments - thanks Jan and Mark!
* cast gyro.gyroDebugAxis to int
* A better fix than int cast
* implement review comments from PL
also hopefully improved some comments.
* increase PG to 10, expecting the Disarm PR to use 9
* two always win against one ;-)
* remove inappropriate comment, remove space
* update comments and review suggestions from PL
* Disarm on landing
* Changes from review comments, thanks PL
* Sorry missed that one
* calculate Acc magnitude once only, not multiple times
* Include gyro factors as in crashRecovery
* Fix bug in CrashRecovery delta gains
Add temporary debugs to monitor error and delta inputs
* remove 1G subtraction for accMagnitude
thanks Karate
* Use AccDelta or Jerk - thanks Karate
* Revert using Gyro Setpoint and Delta
* Fix typo, thanks Mark
* increment PG version to 9
* 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>
* 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>
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
Adds angle setpoint roll/pitch expo for self-level modes.
Previously the angle setpoint was a simple linear calculation based on the stick deflection percentage and the angle limit. This makes control very jumpy around center stick and people would often resort to adding expo in their radios to compensate. This then adds the complication of wanting expo in the radio when in self-level but not when in acro - leading to complicated mixes, virtual switches, etc.
This PR adds separate self-level expo settings for roll/pitch so the user can customize the axis behavior. Yaw is excluded because this axis uses normal rates and expo controlling the rotational rate around the yaw axis and not an angle setpoint. The roll/pitch expo can range from 0 (off) to 100 (max) like other RC expo settings. For example:
```
set roll_level_expo = 30
set pitch_level_expo = 40
```
The default values are 0 which disables any expo and behaves as before.
The settings are available in the CMS rate profile menu.
The original setpoint based iTerm Relax code attenuated the amount of iTerm added per loop by a relax factor based on an HPF of setpoint.
At some point the code was re-factored and the relax factor multiplied the accumulating iterm error itself, such that almost any relax factor below 1.0 would quickly zero out iTerm.
This was bad for racing because when making sustained tight turns, I would abrubtly be zeroed when the setpoint for the starting of some relax was close to the threshold.
This was never the intent of the original proposal, which was for a smoother attenuation of iTerm, and for retention of some accumulation of iTerm during spirals around poles etc.
This PR fixes that error.
It also changes the default threshold up from 30 deg/s to 40 deg/s which better suits racing.
Also included us a form of simple cutoff independence. In the initial form, lowering cutoff would reduce the effectiveness but draw out the duration. Now cutoff only really affects duration.
Lower cutoff values are better for quads with greater motor delay, faster values are better for quicker quads. For most of my quads a cutoff of 30 works best.
I've also removed newlines.
set to current cutoff maybe fix unit test
default cutoff set to current value
in unit test add itermRelaxSetpointThreshold as float
in unit test add itermRelaxSetpointThreshold as float, because ITERM_RELAX_SETPOINT_THRESHOLD doesn't exist any more
Move itermRelaxFactor limit, remove from fast ram
remove unncessary max, revert unit test changes, restore original defaults.
remove max from debug
restore old defaults and revert unit test changes temporarily to see if will pass unit test with defaults
whoops
lets see if unit test passes when cutoff is 20
lets see if unit test passes when cutoff is 20