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

386 commits

Author SHA1 Message Date
jflyper
ff16686893 White space tidy 2020-02-17 23:54:57 +13:00
Tdogb
91333f3781 updated default crashflip expo to 35 2020-01-12 17:01:13 -05:00
Tdogb
3243aafdb9 crashflip expo 2019-12-17 12:57:47 -05:00
Tdogb
73a280cc85 initial commit of crashflip motor power percentage control 2019-12-16 17:24:55 -05:00
mikeller
e0a6f1ab14 Improved fixed wing detection. 2019-11-17 14:05:07 +13:00
Bruce Luckcuck
be79913726 Change virtual current meter to use setpoint rather than rcCommand throttle
Use the final calculated throttle value that may be affected by throttle limiting, throttle boost, etc. instead of the rcCommand input when calculating the virtual current meter.
2019-11-08 16:16:16 -05:00
mikeller
4a7904695e Moved 'config.[ch]' into the 'config/' directory. 2019-10-28 11:17:25 +13:00
Thorsten Laux
d6535d9b38 fix idleMinMotorRps scale 2019-08-04 19:01:34 +02:00
Thorsten Laux
5767102889 scale idleThrottleOffset correctly 2019-08-04 14:34:34 +02:00
Thorsten Laux
e66ab2d8fe ifdef static var 2019-08-02 17:30:22 +02:00
Thorsten Laux
d033a8dc76 address code review 2019-08-02 14:20:37 +02:00
Thorsten Laux
293dc42710 address feedback 2019-08-02 13:51:44 +02:00
Thorsten Laux
bca9f8a587 better idle defaults and don't set idle_throttle if not enabled 2019-08-02 13:51:44 +02:00
Thorsten Laux
e39d5e7000 Make dyn_idle a conditional compile 2019-08-02 13:51:44 +02:00
Thorsten Laux
b4c4757470 Conditional idle compile 2019-08-02 13:51:44 +02:00
Thorsten Laux
ba2c1e9264 IDLE updates 2019-08-02 13:51:44 +02:00
Thorsten Laux
d474df3149 idle 2019-08-02 13:51:44 +02:00
jflyper
542146c702 Motor code refactor (Phase 1) 2019-07-17 01:33:39 +09:00
Dominic Clifton
1f2ef98042 Fix compilation when USE_DSHOT and USE_PWM_OUTPUT are not defined.
Fix compilation when USE_DMA and USE_DMA_SPEC are not defined.

Cleanup calling code of `isMotorProtocolDshot`.

Fix 'unused' warning when USE_PWM_OUTPUT is not defined.

Undo isMotoroProtocolDshot change.

Disable USE_SERIAL_4WAY_BLHELI_INTERFACE when USE_PWM_OUTPUT is not
enabled.

Style cleanup.
2019-07-03 08:36:12 +12:00
jflyper
0e63596abd Move motorConfig_s, motorDevConfig_s and associated PG handling into pg/motor.[ch] 2019-06-29 20:03:54 +09:00
jflyper
cf219cd8a6 Add and handle USE_TIMER 2019-05-05 19:42:52 +09:00
jflyper
45b7fa8095 Add and handle USE_PWM_OUTPUT 2019-05-05 18:05:13 +09:00
Thorsten Laux
5a759c56ef avoid dshot telemetry collisions
actually use calculated deadtime

fix whitespace and return value

fix ws

Address review feedback

fix ws
2019-03-26 21:51:25 +13: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
mikeller
acf759b82e Fixed detection of brushless / brushed motors. 2019-03-03 13:01:04 +13:00
Thorsten Laux
e16ef1db4f First attempt low throttle airmode oscillation fix
raise dc offset immediately

Add airmode noise fix

no filter when inactive and slightly more throttle

hpf throttle to avoid large moves increasing throttle persistently

fix ws

fix ununsed variable and default to off

