1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 12:25:20 +03:00
Commit graph

2314 commits

Author SHA1 Message Date
Dominic Clifton
0caf8a65ba Merge pull request #852 from ProDrone/Failsafe_features_1
Failsafe - New failsafe functionality (Phase 1)
2015-09-05 22:50:34 +01:00
Dominic Clifton
cb147ec85e Fix CJMCU build, broken by df92691410 2015-09-05 20:34:40 +01:00
Dominic Clifton
564c131db5 Merge pull request #1283 from sppnk/patch-4
Fixing servo command parsing of "rate" field
2015-09-05 18:53:33 +01:00
Dominic Clifton
df05d599b5 Merge pull request #1258 from ProDrone/is1257_false_rx_loss_detection_1
Fix false RX loss detection on EEPROM read/write
2015-09-05 18:11:11 +01:00
Dominic Clifton
28aad588cb Fix vtail mixer defaults. Closes #988
Previously the vtail mixer was a copy of the atail mixer which was
incorrect.

The new defaults cater for frames like the Armattan Morphling Vtail.
2015-09-05 18:03:02 +01:00
Dominic Clifton
df92691410 update dump command to show per-profile servo reverse settings. See
#1140.
2015-09-05 18:01:36 +01:00
borisbstyle
a0ac565ff5 Merge remote-tracking branch 'motolab/motolab-integration' into betaflight 2015-09-05 15:11:38 +02:00
ProDrone
f0681de53d Updates and feature additions to failsafe system.
- Added failsafe flightmode and rc control box.

To make failsafe procedure a separate flight mode and make it possible
to trigger failsafe with an AUX switch.

- Failsafe mode is activated when failsafe is active.

RC link lost is simulated with the failsafe AUX switch.
When NOT armed: failsafe switch to failsafe mode is shown in GUI (mode
tab).

- Activate failsafe mode with AUX switch.

- Prevent arming when failsafe via AUX switch is active (safety issue).

- Make failsafe disarm if motors armed and throttle was LOW (2D & 3D)
for `failsafe_throttle_low_delay` time (__JustDisarmEvent__).

Applied code changes to effectively add pull request: Make failsafe
disarm if motors armed and throttle low #717.

- Use failsafeIsMonitoring() to actually start monitoring.

- Added `failsafe_kill_switch` to code.

When set to 1 (0 is default), the failsafe switch will instantly disarm
(__KillswitchEvent__) instead of executing the landings procedure.
Arming is NOT locked after
this, so the craft could be re-armed if needed.
This is intended for racing quads where damage and danger must be
minimized in case of a pilot error.

- Added `failsafe_throttle_low_delay`, adapted documentation.

Used to adjust the time throttle level must have been LOW
to _only disarm_ instead of _full failsafe procedure_
(__JustDisarmEvent__).

- Updated the failsafe documentation.

- Re-enable arming at end of failsafe procedure.

At the end of a handled failsafe event, that means: auto-landing,
__JustDisarmEvent__ or __KillswitchEvent__, the RX link is monitored for
valid data.
Monitoring is a part of the failsafe handling, which means the craft is
still in failsafe mode while this is done.
Arming is re-enabled (allowed) when there is a valid RX link for more
then XX seconds, where XX depends on the handled event like this:
1. XX = 30 seconds after auto landing.
2. XX = 3 seconds after __JustDisarmEvent__.
3. XX = 0 seconds after __KillswitchEvent__.

NOTE: When armed via an AUX switch, you will have to switch to the
disarmed position at the very end to be able to re-arm.
The failsafe mode will not end until you do.

- __KillswitchEvent__ has now priority over __JustDisarmEvent__

- Apply rxfail values instantly when failsafe switch is ON

- Added missing cases to display.c

Show M when failsafe is monitoring for RX recovery (AND disarming when
armed with a switch).

===

Reworked the code from counter-based to time-based.

- AUX failsafe switch now has identical behavior to RX loss.

- Added RX failure and RX recovery timing.

- __KillswitchEvent__ skips RX failure detection delay (direct disarm).

===

[UNIT TESTS]

Adapted failsafe related unittests from counter-based to time-based

- Added failsafeOnValidDataFailed() to some tests

- Removed duplicate test setup from rc_controls_unittest.cc

- Removed magic numbers from rx_ranges_unittest.cc and rx_rx_unittest.cc

- Reworked all test-cases for flight_failsafe_unittest.cc
2015-09-04 16:55:40 +02:00
ProDrone
3a13edfdad Fix false RX loss detection on EEPROM read/write
The problem is caused by hardware counters (timekeeping and PPM/PWM
measurement) that keep running while the firmware is frozen. The result
is misinterpretation of received data.

EEPROM read & write now call a suspend and resume function to make RX
ignore incoming wrong data during reads/writes (and flush the wrong data
on resume).

Fixes issue #1257

(+1 squashed commit)
- Moved the check for skipSamples to the right place.

As commented by hydra
2015-09-04 16:54:25 +02:00
ProDrone
a46832fd85 Changed behavior of PR #1233 and doc update
Stick channels only have AUTO and HOLD mode.
AUX channels only have SET and HOLD mode.
Added check to parameter in CLI.
Modified rx.md to reflect changes (and more).

+1 squashed commit:

- A cleaner approach for the same functionality

