Uncategorized

Ardupilot PID Tunning

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.

  1. Arm the aircraft in STABILIZE

  2. Increase the throttle slowly until the aircraft leaves the ground

  3. If the aircraft starts to oscillate immediately abort the takeoff and/or land the aircraft

  4. Reduce all the following parameters by 50%

  1. ATC_RAT_PIT_P

  2. ATC_RAT_PIT_I

  3. ATC_RAT_PIT_D

  4. ATC_RAT_RLL_P

  5. ATC_RAT_RLL_I

  6. ATC_RAT_RLL_D

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.

Test AltHold¶

This test will allow to test the altitude controller and ensure the stability of your aircraft.

  1. Check MOT_HOVER_LEARN is set to 2. This will allow the controller to learn by itself the correct hover value when flying.

  2. 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.

  3. Set these parameters on ground and preferably disarm (A confident pilot could set them in flight with GCS or CH6 tuning knob):

Note

In Copter 4.6 and earlier these parameters were named PSC_ACCZ_I and PSC_ACCZ_P and were scaled 10x larger:

if AltHold starts to oscillate up and down the position and velocity controllers may need to be reduced by 50%. These values are: PSC_D_POS_P and PSC_D_VEL_P.

Note

In Copter 4.6 and earlier PSC_D_VEL_P was named PSC_VELZ_P and PSC_D_POS_P was named PSC_POSZ_P.

Harmonic Notch Filtering¶

After you have a hover without oscillations the next step is to get get a good notch filter setup to reduce noise to the PID controllers. A good set of notch filtering parameters is critical to a good tune.

To get a notch filter setup you need to hover your vehicle for at least 30 seconds with no pilot input and with INS_LOG_BAT_MASK set to 1. This will enable FFT logging which will guide the correct setup of the notch filters. You should then carefully read the Managing Gyro Noise with the Dynamic Harmonic Notch Filters documentation and setup a harmonic notch to remove the noise from your gyros.

Eliminating noise with the notch filters will dramatically improve the quality of your tune.

Leave a Reply

Your email address will not be published. Required fields are marked *