PID parameters V3 (S7-1200, S7-1500) - PID

Using PID_Compact (S7-1200, S7-1500)

ft:publication_title
Using PID_Compact (S7-1200, S7-1500)
Product
PID
Version
V20
Publication date
11/2024
Language
en-US
PID parameters V3

The PID parameters are displayed in the "PID Parameters" configuration window. During tuning, the PID parameters are adapted to the controlled system with the exception of the dead zone width that has to be configured manually.

Note

The currently active PID parameters are located in the Retain.CtrlParams structure.

Change the currently active PID parameters only in "Inactive" mode online to prevent malfunction of the PID controller.

If you want to change the PID parameters in "Automatic mode" or "Manual mode" online, change the PID parameters in the CtrlParamsBackUp structure and apply these changes with LoadBackUp = TRUE to the Retain.CtrlParams structure.

Online changes to the PID parameters in "Automatic mode" can result in jumps at the output value.

PID_Compact is a PIDT1 controller with Anti-Windup and weighting of the proportional and derivative actions.

The PID algorithm operates according to the following equation (dead zone disabled):

Symbol

Description

Associated parameters of the PID_Compact instruction

y

Output value of the PID algorithm

-

Kp

Proportional gain

Retain.CtrlParams.Gain

s

Laplace operator

-

b

Proportional action weighting

Retain.CtrlParams.PWeighting

w

Setpoint

CurrentSetpoint

x

Process value

ScaledInput

TI

Integration time

Retain.CtrlParams.Ti

a

Derivative delay coefficient (derivative delay T1 = a × TD)

Retain.CtrlParams.TdFiltRatio

TD

Derivative action time

Retain.CtrlParams.Td

c

Derivative action weighting

Retain.CtrlParams.DWeighting

DeadZone

Dead zone width

Retain.CtrlParams.DeadZone

The diagram below illustrates the integration of the parameters into the PID algorithm:

All PID parameters are retentive. If you enter the PID parameters manually, you must completely download PID_Compact.

Download technology objects to device

Proportional gain

The value specifies the proportional gain of the controller. PID_Compact does not work with a negative proportional gain. Control logic is inverted under Basic settings > Controller type.

Integration time

The integration time determines the time behavior of the integral action. The integral action is deactivated with integration time = 0.0. When the integration time is changed from a different value to 0.0 online in "Automatic mode", the previous integral action is deleted and the output value jumps.

If the output value reaches an output value limit in automatic mode, the integral action is stopped depending on the direction (Anti-Windup). As of PID_Compact Version 3.0, the integral component is also actively limited in order to prevent delayed control behavior, e.g. when the output value limits change. Changes to the following tags can lead to an adjustment of the integral component in automatic mode:

  • Output value limits (Config.OutputLowerLimit and Config.OutputUpperLimit tags)

  • Setpoint (Setpoint tag)

  • Proportional gain (Retain.CtrlParams.Gain tag)

  • Proportional action weighting (Retain.CtrlParams.PWeighting tag)

  • Disturbance variable (Disturbance variable)

Derivative action time

The derivative action time determines the time behavior of the derivative action. Derivative action is deactivated with derivative action time = 0.0.

Derivative delay coefficient

The derivative delay coefficient delays the effect of the derivative action.

Derivative delay = derivative action time × derivative delay coefficient

  • 0.0: Derivative action is effective for one cycle only and therefore almost not effective.

  • 0.5: This value has proved useful in practice for controlled systems with one dominant time constant.

  • > 1.0: The greater the coefficient, the longer the effect of the derivative action is delayed.

Proportional action weighting

The proportional action may weaken with changes to the setpoint.

Values from 0.0 to 1.0 are applicable.

  • 1.0: Proportional action for setpoint change is fully effective

  • 0.0: Proportional action for setpoint change is not effective

The proportional action is always fully effective when the process value is changed.

Derivative action weighting

The derivative action may weaken with changes to the setpoint.

Values from 0.0 to 1.0 are applicable.

  • 1.0: Derivative action is fully effective upon setpoint change

  • 0.0: Derivative action is not effective upon setpoint change

The derivative action is always fully effective when the process value is changed.

PID algorithm sampling time

The controlled system needs a certain amount of time to respond to changes in the output value. It is therefore not advisable to calculate the output value in every cycle. The sampling time of the PID algorithm represents the time between two calculations of the output value. It is calculated during tuning and rounded to a multiple of the cycle time. All other functions of PID_Compact are executed at every call.

If you use Output_PWM, the sampling time of the PID algorithm is used as the period duration of the pulse width modulation. The accuracy of the output signal is determined by the ratio of the PID algorithm sampling time to the cycle time of the OB. It is therefore recommended that the cycle time is a maximum of one tenth of the PID algorithm sampling time.

Dead zone width

If the process value is affected by noise, the noise can also have an effect on the output value. The output value may fluctuate considerably when the controller gain is high and the derivative action is activated. If the process value lies within the dead zone around the setpoint, the control deviation is suppressed so that the PID algorithm does not react and unnecessary fluctuations of the output value are reduced.

The dead zone width is not set automatically during tuning. You have to correctly configure the dead zone width manually. The dead zone is deactivated by setting the dead zone width = 0.0.

When the dead zone is switched on, the result can be a permanent control deviation (deviation between setpoint and process value). This can have a negative effect on fine tuning.

If values other than 1.0 are configured for the proportional action weighting or the derivative action weighting, setpoint changes even within the dead zone affect the output value.

Process value changes within the dead zone do not affect the output value, regardless of the weighting.

The diagram below illustrates the effect of the dead zone: The X / horizontal axis shows the control deviation = Setpoint - Process value. The Y / vertical axis shows the output signal of the dead zone that is passed to the PID algorithm.

Rule for tuning

Select whether PI or PID parameters are to be calculated in the "Controller structure" drop-down list.

  • PID

    Calculates PID parameters during pretuning and fine tuning.

  • PI

    Calculates PI parameters during pretuning and fine tuning.

  • User-defined

    The drop-down list displays "User-defined" if you have configured different controller structures for pretuning and fine tuning via a user program.