It's so easy to understand the PID control principle

Publisher:PositiveEnergyLatest update time:2023-10-24 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Many friends think that PID is a kind of control that is out of reach, very mysterious, and very high-sounding. They are also very vague about its control principle and only know it at the conceptual level. They know the result but not the reason. So this issue explores the essence of differential and integral circuits from an alternative perspective, aiming to help understand the control principle of PID (PID: P stands for proportional control; I stands for integral control; D stands for differential control).


Before we understand differential and integral circuits, we all know the characteristics of capacitors: the current of a capacitor leads the voltage by 90°. Many textbooks describe it this way, which is very confusing. What is its essence?


To thoroughly master differential, integral circuits or PID control ideas, you must first understand capacitors.

A capacitor is a container that holds electric charge. From a microscopic perspective, when electric charge flows into the container, the electric field between the electrodes gradually increases over time. Take Figure 1 as an example:

① At the beginning of charging, Uc=0V, the voltage difference △U=Ur=Ui, at this moment there is no charge in the container, and there is no electric field to repel the inflowing charge; therefore, the current Ic is the largest, which is manifested as the smallest capacitive reactance, which is close to a short circuit;

② When Uc rises, the pressure difference △U begins to decrease. This process forms an electric field, and the container begins to repel the inflowing charges; the current Ic gradually decreases, which is manifested as a gradual increase in capacitive reactance;

③When Uc=Ui, the pressure difference △U=Ur=0V, at this moment the electric field in the container is the strongest, and the inflow of charges is blocked with the maximum repulsive force; the current Ic=0, which shows the maximum capacitive reactance, which is approximately an open circuit.

dff01336-080c-11ee-962d-dac502259ad0.png

Figure 1: Capacitor charging model

When the charge flows out of the container, the inter-electrode electric field gradually decreases with time; the capacitor in this discharge process can be regarded as a voltage source with zero internal resistance, taking Figure 2 as an example (remove the power supply and ground):

① At the beginning of discharge, Uc=Ui. At this moment, the container is full of charge, so the electric field is the strongest, and the resistance remains unchanged, then the discharge current Ic is the largest (the direction is opposite to the charging direction), the voltage across the resistor Ur=Uc, then Ur=Ui;

②When Uc decreases, the electric field weakens, the discharge current Ic gradually decreases, and Ur=Uc also gradually decreases;

③ When the discharge is exhausted, Uc=0V. At this moment, there is no charge in the container, so there is no electric field, Ur=0V.

e00ec8bc-080c-11ee-962d-dac502259ad0.png

Figure 2: Capacitor container discharge model

A capacitor is like a bucket. No matter how large or small the water flow is, the water level must rise continuously from the lowest level. The charge in the capacitor also gradually accumulates from 0. The accumulation process is related to the natural constant e, which will not be discussed in depth here.

Figure 3 is the voltage-current curve of capacitor charging and discharging.

e0318460-080c-11ee-962d-dac502259ad0.png

Figure 3: Capacitor charging and discharging, voltage-current curve

In connection with the previous analysis, it can be summarized as follows:

① The capacitor voltage cannot change suddenly, but the current can change suddenly (the textbook definition is that the rate of change of the capacitor current is proportional to the voltage);

② The capacitor during the charging process can be equivalent to a variable resistor, and the capacitor during the discharging process can be equivalent to a voltage source;

③The capacitor current reflects the amount of charge flowing per unit time, and the capacitor voltage (or electric field) reflects the amount of charge. In layman's terms, the flowing charge will lead to changes in the amount of charge (consistent with ①); in mathematical terms, the capacitor current leads the voltage phase by 90°;

④The charging and discharging speed of a capacitor is related to the size of the capacitor and the resistance.

After fully understanding the capacitor, let's first get to know the simplest voltage divider circuit, as shown in Figure 4. According to Ohm's law, VCC=2.5V, this purely resistive voltage divider circuit is the prototype of the proportional operation circuit.

e0498af6-080c-11ee-962d-dac502259ad0.png

Figure 4: Voltage divider circuit

As shown in Figure 5, we replace R2 with a 104 (0.1μF) capacitor, and the C1 capacitor is approximately open circuit after being fully charged, VCC=5V; this circuit is the prototype of the integral operation circuit. Then, changing 5V to a signal source constitutes a low-pass filter circuit.

e05d1828-080c-11ee-962d-dac502259ad0.png

Figure 5: Integrator circuit

Figure 6 shows the charging waveform in the figure above. The red color represents the 5V waveform and the blue color represents the VCC waveform. Because the capacitive reactance of the capacitor increases from small to large until it is open circuit when charging, the voltage VCC also increases from small to large until it reaches 5V. Moreover, it takes a certain amount of time to charge the capacitor, which results in a slower waveform of VCC. (The 5V is the output waveform when the switching power supply is powered on and soft-started)


e07d86b2-080c-11ee-962d-dac502259ad0.jpg

