Previously only a single bitmapped parameter was available in the cli but this wasn't very useful as the users would have to understand the bit positions to enable/disable warning options. This change exposes each warning item as a separate parameter.
Reorder the stats field enumeration to match the actual on-screen display order. Needed to support changes in the configurator so that it will also disply the selections in the same order.
Going forward if there are any changes to the on-screen display order of the post-flight statistics then the enumeration must be updated to match.
Previously the flags controlling the enabled OSD stats were stored as an array of boolean. This change reduces config storage by storing the flags as bits inside a single uint32.
The telemetry data provides eRPM/100. Added a `motor_poles` parameter (defaulting to 14) that is used to calculate the physical RPM.
RPM = (telemetry_rpm * 100) / (motor_poles / 2)
Most motors we commonly use are 14 poles, but the user can adjust if needed for their setup.
Also calculate actual RPM for DEBUG_ESC_SENSOR_RPM, but to fit with in int16 the log value will be RPM/10.
* PID controller unittest
* Clean code for yaw spin recovery
* Yaw spin recovery optimizations
* Flash size optimizations, use 50% throttle when airmode is off, and override pidsum_limit_yaw
Also rebasing from betaflight/master
Previously only vbat_scale was exposed. Adds vbat_divider and vbat_multiplier parameters.
Note that all of these parameters only apply to the first voltage sensor (VOLTAGE_SENSOR_ADC_VBAT). There is the capability to have multiple sensors and those will not have their parameters exposed. Currently there are no target definitions that use multiple sensors.
Adds new throttle_limit_type and throttle_limit_percent parameters that allow the pilot to limit the maximum commanded throttle seen by the flight controller by either scaling or clipping the maximum throttle. The default is 100 representing no limiting. So as an example, if a pilot was to set throttle_limit_type = SCALE and throttle_limit_percent = 80 the throttle input would scale from 0 to 80% based on full stick deflection from the radio.
This capability replaces the method of limiting throttle in the radio which some pilots are using to manage throttle on tight courses or reduce overall battery consumption when the extra power isn't needed.
There is no effect on the maximum throttle seen by the motors so the mixer still has full authority.
* ITerm rotation
* address requested changes
* now counting up
* scale errors according to Ki while rotating
* iterm_rotation profile setting
* revert to non scaled version, style related fixes
* Triggering a CI build.
Allows the user to configure a new OSD stat item called "BATTERY" that will display a live and updating battery voltage. This would allow the user to see how their battery was recovering after disarming by comparing to the stat "END BATTERY".
Added a `USE_32K_CAPABLE_GYRO` define set in `common_fc_post.h` that replaces the repeated testing for each gyro define wherever 32KHz compatibility is checked.
The old gyro_lpf setting was based on the DLPF_CFG values for the MPU6050 gyro and the enumeration was inaccurate and misleading. For example, the default "OFF" setting did not disable the DLPF, but actually set it to around 250hz. The actual cutoff frequency for each setting varies by gyro hardware so the literal frequencies in the enumeration were also incorrect.
Removed gyro_lpf and replaced it with gyro_hardware_lpf (8KHz) and gyro_32khz_hardware_lpf (32KHz). The parameters were renamed to indicate that they are hardware filtering options to differentiate from the many software lowpass filtering options.
gyro_hardware_lpf - This parameter sets the filtering and sample rate options for 8KHz gyros (or 32KHz capable gyros running in 8KHz mode).
- NORMAL - default setting that is equivalent to the previous "OFF" setting. Configures 8KHz sampling with ~250Hz filter cutoff.
- EXPERIMENTAL - 8KHz sampling with a higher frequency filter cutoff (around 3000hz). Considerably more noisy and requires additional software filtering. Note that for the MPU6000 Invensense doesn't officially document the filter cutoff frequency for this selection and simply lists it as "reserved". In testing it's clear that a higher frequency filter cutoff is being selected due to the increased noise, but the actual cutoff frequency is unknown.
- 1KHZ_SAMPLING - 1KHz sample rate with and approximate 188Hz filter cutoff.
Note that the following additional 1KHz sample rate options with lower filter cutoffs have been eliminated - "98HZ", "42HZ", "20HZ", "10HZ", "5HZ". It seems unlikely that these are still needed are probably no longer viable and flight performance would be very poor.
gyro_32khz_hardware_lpf - This parameter sets the filtering options while running in 32KHz mode on capable gyros. It also exposes a new high frequency filter cutoff mode.
- NORMAL - The default and matches the current settings used for 32KHz mode. Provides a filter cutoff around 3000Hz.
- EXPERIMENTAL - Selects a filter cutoff around 8000Hz. This is a very noisy setting and will require substantial software filtering.
The default values for both 8KHz and 32KHz sample rates were chosen to match the previous defaults and users should not experience any performance differences.
Normalized the gyro initialization. Previously there was little consistency on how the initialization was performed and the settings interpreted. For example, MPU9250 used a completely different logic tree when configuring the registers.
Disconnected the literal parameter value from the gyro initialization. The gyro_lpf parameter contained a number from 0-7 that was literally applied to the configuration register during the gyro initialization. This caused some older gyro initializations to be incorrect as they used a different register layout (MPU3050 and L3G4200D). By transitioning to a logical selection the actual value applied to the hardware register is abstracted. This will better future-proof the design as new gyros may have a different register structure that may be incompatible with the old method.
Added a gyroregisters command to the CLI that is used to read the current register settings from the gyro and dump them to the CLI. This is used to verify the configuration in comparison to the datasheets for the various gyros. Testing empirically by looking at the relative noise from the gyros can give a rough estimate whether the different options are selecting correctly, but it's not very precise. The code for the gyroregisters CLI command is wrapped inside #ifdef USE_GYRO_REGISTER_DUMP blocks to allow easy disabling. It's currently enabled for all targets but we may decide to disable before release or only limit to targets with more available space (>=F4).
* Dual-stage Gyro Filtering: PT1, FKF, and Biquad RC+FIR2
* Builds on the previous work of apocolipse.
* Fixes 'stage2'/'stage1' mis-naming to reflect where it is applied in the loop.
That is, the older Biquad, PT1, Denoise (FIR) filters are 'stage2' - applied
after dynamic and static notches (if enabled), and the controversial PT1,
'fast Kalman' filter, and Biquad RC+FIR2 filters, are 'stage1'. e.g. before
dynamic notch.
* FKF bruteforce Kalman gain removed. Calculate from half of PT1 RC constant,
automatically taking loop-time into account.
* New union type definition for stage1 filtering.
* New gyro sensor members for stage1 filter application function and states for
all three supported filter types
* New enum types for stage1 v. stage2. dterm lowpass type references 'stage2'.
* updates to CMS/MSP/FC to allow compilation (untested, probably breaks
MSP, Lua, and ~comms with BFC~).
* Refactors FKF initialization, update and associated structures to be faster by
not continuously calculating 'k'. Filter gain is calculated once during
initialization from RC constant as per PT1 and Biquad RC+FIR2. It was
discovered this converges to static value within 100 samples at 32kHz, so can
be removed. Remove related interface (CLI) settings.
* update dterm_lowpass_type to use new 'TABLE_LOWPASS2_TYPE' (biquad/pt1/FIR)
* Stage 1 defaults to PT1, 763Hz (equivalent to Q400 / R88 from quasi-kalman
filter) - suitable for 32kHz sampling modes. Can be switched to Biquad
RC+FIR2, and FKF.
* Update `#if defined(USE_GYRO_SLEW_LIMITER) to `#ifdef`.
* Includes optional Lagged Moving Average 'smoothing' pipeline step, applied (in
code) after the output of stage1.
* (diehertz): Removed redundant pointers from gyro filtering
* blackbox: fix indentation
* cms IMU menu: fix indentation
* filters: remove USE_GYRO_FIR_FILTER_DENOISE in filter type enum
* gyro sensors: go back to `if defined()` form. for slew limiter
* gyro sensors: increment parameter group version
* due to non-appending changes, the version must be bumped.