1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 21:35:44 +03:00
Commit graph

9176 commits

Author SHA1 Message Date
Bruce Luckcuck
c70e999f24 More cleanup from review 2018-06-06 18:42:08 -04:00
Bruce Luckcuck
dfa6be810a Updates and cleanup from review, simplify auto cutoff calculation
Renamed variables to be more representative of their content.

Simplified the auto-cutoff calculation to be 90% of the nyquist frequency of the measured rx frame rate.

Simplified the PT1 from BIQUAD calculation.

Added active cutoffs to the blackbox log header. Reduce the number of headers by combining like entries into a single line.
2018-06-06 17:30:28 -04:00
mikeller
41492e1309 Moving sensor frame throttling from SmartPort to FPort only. 2018-06-07 00:34:37 +12:00
Michael Keller
3f3fb0c01c Changed 'dtermSetpointWeight' to use decimal scaling. 2018-06-06 11:21:11 +12:00
Bruce Luckcuck
e49c10b573 RC smoothing: improve rx frame rate detection, add rc_smoothing_info cli command
Improved the rx frame rate detection/training by delaying calculation to avoid loop time jitter during flight controller initialization.

For auto cutoffs calculate a value appropriate for BIQUAD or PT1 depending on the configuration.

Added a new rc_smoothing_info cli command to display internal details about its operation.
2018-06-05 18:25:13 -04:00
Michael Keller
445f9d6ad4
Merge pull request #6044 from mikeller/added_interpolation_checks
Added validation checks for interpolation settings, made throttle boost conditional.
2018-06-06 08:00:19 +12:00
Michael Keller
95f8cfd8b8
Merge pull request #6049 from jflyper/bfdev-ag3x-default-burst
AG3X Enable burst mode DMA by default
2018-06-05 22:04:06 +12:00
Michael Keller
60c6ba5ccf
Merge pull request #6035 from mikeller/fix_spracingf3_transponder_default
Added USE_TRANSPONDER to SPRACINGF3 to match the default features.
2018-06-05 21:55:22 +12:00
mikeller
391d6a4185 Fixed SPRACINGF3OSD. 2018-06-05 21:43:17 +12:00
jflyper
69f204b5fc AG3X Enable burst mode DMA by default 2018-06-05 16:32:52 +09:00
Michael Keller
388175f746
Merge pull request #6047 from McGiverGim/fix_msp_gyro_lpf_range
Add new range for gyro lpf 1 into MSP
2018-06-05 19:14:00 +12:00
mikeller
f9cfa86378 Fixes from review. 2018-06-05 18:47:41 +12:00
mikeller
a373204d7a Added validation checks for interpolation settings, made throttle boost conditional. 2018-06-05 18:38:57 +12:00
Michael Keller
91013da2cc
Merge pull request #6043 from mikeller/added_rc_interpolation_options
Added more options for RC interpolation channel selection.
2018-06-05 18:37:49 +12:00
Miguel Angel Mulero Martinez
9c6603fae9 Add new range for gyro lpf 1 into MSP 2018-06-05 08:19:24 +02:00
Michael Keller
93e02388c8 More fixes. 2018-06-05 16:32:59 +12:00
Michael Keller
d299d8b51d Fixes from review. 2018-06-05 13:49:34 +12:00
Michael Keller
522e90ab17
Merge pull request #6031 from mikeller/fix_osd_altitude_display
Fixed OSD altitude display for negative altitude > -1.
2018-06-05 13:11:30 +12:00
mikeller
9738a1cdd2 Added more options for RC interpolation channel selection. 2018-06-04 22:41:54 +12:00
mikeller
e29fa595f5 Optimised the use of static variables in the PID loop. 2018-06-04 18:56:30 +12:00
Bruce Luckcuck
2359449b2a Add delay before training, update defaults, add fields to blackbox header
Also added support for split input and derivative defaults
2018-06-03 21:53:56 -04:00
Bruce Luckcuck
e0514ce2a9 Use FAST_RAM for static variables in new smoothing code 2018-06-03 21:52:16 -04:00
Bruce Luckcuck
7e18d7c1b9 Make filter type selectable and add BIQUAD
Adds options to select the filter type for both input and derivative.
rc_smoothing_input_type = PT1 | BIQUAD (default is BIQUAD)
rc_smoothing_derivative_type = OFF | PT1 | BIQUAD (default is OFF)
2018-06-03 21:52:15 -04:00
Bruce Luckcuck
8b42c80790 Updates per review
Stylistic fixes.
Rearrange initilization code to only run when isRXDataNew.
Corrected use of FAST_CODE and FAST_CODE_NOINLINE.
2018-06-03 21:52:15 -04:00
Bruce Luckcuck
826609e703 Experimental filter-based rc channel smoothing
Adds an additional rc channel smoothing algorithm that can be used in place of the default rc interpolation. Utilizing a filter-based approach the smoothing has lower latency and is immune to loop time jitter that can introduce artifacts.  Additionally a smoothing filter is added to the setpoint derivative used to produce D-term setpoint weight resulting in a smoother effect on D.

The default setting is to use the previous interpolation logic and there are no changes unless the optional method is selected.

Configuration:

rc_smoothing_type: (INTERPOLATION | FILTER) - defaults to INTERPOLATION

