PID (Proportional-Integral-Derivative) controllers are advanced control systems that combine three control actions to achieve precise process control: the proportional term responds to current error, the integral term eliminates steady-state error by accumulating past errors, and the derivative term predicts future error based on rate of change. Unlike on-off controllers that switch between two states and proportional controllers that cannot eliminate steady-state error, PID controllers can maintain process variables at desired setpoints even under disturbances. In TIA Portal, PID controllers are implemented using the PID instruction in cyclic organization blocks, with parameters requiring tuning for optimal performance.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
manual and automatic control tutorial - Part 14 of 14Added:
Hello friends in this video I will start teaching basic controllers which can be used in industrial process first we will have a short introduction to the manual and automatic controls then we will take a look at the on off controllers and their problems usually on-off controllers are used with a deadband these controllers are used by digital devices which have two states on or off on the other side with application of Analog Devices we can design and use the PID controllers each industrial process has some inputs and outputs simple control methods are independent of the output State remember we did a project with the timers for this tank now I am going to show you the problem with a manual control system suppose the desired level is 130 centimeters so I click on this button to start filling the tank I have to check the level with my eyes continuously till it reaches the desired level now I need to click again to stop the feeling as you see because of a delay in the operation of the valve the liquid level has reached above the desired level therefore it is necessary to empty the tank a little the control method which works with human interaction is called a manual control system therefore in a manual control system the performance of the system is highly dependent on the operator this system has no special hazards but for high risk systems the manual control method is not suitable because of system maintenance and also operator safety today many industrial processes are controlled automatically and the output status is used to determine the system input this is its complete diagram in which sensors and control rollers are used instead of the operator here the transmitter measures the boiler pressure and the level sensor measures the liquid level inside the tank and we are using a S7 1200 PLC as the System Controller let's explain this diagram assume that the liquid level inside the tank should be 150 centimeters so this is the reference value here the output we want to control is the liquid level also suppose the level sensor that is connected to the controller shows the number 120 now the difference between the reference value and the actual value is plus 30.
So based on this difference the controller knows the actual level is less than the reference value then the controller will decide to turn on the inlet valve to increase the liquid level inside the tank if the liquid level reaches 160 centimeters depending on the amount of error the controller will decide to turn off the inlet valve or even open the outlet valve now let's determine different types of an automatic control system let's start with the simple on of controller on off controllers are used when devices such as valves have only two modes on and off therefore when the error value is positive the controller can only open the inlet valve and close it when the error is negative note that in this control method the error sign is important not its among let's see how this controller works first I determine the reference value with this potentiometer because the current level of the liquid is less than the reference value the PLC opens the inlet pad automatically until the liquid level reaches the reference value as you can see because of the delay in the event the level of the liquid is a slightly higher than the reference value now let's see the controller performance when the draining valve is open when the water level drops the controller automatically opens the inlet valve and closes it again when the big level reaches difference value as you can see PLC is constantly trying to keep the liquid level at the reference value but the liquid fluctuations inside the tank have affected the controller performance it makes the inlet valve turned on and off constantly which can damage the Implement let's see how this problem can be resolved this diagram shows the operation of the on off controllers as you know this controller opens the filling valve when the error is positive otherwise its output will be off the main problem is when the error is close to zero because in the presence of disturbances such as fluctuations in the liquid the controller output will be switched between the on and off States continuously to resolve this problem we can use on off controllers with a deadband pay close attention to its diagram and this part the controller output is off until the error reaches 10 centimeters after that a small disturbances cannot turn off the output immediately because the output stays on until the error reaches minus 10 centimeters so with this diagram a small disturbances cannot change the output States naturally we can change this width based on the process and disturbances now let's modify the previous PLC program to see this controller performance this network is the main part of the on off controller program when the liquid level is less than the reference or set point value this number will be moved to this PLC output to open the field valve completely otherwise the feeling valve will be closed now let's insert a deadband to this control logic first insert an Sr instruction now insert a subtraction instead of using set point we must subtract 10 from that and then use its result in next comparison similarly when the liquid level is greater than set point plus 10 the feeding valve will be closed foreign let's change the reference value with this potentiometer all right let's choose 80 centimeters automatically the DLC opens the feedback to increase the liquid level time feeding will be stopped if the liquid level reaches 90 centimeters nothing [Music] now let's open the draining valve then tank filling is started again if the liquid level reaches 70 centimeters [Music] as you can see the problem of liquid fluctuations inside the tank has been dissolved by the inserted dead band to the previous on off controller now let's see what the proportional controllers are this controller multiplies the error value by a number such as KP for example if the error is 10 and the KP is 2 the output will be 20.
foreign the output of the controller will be -10 so the controller output is a number that has more than two states therefore in order to use this controller analog equipment must be used this diagram shows the relationship between the input and output of the controller with the KP gain usually we must consider some limitations in practice sometimes we cannot have a negative value at the controller output because some electric devices only work with positive voltages so the controller diagram will look like this in this case we can use two valves a feeling valve for positive errors and the draining valve for negative errors the next limitation is the output signal size we cannot give an infinite voltage to an electric valve so the diagram of a proportional controller could be like this foreign the previous project to have a controller with this Logic the inlet valve voltage changes between 0 to 10 when the error is between 0 and 25 centimeters all right let me delete this external blocks I need to have an error value so I subtract the liquid level from the set point value now let's find and insert a limit instruction so if the error is negative its output will be zero and if the error is greater than 25 its output remains 25. now I am going to use norm and scale instructions like the previous projects foreign volts at the PSE output we must write 27 648 at the output address all right this is the main part of my PLC program Let's test this control logic now the reference value is 80 and the feeding value is opened completely [Music] [Music] as you can see when the liquid level reaches the set point the fill the fin valve voltage is decreased until the level of the liquid is equal to the reference value [Music] all right I explained on off and proportional controllers the proportional controller is one of the three common PID controllers now we are going to explain and test the PID controllers all right we saw how the proportional controller could bring the liquid level inside the tank to the reference level now we want to check if the controller can keep the liquid level at the reference level when the discharging valve is open as you can see if the discharging valve is open the liquid level starts to drop and then the controller tries to bring the liquid level to its reference band if you do simulation you will see that the liquid level will be fixed at 90 centimeters although the proportional controller didn't have the isolation light on off controllers the current level differs from the set point about 20 centimeters why and how this problem can be resolved again let's see the proportional controller diagram in the previous simulation the reference value was 110 centimeters in the steadier State the liquid level stays at 90 centimeters so when the system reaches its steady state the error was equal to 20 centimeters based on this error the controller sends a voltage to the inlet valve to open it finally the liquid level remained constant at 90 centimeters despite the output valve is open now let's see why the error cannot be equal to zero in a proportional control assuming it to be zero the output of the controller becomes 0 as well and then the feeding valve is closed this state decreases the liquid level because the discharging valve is open so the reference value and the liquid level are not going to be equal this means the studio State error cannot be zero this is the proportional controller's weakness therefore in the industrial process the system integrators and Engineers prefer to use the pi controllers let's see what a pi and PID controllers are PID is an abbreviation of proportional integral derivative I've explained the proportional controller earlier if the integral of the error is added to this controller then we will have a pi controller and also if we use a derivative of the error in the formula then we will have a PID controller first let's explain the pi controller suppose the reference level is 110 and the current level is 90. at the start time the error is 20. the last time is zero so the integral output will be zero but the proportional term will send the voltage to open the feeding valve to increase the liquid level now suppose the error is 10. now both proportional and integral terms send the voltage to the feeding valve similarly this process will be continued until the liquid level reaches the reference value here we can see the important difference between the proportional and the integral terms when the error is zero the output of the proportional term is zero but the integral term uses the past error values so its output can be non-zero therefore unlike the proportional controller the pi controller can open the feeding valve sufficiently when the error is zero so the integral term compensates for proportional weakness the pi controller has a small problem that can be ignored in most industrial processes when the level reaches the reference value due to the internal tail the feeding valve remains open so the liquid level rises again when the error value is negative the system will try to return to the reference value therefore the integral term causes the controller output to fluctuate slightly which it disappears over the time note that at the beginning of a process the size of the error is large and the last time is a small therefore the output of the proportional term becomes larger which has a major role in the controller's performance I as time goes on and the error size decreases like in this example the proportional output becomes closer to zero and the integral term determines the controller output sometimes the derivative term is used in the controller to eliminate the fluctuations caused by the integral term like the integral term try to understand how the derivative term works for many industrial processes we can achieve a suitable controller by adjusting these coefficients this figure shows the effect of each coefficient for a tuned PID controller now let's design a PID controller in Tia portal here we have a level meter and this valve which is connected to these PLC addresses here the second network of my PSE program converts the level sensor signal to a number between 0 and 300. this number indicates the liquid level in centimeters the easiest way to implement a PID controller in the TR is to use the PID instruction to use this instruction first click on add new block then select cyclic interrupt and determine its time like 500 milliseconds pay attention we don't call this organization block from the main block because it will be executed every 500 milliseconds automatically now from the right list insert the PID compact instruction in the created cyclic organization block this instruction needs a data block to work at its first input the set point value is defined at the second input a variable of the user program is used as a source for the process value here I can use the computed liquid level that's a number between 0 and 300 centimeters the third input input pair should be connected to a PLC analog input as the source of the process value pay attention the PID controller will use only one of these two inputs which must be specified in its settings window well this block has three outputs output is a number in real format output pair for PSA analog outputs and output pwm to have a modulated pulse signal let me use this PSA analog address which is connected to the filling valve now let's go to this PID setting first the type of the process under control and its measurement unit can be selected if necessary the output signal of the PID can be reversed in The Help window we can see this controller information like its operating modes they used mathematical relationship with its parameters description and also its diagram for example inverting the controller output is performed here all right let's select the automatic mode and go to the next step here the inputs and outputs that are explained before must be selected now I need to modify the input range remember the liquid level inside the tank is a number between 0 and 300 centimeters this part is disabled because the analog input has not been selected before also if it is necessary you can change some outputs settings and finally you can see the PID parameters to improve the PID performance these parameters must be tuned first let's test the pi controller performance with these default settings pay attention you may not be able to simulate the PID controller on your computer like in the previous projects to resolve this problem which happened only in the simulation mode to me and others you either have to use a real PLC or use the plc same simulator with a 1500 CPU in the hardware configuration first I'll test the PID controllers with the PLC simulator and then I will use a rear S7 1200 plc alright first I need to find and open an appropriate PLC Sim 1500 template which can be downloaded from the factory IO website after all these I have generated the PID program in a cyclic organization block again these two bits are used to activate the PID controllers also after transferring the program to the virtual CPU we have to change the factory IO configuration from S7 1200 to S7 1500 now the factory IO is connected to the program on the virtual CPU let's go to the online mode based on the program I have to activate the PID controller first let me change this Auto manual selector foreign the next contact is activated by a switch from the HMI which has been designed before let's activate the PID controller all right as you can see the PID controller is activated I can change its set point from the HMI screen let's select 150 centimeters as you can see the PID controller output is activated and it turns on the feedback [Music] well this display shows the liquid level [Music] also on the design HMI program we can see the level liquid and the set point diagrams and also the PID parameters at the bottom [Music] as you can see as the water level passes the reference value the controller starts closing the inlet valve now let me open the discharge valve for 50 percent if you simulate this program like me you will see that after the time with a little fluctuation in the water level the controller can fix the water level at the reference value [Music] now click here to see how PID coefficients can be tuned by the tier software [Music] click here to start sampling and to show the process and reference values start pre-tuning all right here is an error at the startup of the tuning this process value is too close to the set point to resolve this error let me stop Factory IO to empty the tank and then start it again now the reference value is 150 centimeters but the current level is zero let me start the pre-tuning again [Music] as you can see the tier modified the PID coefficients [Music] well let's P ID coefficients to control the water level with my S7 1200 PNC and HMI notice that in the manual mode I can control the two valves with these two potentiometers let's go to the automatic mode in which the water level will be controlled on the HMI notice that on the HMI screen I can choose what percent the valve must be open now let's activate the PID controller with the previous coefficients as you can see the controller tries to reach the water level to the desired level which is 50 centimeters now the level is higher than 50 centimeters in other words the hero is negative so the controller decreases the inlet water volume [Music] foreign [Music] now the water level is lower than 50 centimeters so the controller increases the water inlet volume notice that the P ID controller tries to keep the water level at the desired level [Music] [Music] [Music] [Music] now the water level is reached the desired level which is 50 centimeters if I change the desired level the PID controller tries to bring the water level to my desired level as well I hope this video has helped you to understand the concept of the PID controllers now let's learn recipes and alarms in an HMI display programming alright let's see the previous project we have learned to change any parameters on the HMI screen now we are going to see how the status of two values can be changed at the same time therefore we will be able to change the status of any number of variables such as PID controller coefficients at the same time to do that on the left side click on recipe here we can create a recipe and choose a name for that I want to change the value States pay attention each recipe has a unique number in the bottom window the desired parameters are selected here I select the field person tag of the PLC program which is related to The Filling valve similarly I select a PLC tag related to discharging valve in the next tab data records via specified desired values for each selected parameter here each state has a unique number for the first state of the recipe let's open the inlet valve and close the outlet valve for the second state let's open both valves for 50 percent finally for the Third Estate let's close the inlet and open the outlet valve completely now let's save this recipe with three Estates and get back to the tank screen I want to use some buttons to apply each State's values to my PSC program well in the events tab select this function set data records to plc this function selects a recipe with its number note that each defined state has a unique number so this function uses a state 1 values for the selected parameters which are filling and discharging values similarly let me use two buttons to select other states let's simulate this screen [Music] all right as you can see I can change the state of two valves with these three buttons here is a problem before we have seen and changed the state of two valves with these numeric i o fields now we just see Zero why is that pay attention this numeric i o field and this button are using the same tag of PLC address which is field person this PLC tag is used in the recipe as well let's go to the HMI tags table when we use a PLC address for the first time in the HMI automatically the HMI defines a similar tag for itself which is connected to the selected PLC address here we are using a PLC address a feed person tag and also discharge person for two elements in the HMI to resolve the previous problem we must Define a new HMI tags and use them in the recipe pay attention the old and new HMI tags are connected to the same PLC addresses let's go to the recipe and replace the tags with new HMI tags now let's test the recipe notice that the previous problem has been resolved we can change two valence States and also see their values on the HMI also we can Define recipes on the HMI screen from the control tab on the right side insert a recipe on a blank screen if you simulate the HMI screen again please explain will be shown which can be used to modify or delete messages for example let's change the parameters value in second state to zero and save the recipe [Music] [Music] [Music] all right what is this yellow triangle and what these messages are now we are going to learn to use alarms on the HMI screens the alarms are messages we shown onto my automat when a special condition of Curves now if the water level reaches 250 centimeters a warning text will be displayed on the screen as you can see this number is still zero now important level exceeds 290 the HMI will show an error text on the current screen naturally the interest value must be closed in this condition so the lower number of the yellow triangle indicates the number of the current system errors which has been inserted here too if I open the outlet valve the water level starts to drop now the error has been removed and when the water level returns to less than 250 centimeters the warning text will be erased from this screen now let's see how the error or warning alarms can be defined on the HMI we want to show an appropriate message on the HMI screen when the liquid level is lower or higher than a normal level and also when we activate or deactivate the PID controller so click on the HMI alarms select this tab to Define analog alarms click here to create the new alarms here we can write an appropriate message which will be shown on the HMI I want to use this alarm when the liquid level is lower than 10 centimeters in this column the class of alarm is specified here there are four predefined classes let's select the error class because 10 centimeters is too low then I connect this alarm to the level liquid tag here we write the critical level finally we must determine its limit mode let's define another alarm when the liquid level is lower than 50 centimeters for this alarm I select the warning class similarly I Define appropriate alarms when the level is higher than the normal level to Define discrete alarms we need a word address of PLC memory so let's go to the PLC tags table now let's define the alarm board tag with MW 200 address as you know a word address has 16 bits a run condition must be written in the PLC program the first discrete alarm is when the PID controller is activated so I use the PID activator tag and save that on the first bit of the mw-200 pay attention to mw-200 is included in the M200 and m201 the address of the first bit is m201.0 similarly we can Define the other discrete alarms with a word of memory we can Define up to 16 alarms now let's transfer this program to the virtual PLC and get back to the discrete alarm window now discrete alarms can be defined by the word memory the first alarm is when the PID controller is activated here I connect alarms to a bit of the word memory now it is the fresh beat memory of this selected address mw200 similarly we can Define the next alarms now we need to create a blank screen to show alarm messages now just enter the alarm view from the right list here we can change some settings of the inserted alarm View to view errors on all the screens go to the global screen and use alarm elements like the way I am doing all right we have tested this project before with the TR simulator similarly I can use my PLC and HMI to test the program as you can see in the manual mode I can control the two values with these two potentiometers [Music] [Music] let's go to the automatic mode which the water level will be controlled by the HMR dead under my screen and says I'm here water levels low also I can change the inlet Outlet water volume with the S1 S2 and these three buttons on the right side of the HMI screen I can see and manage all recipes on the HMR if I click on this spot I will be directed to the see all around a lot of videos as you can see if the water level exists 290 Center HMI which show an error message to [Music] I hope you have learned what the recipes and alarms are in an HMI display programming thanks for watching this video
Related Videos
U.S. Military Just Flexed The Most Dangerous Aircraft Ever Built The F-47
MaxAfterburnerusa
11K viewsβ’2026-05-29
Heating Staying On On The Hottest Day Of The Year
PlumbLikeTom
507 viewsβ’2026-05-29
λ°μ ν¨μ¨μ λμ΄λ νμκ΄ μΆμ μμ€ν μ κΈ°μ μ μ리 #곡ν #곡μ #νμκ΄ #μκ³ λ¦¬μ¦ #μ¬μμλμ§
μ°νμ₯κΈ°μ
2K viewsβ’2026-05-29
μ§κ΄ λ° κ³‘κ΄ λ°°κ΄ κ²°ν© κ³ μ μμ #worker #process #fabrication #pipework #clamp
μλμ΄μ΄
2K viewsβ’2026-05-30
Wire To Wire Connection Trick | Strong And Secure Electrical Joint #shortvideo #wireworks
ElectricianTips-b1h
5K viewsβ’2026-06-02
Peterborough to Newark Northgate Driver's Eye View aboard an InterCity 225 - East Coast Main Line
TrainsTrainsTrains
822 viewsβ’2026-05-31
AI turbine design: hypersonic cooling leap #shorts #ai #hypersonic
bobbby_rn
671 viewsβ’2026-05-31
How Far Can A Tomahawk Missile Actually Travel?
WarCurious
13K viewsβ’2026-05-28











