An example shows PID parameter tuning

Source: Internet
Author: User

foreword: PID is the abbreviation of proportion, integral and differential, the difficulty of PID control is not programming, but the parameter setting of controller. The key of parameter setting is to understand the physical meaning of each parameter correctly, and the principle of PID control can be understood by employing the manual control of the furnace temperature.    1. Proportional control

experienced operators manually control the furnace temperature, can obtain very good control quality, PID control and manual control of the control strategy has a lot of similar places.

The following describes how the operator uses proportional control of the idea to manually control the temperature of the electric heating furnace. Suppose a thermocouple is used to detect the furnace temperature, and a digital meter displays the value. During the control process, the operator uses the eye to read the furnace temperature and compares it with the given value of the furnace to get the error value. Then, by hand, the electric current is adjusted to keep the furnace temperature near the given value.

The operator knows the approximate position of the potentiometer when the furnace temperature stabilizes at a given value (we call it position L) and adjusts the angle of the potentiometer that controls the heating current based on the temperature error values at that time. When the furnace temperature is less than the given value, the error is positive, and the angle of the potentiometer is increased clockwise on the base of the position l to increase the heating current. When the furnace temperature is greater than the given value, the error is negative, the angle of the potentiometer is reduced counterclockwise on the base of the position l, and the difference between the angle and position L is proportional to the error. The above control strategy is proportional control, that is proportional to the output of the PID controller in proportion to the error.

There are a variety of delay effects in the closed loop. For example, after adjusting the potentiometer angle, there is a large time delay when the temperature rises to the corresponding steady-state value of the new corner. Due to the existence of delay factors, adjusting the angle of the potentiometer can not immediately see the effect of adjustment, so the main reason for the closed-loop control system difficulty is the delay in the system.

proportional control of the proportional factor if too small, that is, the adjusted potentiometer angle and position l difference is too small, the intensity of the adjustment is not enough, so that the system output changes slowly, the total time required for adjustment is too long. If the scale coefficient is too large, that is, after adjusting the potentiometer angle and position l difference is too large, the adjustment intensity is too strong, will cause the adjustment overdo, even make the temperature suddenly high and low, back and forth concussion.

The increase of the proportional coefficient makes the system responsive, the adjustment speed is accelerated, and the steady state error can be reduced. But the proportional coefficient over the General Assembly causes the overshoot to increase, the oscillation frequency increases, the adjustment time is longer, the dynamic performance becomes bad, the proportional coefficient is too big even causes the closed-loop system to be unstable.

simple proportional control is difficult to ensure the right adjustment, completely eliminate the error.

2. Integral Control

The integral of the PID controller corresponds to the area bounded by the error curve and the axis in Figure 1 (the gray part of the figure). The PID control program is executed periodically, and the period of execution is called the sampling period. The computer program uses the sum of each rectangular area in Figure 1 to approximate the exact integral, and the TS in the graph is the sampling period.

Figure 1 Integral operation

each PID operation, based on the original integral value, adds a tiny part proportional to the current error value EV (n). When the error is negative, the increment of the integral is negative.

when manually adjusting the temperature, the integral control is equivalent to the current error value, periodically adjusting the angle of the potentiometer, the angle increment value of each adjustment is proportional to the error value at that time. When the temperature is lower than the set value, the error is positive, the integral term increases, and the heating current increases, whereas the integral term decreases. So as long as the error is not zero, the output of the controller will change due to the integral effect. The "general direction" of integral adjustment is correct, and the integral term has the function of reducing the error. Always to the system in a stable state, when the error is constant zero, the proportional part and the differential part are zero, the integral part is no longer change, and just equal to the steady state of the controller output value, corresponding to the above temperature control system potentiometer angle position L. Therefore, the function of integral part is to eliminate the steady state error, improve the control precision, integral function is generally necessary.

the integral part of the PID controller output is proportional to the integral of the error. Because the integration time TI in the denominator of the integral term, the smaller the TI, the faster the integral term changes, the greater the integration effect.

3. Pi Control

The integral term in the controller output is proportional to the current error value and the accumulated value of the previous error values, so the integral effect itself has a serious lag characteristic, which is unfavorable to the stability of the system. If the coefficient of integral is not set well, its negative effect is difficult to be quickly corrected by the integral action itself. The proportional term has no delay, as long as the error occurs, the proportional portion will immediately function. Therefore the integral function is rarely used alone, it is generally used in combination with proportional and differential, to form a PI or PID controller.

PI and PID controller can not only overcome the shortcomings of simple proportional adjustment with steady state error, but also avoid the shortcomings of simple integral adjustment response slow and bad dynamic performance, so it is widely used.

if the controller has integral function (for example, using PI or PID control), the integral can eliminate the steady-state error of the step input, then the scale coefficient can be adjusted smaller.