Figure 6: Integrator circuit waveform

Combining Figure 4 and Figure 5 gives the circuit of Figure 7, which is the PI circuit (proportional integral) we often use. It is very common in reference voltage or voltage divider circuits. The purpose of adding capacitors is to increase the delay and stabilize the voltage of VCC so that it does not fluctuate due to 5V fluctuations. VCC=2.5V.

e098d44e-080c-11ee-962d-dac502259ad0.png

Figure 7: PI circuit

By exchanging the positions of the capacitor and the resistor in Figure 5, we get the circuit shown in Figure 8. After the capacitor C1 is fully charged, it is approximately open circuit, and VCC = 0V; this circuit is the prototype of the differential operation circuit. Then, changing 5V to the signal source constitutes a high-pass filter circuit.

e0ba128a-080c-11ee-962d-dac502259ad0.png

Figure 8: Differentiator circuit

Figure 9 shows the charging waveform in the figure above. The red color represents the 5V waveform, and the blue color represents the VCC waveform. Because the reactance of the capacitor changes from small to large until it is open circuit when it is charged, the voltage VCC changes from large to small until it reaches 0V. That is, the moment the red waveform jumps from 0, VCC is already the maximum value, so the differential has the property of advanced prediction (reflecting the rate of change of the input signal).

e0d7d0f4-080c-11ee-962d-dac502259ad0.jpg

Figure 9: Differentiator Circuit Waveforms

Figure 10 shows an (inverting) proportional operation circuit.

e10294a6-080c-11ee-962d-dac502259ad0.png

Figure 10: Ratio operation circuit

As shown in Figure 11, Uo and Ui are in a linear relationship.

e1136f56-080c-11ee-962d-dac502259ad0.png

Figure 11: Ratio operation circuit waveform

Figures 12 and 13 show the charging and discharging process of the differential operation circuit:

The capacitor C1 during the charging process can be equivalent to a variable resistor. The capacitive reactance of C1 when it starts to charge is 0. If the voltage cannot change suddenly, the voltage is 0. The divided voltage obtained at the input end of the op amp is the maximum positive peak value, so Uo is the maximum negative peak value of the op amp. As the capacitor is fully charged, U0 gradually becomes 0.

e12962de-080c-11ee-962d-dac502259ad0.png

Figure 12: Differential operation circuit - charging

The capacitor C1 in the discharge process can be equivalent to a voltage source, and the voltage cannot change suddenly. At this time, the reverse current is the maximum value, and the instantaneous reverse voltage of R1 is also the maximum value. The voltage divided by the input terminal of the op amp is the negative maximum peak value, so Uo is the positive maximum peak value of the op amp. As the capacitor is discharged, U0 gradually becomes 0.

e14d7584-080c-11ee-962d-dac502259ad0.png

Figure 13: Differential operation circuit - discharge

As shown in Figure 14, the input and output waveforms of the differential operation circuit are shown. Combined with the previous analysis results, Uo reflects the rate of change of Ui, thus achieving the effect of predicting ahead of time.

e16c2754-080c-11ee-962d-dac502259ad0.png

Figure 14: Differential operation circuit waveform

Figure 15 shows a differential operation simulation circuit. In order to prevent the operational amplifier from saturation, the input current must be limited. In actual use, a small resistor R2 needs to be connected in series with the input end of capacitor C1. The circuit after the series resistor is no longer an ideal differential operation circuit, but as long as the input signal period is greater than 2 times the RC constant, it can be approximated as a differential operation circuit.

e17c64de-080c-11ee-962d-dac502259ad0.png

Figure 15: Differential operation simulation circuit

Figure 16 shows the waveform of the differential operation simulation circuit, where IN- is the waveform of the op amp input terminal.

e18ef0f4-080c-11ee-962d-dac502259ad0.png

Figure 16: Differential operation simulation circuit waveform

Figures 17 and 18 show the charging and discharging process of the integral operation circuit:

The capacitor C1 during the charging process can be equivalent to a variable resistor. The capacitive reactance of C1 when it starts to charge is 0. If the voltage cannot change suddenly, the voltage is 0, and the voltage divided by the input terminal of the op amp is 0, so Uo is 0. As the capacitor is fully charged, the voltage divided by the input terminal of the op amp is the positive maximum value, and U0 is the negative maximum peak value of the op amp.

e1b8e508-080c-11ee-962d-dac502259ad0.png

Figure 15: Integral operation circuit - charging

The capacitor C1 in the discharge process can be equivalent to a voltage source, and the voltage cannot change suddenly. The voltage divided by the input terminal of the operational amplifier cannot change suddenly either. As the capacitor is discharged, Uo gradually changes from the negative maximum peak value to 0.

[1] [2]
Reference address:It's so easy to understand the PID control principle

Previous article:Under certain conditions, does a higher speed motor have better performance?
Next article:Siemens PLC pointer type and indirect addressing tutorial

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号