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

188 commits

Author SHA1 Message Date
supiiik
76e3e7aded dterm_setpoint_weight to uint16_t
dterm_setpoint_weight changet to uint16 with limit 0-2000
2018-05-23 08:39:45 +02:00
s0up
ac6b8088c9 add gps rescue mode 2018-05-20 16:28:17 -07:00
Loopur
495cfb4d07 Add barometer sensor QMP6988 2018-05-18 16:26:07 +08:00
Bruce Luckcuck
0916d117b8 Add OSD warning options as cli parameters
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.
2018-05-11 20:06:34 -04:00
Michael Keller
7e6ba60d7d
Merge pull request #5831 from etracer65/osd_stats_reorder
Changes to support enhancements to BFC for OSD stats field ordering
2018-05-12 12:00:34 +12:00
s0up
de5fa47c4c navigation feature / reference removal 2018-05-09 10:28:36 -07:00
Bruce Luckcuck
5687e66f45 Changes to support enhancements to BFC for OSD stats field ordering
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.
2018-05-08 08:59:27 -04:00
Michael Keller
fa6c993f04
Merge pull request #5847 from mikeller/remove_telemetry_switch
Removed 'tlm_switch', replaced with 'isModeActivationConditionPresent(BOXTELEMETRY)'.
2018-05-08 23:41:16 +12:00
Bruce Luckcuck
905f14d86c Change enabled OSD stats storage to bitmap
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.
2018-05-07 12:07:25 -04:00
mikeller
19a360b867 Removed 'tlm_switch', replaced with 'isModeActivationConditionPresent(BOXTELEMETRY)'. 2018-05-08 01:14:18 +12:00
Michael Keller
2f2c95a556
Merge pull request #5686 from pulquero/antigrav_osd
Display anti-gravity activity in OSD.
2018-05-07 21:26:38 +12:00
Mark Hale
b2e43abf2d Display anti-gravity activity in OSD.
Signed-off-by: Mark Hale <mark.hale@physics.org>
2018-05-05 19:56:56 +01:00
Michael Keller
65d9e08f1b
Merge pull request #5783 from jflyper/bfdev-max7456-busdevice-conversion
MAX7456 Increase (re)configurability
2018-05-05 18:32:02 +12:00
Michael Keller
d242de87bd
Merge pull request #5764 from dbasch/gps_rescue
[GPS RESCUE] added gps for altitude estimation
2018-05-05 12:48:29 +12:00
Diego Basch
c46be03047 added gps for altitude estimation, remove most unused code, rename altitude.c to position.c, add hdop to nmea 2018-05-04 08:45:26 -07:00
Bruce Luckcuck
809c2a950b Update RPM data in smartport and frsky_hub telemetry
Both previously displayed eRPM.  frsky_hub RPM data is constrained to int16 so the value sent is RPM/10.

