1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00
Commit graph

66 commits

Author SHA1 Message Date
Bruce Luckcuck
f584780944 Gyro native rate sampling, filtering, and scheduler restructuring 2020-02-04 18:19:35 -05:00
mikeller
ab025b76a8 Fixed missing spaces after 'if'. 2020-01-26 13:16:01 +13:00
Dominic Clifton
2fead0aedf Log disarm reason. 2020-01-16 20:16:11 +01:00
mikeller
93c708f57d Refactored 'WAS_EVER_ARMED' arming flag to be only enabled on first disarm. 2019-11-30 15:01:55 +13:00
mikeller
cedcf2d7e2 Added calibration menu to CMS. 2019-11-19 13:59:52 +13:00
mikeller
a045a9c672 Improved compass calibration. 2019-11-19 01:08:44 +13:00
mikeller
cc8b8d3bf6 Improved detection of upright / 'SMALL_ANGLE' state. 2019-11-18 14:09:06 +13:00
mikeller
e0a6f1ab14 Improved fixed wing detection. 2019-11-17 14:05:07 +13:00
mikeller
4a7904695e Moved 'config.[ch]' into the 'config/' directory. 2019-10-28 11:17:25 +13:00
Bruce Luckcuck
365c6cb1f6 Move calibrationCompleted flag to a 4th element in the accZero structure
Allows the flag indicating that calibration was completed to be output in the values for `acc_calibration`.
2019-10-21 11:49:11 -04:00
Bruce Luckcuck
565f1f4db5 Add ACC_CALIB arming disabled reason if ACC is required but not calibrated
Checks various features, modes, and OSD elements to determine if ACC is needed. Generates an arming disabled warning if ACC calibration has never been completed.
2019-10-21 11:13:55 -04:00
Bruce Luckcuck
5a9ce05ec0 Prevent DSHOT commands during protocol initialization/detection
Adds a fixed delay after the motors are enabled before DSHOT commands can be sent. Fixes a problem caused by sending DSHOT commands too soon and prevent the ESC from properly detecting the protocol.
2019-09-21 18:26:05 -04:00
Michael Keller
a29ba5f00b
Prevent runaway takeoff detection during GPS Rescue flight mode (#8870)
Prevent runaway takeoff detection during GPS Rescue flight mode
2019-09-13 09:28:50 +12:00
mikeller
65be79c86a Fix faulty timer allocation in bitbanged Dshot. 2019-09-13 00:29:09 +12:00
Bruce Luckcuck
7c52886b22 Prevent runaway takeoff detection during GPS Rescue flight mode
Addesses the possible edge case of runaway takeoff detection still being active and getting triggered by the quick yaw turn when GPS Rescue is activated.
2019-09-11 12:20:36 -04:00
jflyper
adf6fd1764 DMA bit banging Dshot, first cut
F405 working (OMNIBUSF4SD target)
F411 not tested
F722 working, needs testing (OMNINXT7 target)
F74x not working

NOX target (temporary)

bb_dshot with telemetry on f4
bbshot f7 targets and fix crash due to missing debug pins

remove empty line

add empty lines

remove OMNIBUSF4 specific debug pins

add missing comma

add missing comma

Use separate bbTimerHardware array to fix unified targets

eliminate now unneeded timerGetByUsage

don't duplicate timer1 def

Add auto mode, rename dshot_bbshot to dshot_bitbang

remove newline

renamve various files

various changes to address feedback

address feedback

address feedback

add pacer timers to timer show

don't disable telemetry if dshot_bitbang is on or auto

Address feedback, add faster decode implementation based on bit banding, modify dma parameters to reduce required memory bandwidth on half

remove debug output

remove NOINLINE

Protect gpio direction change with critical sections

FIXWS_SAVE_INDEX

add static back in

no forward typedef

address review feedback

disallow proshot1000 with dshot bitbang

Extracted and plumbed up 'dbgPin'.
2019-09-04 16:06:48 +12:00
mikeller
766c90bf00 Moved telemetry processing into the frame processing handler. 2019-08-13 01:21:21 +12:00
jflyper
542146c702 Motor code refactor (Phase 1) 2019-07-17 01:33:39 +09:00
mikeller
1920a61226 Some fixes for persistent stats. 2019-06-11 02:05:19 +12:00
Michael Keller
bb560ebdb8
Extend the scope of BOXPARALYZE to cover stick commands, adjustments, and CMS. (#8161)
Extend the scope of BOXPARALYZE to cover stick commands, adjustments, and CMS.
2019-05-09 14:50:30 +12:00
mikeller
4fb58b340e Extend the scope of BOXPARALYZE to cover stick commands, adjustments, and CMS. 2019-05-06 01:28:37 +12:00
mikeller
5141bbfa94 Moved 'rpm_filter' into 'flight'. 2019-05-06 00:10:31 +12:00
Thorsten Laux
f1e9c9f19a invert csum in telemetry 2019-05-02 14:18:19 +02:00
Michael Keller
b9fc77db3b
When GPS Rescue is engaged after a Failsafe, pilot has to manually sw… (#7936)
When GPS Rescue is engaged after a Failsafe, pilot has to manually sw…
2019-04-30 08:24:59 +12:00
Bruce Luckcuck
644d5713df Add DSHOT telemetry motor level packet stats
Captures packet quality statistics per motor to provide a platform for troubleshooting and in-flight alarms or warnings.

Continuously monitors and captures packet stats over the past second to be used to determine DSHOT telemetry link quality.

Update the CLI to move the DSHOT telemetry data/stats out of the `status` command and into a dedicated `dshot_telemetry_info` command. Reformatted the motor data to include the invalid packet percentages. Will aid in debugging by identifying ESC's that may be misconfigured (not supplying data), or those with problems generating high invalid packet percentages.

Data can later be used to generate OSD and beeper-based warnings if invalid packet percentages exceed thresholds.

Included a blackbox logging debug mode (`set debug_mode = DSHOT_RPM_ERRORS`) to record the per-motor invalid packet percentages in hundredths of a percent (so 123 is 1.23%).
2019-04-16 08:47:50 -04:00
Tony Cabello
d829563179 GPS Rescue procedure can be aborted by moving sticks, with a configurable delay after recovering rx 2019-04-14 14:15:17 +02:00
Michael Keller
e12b802bb1
Merge pull request #7927 from krzysztofmatula/km-odometer
Flight statistics (odometer) added.
2019-04-14 21:49:31 +12:00
Krzysztof Matula
eb99c7e0d1 stats:
- cosmetic changes from code review
- not enabling stats on any F3 (not enough flash)
2019-04-07 12:09:28 +02:00
Krzysztof Matula
36c8f1e224 Flight statistics (odometer) added.
Supported counters:
- total flights count
- total flight time
- total flight distance (if GPS available)
2019-04-05 23:43:09 +02:00
mikeller
760a524027 Fixed tests, added crash indication. 2019-04-05 08:39:23 +13:00
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