Press ESC to close · Ctrl+K to open

Temperature Control System (II)

Temperature Control System (II)

Continuing with the example of tank temperature simulation, today we are going to program a simple temperature PID Control with Tia Portal 18 that can control the inlet proportional valve to maintain the tank or control system at a given temperature. Let's get started.

Step 1: Control and Process Variable

The first thing is to be clear about which variables make up the system and which one I need to act on to modify the temperature behavior:

  • Tank Temperature: this will be the temperature inside the tank that we want to regulate.
  • Desired Temperature or SP: the temperature we want our tank to be at.
  • Inlet Proportional Valve: this is the one we act on to modify the heat exchange fluid with our tank.

Step 2: Add PID in TIA Portal Project

For this example, I used TIA Portal 18 and a simulated PLC (1515-2PN) in PLC SIM Advanced V5.0.

  • We add the PID Compact (Technological object) to our project. In this case, we will use the "Compact" for simplicity, although there is also a specific temperature PID for this type of application that allows for greater parameterization, such as cooling and heating regulation.
  • We add our PID to OB30 "Cycle interrupt": Since the PID calculations can affect the main scan cycle (OB1), we place the PID in this other OB.
  • We link our 3 variables as seen in the image. The use of the "_PER" inputs and outputs can be done if the variables are directly percentage-based. In our case, the input is temperature, so we use the default option.

Step 3: Parameterization

The PID contains a series of parameters that allow us to modify it according to our needs. We can modify the inputs and outputs we use (input/Input_Per), PID limits, PID parameters (Kp, Kd, Ki), etc.

In our case, we will carry out the commissioning with the tool provided by TIA Portal, and we will not touch these parameters, letting the Auto-tune do its job.

Note: In real systems with more complexity, it will be necessary to review these parameters, as long as the basic commissioning does not yield the expected results. In my experience, for simple applications, there is hardly anything to modify, and Siemens makes it easy for you.

Step 4: Commissioning

The time has come to regulate the system. We find that we have everything perfectly prepared, our sensor reads well, our valve is tested and responds, and we just need to prepare the system to automatically regulate the valve to achieve our desired temperature (Set Point) in the tank.

  • We open the PID commissioning window:
  • We go online and start sampling: we will see that values start to appear in the graph of our temperature. But the PID is still not functioning
  • We disable manual mode: so that everything can function automatically. It is important to always keep this checkbox disabled.
  • Tuning mode: when we are going to adjust our PID, there are two options.
    • Pretuning: when the desired value is very far from the current value, this function is used to bring us closer to the target area.
    • Fine tuning: we use this when we are already close to the Set point.
  • We adjust the system: once everything above is done, we will adjust the PID parameters for a given temperature (in the program), in this case 30ºC. And we will press the Start Fine Tuning button.
    • The system will start to adjust, opening and closing the valve to find its Kp, Ki, and Kd parameters.
    • This process may take longer if the system has a lot of delay or inertia, such as large volumes of fluid.
    • SYSTEM TUNED!! at this point, it will have found its parameters
At this point, it is important to clarify that a PID adjusts the behavior of the system around a working point. That is, we regulate the parameters so that it adjusts well when we are in a specific area.
For example: if the temperature range of the tank is 0-100ºC, and we regulate it around 30ºC because it will be our most common SP, it will adjust very well to temperatures close to 30ºC, but it will perform worse the further it gets from it.

Step 5: Check Values

We must ensure that these values are loaded into the PLC and that the startup values are always these, to avoid losing them when we restart the PLC.

Conclusions

  • Facilitates commissioning: Carrying out the temperature PID control with Tia Portal greatly facilitates the commissioning of our systems
  • It is not infallible: for systems with a lot of inertia or where we have to regulate indirectly through another system, we must use cascade PID. Regulation in these cases is considerably more complex.