1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00
Commit graph

36 commits

Author SHA1 Message Date
Bruce Luckcuck
3fdb0e2b2e Disallow dual gyro in "BOTH" mode if RPM filter enabled
RPM Filter currently doesn't support dual-gyro running in "BOTH" mode. Switch to the "FIRST" gyro if configured for "BOTH" and RPM filter is enabled.

Once RPM filter is updated to support dual-gyro using both sensors then this check should be removed.
2019-03-29 09:30:42 -04:00
Bruce Luckcuck
81c226e769 Periodically try to activate DSHOT telemetry if enabled but not working
If DSHOT telemetry is enabled but one or more ESC's are not supplying valid telemetry packets, then send the DSHOT command to enable telemetry once a second while disarmed until all ESC's are supplying telemetry.

Addresses the issue of the flight controller booting without the ESC's powered. In this case the initial command at boot to enable bidirectional telemetry will be missed by the ESC since they're not powered. If the battery is subsequently plugged in the ESC's will default to bidirectional telemetry disabled.

This change will detect that ESC's are not supplying telemetry and attempt to preiodically enable them.
2019-03-17 17:45:08 -04:00
Bruce Luckcuck
89ceb70b3c Add arming disabled check if RPM filter enabled but DSHOT telemetry not working
If the RPM filter is enabled, requires all motors to have received a valid DSHOT telemetry frame before arming is allowed. Otherwise sets the arming disabled reason `ARMING_DISABLED_RPMFILTER`.
2019-03-17 10:36:21 -04:00
Bruce Luckcuck
30672a37c5 Refactor OSD element display code
Remove the giant `select` block that contained all the code to generate the elements and transition them to individual functions called only when the element is active. Simplifies the code and results in a performance improvement as it's not necessary to fall through the large `select` statement for every element that will be drawn. The individual functions and the element to function mapping are moved to a new `osd_elements.c` file.

Moved the OSD related code files to a new `osd/` directory.

Also pre-analyze the active elements and only process those that are active. This also saves processing as it's not necessary to loop through all 50 or so elements when only a couple are active.

Various other cleanup and removal of stale or unnecessary code.

In the default configuration the element drawing phase of the OSD task is reduced from ~51us to ~35us - resulting in about a 30% decrease in processing time.
2019-02-21 14:03:25 -05:00
mikeller
b5908f5bab Applied 'USE_ACC' consistently. 2019-02-08 09:51:48 +13:00
jflyper
cc0e689bb5 Add USE_ACC conditionals 2019-02-04 20:37:43 +09:00
mikeller
38e1ce04df Reorganised interfaces, putting them where they are used. 2019-01-27 13:38:22 +13:00
Michael Keller
aaad98ecc3
Merge pull request #7435 from etracer65/use_fabsf_for_floats
Use fabsf() instead of ABS() for floats
2019-01-21 11:34:47 +13:00
Bruce Luckcuck
3d671c7134 Use fabsf() instead of ABS() for floats
The ABS() macro doesn't handle -0 floats correctly. Also fabsf() is more efficient.
2019-01-19 14:15:54 -05:00
Bruce Luckcuck
d867aeced3 Move anti-windup iterm reset from rx loop to pid loop
Having the iterm resetting happening in the rx loop causes a sawtooth PID/motor effect while idling since the PID loop is running at a much higher rate and iterm is allowed to grow during this, and then only reset at a much lower rate in the rx loop. This can potentially lead to some oscillation and/or resonance while idling before takeoff as the sawtooth signal can make it through to the motor outputs.
2019-01-19 11:18:24 -05:00
Tony Cabello
ec71965dd8 GPS Rescue disabled warning 2019-01-15 17:34:04 +01:00
Thorsten Laux
7859e6d540 Add dshot command queue and limit max notch filter frequency 2019-01-12 12:25:30 +01:00
Michael Keller
6e42e3f68f
Merge pull request #7320 from TonyBlit/gps_rescue_arm
Allow arming without GPS
2019-01-11 03:48:34 +13:00
Tony Cabello
007e14f348 GPS Rescue: allow arming without GPS fix (refactor) 2019-01-07 14:27:33 +01:00
Michael Keller
00e0248988
Merge pull request #7264 from joelucid/dshot_telemetry
Dshot telemetry
2019-01-08 01:04:22 +13:00
Thorsten Laux
816da6cbf5 Dshot erpm telemetry on the signal line 2019-01-03 14:42:52 +01:00
mikeller
e4383b5a36 Simplified conditionals for using gyro data analysis. 2018-12-30 01:31:06 +13:00
Kenneth Mitchell
ab4ff72cc2
Add max FFT to OSD Summary 2018-12-27 14:50:09 -06:00
mikeller
468d8a3af5 Added 'small_angle' indicator to OSD flip arrow. 2018-12-20 01:20:49 +13:00
Bruce Luckcuck
5ed1bbb2a9 Fix OSD throttle position element calculation and add 3D support
Previously the Throttle Position element calculation was based solely on the raw rcCommand value and didn't take into account the min_check deadzone so the resulting displayed percentage was incorrect. Also 3D trottle handling was not considered.

