What is a PID Controller? | DigiKey

preview_player
Показать описание
PID controllers are popular control mechanisms found in many systems used to help drive the main process’s output to achieve some desired set point. PID stands for “proportional, integral, derivative.” The controller compares the output of the process to some set point to create an error term. That error term is used in three separate calculations to produce a control signal for the process or plant.

In the video, we use an example of a cruise control system in a car. We want to design a mechanism that can maintain a constant speed by controlling the position of the accelerator (gas pedal). PID controllers are a perfect fit for such a system. In fact, most modern cars use PID controllers for cruise control.

A simple, naive approach to designing such a controller is to adjust the process’s input signal based on the set point alone with no feedback. This is known as an “open-loop control system.” This may work in some cases, but most of the time, the output is dependent on other factors (such as road conditions and hill climbs for our cruise control system). As a result, we need to incorporate feedback into our controller.

A “closed-loop control system” measures the actual output of the process and compares it to the set point. The error is the difference between these two values, and it’s used as the input to the controller. The controller looks at that error and makes adjustments as needed to the process’s input.

The proportional (P) part of the PID controller simply multiplies the error term by a constant, Kp. The further away the process’s output is from the set point, the higher the magnitude of the input value. This works in some cases, but it can result in “steady-state error” where the desired output can never be achieved. In our cruise control example, if we are at our cruising speed, the error is 0, which means that we should completely release the gas pedal. Obviously, this is not a desired behavior, so we add additional terms to our controller.

The integral (I) term sums the error term over time and multiplies this sum by a constant, Ki. This process solves the issue of steady-state error found in the P controller. As the steady-state error accumulates, the I term causes the process input signal to increase, thus closing the gap found in that steady-state error. It essentially looks at the past performance of the system and adjusts as needed.

Sometimes, a PI controller is sufficient. However, you often face a tradeoff when tuning such a system. You can either have an “overdamped response” where the error slowly (but surely) approaches 0, or you can have an “underdamped response” in which the output quickly approaches the set point but oscillates for some time. If you want a “critically damped” system that quickly approaches the set point and settles with little or no oscillation, you need to add a third term.

The derivative (D) term counteracts the effects of the proportional and integral terms. It attempts to predict where the response is headed by solving for the slope of the error curve and multiplying that value by the constant Kd. If the magnitude of the slope is too high, such that the system is approaching 0 error too quickly, it will add a negative value to the sum of the P and I terms, thus “pulling back” on the input.

With properly tuned Kp, Ki, and Kd values, systems should ideally become critically damped where the output quickly approaches the set point without any overshoot. Tuning a PID controller can be quite involved, and we will cover it in a future video.

Note that most modern PID controllers are implemented in software to run on computers or microcontrollers. We provide a snippet of pseudocode to help you get started implementing your own PID controllers in, say, Arduino.

Product Links:

Related Articles:

Learn more:

00:00 - Intro
00:57 - Control Theory Overview
02:53 - Open-loop System
03:59 - Closed-loop System
05:06 - Proportional Controller - Distance
07:37 - Proportional Controller - Cruise Control
10:04 - Proportional and Integral Controller
14:05 - Over, Under, and Critically Damped Responses
15:04 - Proportional, Integral, and Derivative Controller
18:12 - PID Controller Tuning
19:43 - Code Example
21:09 - Use Cases
21:44 - Conclusion
Рекомендации по теме
Комментарии
Автор

I have watched many videos on PID control, but this is the one where it finally clicked.

pekhotinyets
Автор

This is honestly the BEST explanation of PID. I’ve watched many videos on it and read articles. I’ve just hear that it’s an “art” or that it’s something debated about, but nothing like this. This just straight into the facts and math.

micah
Автор

Brilliant! I love that the PID controller applies to so many widely varying systems... massive boilers operating on hour time scales, or as fast as modern motor controllers in the millisecond range.

grottyboots
Автор

Shawn, you are such an excellent presenter! Looking forward to more. I really loved your KiCad tutorial series also.

jimomertz
Автор

One of the best video that actually help you to understand how a PID controller works.

ScientificThamizhan
Автор

Been looking to get deeper into PID controllers. Perfect timing on the video.

tehmudjinkhan
Автор

the best explanation on the PID controller I've ever seen on YouTube. thanks

aliusef
Автор

Probably the BEST video on PID controllers.

amritpalsingh
Автор

Honestly, this is the BEST explanation of PID, although the SUM column is summed wrong.

alejandromoreira
Автор

There was such clarity and continuity in the explanations...
Really liked and understood the concept clearly ....
This was really helpful ....

mruthyunjayamr
Автор

Shawn, this is one of the best explanation on PID, thanks a lot.

pabcet
Автор

I can't tell you how helpful this video has been and how often I keep coming back to it as a reference. Thank you!

JM-jkvz
Автор

Wish I had you as my teacher when I was coming through the trade! I never claimed to be a sharp knife in a drawer, takes me more time for this material to stick. God Bless You for sharing this video.

DennisSolari-rz
Автор

The best PID video available on youtube 😂 thank you my friend!

moneyhustle
Автор

I have watched many videos on PID, but this is the one from which I understand, Thanks

vidtechnology
Автор

This is an amazing explanation of PID THANK YOU!

spreaderikthierheimer
Автор

I was trying to understand this as an programmer for almost a year now finally I get it.

erdum
Автор

This is an excellent explanation of the PID controller. Thank you so much for sharing this.

ellenamori
Автор

Clarity clarity and clarity
God bless

ganeshhampapura
Автор

Thank you Shawn for diving into PID controllers. This is extremely helpful.

chinmayyande