This code cuts D by a specified percentage durning normal flight.
It lets D smoothly rise up to normal during rapid gyro moves like flips and rolls, and increase during prop wash events.
D should now be tuned to values the 'normal' 30-45 range.
If D is 40, a dterm_cut_percentage of 65 will cut D to 14 in normal flight, but the quad will still get full 40 of D to control bounce-back after flips and about 25 of D during strong prop wash.
The dterm_cut_percentage can be adjusted via the OSD, from the D filtering page.
Adding d_cut results in cooler motors, lower amounts of noise in motor traces and faster reactions to quick stick inputs.
Too high a dterm_cut_percentage may bring out P oscillation from lack of D. Values of 70% are generally OK.
Input is gyro differential (delta). Frequencies above 40hz (above propwash) are attenuated with a configurable (dterm_cut_range_hz) biquad filter. Lower values for range can be used if the quad is very noisy or gets low frequency D resonant oscillation. Up to 50 or 60hz may suit clean quads where prop wash control is the main priority. Too high a range value results in D being boosted from noise in normal flight.
The boost signal is 'integrated, smoothed and delayed' with a 7hz PT1 'dterm_cut_lowpass_hz' filter. The default of 7Hz gives about the right amount of smoothing and delay. Higher numbers cause the boost to come on faster, with less delay. Lower values delay the boost effect and cause it to last longer.
The dterm_cut_gain amount controls the strength of the boost effect by amplifying the input to the boosting effect. If the quad is flow gently, a higher gain value may be needed to gain full boost.
Logging with set debug_mode = D_CUT allows recording of realtime D values on roll and pitch into debug 2 and 3. The reatime D value should reach its set maximum during rapid turns, ideally at about the time D itself peaks. If it fails to reach the maximum, gain should be increased.
The D_Cut feature is not enabled on LUXV2RACE, OMNIBUS, SPRACINGF3NEO because there isn't enough flash space.
The logic already performed a reboot if mass storage init failed, but it never reset the boot vector value so it continued to contain the `MSC_MAGIC` value leading to a boot loop.
Also fixed fixed the F7 version of `mscWaitForButton()` as it was using the F4 vector.
Previously the logic would only validate whether one or more of the defined flash device types was ready and not examine the user selected blackbox device. Then on reboot during `mscStart()` the logic there would use the selected blackbox device type to decide which mode to operate in. If a flash device wasn't selected the msc initialization failed (like if serial port or "no logging" were selected).
This change only checks the status of the selected blackbox device to ensure that a reboot will properly start mass storage mode.
When using external XJT it annoyingly beeps when A1 drops below 3.7v (72 out of 255). I removed frsky_spi_use_external_adc and added frsky_spi_a1_source = VBAT, EXTADC, CONST. To prevent XJT from beeping ever set CONST and XJT will assume that the "reciever" is powered with 5v. I messed up previous PR #7305 branch so I decided that it's easier to open a new one.
Closes#7297
Adds a new exit/save menu that can be displayed at any time using the yaw-right stick command. Yaw-left still functions as "back".
Allows the user to save their settings even while nested deep in multiple menus. Previously the user was required to back up all the way to the top level menu to save or exit.
Previously the "set" option was only available for aux channels and roll/pitch/yaw/throttle only allowed "auto" (R/P/Y centered, throttle min) and "hold" (hold all channels at previous values). The problem with this is that many pilots wil set the throttle channel to "hold" to avoid a complete drop (and possible motor _stop if configured). This could lead to undesirable behavior if the throttle happened to be at a high value when the signal drop occurred.
With this change the user can set the control channels to a preset value as appropriate during a stage 1 failsafe. For example it may make sense to set the throttle channel to an approximate "hover" value appropriate for that quad to avoid gaining/losing altitude during the initial stage 1 portion of a failsafe.
No changes are made to stage 2 and the existing behavior of DROP, AUTO-LAND, or GPS-RESCUE (if configured) still apply.
Located under the Features top-level menu. Allows configuring the failsafe procedure (like selecting GPS-RESCUE if applicable).
Bounded with `#ifdef USE_CMS_FAILSAFE_MENU` so it can be disabled for space critical targets.
The logic did not support the switched 3D modes and would always set the throttle to `mid_rc`. This is appropriate for normal 3D mode, but for switched 3D modes this would lead to 50% throttle (either positive or negative depending on the switched mode settings).