Corrected the calculation and added support for 3D throttle modes. Reversed thrust will be represented with negative throttle percentages.
2018-12-08 12:58:06 -05:00
Michael Keller
76e3722a17
Merge pull request #7159 from TonyBlit/gps_rescue_prevent_arm
GPS Rescue: check failsafe procedure when preventing arming
2018-12-03 23:33:04 +13:00
Tony Cabello
84d2bc2c83 Arm prevention if Rescue is activated 2018-12-02 19:17:52 +01:00
Tony Cabello
bdd57a6ce4 GPS Rescue: check failsafe procedure when preventing arming 2018-12-02 04:47:47 +01:00
Tony Cabello
3199c48ee9 GPS Rescue no longer forces a reset home position when disarmed
Home position is deinitialized on disarm at gpsUpdate, so it can't be missed
DistanceFlown is reset inside GPS_calculateDistanceFlown
DistanceFlown was not calculated properly
2018-11-26 00:32:22 +01:00
Bruce Luckcuck
98641cde75 Suppress OSD stats if disarming from crash-flip or untriggered launch control
The OSD stats provide no meaningful information and are just an annoyance when exiting these special states.

For Launch Control the stats will be displayed if the launch is triggered and normal flight occurrred.
2018-11-04 09:57:02 -05:00
mikeller
79fd505a8c Changed warning to only be shown when armed. 2018-11-04 13:37:39 +13:00
mikeller
286f21150c Unified warning activation conditions. 2018-11-03 19:25:43 +13:00
Bruce Luckcuck
b723d2976d Changes from review and add unit tests
Stylistic updates and add tests to the PID unit tests to verify launch control behavior
2018-10-30 18:14:49 -04:00
Bruce Luckcuck
e4dc93b128 Launch Control
Adds a race start assistance system that allows the pilot to pitch forward and then release the sticks with the quad holding position for the race start.
2018-10-27 11:50:37 -04:00
Bruce Luckcuck
4636f10385 Prevent MOTOR_STOP auto-disarm for stick arming when GPS Rescue is active
The MOTOR_STOP logic is designed to stop the motors if:
1. MOTOR_STOP feature is enabled
2. Airmode is disabled
3. Throttle is at minimum

The problem is that this also applied during GPS Rescue and if the pilot had these conditions the motors would stop. Changed to disable MOTOR_STOP while GPS Rescue is active.

Also if stick-arming is used the MOTOR_STOP logic also will auto-disarm after 5 seconds (auto_disarm_delay). Disable this also when GPS Rescue is active.
2018-10-24 11:28:04 -04:00
mikeller
817bb2ed86 Rename 'isAirmodeActive()' to 'airmodeIsEnabled()'. 2018-10-23 01:09:17 +13:00
Bruce Luckcuck
f0e2cf195b Fix stick arming auto-disarm timer not being reset
Fix code path that could prevent the auto-disarm timer from being reset leading to a possible immediate disarm if airmode was switched off while in flight.
2018-10-15 09:00:13 -04:00
Michael Keller
b43c6ca73b
Merge pull request #6796 from etracer65/adjustment_range_optimize
Optimize in-flight adjustments to only process configured ranges
2018-09-20 20:51:21 +12:00
Bruce Luckcuck
044648ca12 Optimize in-flight adjustments to only process configured ranges
Previously the logic would process all possible ranges defined by MAX_ADJUSTMENT_RANGE_COUNT even if some (or even all) ranges were not configured.  This change first builds a list of configured ranges and only processes thos entries.

Reduces CPU load by skipping unnecessary processing and minimizes the impact of increasing the number of available ranges.
2018-09-18 10:31:58 -04:00
ctzsnooze
37da70c555 rebase and recheck 2018-09-15 12:19:53 +10:00
mikeller
0bce8549ee Renamed 'fc/fc_' files to remove the double 'fc'. 2018-08-26 14:07:06 +12:00
Renamed from src/main/fc/fc_core.c (Browse further)