Updates per review and function renaming
2018-05-04 07:53:18 -04:00
Bruce Luckcuck
063f3829d4 Display ESC telemetry as real RPM in the OSD
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.
2018-05-04 07:51:16 -04:00
jflyper
944a2986a5 Use busDevice_s for reconfigurability 2018-05-04 17:09:56 +09:00
Bruce Luckcuck
1bfc2c2fa7 Add descriptive enumeration for vcd_video_system values
Previously the values were numeric and ranged from 0 to 2. This change adds a descriptive value list as "AUTO", "PAL" and "NTSC".
2018-04-28 11:08:57 -04:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
Michael Keller
5c8f330c33
Merge pull request #5706 from ctzsnooze/yaw_spin_fix2
Yaw Spin Recovery
2018-04-25 00:23:08 +12:00
Michael Keller
ec583cf9e9
Merge pull request #5755 from mikeller/make_frsky_spi_telemetry_configurable
Made FrSky SPI telemetry and external telemetry values configurable.
2018-04-25 00:16:37 +12:00
Michael Keller
3ef12389da
Merge pull request #5743 from codecae/crsf_displayport
CMS Telemetry over CRSF w/ Lua Script (X9D, so far)
2018-04-25 00:09:58 +12:00
Curtis Bangert
9d4d3ad45c CMS Telemetry over CRSF w/ Lua Script (X9D, so far) 2018-04-23 22:34:30 -04:00
Bruce Luckcuck
0a0add8c56 Yaw spin recovery optimize (#3)
* 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
2018-04-24 14:02:36 +12:00
ctzsnooze
41fb37a264 Clean code for yaw spin recovery 2018-04-24 13:51:06 +12:00
mikeller
d88bec63a8 Made FrSky SPI telemetry and external telemetry values configurable. 2018-04-24 00:14:50 +12:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
pulquero
a51bea1ebc Fixes to ranges of esc warning thresholds. (#5726)
Signed-off-by: Mark Hale <mark.hale@physics.org>
2018-04-21 18:12:11 +12:00
jflyper
f9f05ecad5 FLASH Full (re)configurability (#5720) 2018-04-20 07:55:17 +12:00
Alberto García Hierro
e192f82fcc Don't make the report_cell_voltage setting depend on IBUS (#5711)
report_cell_voltage was only compiled in when IBUS was enabled, but
it's used for several telemetry protocols. Now it only depends on
USE_TELEMETRY.
2018-04-19 21:06:39 +12:00
pulquero
a86aaeebd1 Improve ESC warning message and include current threshold check. (#5685)
Signed-off-by: Mark Hale <mark.hale@physics.org>
2018-04-18 00:25:36 +12:00
Míguel Ángel Mulero Martínez
802edf236b Fix Blackbox P interval (#5645) 2018-04-10 00:35:54 +12:00
Bruce Luckcuck
9a7533f57d Expose vbat ADC divider and multiplier parameters in CLI (#5641)
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.
2018-04-07 12:26:16 +12:00
Bryce Johnson
588addd6dd added crashflip_motor_percent. This will use the other motors while doing a turtle. (#5600) 2018-04-06 20:24:48 +12:00
Bruce Luckcuck
7bc600d651 Throttle limit feature (#5608)
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.
2018-04-05 16:01:28 +12:00
Chris
c71cfe1b8c Cache up SDIO Writing, add option to enable clock bypass. (#5612)
* Speed up SDIO Writing, add option to enable clock bypass.

* Fix identation

* Requested changes

* Move PG SDIO into correct place.
2018-04-05 12:52:30 +12:00
Michael Keller
07cce64572
Added ESC temperature warning, fixed ESC warning issue with motor count > 8. (#5583) 2018-04-04 01:04:18 +12:00
codecae
bc824e42c2 Corrected CLI to include vtx_band=0 to enable freq selection mode. (#5465) 2018-04-03 19:59:02 +12:00
Michael Keller
83e614c139
Made MSC initialisation pin configurable. (#5535) 2018-03-27 01:04:59 +13:00
Michael Keller
4b20ab5d7b
Fixed naming inconsistency for OSD elements. (#5534) 2018-03-26 11:30:19 +13:00
joelucid
ee8daac41d ITerm rotation (#5469)
* 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.
2018-03-26 10:50:21 +13:00
etracer65
9edce2359a Add current battery voltage as an option for the OSD stats page (#5531)
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".
2018-03-25 13:56:25 +13:00
conkerkh
b9ab42d6a7 Enable Composite USB HID for all F4, add PG for USB device. (#5525) 2018-03-25 12:44:57 +13:00
joelucid
efda704ee5 Throttle boost (#5508)
* throttle boost which temporarily boosts throttle in both directions to improve response

* fix comment and use pt1FilterGain

* incorporate review suggestions

* incorporate review suggestions

* use float constant to avoid double promotion

* formatting changes

* formatting change

* hopefully last style changes
2018-03-25 11:33:22 +13:00
etracer65
c8a646ebc3 Cleanup 32K capable gyro includes (#5523)
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.
2018-03-24 18:02:27 +13:00
joelucid
98a77dcd96 Discontinuity fix (#5509)
* use continuous feed-forward

* use continuous feed-forward

* formatting
2018-03-23 14:13:32 +13:00
etracer65
062ef77276 Rework gyro sample rate and DLPF configuration and expose additional filter cutoffs (#5483)
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).
2018-03-22 14:02:30 +13:00
Andrey Mironov
a453063dd7 Restricted Dterm lowpass filter options (#5492)
* Restricted allowed filter types for Dterm lowpass 1

* Fixed output of CLI lookup entires with skips

* Reverted trailing NULLs

* Revert whitespace changes
2018-03-22 10:28:10 +13:00
AJ Christensen
46291a8374 Dual-stage Gyro Filtering: PT1, Biquad, Butterworth, Denoise (FIR), FKF (fixed K), and Biquad RC+FIR2 (#5391)
* 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.
2018-03-21 15:52:59 +13:00