1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00
Commit graph

12294 commits

Author SHA1 Message Date
Michael Keller
37b059532f
Merge pull request #8792 from jflyper/bfdev-fix-servo-to-write-...
Write forward only servos
2019-09-03 23:59:24 +12:00
Michael Keller
dd8d7b0be2
Changed Unified Target custom defaults to use sector 0 memory. (#8797)
Changed Unified Target custom defaults to use sector 0 memory.
2019-09-03 23:34:10 +12:00
mikeller
802c053e4e Removed Dshot1200 protocol. 2019-09-03 23:00:01 +12:00
Thorsten Laux
1a4c42aabc change transient throttle limit to 0 2019-09-03 12:38:12 +02:00
jflyper
a5c4c8c21f Refactor tripcopter case 2019-09-03 15:10:06 +09:00
azolyoung
86e79b2216 add speedybee f7 2019-09-03 12:01:59 +08:00
mikeller
1c8cfbd241 Extended configuration status to accommodate custom defaults. 2019-09-03 09:57:43 +12:00
Dominic Clifton
8731e4a003 Use CCM_CODE for DMA handlers on F3.
This shaves a few cycles when handling the DSHOT telemetry responses.
Fewer invalid packets.
2019-09-02 18:40:13 +02:00
Dominic Clifton
105093211d Use CCM_CODE for pwmDshotSetDirectionInput andmotor_DMA_IRQHandler on
F3.

This reduces the cycles from 396 to 378 which results in 0% invalid
DSHOT telemetry packets!
2019-09-02 18:40:13 +02:00
Dominic Clifton
376441f89f F3 - Add support for code in CCM RAM. 2019-09-02 18:40:13 +02:00
Dominic Clifton
376d4c5294 Use FAST_CODE for motor_DMA_IRQHandler 2019-09-02 18:40:13 +02:00
Dominic Clifton
a722be1a15 Use FAST_CODE for pwmDshotSetDirectionInput. 2019-09-02 18:40:13 +02:00
mikeller
460c16d57d Changed Unified Target custom defaults to use sector 0 memory. 2019-09-02 21:16:26 +12:00
ctzsnooze
f61a940a05 Set default dyanmic notch range to medium
In 4.0x the dynamic notch range was set by default to AUTO mode.

This would set range to low, medium or high based on the dynamic lowpass max setting, which the user was supposed to configure to suit the maximum rpm of the quad.

In 4.1 we are moving the maximum value of the dynamic gyro lowpass very high whenever the rpm filter is enabled.  And, generally, it is OK to do this even on non-rpm quads.

The problem then becomes that the dynamic notch quietly shifts itself to HIGH mode, and that can cause it to not track ordinary frame and prop resonances like it should.

I think it will be better overall in medium mode, which works best for most quads out of the box.  Users of very high RPM quads can choose high.  XClass quads or machines with low frequency resonance should choose low, and should set the dyn_notch_min_hz value low enough to reach the resonant peak.
2019-09-02 15:50:10 +10:00
Michael Keller
227f6f76a2
Merge pull request #8769 from mikeller/add_custom_defaults_to_msp
Added support for resetting to custom defaults to MSP.
2019-09-02 08:50:29 +12:00
jflyper
e9c951ea51 Write forward only servos after gimbal servos
Servos marked as forwarded from RC channels and not written previously
should be written after gimbal servos and before forwarding by
FEATURE_CHANNEL_FORWARDING.
2019-09-02 02:34:18 +09:00
ctzsnooze
445122a997 FF defaults increased to 90's
Higher feed forward improves stick responsiveness and reduces bounce back on lower authority quads.

Feed forward defaults in 4.0 were slightly conservative even for typical quads.

In association with ff_boost and ff_max_rate_limit, overshoot with even higher feed forward is less of a problem than before.

I think these values should be about right for 4.1
2019-09-01 20:06:06 +12:00
mikeller
36dc7306e2 Merge branch 'fix_custom_defaults_addresses' into add_custom_defaults_to_msp 2019-09-01 20:03:57 +12:00
Michael Keller
1585b4a31a
Merge pull request #8784 from ctzsnooze/Static-lowpass1-to-match-min
Set default static lowpass1 gyro value to the same as default gyro lowpass1 min
2019-09-01 15:43:28 +12:00
Michael Keller
a835939ddd
Increase iTerm defaults slightly for 4.1 (#8785)
Increase iTerm defaults slightly for 4.1
2019-09-01 15:42:36 +12:00
mikeller
772b249a3f Added support for resetting to custom defaults to MSP. 2019-09-01 14:26:57 +12:00
mikeller
3128328224 Fixed start / end addresses for custom defaults. 2019-09-01 13:35:10 +12:00
Bruce Luckcuck
86f9960987 Gyro filtering restructure
Refactor the gyro filtering to move the filters from the individual gyro sensor and make them part of the logical gyro object. For dual-gyro mode the sensors are averaged BEFORE and then filtering is applied. This differs from the current structure where filtering is applied individually to each sensor and the results were averaged at the end.

Significantly reduces filtering processing load and enables RPM Filtering for dual-gyro mode.
2019-08-31 19:13:41 -04:00
Michael Keller
e38d460acf
Fix tasks period calculation (#8782)
Fix tasks period calculation
2019-09-01 11:01:24 +12:00
Michael Keller
2184a0d126
Merge pull request #8776 from DieHertz/tmotor-f7-target
Add TMOTORF7 FC target
2019-09-01 10:56:26 +12:00
Michael Keller
c33cc100ec
Merge pull request #8759 from TonyBlit/3d_speed
Feature: show 3d speed on the OSD
2019-09-01 01:19:03 +12:00
ctzsnooze
b5ec9cd5bf Increase iTerm defaults slightly for 4.1
The feed forward changes in 4.1 will bring, to all quads of reasonable control authority, reduced setpoint to gyro delay and less error.  iTerm will tend to accumulate less during fast inputs so there will be less of a problem with iTerm-windup and iTerm related bounce-back.

Higher I values lead to better control during tight turns and greater stability in wind.  Higher I doesn't increase the absolute amount of iTerm accumulating in the PID loop, but does allow it to change more quickly and to more quickly zero out the residual errors that are strong in tight turns.

I think this modest increase will optimise performance of the default 4.1 PIDs for most quads.

Lower authority quads will need to either reduce their I setting, or, preferably, lower the iterm_relax value to 10 or even 5, to avoid wind-up.
2019-08-31 12:59:51 +10:00
ctzsnooze
e1c1fa8e47 Set static lowpass1 on gyro to match gyro lowpass1 min
In 4.0, the dynamic gyro lowpass1 min and the static gyro lowpass1 alternative had the same values, so that if the dynamic lowpass was not active, we would get conservative static filtering.

In moving to 4.1 with PT1 filtering we have raised the dynamic gyro lowpass1 min, but not raised the static gyro lowpass1 value.

We should make them both the same, again.
2019-08-31 12:25:37 +10:00
Bruce Luckcuck
ec43107559 Fix tasks period calculation 2019-08-30 13:39:30 -04:00
Dominic Clifton
c1ce69e813
Merge pull request #8777 from hydra/bf-remove-processrccommand-from-fast-code
Keep `updateRcCommand` out of FAST_CODE.
2019-08-30 17:11:06 +02:00
Tony Cabello
0ddcfc097c Feature: show 3d speed on OSD 2019-08-30 08:21:19 +02:00
Dominic Clifton
99f18775c8
Merge pull request #8768 from hydra/bf-dshot-remove-micros-use-in-irq-handler
Reduce CPU usage in dshot motor handler to reduce DSHOT telemetry errors.
2019-08-30 03:12:26 +02:00
Dominic Clifton
2d4b2f827b
Merge pull request #8771 from etracer65/target_furyf4osd_add_baro
Add missing baro support for target FURYF4OSD
2019-08-30 01:04:56 +02:00
Michael Keller
2cb3191d8a
Merge pull request #8758 from TonyBlit/fix_ttff
BugFix: time to first fix was sometimes abnormally high due to improp…
2019-08-30 07:25:51 +12:00
Dominic Clifton
d016aa2fc4 DSHOT - Use cycle counting instead of recording timestamp in dshot motor_DMA_IRQHandler.
It turns out that two calls to micros() and the calculation of
directionChangeDurationUs took 581 cycles, vs 396 cycles without the
calls to micros() and deferred calculation of the duration which is only
needed in the CLI.

This brings the time down from around 7 microseconds to 5.5 microseconds
on an F3 at 72Mhz.

This makes the difference between 100% invalid telemetry and 4% invalid
telemetry on the first motor on the F3.

Squashed commits:
* Remove the forward declaration for `pwmDshotSetDirectionInput` and make
it static.
* Remove unneeded forward declaration of `motor_DMA_IRQHandler`.
* Remove duplication in DMA IRQ Handler.
  Doesn't affect resulting code but improves readability.
* Use an inline function to read DWT->CYCCNT.
* Remove unneeded forward declarations from cli.c now that the correct
header is included.
* Update DWT unlock method.
2019-08-29 20:01:20 +02:00
Michael Keller
fc97d888f4
Scheduler - Fix unused period warning when `USE_TASK_STATISTI… (#8765)
Scheduler - Fix unused `period` warning when `USE_TASK_STATISTICS` is not defined.
2019-08-30 02:07:13 +12:00
Dominic Clifton
0baed339e6 Keep updateRcCommand out of FAST_CODE.
It's event driver or called at 33hz.

Keeping this out of FAST_CODE allows for more important code to be
placed in FAST_CODE.
2019-08-29 15:52:07 +02:00
Tony Cabello
751e1ae444 BugFix: time to first fix was sometimes abnormally high due to improper configuration of Ublox GPS 2019-08-29 15:41:36 +02:00
Michael Keller
6f4c2bb48c
Merge pull request #8770 from etracer65/fix_osd_hdop_pg
Fix osd_gps_sats_show_hdop setting being in incorrect PG
2019-08-30 01:40:02 +12:00
Andrey Mironov
84c6939f29 Added TMOTORF7 target 2019-08-29 15:58:40 +03:00
Bruce Luckcuck
3bec1576ba Add missing baro support for target FURYF4OSD 2019-08-28 11:07:57 -04:00
Bruce Luckcuck
736a677a3c Fix osd_gps_sats_show_hdop setting wrong PG
Setting was mistakingly in PG_GPS_CONFIG and should be in PG_OSD_CONFIG.
2019-08-28 11:01:45 -04:00
Dominic Clifton
5dd4038e1c Scheduler - Fix unused period warning when USE_TASK_STATISTICS is
not defined.
2019-08-28 09:22:32 +02:00
Dominic Clifton
1ae4b2830a F3 - Fix type conversion warning in ADC code. 2019-08-28 09:16:18 +02:00
Dominic Clifton
a8262722d5 Refactor pwmDshotSetDirectionOutput.
Refactoring steps were as follows:
* Duplicate pwmDshotSetDirectionOutput to pwmDshotSetDirectionInput and
remove `output` variable in preparation for removing the `output` variable from each method.
* Delete all trace of `output` flag from `pwmDshotSetDirectionInput`
* Delete all trace of `output` flag from `pwmDshotSetDirectionOutput`
* Cleanup now that pwmDshotSetDirectionInput is only called when USE_DSHOT_TELEMETRY is
enabled.
* Remove redundant code paths.
* Move #ifdef outside the method.
* Removed parameters that are never needed.
* Delete unneeded forward declarations.
2019-08-28 08:57:04 +02:00
Michael Keller
4f923e4827
Merge pull request #8745 from etracer65/dshot_telemetry_info_msp
Add motor telemetry data to MSP - support displaying RPM in the Configurator
2019-08-28 17:17:57 +12:00
Michael Keller
8859e58615
Feature: show HDOP next to num sats indicator (#8760)
Feature: show HDOP next to num sats indicator
2019-08-28 17:16:23 +12:00
Dominic Clifton
4eb839c7bf Add fullTimerHardware for F3 for use with USE_TIMER_MGMT.
STM32F3 doesn't have TIM5.
2019-08-27 04:38:16 +02:00
Bruce Luckcuck
d698a559c5 Add motor telemetry data to MSP
Adds the RPM (ESC sensor or DSHOT telemetry), invalid packet stats (DSHOT telemetry), and ESC temperature (ESC sensor) for each motor to MSP.

Adds controlling flags and `motor_poles` to `MSP_MOTOR_CONFIG`.

Added to the MSP_MOTOR_CONFIG message:
U8    configured motor count
U8    motor poles
U8    dshot telemetry enabled (boolean)
U8    esc sensor enabled (boolean)

New MSP_MOTOR_DSHOT_TELEMETRY message
U8    motor_count - number of active motors for which data will follow
Loop for motor_count
U32   motor_rpm
U16   invalid_packet_percent - 2 decimal places. So 10000 is 100.00%
U8    esc temperature (degrees celcius)
U16   esc voltage (0.01V per unit)
U16   esc current (0.01A per unit)
U16   esc mAh consumption
2019-08-26 17:56:08 -04:00
Michael Keller
2b1d256396
Merge pull request #7455 from SteveCEvans/baro_task
Split Baro task into four, rather than two states to reduce max task duration
2019-08-27 08:29:21 +12:00