rc_smoothing_input_hz: (0-255) - sets the rc channel input filter cutoff in Hz. Default value of 0 will enable auto calculation based on received RX frame rate.

rc_smoothing_derivative_hz: (0-255) - sets the setpoint weight derivative filter cutoff in Hz. Default value of 0 will enable auto calculation based on received RX frame rate.

rc_smoothing_debug_axis: (ROLL | PITCH | YAW | THROTTLE) - determines which axis is logged in the debug fields

Debug logging:

set debug_mode = RC_SMOOTHING

debug(0) = raw un-smoothed rc channel data
debug(1) = raw un-smoothed setpoint derivative
debug(2) = filtered setpoint derivative before applied to setpoint weight
debug(3) = auto-calculated filter cutoff frequency base after sampling the rx frame rate

Notes:

Currently only enabled for F4/F7 due to flash size limitations

Uses the rc_inter_ch parameter to determine which channels are smoothed (same as default interpolation logic)

The auto filter cutoff calculation will set a cutoff frequency of 30Hz for typical SBUS frames (9ms).  11ms Spektrum will calculate to approximately 25Hz. The user can manually enter the filter cutoffs to be used instead of the auto calculation.  The current default calculation was chosen as a good starting point but may be adjusted in the future.

Setting a lower cutoff frequency will result in more smoothing, but also more delay.

There currently isn't any support for receivers that change their rx frame rate dynamically.  So for CRSF users wishing to use this alternate smoothing method should change their settings to lock the rx frame rate for now. Support for auto-adjusting to new frame rates in flight will likely be added.
2018-06-03 21:52:01 -04:00
Michael Keller
b21b626e12
Merge pull request #6024 from mikeller/add_filter_msp_and_defaults
Added defaults and MSP support to filter settings.
2018-06-04 11:28:29 +12:00
mikeller
15e9bb1b38 Removed TRANSPONDER support. 2018-06-04 11:25:24 +12:00
mikeller
df06b9b4cb Fixed tests. 2018-06-04 00:23:45 +12:00
mikeller
0c60821a7d Added USE_TRANSPONDER to SPRACINGF3 to match the default features. 2018-06-03 23:27:12 +12:00
Michael Keller
6bac0cd392
Merge pull request #6034 from Smeat/gps_alt_fix
Fix altitude task when using GPS only.
2018-06-03 23:03:07 +12:00
Michael Keller
1640f6179d
Merge pull request #6032 from mikeller/add_rssi_offset
Added RSSI offset to complement RSSI scaling.
2018-06-03 22:59:55 +12:00
mikeller
f32731638d Removed default changes from this pull request. 2018-06-03 22:44:42 +12:00
mikeller
75693fbd5b Added defaults and MSP support to filter settings. 2018-06-03 22:44:42 +12:00
Michael Keller
00a9feb0cd
Merge pull request #6029 from mikeller/fix_dshot_beacon
Fixed Dshot beacon activation conditions.
2018-06-03 22:43:57 +12:00
mikeller
fa24697df6 Make it terminate the string properly. 2018-06-03 22:43:12 +12:00
mikeller
0aba86ccb4 Converted it to fixed width. 2018-06-03 22:40:01 +12:00
mikeller
e30f1fadd9 Fixed OSD altitude display for negative altitude > -1. 2018-06-03 21:46:44 +12:00
mikeller
76a1e81d97 Removed extra parentheses. 2018-06-03 21:45:55 +12:00
mikeller
a9c1f02afb Added RSSI offset to complement RSSI scaling. 2018-06-03 21:45:55 +12:00
Kevin
ba0de59fc1 Fix altitude task when using GPS only. 2018-06-03 11:40:12 +02:00
mikeller
a9b3911e03 Made new PID loop improvements conditional, disabled some for F3 to save flash space. 2018-06-03 17:07:10 +12:00
mikeller
834df547e6 Fixed Dshot beacon activation conditions. 2018-06-03 12:46:48 +12:00
mikeller
227c08f94e Added profile / rateprofile info to 'get'. 2018-06-02 22:27:16 +12:00
mikeller
532e8afe61 Fixed dumping of profile values in CLI. 2018-06-02 21:01:22 +12:00
mikeller
51763a40f9 Made Dshot commands work in a non-blocking way. 2018-06-01 21:56:11 +12:00
Bryce Johnson
0045b36320 Added blocked dshot commands, Added post command delay
Moved the dshotcommand to happen in pwm_output_dshot.
Simplified the timing and repeats to happen on a group basis instead works better for dshotburst
2018-06-01 21:56:11 +12:00
Michael Keller
f37a8184d5
Merge pull request #5891 from mikeller/add_disable_rx_loss_dshot_beacon_option
Implemented 'beacon' command in CLI.
2018-06-01 21:51:57 +12:00
Michael Keller
9f28f87c97
Merge pull request #6013 from mikeller/fix_enum_in_pg
Reordered and optimised pidProfile parameter group.
2018-06-01 14:54:12 +12:00
Michael Keller
42b2e4077f
Merge pull request #5985 from mikeller/add_board_info
Added ability to set and check board info.
2018-06-01 07:50:59 +12:00
mikeller
2ca07f7302 Fixed typo, BETAFLIGHTF3 flash overflow. 2018-06-01 00:48:21 +12:00