Introduction to PID for Drones – PID Tuning to become as stable as DJI.

Ever wondered why DJI Drones are so stable and yours is flipping like prata? There are many reasons and one of it leads to tuning your PID. Lets assume you are new to drones, and you really want to know just the right amount about PID. Here’s a summary post of everything you need to know about PID for a start.. The information is compiled from experience and personal resources. The control theory behind PID will be avoided to allow younger readers to understand.  -B.KANESH

Relevant topics : #Control Theory, #Aircraft Stability Modes, #Drones, #Multicopter #PID #StableDrone #STEM #Singapore

What are basic movements of the drone? 

Drones have a standard 3 axis angular change which are namely roll, pitch and yaw. Thrust can be related to the vertical ascent and decent in multirotors and forward motion in aircraft. This can be tuned using throttle curve. However in PID we mainly relate to the movement /response along the 3 common axis. The brain or microcontroler tries to correct the error calculated between a measurement at the controller input (measured by gyros) and a input set point (position of joystick) and drives the motors to attempt to return the drone to the initial position.

What  is Acro Mode? 

The combination of measured angluar deivation and sampling the change over time provides information to the controller that assists the drone to return to equilibrium only with a gyroscope.

Where do i get my suitable PID Values? 

In most cases several online resources will guide you to your first set of PID values. These are subjective to the setup. Therefore use these values as a start point to your tuning. Remember tuning is to suit your flying style. If you are considering a PID for anyone, you should consider values that lead you to a slower response on the drone with large set point rates on the controller. The new users usually tend to control the stick more dramatically as compared to experienced pilots. Do note that slow response should only be when there is an input from the controller, the drone should be programmed to attain stability when there is no input. This is known as active flight recovery. This is basically how DJI suits everyone.

What is PID? 

P– The amount of corrective force force applied to return the drone back to its initial position.

Increasing P : Drone will become stable until it reaches a maximum point before it starts to become unstable again. It will oscillate and loose control. You will also notice a very strong resistant force to any attempts to move the drone.

Decreasing P : The drone will start to drift in control until P is too low, it will become unstable. It will be less resistant to any attempts to change orientation.

Further Explanation : The amount of force is proportional to a combination of the deviation from the initial position minus any command to change direction from the controller input. A higher P value will create a stronger force to reisist any attempts to change its position. If the P value is too high, on the return to initial position, it will overshoot and the opposite force is needed to compensate. This creates an oscillating effect until stability is reached. If you have too much of P, the drone can become completely unstable.

  • Aerobatic Flight : Requires higher P values
  • Stable Flight: Requires a lower P

I– Is the time period for which the angular change is sampled and averaged.

Increasing I – This increases the ability to hold the overall initial position and reduce drifting. This also increases the delay in returning to the original position. The amount of force. Increasing I also decreases the effect of P.

Decreasing I:  Will improve the reactions to changes however will increase drift and reduce ability to hold position. It will also increase the importance of P.

Further Explanation : The amount of force applied to return to the original position is increased by I. The longer longer the deviation exists until a maximum force value is reached. A higher I will increase the heading hold capability.

  • Aerobatic Flight : Requires a lower I
  • Stable Flight : Requires a higher I

D – Is the speed at which the drone is returned to its original position.

Increasing D : Improves the speed at which deviations are recovered. With a better recovery speed comes a higher chance of overshooting and oscillations. Increasing D will also increase the effect of P.

Decreasing D : Reduces the oscillations when returning any deviations to their initial position.Recovery to initial position also becomes slower. This will also decrease the effect of P.

  • Aerobatic Flight : Increase D
  • Stable Flight : Decrease D

Suitable PID for my flying? 

For Stable flight (Recommended for Autopilot/First Person View)

  • Increase P until oscillations start and back off slightly.
  • Change value for I until recovery from deviations is unacceptable, then increase slightly.
  • Decrease value for D until recovery from dramatic control changes become too slow. Then increase D slightly
  • P may have to be reduced slightly to compensate for the changes above.

For Stunt/Aerobatic flying

  • Increase P value until oscillations start and back off slightly
  • Change value for I until hover drift is unacceptable, then increase slightly
  • Increase value for D until recovery from dramatic control changes results in unacceptable recovery oscillations.
  • P should be reduced slightly to compensate the above settings.

What is the procedure for setting PID? 

  1. Ensure the CoG of the drone is accurately identified and centered.Usually highly affected by the placement of the battery
  2. Ensure battery is secured well.
  3. Secure the drone to a table or jig. Remove propellers for vibrations test.
  4. Set motors to run at about 50% throttle, check GUI (Graphic User Interface) e.g APM Planner, Mission Planner. Trace the movement from GYRO and Accelerometer and ensure you are getting a flat line graph. If the trace shows unstable graph, you have vibration issues and it needs to be sorted. Usually a loose propeller nut, insecure parts or resonance on the table due to loose jig clamp.
  5. Keep in mind P is the dominant part of PID and gets you good flight characteristics.
  6. Put on Propellers now.
  7. Hold the drone in your hand and safely and securely up in the air, (wear personal protection equipment)
  8. Increase throttle to hover point where it starts to feel light.
  9. Lean the drone slightly towards each flight axis ( roll, pitch yaw) starting with the roll axis.
  10. Change P until it is difficult to move against the reaction.
  11. Rock the drone along the pitch axis, increase P until it starts to oscillate and then reduce slightly.
  12. Repeat for Yaw Axis.
  13. Your settings now should be suitable for stable flight.

You can also do this procedure without holding your drone if you have a initial settings applied. This is called Altitude PID tuning.

  1. Set P and I to 0,
  2. Slowly increase D from 0, by 0.2 increments until you start to get a slow yo-yo movement. Reduce D a little once you face the yo-yo movement.
  3. The drone will start to hold altitude with a drift.
  4. Increase P slowly now, your drone will start to hold until it starts Yo-yoing again. Reduce P until yo-yo movement goes away.
  5. I is now slowly increased to reduce the drift when the battery runs down and the throttle needed to keep the copter at the hover changes.

Factors affecting PID? 

  • Type of propellers
  • Length of booms used ( Shorter booms= lower P)
  • Value of Low Pass Filter used in autopilot software.
  • The type of gyro sensors, and the quality of it.
  • The current elevation (e.g Sea Level)
  • The payload
  • Size,weight,type,quality of motors.
  • Unbalanced props
  • Incorrect Mode Switch settings
  • Weight of the drone
  • Mismatch of propellers and motors
  • Uncalibrated ESC
  • Bad airframe quality
  • Quality and response of transmitter and reciever.
  • Signal Interference during tuning.
  • Pilot Skill.

 

ADLABS runs enrichment workshops Technology, Science & Engineering Education. You can sign up for our workshops for 2018 soon. Email us adlabssg@gmail.com

Author: adlabs2

Arrowdynamic Laboratories Pte. Ltd. (ADLABS) was founded in 2008 anticipating imminent technological pervasion. ADLABS operates with two wings, Education and Engineering. Education involves the development of skills training programs and STEM-based enrichment programs for everyone. The engineering wing conducts research and development activities on new prototypes with potential to form into a new branch startup. Our engineering team also offers specialised services for startups, companies and institutions.

Leave a Reply

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