if the integral function is too strong (that is, the integration time is too small), the equivalent of each trimmer potentiometer angle value is too large, its cumulative effect will make the system output dynamic performance is poor, overshoot increase, even make the system unstable. If the integral function is too weak (that is, the integration time is too large), the speed of eliminating the steady state error is too slow, and the value of the integration time should be moderate.

4. Differential action

the differential of error is the rate of change of error, the faster the error change, the greater the differential absolute value. When the error increases, the differential is positive and the differential is negative when the error decreases. The differential portion of the controller output is proportional to the differential of the error, which reflects the trend of the controlled volume change.

experienced operators in the temperature rise too fast, but have not yet reached the set value, according to the trend of temperature changes, the premonition temperature will exceed the set value, there is overshoot. The angle of the potentiometer is then adjusted to reduce the heating current in advance. This is equivalent to when a soldier shoots a distant moving target, taking into account the time of the bullet movement, which requires a certain amount of advance.

Figure 2 Step response curve

Figure 2, C (∞) is the steady-state value of the controlled volume C (t) or the expected values of the controlled amount, error E (t) = C (∞)-C (t). In Figure 2, the ascent phase of the initiation process, at that time, the controlled volume has not exceeded its steady state value. However, because the error E (t) is decreasing, the differential of the error and the differential part of the controller output is negative, the output of the controller is reduced, which is equivalent to the braking action in advance to prevent the increase of the controlled amount, so the overshoot can be reduced. Therefore, the differential control has the characteristics of advance and prediction, before the overshoot has not yet appeared, it can give a control effect in advance.

The fundamental cause of the oscillation and even instability of the closed-loop control system lies in the large lag factor. Because the differential term can predict the trend of error variation, the effect of this "advance" can counteract the lag factor. The proper differential control can reduce the overshoot and increase the stability of the system.

if the effect of pi control is not satisfactory for the controlled object with large lag characteristics, the differential control can be considered to improve the dynamic characteristics of the system during the adjustment process. If you set the differential time to 0, the differential part will not work.

Differential time is proportional to the strength of differential action, the greater the differential time, the stronger the differential action. If the differential time is too large, a "glitch" may appear on the response curve when the error changes rapidly.

the disadvantage of differential control is that it is sensitive to disturbance noise, which reduces the ability of the system to suppress interference. Therefore, the inertial filter can be added to the differential part.

5. Sampling Period

The PID control program is executed periodically, and the period of execution is called the sampling period. The smaller the sampling period, the more the sampled value can reflect the change of the analog quantity. But too small will increase the computational workload of the CPU, the difference between the adjacent two samples almost no change, will make the PID controller output of the differential part close to zero, so it is not appropriate to take the sampling period too small.

it should be ensured that when the charge is rapidly changing (for example, during the ascent phase during startup), there are enough sample points to lose important information in the collected analog due to too few sample points.

6. Adjustment method of PID parameters

The parameters of the PID controller can be adjusted according to the qualitative relationship between the parameters of the controller and the dynamic performance of the system and the steady-state performance. Experienced debugging personnel can generally get more satisfactory debugging results. The most important problem in debugging is that when the performance of the system is unsatisfactory, you know which parameter should be adjusted and whether the parameter should be increased or decreased.

to reduce the need for tuning parameters, the PI controller can be used first. In order to ensure the security of the system, at the beginning of debugging should be set more conservative parameters, such as the scale factor is not too large, the integration time is not too small to avoid the system instability or excessive overshoot abnormal situation. Give a step given signal, according to the output waveform of the controlled volume can obtain the system performance information, such as overshoot and adjust the time. The parameters of PID should be adjusted repeatedly according to the relationship between PID parameters and system performance.

if the overshoot of the step response is too large, after multiple oscillation can be stable or not stable at all, the proportional coefficient should be reduced and the integration time should be increased. If the step response has no overshoot, but the charge rise is too slow, the transition time is too long, the parameter should be adjusted in the opposite direction.

if the speed of eliminating errors is slow, the integration time can be reduced and the integral function will be enhanced.

repeated adjustment of the proportional factor and integration time, if the overshoot is still large, you can add differential control, the differential time from 0 gradually increased, repeatedly adjust the ratio of the controller, integral and differential parts of the parameters.

In short, the PID parameter debugging is a synthesis, each parameter mutually affects the process, the actual debugging process several times the attempt is very important, also must.

7. PID Parameter Tuning Example
Because the PID belongs to the model-free control, the adjustment of the three-link parameters will have a great difference depending on the control object. The conclusions you have mentioned are in fact based on experience.
Here is a simple example to illustrate the principle of PID control.

1) Suppose that the system we are facing is a simple tank of liquid level, to start from the empty tank water to reach a certain height, and you can control the variable is the water tap switch size. So this simple mathematical model is



For this simple system, we even need a proportional link



