Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 66995021, Entry date: 12/05/2013

How are the automatic PID controller settings (optimization) made for asymmetrical temperature control paths in STEP 7 (TIA Portal) V11 and higher?

  • Entry
  • Associated product(s)
You must observe a specific time sequence for the automatic optimization of PID controllers ('PID_Compact' or 'PID_3Step') for temperature control paths with asymmetrical time behavior.

Generally, with automatic optimization it is assumed that the time constant is approximately identical for heating and for cooling. This is not always the case in some paths (as shown in Fig. 01).

Fig. 01 shows the typical curve of an asymmetrical temperature control path

When controlling in automatic mode, asymmetrical oscillations often occur when the setpoint value is approached. This is shown in the example below in Fig. 02. Here, too, you can see that there are different times for heating (A) and cooling (B).

Fig. 02

Fig. 02 shows typical controller behavior for temperature control paths with overshooting, which can lead to the behavior below:

  • The PID parameters can only be calculated imprecisely.
  • The automatic optimization (also called automatic tuning) takes a very long time.
  • The automatic tuning might abort with very slow paths where time limits are exceeded.

In order to optimize the PID controller for temperature control paths we recommend the three steps below.

  1. Achieve engaged status
    Control and stabilize the process up to the setpoint value. Use manual mode for this or let the PID controller control automatically to the desired setpoint value with its default values.
    1. Manual mode: Set the controller to manual mode ("sRet.i_Mode" = 4) and select an appropriate manual value. Approach the desired setpoint value by changing the manual value. When the actual value reaches the setpoint value and this does not change any more, proceed as in Step 2.
    2. Automatic mode: Put the controller into automatic mode ("sRet.i_Mode" = 3) and specify the desired setpoint value. Let the controller control up to the setpoint value and wait until the process engages. Under circumstances, this might take quite a long time. If it takes too long, continue with Point a.
  2. Change to automatic mode
    Change to automatic mode by assigning the value "3" (automatic mode) to the static variable "sRet.i_Mode". Alternatively, you can also enable manual mode in the commissioning dialog under "Online status of the controller".

    It is important that the process is in a stable state and is as close as possible to the setpoint value. You can see this from the control output in automatic mode. The control output should remain constant for a long period of time.
  3. Start optimization
    Now start optimization by assigning the value "2" (optimization) to the static variable "sRet.i_Mode". The temperature control paths normally have very large time constants which means that optimization takes a long time.

You can only change the mode using the "sRet.i_Mode" variable by changing the value. Proceed as below to ensure a safe change:

  • Before each change you assign first the value of the output parameter "State" of the static variable.
  • Then assign the desired value ("2" for optimization, for example) to the variable.

More information about "PID_Compact" and "PID_3Step" is available in the STEP 7 (TIA Portal) Online Help under

  • PID_Compact
  • PID_3Step

Note on S7-1500
As from STEP 7 V12 you can also use controller optimization with "PID_Compact" and "PID_3Step" for the S7-1500.

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.