# Checklist of Parameters

Make sure the parameters you generated in the previous step are uploaded to the craft. These include the ones generated by QuatosTool, the ones you computed after doing the thrust measurements and the license key.

## Quatos final Setup and Tuning

In general a quatos setup should not require much tuning once the airframe and thrust calculations are done. However, some tuning may be needed, so we will go over that in the following:

**In the param tree, you will find the following parameters:**

#define DEFAULT_QUATOS_AM1 -10.0f // Attitude correction rate #define DEFAULT_QUATOS_AM2 -25.0f // Correction Thrust. #define DEFAULT_QUATOS_PROP_K1 14.62f // Propellor torque #define DEFAULT_QUATOS_M_TLT_RT 1.0f // rads/s #define DEFAULT_QUATOS_M_YAW_RT 1.0f // rads/s #define DEFAULT_QUATOS_MAX_OUT 4.0f // total moment demand allowed (n_a + n_b) #define DEFAULT_QUATOS_QUAT_TAU 0.05f // Correction Response filter constant #define DEFAULT_QUATOS_L1_ASP -10.0f #define DEFAULT_QUATOS_L1_K1 18.6f // Overall adaptation gain

**AM1** is the Attitude Correction Rate demanded by the controller (Negative values, a higher negative value demands more correction rate)

**AM2 ** is the thrust applied to acheive the correction rate that is demanded by AM1 (Negative values, a higher negative value demands more thrust to acheive the desired correction rate)

Both AM1 and AM2 are probably too high defaults at the moment for a “normal” build with Brushless motors. A good starting point is AM1 = -8 and AM2 = -15. A rule of thumb for tuning the ratio between rate and thrust is that AM1 usually is around half of AM2.

**PROP_K1** is a constant that describe the propellor torque: The more torque (eg bigger/steeper prop), the lower this value. Default value is about for a 10-12″ prop. Slowflyers have more torque than Speed type props (e-props, thin electric, etc).

**M_TLT RATE** and **M_YAW_RATE** is rate response limiters expressed in radians per second. 1 radian equals 57.29 degrees, so the default is 57.29 degrees per second.

**QUATOS_MAX_OUT** is the maximum moment that the adaptive control can demand. Do not mess with this unless for a good reason.

**QUAT_TAU** is a filtering constant that adjusts the speed at which attitude change demands from the RC are applied. Lower to get more sharp/fast attitude changes. Raise to smooth.

**QUATOS_L1_ASP** is some component you should not mess with!

**L1_K1** is the Overall gain factor for the adaptive control.

## Tuning AM1, AM2, L1K1 and PROP_K1

To tune your setup optimally is generally a question of getting rate (AM1) and thrust (AM2) matched to the airframe with the correct adaptation gain factor (L1_K1). Some tuning of Prop_K1 to account for propeller drag may also be needed.

**AM1**

AM1 is effectively multiplied against the error between the desired and actual attitude to calculate the desired rate (to correct for the error.) The larger the difference, the more rate is requested.

If this value is too high, small attitude errors would result in large rate requests to correct. It would get to the point where the control system does not have the performance to attain the angular acceleration needed. This would mean overshooting the desired attitude which would look like very small, high frequency oscillations.

If AM1 were too low, the desired rate would be very low, to the point where it never quite achieves the desired attitude before external disturbances create new attitude errors. It would look very loose and sloppy.

Somewhere in between, you find a good mix. This is likely going to be somewhere between -5 and -10, perhaps higher for smaller machines which can accelerate faster and lower on larger machines which cannot.

**AM2**

Looking at it in a simplified way, AM2 is effectively multiplied against the desired rate during the final output thrust calculations. Think of it as how hard the system is going to push to achieve the desired rates. It is important to note that the resultant thrust requests are expected later by the adaptive aspect of the controller. So, if you ask for more than the motors can achieve, you will be inviting a windup of the adaptive components.

Too high a value will result in oscillations at potentially two different frequencies. A high frequency as the system is over reacting to rate requests and possibly a lower frequency as the adaptation is over reacting to the fact that the system is constantly failing to achieve the desired thrust.

If AM2 were set too low, you would see loose, sloppy reactions similar to a low AM1, except less controlled. When you have it right, you will have very quick, smooth reactions to the slightest attitude change or in response to external disturbances.

**L1_K1****
**L1_K1 is the adaptation factor. In an over simplified way, think of it as the I term of a PID. It controls the gain of the adaptation to perceived deficiencies in the thrust that is achieved vs the thrust that was requested.

The feedback goes through a low pass filter to help to reduce short term adaptation which can result in oscillations. However, too high a value for L1_K1 will start to show these oscillations.

Too low of a value and the system will not adapt to problems quickly enough and lead to delayed overshoot as you might see with a low ITERM for PID.

There is a large gray area in between too low and too high where the system seems to perform well under normal circumstances. However, if you had a catastrophic event like a motor failure, you will want the adaptation to happen as quickly as possible. For this reason, you would want to raise L1_K1 as high as possible in that gray area.

**PROP_K1:**

Simply put PROP_K1 represents the inverse of the drag factor of a particular propeller. The more air drag a prop has, the more yawing torque it produces and therefore the less yaw torque the controller needs to request. So lower this value when increasing prop size and pitch and raise it for smaller, lower pitch propellors.

Setting PROP_K1 too high will result in high frequency oscillations on the yaw axis which will also be coupled to pitch and roll to some degree.

Setting it too low you will see lazy yawing which usually results in consistent overshoots in heading. The goal is to tune it high enough so that the overshoots disappear without getting oscillations.

This can be done best in position hold. Set a home position, then yaw away from it by 90 or 180 deg. Engage RTH and watch the yaw reaction. There should be a smooth controlled yaw with no overshoot.

## Manual Control Rate Limiters

A number of control rate limiters are also relevant to tune to acheive desired flight characteristic.

Quatos tilt and yaw rate limiters are for mathematical reasons expressed as Radians per second (1 radian equals 57.29 degrees):

#define DEFAULT_QUATOS_M_TLT_RT 1.0f // Quatos manual tilt rate in radians per second #define DEFAULT_QUATOS_M_YAW_RT 1.0f // Quatos manual yaw rate in radians per second

For tilt rate, the QUATOS_M_TLT_RT limit of 1 radian per second is probably fine for most setups. But it can be raised or lowered to limit or increase manual control attitude change rates. But be careful and go in small increments.

However, for Yaw, a Limit of 1 radian per second is probably a bit sluggish for some people. So to increase yaw rate, you can increase QUATOS_M_YAW_RT accordingly.

In case you are raising QUATOS_M_YAW_RT, you will run into the overall control limiter, setting the maximum yaw rate to 60 degrees per second. Increase this parameter accordingly:

#define DEFAULT_CTRL_MAN_YAW_RT 60.0f // Overall manual yaw rate allowed in degrees per second

Do be aware that you must have enough physical yaw control authority to achieve the maximum desired yaw rate. If you do not, you will saturate the motors and this will likely be seen as a twitch in pitch / roll during maximum yaw acceleration and deceleration if you push the yaw rate settings too far.

Once you have found acceptable maximum yaw rate settings, make sure it matches up with the nav yaw rate limiter:

#define DEFAULT_CTRL_NAV_YAW_RT 180.0f // maximum navigation yaw rate in degrees per second