seem PID Gao Dashang , In fact, we were all shocked by his appearance . Be bullied first , Then he was bluffed by the formula , Because most people don't or forget at all , So let's look at the formula again , I was scared to death . After understanding the very shallow principle , The result formula is not understood , Don't understand the meaning , So it wasn't thorough in the end . Let me analyze the formula first , I understand the formula , Combined with some online pid Examples described , I see .

 

Right first PID The meaning of these three coefficients is simple literacy ,. It also prevents you from forgetting .P Is the scale factor ,I Is the integral coefficient ,D Is the differential coefficient . Below right PID These three coefficients are described in detail .

 

 

1. Scale factor P What's it for , In fact, if you are a junior high school student now , You understand at once , The scale factor is used to pass through (0,0) The magnification of this coordinate point line k,k The bigger , The greater the slope of the line , So it's used in y
= k * x Medium , Among them k Is the scale factor p, Everyone is referred to as kp, So it became y = Kp * x.

x Is the current value currentValue And target values totalValue Difference between , Abbreviation error err, be err = currentValue -
totalValue.y Is the output value corresponding to the actuator U, Therefore, the output value corresponding to the actuator U = Kp * ( currentValue - totalValue ) .

therefore , If it is adjusted by proportion .

Then the current second 1 The corresponding output value of the actuator during this adjustment is U1 = Kp * ( curentValue1 - totalValue1 ).

The first 2 The corresponding output value of the actuator during this adjustment is U2 = Kp * ( currentValue2 - totalValue2 ).

This is the scale factor P Application of , That is what we call proportional adjustment . Proportional adjustment is based on the difference between the current value and the target value , Multiplied by one Kp Coefficient of , Get an output value , This output value directly affects the next change in the current value . If only proportional adjustment , The system will vibrate badly . For example, what is the speed of your car now 60km/h, Now you want to control the car to a constant through your actuator 50km/h, If you only use kp Conduct proportional adjustment .U
= Kp * ( 60 - 50 ), hypothesis Kp Value is 1, Get at this time U The output value of the actuator is 10, As a result, when you output the actuator , I found the car turned into 35Km/h, here U2 =
Kp * (35 -
50), Get at this time U The output value of the actuator is -15, As a result, when you output the actuator , Found that the car became 55Km/h, Due to inertia and unpredictable error factors , Your car has never been able to reach a constant speed 50km/h. Always shaking , I believe if you're in the car , You must have vomited badly . Therefore, the light has a proportional coefficient to adjust , In some cases, there is no way to stabilize the system . So in order to slow down the severe shock , Scale is used in combination P And differential D.

 

2. Differential coefficient D

differential , In fact, it differentiates the error . Addition error 1 yes err(1). error 2 yes err(2). Then error err The differential of is (err2 -
err1). Multiply by differential coefficient D, It's called KD, Then when the actuator 1 After the second adjustment 1 Secondary error , The first 2 After the second adjustment 2 Secondary error , Then combine P coefficient . There it is PD combination , According to each adjustment , Empirical calculation of error value , You can choose to take it out D Coefficient of . If the error is getting smaller and smaller , Then the differential must be a negative value . Negative values are multiplied by one D coefficient
After adding the value of proportional adjustment, the positive value is smaller than the value of proportional adjustment alone , So it plays the role of damping . With the effect of damping, the region of the system will be stable .PD After the above analysis, the combined formula is

U(t) = Kp * err(t) + Kd * derr(t)/dt

 

3. Integral coefficient I

integral , It's actually an integral of the error , That is, the infinite sum of errors . How to understand integral coefficient I, Here is an example from the Internet

Take hot water as an example . If someone brings our heating device to a very cold place , Start boiling water . Need to burn 50℃.

stay P Under the action of , The water temperature rises slowly . Until it rises to 45℃ Time , He found a bad thing : It's too cold , The rate at which water dissipates heat , and P The controlled heating rate is equal . 
What can I do ?

P Brother thinks so : I'm close to the goal , Just heat it gently . 
D Brother thinks so : Heating and heat dissipation are equal , The temperature does not fluctuate , I don't seem to have to adjust anything .

therefore , The water temperature stays at 45℃, Never 50℃.

As a person , According to common sense , We know , The heating power should be further increased . But how to calculate the increase ? 
The method advanced scientists have come up with is really ingenious .

Set an integral . As long as the deviation exists , We're constantly integrating the deviation ( accumulation ), And reflected in the adjustment strength .

thus , even if 45℃ and 50℃ The difference is not too big , But over time , As long as the target temperature is not reached , This integral keeps increasing . The system will gradually realize : The target temperature has not been reached , It's time to increase power ! 
When the target temperature is reached , It is assumed that the temperature does not fluctuate , The integral value will not change . At this time , The heating power is still equal to the heat dissipation power . however , The temperature is stable 50℃. 
kI The larger the value of , The greater the coefficient of integration , The more obvious the integration effect is .

therefore ,I The role of is , Reduce static error , Make the controlled physical quantity as close to the target value as possible .

I There is another problem when using : Integral limit needs to be set . Prevent from heating at the beginning , Just multiply the integral too much , Difficult to control .

 

So the final combination PID after , The company becomes , I found the screenshot directly from the Internet as follows

 

Technology
©2019-2020 Toolsou All rights reserved,
Android Using wechat in H5 Payment result refresh during payment shock !!C++ Can make a sound ! Basic operation of single linked list C Language explanation Java Implement an epidemic number management system 2021 year 11 World programming language ranking linux upper mysql Invalid command _linux lower mysql The command is useless Java project : Campus dormitory management system (java+jsp+javaweb+mysql+ajax) Wechat applet development project directory linux ubuntu Which version ,Ubuntu Which version is the best ?python Code painting cherry blossoms - How to use Python Draw a beautiful cherry blossom