will be able to control it.
Plainly, that is, the water tank level away from the predetermined height when the big point, close to the point of opening, with the liquid level gradually close to the predetermined height gradually turn off the faucet.

At this time, the size of the faucet is the thickness (that is, the amount of water to the level of the sensitivity of the error, assuming that the tap opening and error proportional relationship), the more coarse adjustment of the faster, that is, the so-called " increase in proportion coefficient generally will speed up the system response." Such as:

2) Suppose we are not only a container for water, but also a constant supply for the user.
The mathematical model of the system would need to add one more item:

, here c is a positive constant.

At this point we find that if the controller has only one proportional link, then when the system is stable, that is, it happens. E is not 0 when the system is stable, the level is always less than the height we want, which is known as the steady state error, or static difference.

At this point c is fixed, then of course the greater KP, the smaller e. This is the so-called increase of the ratio of p in the case of static error in favor of reducing the static error. such as:


3) from the above formula you can see, KP again big that is just a denominator, it is impossible to turn E into 0. I can't get a reservation. The boss will curse, what can I do?

Then someone thought, in the second section of the tank compared to the first bar, is not more than a leaky hole. How much does it leak? How much do I give it, that doesn't become the simple system in the first section. by whom? This is where the point comes in handy.
We turn the previous controller into a proportional link + integral link:

The meaning of the integral link is equivalent to you add a faucet, the switch rule is the water level than the predetermined height of the must not has been a big twist, higher than the predetermined height of the small twist. If the water leakage speed is constant, then one day this faucet water speed is exactly the same as the rate of leakage, the system and the first bar of the same. At that time, the silence was gone. This is called the integral Link can eliminate the system static error.

4) What is the integral time constant ? In general PID control, the factor that represents the sensitivity of the integral link, this ti is the integration time constant. From this equation we can see that the greater the integration time constant, the smaller the integral link coefficient, the less sensitive integral link (that is, the second tap thinner).

When we have only one proportion of the faucet water injection, it will not inject more, because the closer the tap off the smaller AH.
But when we use two taps to inject water, in the not to the predetermined height before the second point of the tap can always be screwed, that when reaching the predetermined height of it just screwed to the maximum, naturally will inject more. And the more out of this part of the water is called " overshoot ." The thicker the second faucet, the more water it will be, the faster it will be equal to the leak speed, but at the same time it will be more twists and turns.

So, the teacher told us to increase the integration time I help reduce overshoot, reduce oscillation, so that the stability of the system increases, but the system static elimination time is longer. such as:


5) Let's look at some interesting things next. Or the above system, if we use the same integration time constant, but choose a different scale factor?

Seeing the picture above, some children's shoes with good memory may have doubts. Because the teacher clearly said, " too large proportional coefficient will make the system has a relatively large overshoot, and produce oscillation, so that the stability of the bad", but the above picture of how large proportion of the rather small?
In fact, the above picture is very good explanation, in section 4 we explained that the PI controller overshoot occurs because of the integration of the faucet when reaching the target level also happens to be the largest. The larger the ratio of this faucet, the more obvious it is to suppress overshoot when it exceeds the target level.

here, I would like to emphasize that: the conclusion of PID parameter tuning is based on the general experience, but it is not necessarily suitable for a specific system.

6) in the above system, we assume that the user uses a fixed value of water, but the actual situation of the user's consumption is often changed. What if our system is?
To analyze:
The goal of our control is to let the definition of system error be:;
Then the error state equation is
The control target we set above is a constant, so;
So
From the above we can see that when e=0, no longer changes, and C (t) is always changing.
So at this time de is not constant zero, that is, E is not constant zero.
In other words, when C becomes C (t), the e=0 is no longer the stable equilibrium point of the system, the system is no longer stable in the classical sense.

7) Is it possible to stabilize the system by adding a differential link D to PID control?
When adding a differential link,

So

for any (), the differential link slows down the de's change, which is
"The main function of the differential link is to suppress deviations in any direction during the response process ."
"The differential constant cannot be too large, otherwise the response process will be braked early, extending the adjustment time "

As for the " differential link will reduce the system's anti-jamming performance ", more refers to the majority of micro-measurement noise caused by small, but the large instantaneous, the differential link with respect to the PI link is more likely to receive these subtle noise effects.
However, no matter how to select the differential parameters, PID control can not stabilize the system. From here, we can see the limitations of PID control.
——————————————————————————————————————————
Differential links think for a long time, and finally think of the examples are not clear and accurate, or more comfortable with the formula.
I hope you do not rote the formula, more use of the control theory learned to specific problems specific analysis.
——————————————————————————————————————————
In addition, an engineering example: four-axis dedicated PID parameter tuning method and principle
Reference: http://www.zhihu.com/question/23088613/answer/23942834http://blog.gkong.com/liaochangchu_117560.ashx

An example shows PID parameter tuning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.