Basically addressing all comments from Hydra
2015-09-04 16:51:19 +02:00
ProDrone
3b9cd37a57 Prevent arming when in CLI mode 2015-09-04 16:46:03 +02:00
Nicholas Sherlock
f7530df974 Fix 1 millisecond backwards time leap in time measured by micros()
This race condition caused periodic flight instability when micros() was
called precisely on a 1000 nanosecond boundary.
2015-09-04 23:44:41 +12:00
borisbstyle
c9c073b71a micros fix // timer bug F3 targets
This solves the twitching issues on F3 targets
2015-09-04 12:28:22 +02:00
sppnk
45d31f2290 Fixing servo command bug
The limits for RATE were bad, so we had a "Parse error" when changing rate values other than 100.
2015-09-03 16:47:00 +02:00
borisbstyle
cb8c56d814 add microsecond delay to interrupt read 2015-09-03 15:22:21 +02:00
borisbstyle
426ccbd307 Watchdog delay timer to 150
Should be enough!

Update Hex files
2015-09-03 15:22:16 +02:00
nathan
80be01e530 bring betaflight up to par with serial1wire-blheli-multiesc 2015-09-02 21:43:42 -07:00
borisbstyle
6d99b58330 Lower watchdog timer for interrupt 2015-09-02 14:28:41 +02:00
borisbstyle
1b18d7aa14 Remove blheli bug workaround 2015-09-02 13:53:08 +02:00
borisbstyle
b457b16227 Merge branch 'betaflight' of https://github.com/borisbstyle/cleanflight into betaflight 2015-09-02 13:13:59 +02:00
4712
f6d99f356c fixed undefined reference to usb1WireInitialize() 2015-09-02 12:45:31 +02:00
borisbstyle
4899c0898d rebase correction 2015-09-02 00:41:12 +02:00
nathan
6e37b352e7 multiesc support for the cc3d 2015-09-02 00:38:39 +02:00
nathan
5be6a0762f serial1wire MSP and multi-esc configuration logic, compatible with BLHeliSuite 14.0.0.3.2 (beta)
mad props to @4712
2015-09-02 00:35:19 +02:00
nathan
291a56d9ca SPRACINGF3 support for serial1wire passthrough 2015-09-02 00:34:28 +02:00
nathan
8f12125c1e serial 1wire passthrough for ESCs with the BlHeli bootloader 2015-09-02 00:34:24 +02:00
nathan
804e2268bd cc3d opbl target -- undef baro to get it to build
without this: region `FLASH' overflowed by 144 bytes
2015-09-02 00:31:51 +02:00
borisbstyle
82e23fd437 rework RC Smoothing 2015-09-02 00:31:46 +02:00
borisbstyle
77effd3b71 Luxfloat Level Mode (rcCommand scaled to max_angle_inclination) 2015-09-02 00:31:00 +02:00
borisbstyle
9febb8cacd New Betaflight Defaults
Still good idea to get full 1kh sampling by disabling acc on naze boards
2015-09-02 00:30:58 +02:00
borisbstyle
bb12ad8646 Yaw pterm_cut_hz (derived from pterm_cut_hz) 2015-09-02 00:30:57 +02:00
borisbstyle
7a6fbc1702 original dT back
update hex
2015-09-02 00:30:56 +02:00
borisbstyle
bb4b5526cc Correction in watchdog // old dT
restore old dT
2015-09-02 00:30:53 +02:00
borisbstyle
5390cdc804 Selectable BARO (set baro_hardware)
Disabling baro will boost performance on FULL boards
2015-09-02 00:30:51 +02:00
borisbstyle
00ae128e3d constdT for gyro fliter
dTGyro
2015-09-02 00:30:49 +02:00
borisbstyle
41895bc1af New Clli params RC Smoothing and sync_gyro_to_loop 2015-09-02 00:30:46 +02:00
borisbstyle
259630840a Luxfloat more precision in Configurator tuning 2015-09-02 00:30:45 +02:00
borisbstyle
b02a884c0c Betaflight Recognition 2015-09-02 00:30:44 +02:00
borisbstyle
6a92b9a808 F1 target decreased max refresh 2015-09-02 00:30:43 +02:00
borisbstyle
a2d3a79187 Add MPU3050 INT_STATUS 2015-09-02 00:30:42 +02:00
borisbstyle
6f3afb2df1 Enable full 1khz sampling on F1 boards (no acc mode) 2015-09-02 00:30:41 +02:00
borisbstyle
de5f6aa68f MPU6500 INT_STATUS support // MPU3500 dummy handling 2015-09-02 00:30:40 +02:00
borisbstyle
26deeb8ff6 Loop synced to Gyro
Remove double MPU_RA_PWR_MGMT_1

Looptime to Gyro refresh rate

disable 2khz when acc used for F3

Gyro sync code improvement

doc change
2015-09-02 00:30:39 +02:00
borisbstyle
07b9aceb7c Luxfloat Optimisation and new defaults
Remove constraining of delta

Yaw D default to 10

Default change and rebase with master
2015-09-02 00:30:38 +02:00
borisbstyle
d282ec3483 Remove TPA from Iterm PID1 2015-09-02 00:30:37 +02:00
borisbstyle
60955fc27d RC Smoothing
fix loopcount

Improve AUX logic // initial factor set to 1

Better Delta approach

FIX AUX CALC

Update refresh rates
2015-09-02 00:30:36 +02:00
borisbstyle
fdcfe71b73 Improve soft filtering function for reuse
Reorder serial.c *_cut_hz parameters

Remove unnecessary dT calculation in luxfloat

Restructured filter

filter.h fix

Luxfloat remove internal dT

Void function for gyro fillter
2015-09-02 00:30:35 +02:00
Richard Lehey
637fd64f36 Add support for new BMP280 barometer, modified files 2015-09-02 00:30:33 +02:00
Richard Lehey
105910b25a Add support for new BMP280 barometer 2015-09-02 00:30:32 +02:00
nathan
5c20fdf1c5 SPRACINGF3 support for serial1wire passthrough 2015-09-02 00:30:31 +02:00