Skip to content

Commit

Permalink
Multicopter PID Tuning Cookbook: Add overall structure & Thrust Curve
Browse files Browse the repository at this point in the history
part

Rename pid_multicopter to pid_multicopter_cookbook for easier Review

- Previous file was interfering the view in the diff of the PR, this
renames the file so that there's a clear *new-file indicator, instead of
a diff, since this is in principle, a new file
- As the PR gets merged, this file should be rename back to original, to
restore linked connections from other docs
  • Loading branch information
junwoo091400 committed Jan 9, 2023
1 parent 5b2a950 commit ce9144c
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions en/config_mc/pid_tuning_guide_multicopter_cookbook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Multicopter PID Tuning Cookbook

This document will guide you through the whole PID tuning process of Multicopter step by step, just like a cookbook!

## Step 1: Hardware configuration

### Check motor output settings
First things first, you need to make sure your motors are configured correctly!

If you are using PWM output, set the correct Disarmed, Minimum and Maximum output value by referring to [Actautor Outputs > Motor Configuration](../config/actuators.md#motor-configuration).

It is important to set PWM minimum value properly to make sure motors won't stop spinning in the air.

### Setting motor thrust curve factor

<!-- TODO: Insert Thrust curve simulation (interactive diagram) -->

Thrust curve factor([THR_MDL_FAC](../advanced_config/parameter_reference.md#THR_MDL_FAC)) defines the relationship between output signal and the thrust generated by the motor.

This is important to set correctly, as the most fundamental rate control of the PID controller will output a torque setpoint which will get mapped to appropriate signal value depending on the thrust curve factor.

Therefore, if you set it to be `linear` (`thrust = signal`) when in reality it is `quadratic`(`thrust = signal^2`), the vehicle dynamics assumption will be wrong and it may behave erratically.

<!-- TODO: Insert diagram showing Thrust Curve's effect on control authority -->

This is highly dependent on the ESC, Motor and Propeller (and even Battery), so it should be evaluated for every specific setup.

Refer to [Thrust Curve](pid_tuning_guide_multicopter_advanced.md#thrust-curve) documentation for the detailed explanation of a Thrust Curve.

The best case is to have an actual thrust measurement data that you can plot and fit onto the thrust curve. Depending on that please jump to appropriate sections below:

- [If you have a thrust measurement, jump to here](#if-you-have-a-thrust-measurement-data)
- [If you don't have a thrust measurement, jump to here](#if-you-dont-have-a-thrust-measurement-data)

#### If you have a thrust measurement data

If you have the thrust measurement for your ESC, motor and propeller combination, simply plot the data in a tool (e.g. Excel) and find for the best `alpha` value that fits the thrust curve data, and set it as the thrust curve factor parameter.

*rel_thrust = ( `alpha` ) * rel_signal^2 + ( 1 - `alpha` ) * rel_signal*

An example of a thrust measurement is something like this: [EXAMPLE](https://github.com/Auterion/thrust-bench-data/blob/master/StepsTest_2019-04-30_112217_MT2212-11_1100kv_APC10x5-5_low.csv).

And this example plots to a thrust curve like below, and the appropriate thrust curve factor is identified as 0.X. (TODO)

#### If you don't have a thrust measurement data

This is most likely the case since most people don't have a thrust measurement system available, in that case we can select empirically depending on the type of ESC:

- Set to `1.0` if your ESC explicitly states that it does RPM control (RPM proportional to signal), since thrust will be fully quadratic (proportional to `signal^2`).
- Set to `0.3` for all other ESCs. Which is an empirically derived value that assimilates *most* ESC / Motor / Propeller combination).

If you don't set any value, the default will be `0.0`, which assumes linear relationship between signal and the thrust.

## Step 2: Pre conditions

## Step 3: Rate control tuning

## Step 4: Attitude control tuning

## Step 5: Velocity control tuning

## Step 6: Position control tuning

## Step 7: Gyro filter tuning

0 comments on commit ce9144c

Please sign in to comment.