PID and its derivative algorithms are one of the most widely used algorithms in industry at present, and are well-deserved universal algorithms!
For R&D personnel, mastering the design and implementation process of the PID algorithm is enough to deal with general R&D problems.
PID Concept
PID is the abbreviation of Proportional, Integral, and Derivative. The proportional, integral, and derivative of the deviation are linearly combined to form a control quantity, which is used to control the controlled object.
The control process of PID cannot be simpler, as shown in Figure 1:
Figure 1: PID control process
Through this flow chart, we can see that PID is also feedback control. In PID control:
1.
first step
Calculate the error based on the feedback value and the expected value. For example, in trajectory tracking control, this error is the distance between the vehicle's current position and the expected path.
2.
Step 2
After finding the error, the proportional, integral and differential terms are calculated based on the error value, where Kp, Ki and Kd are the coefficients of these three terms, indicating the proportion of the influence of these three terms on the output control quantity.
3.
Step 3
Finally, the calculated proportional, integral and differential terms are summed to obtain the final output control quantity.
The structure of PID can be changed flexibly, because according to the actual situation, not all three items, namely proportional, integral and differential, need to play a role, so the PID controller can often be transformed into a P controller and a PD controller.
Next, we will take trajectory tracking as an example to discuss the significance of the three terms: proportion, integration, and differentiation.
Concept
Consider a simple situation. Suppose we want the self-driving car to follow the route in the figure, but the car is in the position shown in Figure 2. How many degrees does it need to turn?
Figure 2: Initial position of the car
If we input a fixed value for steering, the trajectory of the car will be as shown in Figure 3: the car will follow a serpentine curve along the center line of the lane.
Figure 3: Driving trajectory of a car with fixed steering value
Obviously, if we sit in such a car, it will be very uncomfortable. Therefore, experienced drivers with skilled driving skills will keep adjusting the steering wheel when changing lanes or turning. When the deviation is large, they will turn a larger angle, and when the deviation is small, they will turn a smaller angle.
P control in PI, also known as proportional control, is to output different control signals according to different deviations. The output of the controller is proportional to the input. As long as the deviation occurs, a control signal proportional to it can be generated in time, as shown in the figure below.
Figure 4: Proportional control
In this example of trajectory tracking control, it can be expressed as:
steering = K p .e(t)
Here, e(t) is the deviation between the expected value and the feedback value, which here refers to the distance the vehicle deviates from the expected path. Kp is the coefficient of proportional control, usually called the proportional parameter.
We can understand it this way: the angle that the steering wheel should be turned is a multiple of the distance the vehicle deviates from the current lane, and this multiple is Kp.
In P control, the coefficient Kp will directly affect the actual control effect. Within a reasonable value range, the larger the Kp, the better the control effect, and the faster the car will return to the desired path, as shown in Figure 5.
Figure 5: The trajectory of the car at different Kp
However, if the position of the car itself is far away from the expected path and Kp is relatively large, the vehicle will lose control, as shown in Figure 6:
Figure 6: Vehicle out of control when Kp is too large
If proportional control is used alone, the car may constantly cross the desired path and adjust back and forth, and cannot steadily drive along the center line of the lane. In the field of control, this phenomenon is called "overshoot".
PD Concept
It seems that PD control can achieve better control effect, but this is only for normal situations when there are disturbances in the environment.
For example, if the road surface is uneven and the vehicle is slightly offset by external force, the proportional control tends to move toward the center line of the lane, while the differential control hopes to offset this tendency. This may cause a continuous deviation between the vehicle's driving route and the expected path (as shown in Figure 7), making it impossible for the vehicle to travel along the expected path. We call this deviation "steady-state error."
Figure 7: The trajectory of the car after it is disturbed and deviated
In order to eliminate the steady-state error, we need to introduce another term - the integral term. We also multiply the integral of the deviation by a coefficient Ki and add it to the expression of proportional differential control:
Then the control output now becomes the sum of proportional, integral and differential terms. Now the controller changes from a PD controller to a PID controller, which is a proportional, integral and differential controller.
Integral control is actually very easy to understand. After the steady-state error persists for a period of time, the actual trajectory of the vehicle and the expected path will form a long strip area. This area can be called the cumulative error ****.
This cumulative error is actually the area of the long strip, and the area of this area can be expressed as the integral of the deviation.
After adding the integral term, the control function will try to make the integral of the vehicle's actual trajectory as small as possible (that is, make the area of the shape formed between the vehicle's actual trajectory and the expected path as small as possible), so that the steady-state error can be eliminated.
Now we need to adjust three coefficients. Similarly, the size of the integral coefficient Ki will also affect the stability of the entire control system, as shown in Figure 8:
Figure 8: The trajectory of the car with different Ki
If Ki is too large, the controller will become unstable because normal controller fluctuations will be exaggerated.
If Ki is too small, it will take a long time for the controlled vehicle to escape from the steady-state error, which will inevitably put the vehicle in a dangerous situation in some cases.
Only when Ki is just right can the vehicle quickly approach the ideal trajectory.
Summarize
We simultaneously consider three factors: the degree of vehicle deviation, the speed of approaching the desired path, and the continuous deviation error to control the vehicle to achieve trajectory tracking. This is proportional-integral-derivative control (PID).
This is explained using the example of vehicle trajectory tracking. Let’s summarize each link of PID:
The role of proportional control is to change the control amount in the direction of reducing the deviation according to the size of the deviation. The strength of the control effect depends on the proportional coefficient Kp. The larger the Kp, the stronger the control. However, too large a Kp will cause system oscillation, produce "overshoot", and destroy system stability.
The role of differential control is to prevent the change of deviation according to the rate of change of deviation. It helps to reduce overshoot, overcome oscillation and make the system stable.
Integral control can eliminate the steady-state error of the system and also promote the control quantity to change in the direction of reducing the deviation.
Selecting appropriate K p , Kd and Ki is the key to using PID controller, and the values of the three parameters need to be determined through continuous trial and adjustment combined with actual working experience.
Previous article:Two techniques for implementing PID control algorithms
Next article:Brief Introduction of FOC of BLDC Motor Control Algorithm
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【NUCLEO-L552ZE Review】+ Bluetooth communication experiment (1)
- Sigma-Delta ADC Digital Filter Types
- Remote upgrade of HuaDa MCU HC32L110
- Explanation of the stack pointer register SP of msp430
- Qorvo at CES 2020: Innovative Solutions for 5G, IoT, Wi-Fi 6 and V2X
- dsp28335 Ecap Summary
- Motor drive control essence summary post
- Preliminary analysis of the G problem of the electronic competition
- AD automatically adds test points
- iTOP-3399 development board Linux system modify boot LOGO