Tuning Process Instructions¶
Setting the aircraft up ready for tuning¶
The following parameters should be set correctly based on the specifications of your aircraft.
Parameters used to linearise your motor thrust curve.
- MOT_BAT_VOLT_MAX : 4.2v x No. Cells
- MOT_BAT_VOLT_MIN : 3.3v x No. Cells
- MOT_THST_EXPO : 0.55 for 5 inch props, 0.65 for 10 inch props, 0.75 for 20 inch props (or larger). This parameter should be derived by thrust stand measurements for best results (don’t trust manufacturer data).
Parameters used to define the output range sent to the ESC.
PID Controller Initial Setup¶
- INS_ACCEL_FILTER : 10Hz to 20Hz
- INS_GYRO_FILTER : 80Hz for 5 inch props, 40Hz for 10 inch props, 20Hz for 20 inch props (or larger)
- ATC_ACCEL_P_MAX : 110000 for 10 inch props, 50000 for 20 inch props, 20000 for 30 inch props
- ATC_ACCEL_R_MAX : 110000 for 10 inch props, 50000 for 20 inch props, 20000 for 30 inch props
- ATC_ACCEL_Y_MAX : 27000 for 10 inch props, 18000 for 20 inch props, 9000 for 30 inch props
- ACRO_YAW_P : 0.5 x ATC_ACCEL_Y_MAX / 4500
For Copter-4.0 (and later):
- ATC_RAT_PIT_FLTD : INS_GYRO_FILTER / 2
- ATC_RAT_PIT_FLTT : INS_GYRO_FILTER / 2
- ATC_RAT_RLL_FLTD : INS_GYRO_FILTER / 2
- ATC_RAT_RLL_FLTT : INS_GYRO_FILTER / 2
- ATC_RAT_YAW_FLTE : 2
- ATC_RAT_YAW_FLTT : INS_GYRO_FILTER / 2
For Copter-3.6 (and earlier):
The initial tune of the aircraft should be done in the aircrafts most agile configuration. This generally means that the aircraft will be at its minimum take off weight with fully charged batteries.
Pilot’s preparation for first flight¶
The first takeoff of an untuned multirotor is the most dangerous seconds of the aircraft’s life. This is where the aircraft could be very unstable causing a sudden increase in power when then results in the aircraft jumping into the air, or it may be so poorly tuned that you have insufficient control over the aircraft once it is airborne. The pilot should be extremely diligent during the tuning flights to avoid a situation that could result in injury or damage.
There are several things that the pilot can do to minimise the risk during the early tuning process:
- The pilot should conduct a motor number and orientation check (see Checking the motor numbering with the Mission Planner Motor test). Care should be taken to ensure that the correct frame type is selected. Incorrect frame type can result in a very fast yaw rotation or complete loss of control. Take note of the output percentage required to spin the propellers and ensure that:
- MOT_SPIN_ARM is set high enough to spin the motors cleanly.
- MOT_SPIN_MIN is set high enough to spin the motors win a minimal level of thrust.
- All flights after a significant tuning change should be done in Stabilize. Stabilize provides the pilot with significantly more control over the aircraft in the event that the attitude controllers are unstable.
- The pilot should not take off in AltHold until the altitude controller has been tested in flight. This should be done by taking off in Stabilize and switching to Alt Hold. While Alt Hold is rarely a problem unless the aircraft has a very low hover throttle.
- For the initial flights the pilot should ensure that these parameters are set:
- Use a radio and calibrate the radio correctly (see Radio Control Calibration).
- Configure an Emergency Stop Motors switch and test it (see Auxiliary Functions).
- Do tuning flights in low-wind condition and normal weather (no rain and between 15°C/59°F and 25°C/77°F).
- Practice STABILIZE flight in simulator or on a low-end drone first, you should be confident to be able to takeoff and land with your untuned aircraft.
The first take off is the most dangerous time for any multirotor. Care must be taken to ensure the aircraft is not destroyed in the first seconds of flight and nobody is injured.
- Ensure that all spectators are at a safe distance.
- Ensure the pilot is at a safe distance and position.
- The pilot should refresh themselves on the method used to disarm the aircraft (using Auxiliary Functions for Motor Interlock or Arm/Disarm may be beneficial).
This flight will allow to setup your aircraft in a “flyable for tuning” state.
- Ensure the aircraft is in STABILIZE mode
- Arm the aircraft
- Immediately disarm the aircraft to ensure your disarm procedure is correct
- Arm the aircraft
- Slowly increase the throttle looking for signs of oscillation. (long or flexible landing gear may cause some landing gear oscillation that will only go away after the aircraft leaves the ground)
- As soon as the aircraft lifts off the ground immediately put the aircraft back down as gently as possible
- Disarm the aircraft
- Evaluate what you observed to decide if you need to make adjustments to the tuning parameters or if it is safe to take off again
- Arm and increase the throttle to initiate a takeoff
- Hover at approximately 1m altitude and apply small (5 degrees) control inputs into roll and pitch
- Immediately land if any oscillation is observed
Next section will explain how to remove the oscillations.
Initial aircraft tune¶
The first priority when tuning an multirotor aircraft is to establish a stable tune, free of oscillations, that can be used to do further tests.
- Arm the aircraft in STABILIZE
- Increase the throttle slowly until the aircraft leaves the ground
- If the aircraft starts to oscillate immediately abort the takeoff and/or land the aircraft
- Reduce all the following parameters by 50%
This process is repeated until the aircraft can hover without oscillations being detectable visually or audibly.
If the aircraft has very long or flexible landing gear then you may need to leave the ground before ground resonance stops.
Be aware that in this state the aircraft may be very slow to respond to large control inputs and disturbances. The pilot should be extremely careful to put minimal stick inputs into the aircraft to avoid the possibility of a crash.
This test will allow to test the altitude controller and ensure the stability of your aircraft.
- Check MOT_HOVER_LEARN is set to 2. This will allow the controller to learn by itself the correct hover value when flying.
- Take off in STABILIZE and increase altitude to 5m. Switch to AltHold and be ready to switch back to STABILIZE. If the aircraft is hovering at a very low hover throttle value you may hear a reasonably fast oscillation in the motors. Ensure the aircraft has spent at least 30 seconds in hover to let the hover throttle parameter converge to the correct value. Land and disarm the aircraft.
- Set these parameters on ground and preferably disarm (A confident pilot could set them in flight with GCS or CH6 tuning knob):
Evaluating the aircraft tune¶
Most pilots will look to move to Autotune as quickly as possible once their aircraft can hover safely in AltHold. Before Autotune is run the pilot should ensure that the current tune is good enough to recover from the repeated tests run by Autotune. To test the current state of tune:
- Take off in AltHold or STABILIZE
- Apply small roll and pitch inputs. Start with 5 degree inputs and releasing the stick to centre, pitch, left, right, roll forward back, then all 4 points on the diagonal
- Increase inputs gradually to full stick deflection
- Go to full stick deflection and letting the sticks spring back to centre
If the aircraft begins to overshoot significantly or oscillate after the stick input, halt the tests before the situation begins to endanger the aircraft. The aircraft may require manual tuning (see next section) before autotune can be run.
To test the stabilization loops independent of the input shaping, set the parameter: ATC_RATE_FF_ENAB to 0.
- Take off in AltHold or STABILIZE
- Hold a roll or pitch input
- Release the stick and observe the overshoot as the aircraft levels itself
- Gradually increase the stick deflection to 100%
Halt the tests if the aircraft overshoots level significantly or if the aircraft oscillates, the aircraft may require manual tuning (see next section) before autotune can be run.
Set ATC_RATE_FF_ENAB to 1 after the tests are complete.
Manual tuning of Roll and Pitch¶
Manual tuning may be required to provide a stable tune before Autotune is run, or if Autotune does not produce an acceptable tune. The process below can be done on roll and pitch at the same time for a quick manual tune provided the aircraft is symmetrical. If the aircraft is not symmetrical then the process should be repeated for both roll and pitch individually.
When oscillations start do not make large or sudden stick inputs. Reduce the throttle smoothly to land the aircraft while using very slow and small roll and pitch inputs to control the aircraft position.
- Increase the D term in steps of 50% until oscillation is observed
- Reduce the D term in steps of 10% until the oscillation disappears
- Reduce the D term by a further 25%
- Increase the P term in steps of 50% until oscillation is observed
- Reduce the P term in steps of 10% until the oscillation disappears
- Reduce the P term by a further 25%
Each time the P term is changed set the I term equal to the P term. Those parameters can be changed on ground and preferably disarmed. A confident pilot could set them in flight with GCS or transmitter tuning knob (see Transmitter based tuning section).
If using Transmitter based tuning , set the minimum value of the tuning range to the current safe value and the upper range to approximately 4 times the current value. Be careful not to move the slider before the parameter list is refreshed to recover the set value. Ensure the transmitter tuning is switched off before setting the parameter value or the tuning may immediately overwrite it.
If the aircraft appears stable enough to attempt autotune follow the instructions in the autotune page.
There a number of problems that can prevent Autotune from providing a good tune. Some of the reasons Autotune can fail are:
- High levels of gyro noise.
- Incorrect value of MOT_THST_EXPO.
- Flexible frame or payload mount.
- Overly flexible vibration isolation mount.
- Non-linear ESC response.
- Very low setting for MOT_SPIN_MIN.
- Overloaded propellers or motors.
If Autotune has failed you will need to do a manual tune.
Some signs that Autotune has been successful are:
- An increase in the values of ATC_ANG_PIT_P and ATC_ANG_RLL_P.
- ATC_RAT_PIT_D and ATC_RAT_RLL_D are larger than AUTOTUNE_MIN_D.
Autotune will attempt to tune each axis as tight as the aircraft can tolerate. In some aircraft this can be unnecessarily responsive. A guide for most aircraft:
- ATC_ANG_PIT_P should be reduced from 10 to 6
- ATC_ANG_RLL_P should be reduced from 10 to 6
- ATC_ANG_YAW_P should be reduced from 10 to 6
- ATC_RAT_YAW_P should be reduced from 1 to 0.5
- ATC_RAT_YAW_I : ATC_RAT_YAW_P x 0.1
These values should only be changed if Autotune produces higher values. Small aerobatic aircraft may prefer to keep these values as high as possible.
Setting the input shaping parameters¶
Arducopter has a set of parameters that define the way the aircraft feels to fly. This allows the aircraft to be set up with a very aggressive tune but still feel like a very docile and friendly aircraft to fly.
The most important of these parameters is:
- ACRO_YAW_P : desired maximum yaw rate / 45 degrees/s
- ANGLE_MAX : maximum lean angle
- ATC_ACCEL_P_MAX : Pitch rate acceleration
- ATC_ACCEL_R_MAX : Roll rate acceleration
- ATC_ACCEL_Y_MAX : Yaw rate acceleration
- ATC_ANG_LIM_TC : Aircraft smoothing time
Autotune will set the ATC_ACCEL_P_MAX, ATC_ACCEL_R_MAX and ATC_ACCEL_Y_MAX parameters to their maximum based on measurements done during the Autotune tests. These values should not be increased beyond what Autotune suggests without careful testing. In most cases pilots will want to reduce these values significantly.
For aircraft designed to carry large directly mounted payloads, the maximum values of ATC_ACCEL_P_MAX, ATC_ACCEL_R_MAX and ATC_ACCEL_Y_MAX should be reduced based on the minimum and maximum takeoff weight (TOW):
- ATC_ACCEL_P_MAX x (min_TOW / max_TOW)
- ATC_ACCEL_R_MAX x (min_TOW / max_TOW)
- ATC_ACCEL_Y_MAX x (min_TOW / max_TOW)
ATC_ANG_LIM_TC may be increased to provide a very smooth feeling on the sticks at the expense of a slower reaction time.
Aerobatic aircraft should keep the ATC_ACCEL_P_MAX, ATC_ACCEL_R_MAX and ATC_ACCEL_Y_MAX provided by autotune and reduce ATC_ANG_LIM_TC to achieve the stick feel desired by the pilot. For pilots wanting to fly ACRO the following input shaping parameters can be used to tune the feel of ACRO:
The full list of input shaping parameters are:
Arducopter has an extremely flexible controller design that can been used with great results on aircraft from 100g to 500 kg. There are a number of difficult control problems that provide a greater depth of understanding that can be provided here. Some of these issues include:
- High gyro noise levels
- Flexible airframes
- Soft vibration dampers
- Large payloads on flexible or loose mounts
- Rate limited actuators
- Non-Linear actuators
- Extremely aggressive or dynamic flight