Video 1.7 - PID Control

Video

#Physics #Engineering #Control_Theory #Robotics

↩️ Go Back

Table of Contents:


C.3) PID Control

Last time, we saw that the PI-Regulator (or its slightly more elaborated brother, the PID - Regulator) was enough to make the cruise controller achieve Stability, Tracking, and Robustness.

Now we will see what are the effects of the controller gains and why the PID - Regulator is such an important regulator in virtually every industry.

C.3.1) Proportional Gain


C.3.2) Integral Gain


C.3.2) Derivative Gain


C.4) Fun Facts of the PID

So… PID is by far the most used "low-level controller"

You may ask: What is the difference between a low level control and a high level control?

Controllers that directly drive the hardware are low-level controllers whereas those that implement logical decision-making are high-level controllers.

The terms "high" and "low" are relative. Nested controllers ensure abstraction and code modularity.

You may also ask: Why does PID work with many systems so well?

Because feedback has a remarkable ability to fight uncertainty in model parameters

warning

With PID, stability is not guaranteed

C.5) Tuning the PID gains for the Cruise-Controller (Trial and Error)

C.5.1) Tuning Kp

We start by tuning the P-Regulator,

Say Kp= 1,
|450

we see that the system is stable, but we have no tracking since we can't reach r=1,

Let's Tune now the integral gain.

C.5.2) Tuning Ki

Tuning the integral gain we get,

Say Ki = 1,
|450

The system works great! We are done.

But what happens if me increase the integral gain? 🤔
Can we do it better? 🤔

Let's try with Ki= 10
|450

Now my system starts oscillating.

So this is an example of where the integral part may actually cause oscillations.

If we see oscillations it may be an indicator that Ki is to high.
Be careful !

C.5.3) Tuning Kd

Now let's tune the "D" part,

Let's try with Kd= 0.1,

|450

In this case, it doesn't actually matter too much.

Notice Kd is small because we know it can make the system sensitive to noise

So, how is this different from the PI - Regulator?

Notice we are getting a faster initial response, but then it is slower towards the end. So maybe a PID is not the best for our particular application.

This is some of the thinking that goes into tweeking PID regulators, in fact there are many methods for tuning the gains of a PID.

So what we are going to do next time is, we are going to go now from this rather abstract math to something that we can actually implement. And we are going to use a PID to control the altitude of a hovering Quadrator.

C.5.4) Extra Content 🎦 - How to Tune a PID Controller by RealPars

Video

#PLC #PID #Control_Theory

↩️ Go Back

Table of Contents:


A) Introduction - PID Controllers

PID is an acronym from "Proportional", "Integral", and "Derivative".

A PID Controller is a device that is used to control a process.

The controller can be a physical, stand-alone device or a control block found in a PLC function database.

The PID portion of the controller is a series of numbers that are used as adjustments in order to achieve your objective.

Some simple examples of controlled processes are:

Now let's discuss what the parameters of a PID controller are, and how they are used.

|350

In the most simplistic terms, the controller calculates the "P", "I", and "D" actions…

|350

...and multiplies each parameter by the error “E”, which is equal to,
"Set Point" - "Process Variable" in "Direct Acting”

Note: Direct Acting vs Reverse Acting

A Direct Acting Controller is one whose output tends to increase as the measurement signal increases.
|500
A Reverse Acting Controller is one whose output tends to decrease as the measurement signal increases.
|500


More examples:

Then, all parameter calculations are added up to produce the "Control Variable"

|350

Unfortunately, there is no industry standard on the parameter terms.
Here are some of the uses found today!

A.1) Proportional Term

The "Proportional" term, often called "P" constant, can be referred to as "Proportional Gain" or just "Gain", which is not a unit but instead a "ratio".

This parameter can also be called "Proportional Band" and measured in the unit of "percent"

The "Proportional Band" can also be written in terms of the "Proportional Gain",

