Incremental pid parameter adjustment formula and strategy

PID algorithm is a commonly used algorithm in the field of engineering control. It has mature technology, does not need to establish mathematical model, has flexible parameter setting, strong applicability, strong robustness and good control effect. It has been widely used and its parameters. The tuning has a great influence on the control effect, and the parameter tuning method for the incremental PID is less involved in the existing literature.

PID is divided into two types: positional PID and incremental PID. Since the output of the positional PID control is related to the entire past state, the accumulated value of the error is used; and the output of the incremental PID is only related to the current state and the first two states. The error is related, so the cumulative error of the positional PID control is relatively larger, and the incremental PID output is the control quantity increment. If the microprocessor fails, the malfunction is less affected, and the actuator itself has a memory function, but still Keeping the original position does not seriously affect the work of the system, and the positional output directly corresponds to the output of the object, which has a great influence on the system. Therefore, the actual incremental PID application is more extensive.

Incremental PID control

Incremental PID control, a basic form of the digital PID control algorithm, is a control algorithm that performs PID control by incrementing the control amount (the difference between the current control amount and the last control amount).

Incremental PID control mainly replaces the cumulative effect of the original integral link by finding the increment, avoiding the large amount of calculation performance and storage space.

The main advantages of incremental PID control are:

There is no need to accumulate in the 1 formula. The determination of the control increment Δu(k) is only related to the sample values ​​of the last 3 times, and it is easy to obtain a better control effect by the weighting process;

2 The computer only outputs the control increment at a time, that is, the amount of change corresponding to the position of the actuator, so the impact range is small when the machine fails, and the production process is not seriously affected;

3 Manual—The impact is small when switching automatically. When the control is switched from manual to automatic, a disturbance-free switching can be made.

Since the incremental type needs to memorize the control amount, it can only be controlled by the positional PID control method for a system without a memory device.

Incremental pid parameter adjustment formula

The incremental PID control writes the control amount at time n-1 according to the positional PID control formula:

Incremental pid parameter adjustment formula and strategy

Assume

Incremental pid parameter adjustment formula and strategy

get

make Integral coefficient For the differential coefficient, the above equation can be simplified to

Incremental PID control algorithm

When the actuator needs not the absolute value of the control quantity, but the increment of the control quantity (for example, to drive the stepping motor), the PID "incremental algorithm" is needed.

Incremental pid parameter adjustment formula and strategy

The incremental PID control algorithm can be derived by equation (2-4). The output value of the k-1th sampling instant of the controller can be obtained from (2-4):

Incremental pid parameter adjustment formula and strategy

Incremental pid parameter adjustment formula and strategy

It can be seen from (2-6) that if the computer control system adopts a constant sampling period T, once A, B, and C are determined, the control amount can be obtained from (2-6) as long as the deviation values ​​measured three times before and after are used. .

Compared with the positional PID algorithm (2-4), the incremental PID control algorithm has much less computation and is therefore widely used in practice.

The positional PID control algorithm can also introduce a recursive calculation formula through an incremental control algorithm:

Incremental pid parameter adjustment formula and strategy

(2-7) is a digital recursive PID control algorithm widely used in computer control.

Incremental PID control algorithm C51 program

/*======================================================== =========================================================== ==

PID Function

The PID (proportional, integral, derivative) function is used in mainly

Control applications. PIDCalc performs one iteration of the PID

Algorithm.

While the PID function works, main is just a dummy program showing a typical usage.

=========================================================== =========================================================== =*/

Typedef struct PID

{

Int SetPoint; //Set the target

Desired Value long SumError; //Error accumulation

Double Proportion; //proportional constant Proportional Const

Double Integral; //Integral constant Integral Const

Double Derivative; //Differential constant Derivative Const

Int LastError; //Error[-1]

Int PrevError; //Error[-2]

} PID;

Static PID sPID;

Static PID *sptr = &sPID;

*========================================================== =======================

Initialize PID Structure PID parameter initialization

=========================================================== =========================================================== =*/

Void IncPIDInit(void)

{

Sptr-"SumError = 0;

Sptr-"LastError = 0; //Error[-1]

Sptr-"PrevError = 0; //Error[-2]

Sptr-"Proportion = 0; //proportional constant

Proportional Const sptr-"Integral = 0; //Integral constant Integral Const

Sptr-》Derivative = 0; //differential constant

Derivative Const sptr-"SetPoint = 0;

}

/*======================================================== =========================================================== ==

Incremental PID calculation section

=========================================================== =========================================================== =*/

Int IncPIDCalc(int NextPoint)

{

Register int iError, iIncpid; //current error

iError = sptr-"SetPoint - NextPoint; //Incremental calculation

iIncpid = sptr-"Proportion * iError //E[k]

- sptr-"Integral * sptr-"LastError //E[k-1]

+ sptr-"Derivative * sptr-"PrevError; //E[k-2]

/ / Storage error for the next calculation

Sptr-"PrevError = sptr-"LastError;

Sptr-"LastError = iError;

/ / Returns the incremental value

Return(iIncpid);

}

Combining the above formulas to explore the general control law of PID and the common parameter tuning method

(1) Let's first discuss the control law of three parameters of PID

1. Proportional adjustment law (Kp): It is the deviation of the proportional reaction system. Once the deviation occurs in the system, the proportional adjustment immediately produces a regulation to reduce the deviation.

2. Integral regulation law (Ki): In essence, the deviation accumulation is controlled until the deviation is zero. The system eliminates the steady-state error and improves the no-difference.

3. Differential regulation law (Kd): The differential action reflects the rate of change of the system deviation signal. It is predictable and can predict the trend of deviation variation. Therefore, it can produce advanced control effects. It has been differentially regulated before the deviation has not formed. eliminate.

4. Proportional integral differential control law PID: PID control law is an ideal control law. It introduces integral on the basis of proportionality, which can eliminate the residual, add differential action, and improve the stability of the system.

(2) Let's discuss the general method of PID parameter tuning

1. Experimental test method, the setting steps are “first ratio, re-integration, and final differentiation. This is also commonly used by people who are new to PID.

2. Theoretical calculation tuning method. It is mainly based on the mathematical model of the system, and the controller parameters are determined through theoretical calculations.

3. Experimental experience method, the expansion of the critical proportional method, the experimental method of adjusting the PID parameters is more commonly used to expand the critical proportional method, the biggest advantage is that the parameter setting is not

Relying on the mathematical model of the controlled object, it is straightforward and easy to set up on site.

In short, for the initial users of PID, when the incremental PID parameter is set, the same coefficient of the same position Kp, integral Ki, and differential Kd are used, which is easier to understand, and the setting will naturally conform to the above. Regularity can achieve the desired control effect.

Wall Charger

Wall charger is AC/DC Adapter, which plugs into home Socket directly to use, no need to connect another Cable , it has EU plug, US plug, UK plug, AUS plug, Brasil Plug and Argentina Plug, used in different countries. Wall adapter is widely used for mobile phone, tablet, pos machine, modem, led light, cctv camera, DVD, router, and other small home devices.


The normal output voltage of wall plug adapter is 5V, 9V, 12V, 24V, but yidashun can do any voltage like 8V, 15V, 18V, 22V and so on, the maximum power is 48W. And the DC Cable of wall mount adapter is 1.2m normally, but yidashun can do 1.5m, 1.8m, 2m, 3m and longer as you want, so any customized wall plug in adapter is welcome!

wall mount charger

wall mounted power adapter

Wall Charger,USB Wall Adapter,Portable Wall Charger,Wall Mount Adapter

Shenzhen Yidashun Technology Co., Ltd. , https://www.ydsadapter.com