How to understand P and I of incremental PID (1)

The New Life of Dawn Chapter

Overturning the understanding of P and I of incremental PID

1. According to the information I know, the understanding of the three parameters of PID is as follows: (I only talk about P and I here)

The role of P : Proportion P can speed up the system adjustment speed. If P is too small, the adjustment time will be longer and the responsiveness will be insufficient. The larger P, the higher the responsiveness and the more serious the overshoot will be. Too large P will cause the system to oscillate.

The function of I : eliminate static error and improve control accuracy. The larger I is, the more lagging it will be. If it is too large, the system will oscillate.

2. The above is true for positional PID, but not for incremental PID. However, the existing information in books and online does not distinguish between positional and incremental types, so it means that the same is true for incremental types.
Now let’s speak with practical evidence: see if P and I of incremental PID are as stated in the book (P can speed up system adjustment, and I eliminates static errors).
————No more nonsense————Picture above:

P I image describe
0.1 0.01 Insert image description here The set value is 200, starting from 0 to 200. At this time, the maximum has exceeded 800.
0.3 0.01 Insert image description here You can see that the peak value is less than 800
0.5 0.01 Insert image description here Peak around 600
1 0.01 Insert image description here Overshoot is smaller and adjustment time is longer
3 0.01 Insert image description here The overshoot is reduced again, the adjustment time is already very long, and the responsiveness is getting worse and worse.
7 0.01 Insert image description here There is no overshoot, because the initial peak value is only 125, then it gets higher and higher, and finally it approaches the set value, and the static difference is almost 0
15 0.01 Insert image description here It started to tremble, and it started to look a little weird.
30 0.01 Insert image description here It can be seen with the naked eye that the wheel is no longer spinning. It is spinning forward and reverse for a while, so the wheel is stuck and cannot rotate.

It can be seen that as P increases, the overshoot decreases. At this point, it is concluded that the P of incremental PID - "Proportion P can speed up the system adjustment speed. If P is too small, the adjustment time will be longer and the responsiveness will be insufficient. The larger P, the higher the responsiveness and the more serious the overshoot will be." This is completely Incorrect.
The above is a picture that proves the role of P, and the next is a picture of I:

P I image describe
3 0.01 Insert image description here The setting value is 200, the peak value is less than 300, and finally it stabilizes
3 0.03 Insert image description here
3 0.05 Insert image description here
3 0.1 Insert image description here As the positive adjustment time of I becomes shorter, the responsiveness increases
3 0.3 Insert image description here It can be seen that as I increases, the overshoot is slowly decreasing.
3 0.5 Insert image description here
3 1 Insert image description here
3 3 Insert image description here On the edge of stability and oscillation
3 5 Insert image description here oscillation

At this point, it is concluded that the incremental PID I-I parameter from 0.01-1 can indeed improve the control accuracy. If it is too large, it will cause oscillation. However, it remains to be determined whether the sentence "the larger I is, the lagging behind" is correct. After all, the I parameter is from 0.01. ~1How to explain this dynamic performance (improved responsiveness)?

As can be seen from the above figure: Only when P decreases can the system adjustment speed be accelerated, and when P increases, the adjustment time will become longer. Increasing I can speed up the system adjustment speed and eliminate static differences. If it is too large, it will cause oscillation. However, the larger I is, the greater the lag will not be noticeable. Therefore, what is said in the "Principles of Automatic Control" book: increasing P can speed up the system adjustment speed, is it wrong?

3. Since the existing understanding of incremental P is incorrect and the understanding of I is inaccurate, what is the true understanding of incremental P and I?
Real understanding: If you want to understand the true role of incremental P and I, I would like to mention two premises: 1. The first moment when starting the motor, the level of the current output value (PWM) in the controller 2. Increasing domain . What are the details? My next blog will reveal the true veil of incremental P and I.

.
.
.
.
.
.
.
.
.
Finally, let’s talk about my control here: a very pure incremental PI control motor. The measuring transmitter uses Longqiu’s 1024-line encoder. The PID controller is a K66 microcontroller + code. The controlled object is Brush DC motor. The PI control code is as follows:


    motor.speed_last_error_R = motor.speed_current_error_R;        //更新每次的差值
    motor.speed_current_error_R = (int16)(motor.speed_set_R-motor.speed_R);   //速度当前差值
 motor.speed_duty_output_R = motor.speed_duty_output_R+(int16)(motor.speed_P*(motor.speed_current_error_R-motor.speed_last_error_R)+motor.speed_I*motor.speed_current_error_R);

motor.speed_R is the actual speed of the car's right wheel measured by the encoder, and motor.speed_set_R is the set value of the car's right wheel.
Limiting and PWM output code:

 if(motor.speed_duty_output_L>999 motor.speed_duty_output_L=999;
    if(motor.speed_duty_output_L<-999) motor.speed_duty_output_L=-999;
        if(motor.speed_duty_output_R>999) motor.speed_duty_output_R=999;
    if(motor.speed_duty_output_R<-999) motor.speed_duty_output_R=-999;
     myMotor_Setspeed(motor.speed_duty_output_R,motor.speed_duty_output_L);
void myMotor_Setspeed(int16 PWM_R,int16 PWM_L)//给速度
{
    
     
  //左
  if(PWM_L>=0)
    {
    
    
      ftm_pwm_duty(L_BACK_FTM,L_BACK_CH,0);
      ftm_pwm_duty(L_GO_FTM,L_GO_CH,(uint32)(PWM_L));
    }
  else
    {
    
    
      ftm_pwm_duty(L_GO_FTM,L_GO_CH,0);
      ftm_pwm_duty(L_BACK_FTM,L_BACK_CH,(uint32)(-PWM_L));
    } 
  //右
  if(PWM_R>=0)
    {
    
    
      ftm_pwm_duty(R_BACK_FTM,R_BACK_CH,0);
      ftm_pwm_duty(R_GO_FTM,R_GO_CH,(uint32)(PWM_R));
    }
  else
    {
    
    
      ftm_pwm_duty(R_GO_FTM,R_GO_CH,0);
      ftm_pwm_duty(R_BACK_FTM,R_BACK_CH,(uint32)(-PWM_R));
    }
  
}

…To Be Continued…

Guess you like

Origin blog.csdn.net/fangchenglia/article/details/109518121