Note:

This parameter can be called "KP", "Gain", Throttling Range (%TR), or others.

This is the parameter that determines how fast the system responds.

The name by which this parameter is referred varies with the manufacturer.

For controllers that use the term "Gain", adjusting this tuning parameter higher, may cause more sensitive, less stable loops.

Conversly, on controllers with “Proportional Band" units, decreasing this turning parameters affects the loop in the same manner.

Keeping this in mind, knowing the type of controller you have is essential to ensure that you are properly adjusting your parameters.

For more information visit:

http://h240.marcks.cc/downloads/06_pb_vs_gain.pdf
This text explains by which conditions the equation %PB = 100/P is true, and how to make the conversion between these parameters when the conditions are not met.

A.2) Integral Term

The Integral term or "I" constant, often called "Reset" can be in different measurements as well.

There are "repeats per second" (or "repeats per minute") and the parameter is known as Ki (or others).

There are "seconds per repeat" or "minutes per repeat" and the parameter is known as Ti (or others).

And these parameters are related by the following equation,

Essentially, regardless of the measurement type, the integral is the sum of all of the values reported from the PV signal, captured from when you started counting, to when you completed counting.

Or the area under a plotted curve.

The integral term determines how fast the steady state error is removed,

To adjust this parameter in "minutes per repeat" (Ti), we know that "smaller" values of Ti will create "larger" integral action.

|450

And "larger" values in "repeats per minute" measurements (Ki), will also create "larger" integral action.

|450

A.3) Derivative Term

Derivative or "D" constant units are typically “seconds" or "minutes".

The purpose of the "Derivative" constant is to predict change,

The derivative action acts on the rate of change measured in the Process Variable,

The value of this parameter basically means how far in the future you want to predict the rate of change.

|300

This parameter can help to create a faster response in your loop and a better performing loop as well.

However, since the "Derivative term" is measuring the rate of change in the Process variable, the Process variable must be a very clean signal.

Meaning no noise within the signal:

Note

For that reason, the Derivative terms are not often used in controls.


B) Algorithms and Parameters

The most commonly used controller is the PI.
Most processes can be well served with this type of control.

|350

P and PID controllers are occasionally used.

While PD controllers are rarely used.

|350

B.1) PID adjustable parameters

PID controllers also have many other adjustable parameters, and just to name a few we have:

B.2) PID algorithm types

PID controllers also implement different algorithm types,

For example:


C) PID tuning methods

There are many methods to tuning a PID loop, but the must widley tuning method is "trial and error",

C.1) Trial and Error

The goal is to control the process, when plotted in a trend, as a nice, even trend line with minimal oscillation.

C.2) Tune a PI Controller

Because the PI Controller is the most widely used, we will only be adjusting those parameters.

As we have discussed the differences in measurements in PID terms, for this tutorial we are going to standardize on "gain" and "repeats per minute"

C.2.1) "Jump right in" approach

We have two cases depending on how the Process Variable responds,

Note: Adjust only one parameter at a time and observe the results

C.2.2) Measured approach

Start with a low proportional gain, and with integral and derivative disable,

Watch the process and begin incrementally adjusting the gain by doubling the value.

When the process begins to oscillate, adjust the gain value down by 50%

Then repeat the process with the integral term. Employ a small integral value and watch the process.

Double the value incrementally until oscillation occurs then cut the integral by 50%

At this point, we are close to the SV and we can begin the fine-tuning process.

C.2.3) Extra: Heuristic Methods for PID tuning

For more information visit:

This video explains the 1st heuristic method for tuning a PID controller using a step response.
https://youtu.be/5WSq4Uv3JFI

For more information visit:

This video explains the 2nd heuristic method for tuning a PID controller using the period of oscillation of the closed loop system.
https://youtu.be/AAaWNNuqpuY


↩️ Go Back


Z) 🗃️ Glossary

File Definition

↩️ Go Back