include airmode throttle offset in loggingThrottle
2019-02-18 23:48:36 +13:00
mikeller
73d18ede66 Halved motor_output_limit for 3D modes. 2019-01-30 00:05:41 +13:00
mikeller
a3cf7e0cf7 Added motor output limiting per profile. 2019-01-28 00:37:00 +13:00
Michael Keller
06f89603bc
Merge pull request #7463 from etracer65/mixer_throttle_fix
Fix mixer throttle calculation
2019-01-27 11:38:15 +13:00
Bruce Luckcuck
8f7cb7184e Fix mixer throttle calculation
The calculation used to transform the rcCommand[THROTTLE] value to a throttle value used in the mixer was incorrectly applying the `min_check` range a second time. This leads to the mixer throttle value scaling incorrectly and adds an additional deadzone at the low range that basically doubles the `min_check` range.
2019-01-25 16:51:30 -05:00
Bruce Luckcuck
99685c21c6 Add setpoint to blackbox logging
Currently only rcCommand values are included in the log data and the configurator calculates the actual setpoint values based on rates values added to the blackbox header. The problem with this is that the rates information is only written at arming so if the rates change during the log (rateprofile change, in-flight adjustments, etc.) then the calculated setpoints will be incorrect. There's no way to tell from the log that this happened. This often causes confusion because it will suddenly make it appear in the log that the PID controller is not acheiving the requested rates when it's just a presentation error. Also the rates will be incorrectly calculated when the user selects Raceflight style rates as the rates type is not supplied in the log header (and the viewer doesn't have the forumla for them anyway).

This change adds the actual setpoint values for each axis as used by the PID controller, removing the necessity for the viewer to perform any calculations. In addition to showing any rate changes, it will also show any cases where other flight features have modified the setpoints from the user's input. These were invisible previously (examples include level modes, Acro Trainer, GPS Rescue, yaw spin recovery, etc.).

Also the throttle value used in the mixer is included in the throttle axis. This allow visualization of things that affect the commanded throttle like throttle boost, throttle limit, GPS Rescue, angle level strength, etc.
2019-01-25 09:01:55 -05:00
Michael Keller
a136f0b7e0
Merge pull request #7304 from joelucid/linear_pids
Thrust Linearization
2019-01-09 09:08:06 +13:00
Thorsten Laux
ad253c146b add Thrust Linearization feature 2019-01-03 15:09:17 +01:00
Thorsten Laux
816da6cbf5 Dshot erpm telemetry on the signal line 2019-01-03 14:42:52 +01:00
mikeller
c684547984 Cleaned up Dshot defines. 2018-12-25 00:55:26 +13:00
Michael Keller
32068e3830
Merge pull request #7126 from jflyper/bfdev-generic-handling-of-target-default-mixer
Remove (literal) target dependency from "TARGET_DEFAULT_MIXER"
2018-11-26 21:52:04 +13:00
Bruce Luckcuck
b777c6f853 Increase DSHOT digital idle default value
The DSHOT digital idle value is quite low (4.5%) and is often the cause of support issues as users are unaware that they may have to adjust this based on their motor/ESC requirements - leading to de-syncs and "death rolls" or other flip-outs.

While DSHOT capable ESC's (BLHeli_S & BLHeli32) have faster MCU's and are often capable of smoother low speed idling, 4.5% is still quite low. For comparison the `min_throttle` default is 1070 equating to a 7% idle.

I propose raising the digital idle to 5.5% to reduce occurrences of de-syncs from too low idle speed.
2018-11-25 10:34:05 -05:00
jflyper
68da794db8 Remove (literal) target dependency 2018-11-25 10:44:13 +09:00
mikeller
ff8b2aa451 Fixed '3d_switched_mode' case. 2018-11-07 02:58:25 +13:00
mikeller
ea99f7785b Fixed crash flip with 3D enabled. 2018-11-07 02:55:29 +13:00
Michael Keller
3492bcff3d
Merge pull request #7028 from mikeller/add_crash_flip_led_warning
Added 'crash flip active' to the list of warnings to be shown on LED_STRIP.
2018-11-04 14:52:40 +13:00
Michael Keller
a815486d56
Merge pull request #7006 from etracer65/dynfilter_throttle_update_optimize
Optimize throttle-based dynamic filter cutoff updates
2018-11-04 13:54:52 +13:00
mikeller
79fd505a8c Changed warning to only be shown when armed. 2018-11-04 13:37:39 +13:00
Bruce Luckcuck
957561c14c Add minimum time interval for updates and move into separate function
Prevents updates more often than 5ms even if throttle is very active.

Separated the logic into its own function to tidy up `mixTable()`.
2018-11-03 19:55:20 -04:00
Michael Keller
c0344496ca
Merge pull request #6992 from etracer65/launch_control
Launch Control
2018-11-02 00:49:42 +13:00
borisbstyle
eeeec78c2d
Merge pull request #6981 from rav-rav/airmode_fix
fix incorrect throttle offset in airmode
2018-10-29 09:03:58 +01:00
Bruce Luckcuck
cbb1ac02cf Optimize throttle-based dynamic filter cutoff updates
Current logic produces excessive load because it updates the filter cutoffs every PID loop based on the throttle value.

The throttle values only change based on receive RX packets so they change relatively infrequently compared to the PID loop. However with rc smoothing on throttle the value can change every PID loop.  But in reality we don't really need to adjust the filter cutoffs for every tiny change to the floating point throttle value.

This change quantizes the throttle in to 100 steps and uses that to compare to the previous value to decide if the filter cutoffs need to be updated.  While this reduces the resolution of the filter cutoffs it in turn dramatically reduces the processing overhead.  IF needed the quantization steps can be increased for more resolution but at the cost of some performance.
2018-10-28 19:00:05 -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
Michael Keller
8609346f21
Merge pull request #6943 from kmitchel/dynamic_lowpass
Implement throttle based dynamic gyro and dterm filters.
2018-10-27 19:24:16 +13:00
Kenneth Mitchell
ca460e842b
Implement throttle based dynamic gyro and dterm filters. 2018-10-25 19:23:14 -04:00