# Why does excessive D Gain cause oscillations and motor overheat?

We all know that too much D term can cause oscillations in a quadcopter sometimes even make motors overheat. In this article we will try to explain why in the simplest way possible.

# Understanding Set-Point, Measurement and Error

If you’ve read my article about PID tuning, you should know the way PID controller works is by adjusting the speed of the motors to move the quadcopter to the desired rotation speed (i.e. how many degrees the quad is spinning per second).

In technical terms, we call this desired rotation speed “Set-point”. The actual rotation speed of the quad measured by the gyro sensor, is called “Measurement“.

An “Error” is simply the difference between set-point and measurement. The job of a PID controller is to minimize the error, and when the error is at 0, the measurement equals to the set-point, which means the quad is spinning at the exact speed we want it to.

# What happens in real life?

When we move our sticks, it changes the set-point and cause the error to grow…

For example, if I move the roll stick, I am telling the quad to spin around the roll axis, this will change the set-point, and error begin to rise. The flight controller will then look at the gyro, which is reporting what the copter is actually doing, and you get what the error is.

The flight controller commands the quad to spin the motors faster or slower, until the quad reaches the desired rotational speed, and the error goes back down to zero.

However, it takes time for the motors to slow down and therefore there is a overshoot and that’s why we see the error is growing to the opposite direction this time. The quad has to spin up motors on the other side to slow down, and the error finally goes back to zero again.

# What is D term & Derivative of Error

The role of D term is to minimize “Derivative of Error“.

The derivative of error is basically the rate in how fast error is changing. It might sound a bit confusing and hard to understand, but it’s not. For example the derivative of speed is acceleration. Kind of makes sense now?

The derivative of error peaks when the error is increasing the fastest, and it goes back down to zero when the value of error is not changing anymore even when it’s at its maximum in amplitude.

So D term looks at the derivative of error, the red line, and say, “I want to keep it as close to zero as possible”. How is it doing it then? Well, simple, by changing your motors’ speed!

Unlike P term, which is exactly proportional to the error, and it changes exactly as fast as the error is changing. D term is calculated based on how quickly error is changing, regardless how big or small error is. So even when the error is small but if it’s changing fast the D term will be large. If error is huge, but if it’s not changing, D term will still be zero.

Further Reading: How does “Derivative of Error” play in terms of flight characteristics in a quad?

# The relationship between D term, oscillations and overheat

Every time the red line (derivative of error) is not zero, D term changes your motor speed to try to minimize it.

As you can see, we only moved our stick once, but D term can potentially change our motor speed 6 times!! (As numbered in the following diagram)

Higher D gain will basically push the motors harder, and when they are unable to handle the rapid change of RPM, it will cause them to stutter, making your quad to oscillate, and eventually leads to overheat. The oscillation will go back into the gyro and can make the problem worse.

This is not the most scientific explanation, it’s over-simplified and didn’t cover all the academic aspect of the subject. But I hope this was useful and gave you a basic understanding on why too much D gain is not a good thing.

7th September 2022 - 11:10 pm

P is always pushing in the direction of the target, but never braking before the target. So P alone is always overshooting because of inertia.

D is always pushing in the direction to avoid increasing or decreasing of the error = D is pushing when the error increases, and is braking against P when error decreases. So D allow a “soft landing” on the target, without overshooting.

If D is too high compared to P, D wins over P and go in the other direction instead of just braking before the target.

Waaooww. Totally new understanding for me, thanks to you.

Going further :
If we see overshooting, D is not big enough compared to P.
If we see that the target is not reached and the error re-increase, then D is too high compared to P.
Easy way to adjust P to D balance.
Totally make sense to me now.

6th May 2023 - 3:10 am

summarized perfectly

7th September 2022 - 6:03 am

Your explanation is simple to understand and intuitive. All your articles are really good. Every aspect of quad is explained in detail and most importantly in the way it could be understood without straining the brain. I am building the quad using ESP32 and developing my own flight controller. I struggled a lot to tune the gains. It was very difficult to fly and control my quad. Finally i zeroed down that only D gain was creating the problem. I was trying to tune D gain but it was very difficult to sense oscillations created by D gain at lower or lift off RPM. Finally when I increased RPM to level 1.3 to 1.5 times lift off I felt the oscillation of D gain. Then I tuned D value. I found my previous D value was 4 times higher than what required. Now flight is smooth.
Thanks.

11th July 2021 - 1:52 pm

Oscar, you are a pimp. Your writing has gotten me through my first build, all kinds of troubleshooting and repairs, and now PID tuning on my new 7″ build. You’re welcome at my house any time.

13th June 2021 - 9:45 pm

Thank you Oscar, your write ups about PID’s are the best out there. Your desire to teach us is truly a blessing

26th June 2020 - 11:37 am

Your blog is a nice library about the hobby. Thank you very very much.