mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Merge branch 'master' into betaflight
Conflicts: Makefile docs/Cli.md src/main/config/config.c src/main/drivers/accgyro_mpu3050.c src/main/drivers/accgyro_mpu6050.c src/main/drivers/accgyro_mpu6050.h src/main/drivers/accgyro_spi_mpu6000.c src/main/drivers/accgyro_spi_mpu6000.h src/main/drivers/accgyro_spi_mpu6500.c src/main/drivers/accgyro_spi_mpu6500.h src/main/drivers/barometer_bmp280.c src/main/drivers/sensor.h src/main/flight/pid.c src/main/mw.c src/main/rx/rx.c src/main/sensors/initialisation.c src/main/target/CC3D/target.h
This commit is contained in:
commit
12c9f65f43
82 changed files with 2309 additions and 1771 deletions
|
@ -1,43 +0,0 @@
|
|||
# Autotune
|
||||
|
||||
Autotune helps to automatically tune your multirotor.
|
||||
|
||||
WARNING: Autotune is an experimental feature. Currently enough feedback has been gathered and we do not recommend that anyone uses it until this warning is removed. Autotune may be replaced by G-Tune, Please see https://github.com/cleanflight/cleanflight/pull/568 for details.
|
||||
|
||||
## Configuration.
|
||||
|
||||
Autotune only works in HORIZON or ANGLE mode, before using auto-tune it's best you setup so there is as little drift as possible.
|
||||
Autotuning is best on a full battery in good flying conditions, i.e. no or minimal wind. Autotune does not support pid_controller 2 or higher (pid_controller 0 is the Cleanflight default, pid_controller 1 will work for autotune as well).
|
||||
|
||||
Configure a two position switch on your transmitter to activate the AUTOTUNE mode. Autotune may be done in ether one of the both only, HORIZON or ANGLE mode (will then apply on both modes).
|
||||
|
||||
|
||||
## Using autotuning
|
||||
|
||||
Turn off the autotune switch. If the autotune switch is on while not armed the warning LED will flash and you cannot arm.
|
||||
|
||||
1. Launch the multirotor.
|
||||
|
||||
1. Phase 1: ROLL/YAW autotune.
|
||||
Turn on/hold the autotune switch on your transmitter for approx 5 seconds. You can observe roll left/right while a beep code sounds on the beeper, when turning off the autotune switch, PID settings will have been updated for ROLL and YAW.
|
||||
|
||||
1. Stay in air and re-align your copter for the following PITCH/YAW autotune.
|
||||
|
||||
1. Phase 2: PITCH/YAW autotune.
|
||||
Turn on/hold the switch again for approx 5 seconds. You can observe pitch forwards/backwards while a beep code sounds on the beeper, when turning off the autotune switch, PID settings will have been updated for PITCH and YAW.
|
||||
|
||||
1. Keep flying and see if it's better. If it's worse then while still armed flip the switch again to restore previous PIDs that were present prior to arming. You can do this while still flying or after landing.
|
||||
|
||||
1. Land & disarm. If desired you may verify results via an app while battery power still on. Cutting the power will lose the new unsaved PIDs.
|
||||
|
||||
1. If you're happy with the PIDs then disarm (but leave the battery still on).
|
||||
|
||||
1. Flip the autotune switch again (copter still under battery power) to save all settings.
|
||||
A beeper will sound indicating the settings are saved.
|
||||
|
||||
1. Then flip it back (so you can arm again).
|
||||
|
||||
|
||||
# References
|
||||
|
||||
* Brad Quick for the initial Autotune algorithm in BradWii.
|
|
@ -123,7 +123,6 @@ The OpenPilot bootloader code also allows the remaining section of flash to be r
|
|||
OpenPilot Ground Station (GCS) via USB without requiring a USB to uart adapter.
|
||||
|
||||
The following features are not available:
|
||||
* Autotune
|
||||
* Display
|
||||
* Sonar
|
||||
|
||||
|
|
12
docs/Board - RMDO.md
Normal file
12
docs/Board - RMDO.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Board - RMDO
|
||||
|
||||
The DoDo board is a clone of the SPRacingF3 board in terms of CPU pin mappings. See the SPRacingF3 documentation.
|
||||
|
||||
Hardware differences compared to SPRacingF3 are as follows:
|
||||
|
||||
* The CPU is the cheaper version of the F3 with only 128KB FLASH.
|
||||
* The external flash rom is the same size as found on the Naze32 (2MBit)
|
||||
* The barometer is the cheaper BMP280.
|
||||
* It does not have any compass sensor.
|
||||
* Onboard BEC.
|
||||
* Different physical connectors/pins/pads/ports.
|
11
docs/Cli.md
11
docs/Cli.md
|
@ -73,7 +73,6 @@ Re-apply any new defaults as desired.
|
|||
|
||||
| `Command` | Description |
|
||||
|------------------|------------------------------------------------|
|
||||
| `1wire <esc>` | passthrough 1wire to the specified esc |
|
||||
| `adjrange` | show/set adjustment ranges settings |
|
||||
| `aux` | show/set aux settings |
|
||||
| `mmix` | design custom motor mixer |
|
||||
|
@ -103,8 +102,9 @@ Re-apply any new defaults as desired.
|
|||
|
||||
| `Variable` | Description/Units | Min | Max | Default | Type | Datatype |
|
||||
|---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|--------|---------------|--------------|----------|
|
||||
| `looptime` | This is the main loop time (in us). Changing this affects PID effect with some PID controllers (see PID section for details). Default of 3500us/285Hz. The looptime is also determing the gyro refresh rate together with gyro_lpf. | 0 | 9000 | 3500 | Master | UINT16 |
|
||||
| `looptime` | This is the main loop time (in us). Changing this affects PID effect with some PID controllers (see PID section for details). Default of 3500us/285Hz. The looptime is also determing the gyro refresh rate together with gyro_lpf when sync_gyro_to_loop enabled. | 0 | 9000 | 3500 | Master | UINT16 |
|
||||
| `emf_avoidance` | Default value is 0 for 72MHz processor speed. Setting this to 1 increases the processor speed, to move the 6th harmonic away from 432MHz. | 0 | 1 | 0 | Master | UINT8 |
|
||||
| `sync_gyro_to_loop` | Default value is 0. This enables an experimental gyro_sync feature. In this case the loop will be synced to gyro refresh rate. Loop will always wait for the newest gyro measurement. Use looptime and gyro_lpf to determinge the gyro refresh rate. F1 boards need acc to be disabled to get full 1khz gyro refresh rate. | 0 | 1 | 0 | Master | UINT8 |
|
||||
| `mid_rc` | This is an important number to set in order to avoid trimming receiver/transmitter. Most standard receivers will have this at 1500, however Futaba transmitters will need this set to 1520. A way to find out if this needs to be changed, is to clear all trim/subtrim on transmitter, and connect to GUI. Note the value most channels idle at - this should be the number to choose. Once midrc is set, use subtrim on transmitter to make sure all channels (except throttle of course) are centered at midrc value. | 1200 | 1700 | 1500 | Master | UINT16 |
|
||||
| `min_check` | These are min/max values (in us) which, when a channel is smaller (min) or larger (max) than the value will activate various RC commands, such as arming, or stick configuration. Normally, every RC channel should be set so that min = 1000us, max = 2000us. On most transmitters this usually means 125% endpoints. Default check values are 100us above/below this value. | 0 | 2000 | 1100 | Master | UINT16 |
|
||||
| `max_check` | These are min/max values (in us) which, when a channel is smaller (min) or larger (max) than the value will activate various RC commands, such as arming, or stick configuration. Normally, every RC channel should be set so that min = 1000us, max = 2000us. On most transmitters this usually means 125% endpoints. Default check values are 100us above/below this value. | 0 | 2000 | 1900 | Master | UINT16 |
|
||||
|
@ -203,9 +203,8 @@ Re-apply any new defaults as desired.
|
|||
| `failsafe_throttle` | Throttle level used for landing when failsafe is enabled. See [Failsafe documentation](Failsafe.md#failsafe_throttle). | 1000 | 2000 | 1000 | Profile | UINT16 |
|
||||
| `rx_min_usec` | Defines the shortest pulse width value used when ensuring the channel value is valid. If the receiver gives a pulse value lower than this value then the channel will be marked as bad and will default to the value of `mid_rc`. | 100 | 2000 | 985 | Profile | UINT16 |
|
||||
| `rx_max_usec` | Defines the longest pulse width value used when ensuring the channel value is valid. If the receiver gives a pulse value higher than this value then the channel will be marked as bad and will default to the value of `mid_rc`. | 100 | 3000 | 2115 | Profile | UINT16 |
|
||||
| `gimbal_mode` | When feature SERVO_TILT is enabled, this can be either 0=normal gimbal (default) or 1=tiltmix gimbal | 0 | 1 | 0 | Profile | UINT8 |
|
||||
| `acc_hardware` | This is used to suggest which accelerometer driver should load, or to force no accelerometer in case gyro-only flight is needed. Default (0) will attempt to auto-detect among enabled drivers. Otherwise, to force a particular device, set it to 2 for ADXL345, 3 for MPU6050 integrated accelerometer, 4 for MMA8452, 5 for BMA280, 6 for LSM303DLHC, 7 for SPI_MPU6000, 8 for SPI_MPU6500 or 1 to disable accelerometer alltogether - resulting in gyro-only operation. | 0 | 9 | 0 | Master | UINT8 |
|
||||
| `acc_for_fast_looptime` | This shortens accelerometer processing time by using 1 out of 9 samples. Intended use is in combination with fast looptimes. Default (0) - standard, one sample per cycle; (1) - 1 out of 9 samples. | 0 | 1 | 0 | Master | UINT8 |
|
||||
| `gimbal_mode` | When feature SERVO_TILT is enabled, this can be either 0=normal gimbal (default) or 1=tiltmix gimbal | 0 | 1 | 0 | Profile | UINT8 |
|
||||
| `acc_hardware` | This is used to suggest which accelerometer driver should load, or to force no accelerometer in case gyro-only flight is needed. Default (0) will attempt to auto-detect among enabled drivers. Otherwise, to force a particular device, set it to 2 for ADXL345, 3 for MPU6050 integrated accelerometer, 4 for MMA8452, 5 for BMA280, 6 for LSM303DLHC, 7 for MPU6000, 8 for MPU6500 or 1 to disable accelerometer alltogether - resulting in gyro-only operation. | 0 | 9 | 0 | Master | UINT8 |
|
||||
| `acc_lpf_factor` | This setting controls the Low Pass Filter factor for ACC. Increasing this value reduces ACC noise (visible in GUI), but would increase ACC lag time. Zero = no filter | 0 | 250 | 4 | Profile | UINT8 |
|
||||
| `accxy_deadband` | | 0 | 100 | 40 | Profile | UINT8 |
|
||||
| `accz_deadband` | | 0 | 100 | 40 | Profile | UINT8 |
|
||||
|
@ -217,7 +216,7 @@ Re-apply any new defaults as desired.
|
|||
| `baro_noise_lpf` | | 0 | 1 | 0.6 | Profile | FLOAT |
|
||||
| `baro_cf_vel` | | 0 | 1 | 0.985 | Profile | FLOAT |
|
||||
| `baro_cf_alt` | | 0 | 1 | 0.965 | Profile | FLOAT |
|
||||
| `mag_hardware` | 0 = Default, use whatever mag hardware is defined for your board type ; 1 = None, disable mag ; 2 = HMC5883 ; 3 = AK8975 (for versions <= 1.7.1: 1 = HMC5883 ; 2 = AK8975 ; 3 = None, disable mag) | 0 | 3 | 0 | Master | UINT8 |
|
||||
| `mag_hardware` | 0 = Default, use whatever mag hardware is defined for your board type ; 1 = None, disable mag ; 2 = HMC5883 ; 3 = AK8975 (for versions <= 1.7.1: 1 = HMC5883 ; 2 = AK8975 ; 3 = None, disable mag) | 0 | 3 | 0 | Master | UINT8 |
|
||||
| `mag_declination` | Current location magnetic declination in format. For example, -6deg 37min, = for Japan. Leading zero in ddd not required. Get your local magnetic declination here: http://magnetic-declination.com/ | -18000 | 18000 | 0 | Profile | INT16 |
|
||||
| `pid_controller` | | 0 | 5 | 0 | Profile | UINT8 |
|
||||
| `p_pitch` | | 0 | 200 | 40 | Profile | UINT8 |
|
||||
|
|
|
@ -99,11 +99,10 @@ Some advanced configurations and features are documented in the following pages,
|
|||
* [Profiles](Profiles.md)
|
||||
* [PID tuning](PID tuning.md)
|
||||
* [In-flight Adjustments](Inflight Adjustments.md)
|
||||
* [Autotune](Autotune.md)
|
||||
* [Blackbox logging](Blackbox.md)
|
||||
* [Using a Sonar](Sonar.md)
|
||||
* [Spektrum Bind](Spektrum bind.md)
|
||||
* [Telemetry](Telemetry.md)
|
||||
* [Using a Display](Display.md)
|
||||
* [Using a LED strip](Ledstrip.md)
|
||||
* [Using a LED strip](LedStrip.md)
|
||||
* [Migrating from baseflight](Migrating from baseflight.md)
|
||||
|
|
47
docs/Gtune.md
Normal file
47
docs/Gtune.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# G-Tune instructions.
|
||||
|
||||
The algorithm has been originally developed by Mohammad Hefny (mohammad.hefny@gmail.com)
|
||||
http://technicaladventure.blogspot.com/2014/06/zero-pids-tuner-for-multirotors.html
|
||||
http://diydrones.com/profiles/blogs/zero-pid-tunes-for-multirotors-part-2
|
||||
http://www.multiwii.com/forum/viewtopic.php?f=8&t=5190
|
||||
|
||||
The G-Tune functionality for Cleanflight is ported from the Harakiri firmware.
|
||||
|
||||
- Safety preamble: Use at your own risk -
|
||||
|
||||
The implementation you have here is quiet different and just for adjusting the P values of ROLL/PITCH/YAW in Acro mode.
|
||||
When flying in Acro mode (yaw tune in other modes possible as well - see below) you can activate G-Tune with an AUX box (switch) while the copter is armed.
|
||||
It will start tuning the wanted / possible axes (see below) in a predefined range (see below).
|
||||
After activation you will probably notice nothing! That means G-Tune will not start shaking your copter, you will have to do it (or simply fly and let it work).
|
||||
The G-Tune is based on the gyro error so it is only active when you give no RC input (that would be an additional error). So if you just roll only pitch
|
||||
and yaw are tuned. If you stop rolling G-Tune will wait ca. 450ms to let the axis settle and then start tuning that axis again. All axes are treated independently.
|
||||
The easiest way to tune all axes at once is to do some air-jumps with the copter in Acro (RC centered and G-Tune activated... of course..).
|
||||
You can set a too high P for the axes as default in the GUI, when the copter starts shaking the wobbles will be detected and P tuned down (be careful with the strength setting though - see below).
|
||||
Yaw tune is disabled in any copter with less than 4 motors (like tricopters).
|
||||
G-Tune in Horizon or Level mode will just affect Yaw axis (if more than 3 motors...)
|
||||
You will see the results in the GUI - the tuning results will only be saved if you enable G-Tune mode while the copter is disarmed and G-Tune was used before when armed. You also can save the configuration in an alternative way (like hitting save button in the GUI, casting an eepromwrite with trimming, acc calibration etc.)
|
||||
TPA and G-Tune: It is not tested and will most likely not result into something good. However G-Tune might be able to replace TPA for you.
|
||||
|
||||
## Parameters and their function:
|
||||
|
||||
gtune_loP_rll = 10 [0..200] Lower limit of ROLL P during G-Tune. Note "10" means "1.0" in the GUI.
|
||||
gtune_loP_ptch = 10 [0..200] Lower limit of PITCH P during G-Tune. Note "10" means "1.0" in the GUI.
|
||||
gtune_loP_yw = 10 [0..200] Lower limit of YAW P during G-Tune. Note "10" means "1.0" in the GUI.
|
||||
gtune_hiP_rll = 100 [0..200] Higher limit of ROLL P during G-Tune. 0 Disables tuning for that axis. Note "100" means "10.0" in the GUI.
|
||||
gtune_hiP_ptch = 100 [0..200] Higher limit of PITCH P during G-Tune. 0 Disables tuning for that axis. Note "100" means "10.0" in the GUI.
|
||||
gtune_hiP_yw = 100 [0..200] Higher limit of YAW P during G-Tune. 0 Disables tuning for that axis. Note "100" means "10.0" in the GUI.
|
||||
gtune_pwr = 0 [0..10] Strength of adjustment
|
||||
gtune_settle_time = 450 [200..1000] Settle time in ms
|
||||
gtune_average_cycles = 16 [8..128] Number of looptime cycles used for gyro average calcullation
|
||||
|
||||
So you have lower and higher limits for each P for every axis. The preset range (GUI: 1.0 - 10.0) is quiet broad to represent most setups.
|
||||
If you want tighter or more loose ranges change them here. gtune_loP_XXX can be configured lower than "10" that means a P of "1.0" in the GUI. So you can have "Zero P" but you may get sluggish initial control.
|
||||
If you want to exclude one axis from the tuning you must set gtune_hiP_XXX to zero. Let's say you want to disable yaw tuning write in CLI
|
||||
"set gtune_hiP_yw = 0". Note: The MultiWii Wiki advises you to trim the yaw axis on your transmitter. If you have done so (yaw not neutral on your RC)
|
||||
yaw tuning will be disabled.
|
||||
|
||||
Setting the strength of tuning:
|
||||
gtune_pwr [0..10] Strength of adjustment.
|
||||
My small copter works fine with 0 and doesn't like a value of "3". My big copter likes "gtune_pwr = 5". It shifts the tuning to higher values and if too high can
|
||||
diminish the wobble blocking! So start with 0 (default). If you feel your resulting P is always too low for you increase gtune_pwr. You will see it getting a little shaky
|
||||
if value too high.
|
|
@ -25,9 +25,9 @@ auxillary receiver channels and other events such as failsafe detection.
|
|||
| 18 | 17 | GOV | |
|
||||
| 19 | 18 | OSD | Enable/Disable On-Screen-Display (OSD) |
|
||||
| 20 | 19 | TELEMETRY | Enable telemetry via switch |
|
||||
| 21 | 20 | AUTOTUNE | Autotune Pitch/Roll PIDs |
|
||||
| 22 | 21 | SONAR | Altitude hold mode (sonar sensor only) |
|
||||
| 26 | 25 | BLACKBOX | Enable BlackBox logging |
|
||||
| 27 | 26 | GTUNE | G-Tune - auto tuning of Pitch/Roll/Yaw P values |
|
||||
|
||||
## Mode details
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ This controller has code that attempts to compensate for variations in the loopt
|
|||
don't have to be retuned when the looptime setting changes.
|
||||
|
||||
There were initially some problems with horizon mode, and sluggishness in acro mode, that were recently fixed by
|
||||
nebbian in v1.6.0. The autotune feature does not work on this controller, so don't try to autotune it.
|
||||
nebbian in v1.6.0.
|
||||
|
||||
It is the first PID Controller designed for 32-bit processors and not derived from MultiWii.
|
||||
|
||||
|
@ -150,10 +150,11 @@ For the ALIENWII32 targets the gyroscale is removed for more yaw authority. This
|
|||
|
||||
PID Controller 5 is an port of the PID controller from the Harakiri firmware.
|
||||
|
||||
The algorithm is leveraging more floating point math. This PID controller also compensates for different looptimes on roll and pitch. It likely don't need retuning of the PID values when looptime is changing. Actually there are two settings hardcoded which are configurable via the GUI in Harakiri:
|
||||
The algorithm is leveraging more floating point math. This PID controller also compensates for different looptimes on roll and pitch. It likely don't need retuning of the PID values when looptime is changing. There are two additional settings which are configurable via the CLI in Harakiri:
|
||||
|
||||
OLD_YAW 0 // [0/1] 0 = multiwii 2.3 yaw, 1 = older yaw.
|
||||
MAIN_CUT_HZ 12.0f // (default 12Hz, Range 1-50Hz)
|
||||
set dterm_cut_hz = 0 [1-50Hz] Cut Off Frequency for D term of main PID controller
|
||||
(default of 0 equals to 12Hz which was the hardcoded setting in previous Cleanflight versions)
|
||||
set pid5_oldyw = 0 [0/1] 0 = multiwii 2.3 yaw (default), 1 = older yaw
|
||||
|
||||
The PID controller is flight tested and running well with the default PID settings. If you want do acrobatics start slowly.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue