Siemens PLC project experience – for reference
The project consists of a simple automation system, a liquid tank with two pumps and a level sensor. From the HMI we can select the type of controller and its settings and view its operation on a diagram. PLC program for this liquid level control. The code is in TIA Portal V17. The tank has been modeled in Factory IO 3D simulation software.
Contents included:
- HMI panel
- Switch controller
- PID controller
- Takagi-Sugeno fuzzy PI controller
- Neural network NARX controller
The program structure is divided into four layers. The program structure is similar to the object-oriented concept. Each layer is responsible for one main task.

- HMI Panel
The HMI displays basic tank level control information. It displays pump status, sensor status, operating mode, controller selection and contains waveform graphs. From HMI we can change the default controller settings.

2. controller
The program includes controllers written in scl and lad.
2.1 In automation systems, ramp functions are commonly used as input signals to controllers or actuators and as a means of smoothly starting, stopping, or regulating the speed of a mechanical system. A ramp is a mathematical function that describes a gradual increase or decrease in the value of a signal over time.

2.2 A switching controller with hysteresis, also known as a hysteresis controller, is a control system used for automation and process control. It is a simple and cost-effective control system that turns the system on and off based on a set of thresholds while introducing a small amount of hysteresis to prevent rapid switching between on and off states.

2.3 PID
The incremental PID algorithm is a variation of the classical PID control algorithm used for feedback control systems. It is a form of PID control that calculates the output of the controller based on the change or increment of the input rather than the absolute value of the input. In the incremental PID algorithm, the controller calculates the output by taking into account the difference between the current input and the previous input and the difference between the current error and the previous error. By calculating these differences, the controller calculates the incremental change in output needed to adjust the system and achieve the desired setpoint.

2.4 TS
The Takagi-Sugeno (TS) fuzzy PI controller is a controller that uses fuzzy logic to adjust the proportional and integral gains of a PI controller based on the current operating conditions of the system.The TS fuzzy PI controller is a variant of the classic PI controller commonly used in industrial control systems. The TS fuzzy PI controller works by first defining a set of fuzzy rules based on expert knowledge or experimental data about the controlled system. These fuzzy rules describe the relationship between the inputs and outputs of the system and are expressed as linguistic variables such as “low”, “medium” or “high”. These rules are then used to construct a fuzzy inference system that determines the appropriate scaling and integration gains for the PI controller based on the current values of the system inputs.

2.5 NARX
NARX (Nonlinear Autoregressive) neural control with external inputs is a neural network based control system for modeling and controlling nonlinear dynamic systems. It is a variant of the classical NARX model and is commonly used for time series prediction and system identification.

The NARX neural control system uses a feed-forward neural network to model the behavior of the controlled system. The neural network takes as input the current and past values of the system’s inputs and outputs, as well as any exogenous inputs, and uses them to predict the future outputs of the system. A set of input/output data collected from the system is used to train the network and the weights of the network are adjusted using a back-propagation algorithm to minimize the difference between the predicted output and the actual output.

Once the neural network is trained, it is used as a controller to regulate the behavior of the controlled system. The controller takes as inputs the current and past values of the system inputs and outputs, as well as any exogenous inputs, and uses the neural network to predict the future outputs of the system. The difference between the predicted and desired outputs is used to adjust the control signals sent to the system to bring it into the desired state.
How to use: To run this application, you need to have FactoryIO and TIA Portal (v16 and higher) installed on your computer.
Factory IO: Download the Factory IO scenes and move them to C:\Users\username\Documents\Factory IO\My Scenes
TIA Portal: on TIA v17 and higher: download the original version of the program and open it in TIA
Version Control Interface: on TIA v16 and higher: download the program template and open it in TIA

SIMATIC Automation Comparison Tool
You can use the SIMATIC Automation Comparison Tool software to view functions and blocks in .xml extensions directly.

The final rendering is shown below:

For more information, please contact our technical consulting administrator.
