0% found this document useful (0 votes)
37 views10 pages

ON-OFF and Proportional Control

This document discusses how to scale sensor values in proportional control logic. It explains that the sensor provides a value from 0-10 that needs to be scaled to 0-100% and 0-300 cm. The summary creates a scaling function that: 1) Scales the sensor value from 0-10 to 0-100% by multiplying the value by 10 2) Scales the sensor value from 0-10 to 0-300 cm by multiplying the value by 30 3) Calls the scaling function from the main logic and displays the scaled values but is unable to show real values on the software display due to restrictions.

Uploaded by

Nguyen Ninh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views10 pages

ON-OFF and Proportional Control

This document discusses how to scale sensor values in proportional control logic. It explains that the sensor provides a value from 0-10 that needs to be scaled to 0-100% and 0-300 cm. The summary creates a scaling function that: 1) Scales the sensor value from 0-10 to 0-100% by multiplying the value by 10 2) Scales the sensor value from 0-10 to 0-300 cm by multiplying the value by 30 3) Calls the scaling function from the main logic and displays the scaled values but is unable to show real values on the software display due to restrictions.

Uploaded by

Nguyen Ninh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

72.

LIVE- How to make ON/OFF and


Proportional Control Logic in Liquid 

Alright, so yeah, In this video we are going to understand how to make a proportional logic in a liquid
level control. That is the last lesson of today. But I'll give you a brief what is that proportion control. So
this is a small demo and then further we will program it. So if you see here we have this level right now
at 2.9. Okay, and this potentionmeter is my set point, which I change from here. Okay, this is the fill
valve, which is 0% open, which means it's closed. Also, the discharge valve is 0% open, which means it's
closed. So, we have the filling from the top and discharge from the bottom. There is a Level Meter
whose indication is here 2.9 which means 29% alright. Now, if I say I need more water in the tank, I will
increase my setpoint, I make it to 6.2 and you will see the valve is 100% open and this is increasing, and
as this is reaching to the setpoint, the valve is proportionally decreasing alright, this is automatic. So the
valve level, the filling of this valve is getting close now once it reaches the level. So just 6.2. Now if I say I
want to decrease the level, you will see draining valve is open proportionally. And this is going to close
once I reach the setpoint. So this is called proportional control, how you can control the actuation of
your valves proportionally using a proportional logic, this is what we are going to learn today. However,
the first objective of today is we have to scale the Level Meter ID30 in TIA in percentage. So the first task
of today is if you see here we have this level meter, we have to scale its value right now the value is
from the range 0 to 10. Right now it was 4.6, at maximum levels will be 10. And minimum it will be zero.
So we have to scale this value, in 0 to 10. 0 to 10 to 0 to 100%. And the height which is 0 to 300
centimeter. So if you see here, the height is mentioned here, which is 300. And if you see the bottom,
it's zero. So we have to scale this value. And we have to see how we can do that in TIA. (Student: can i
ask you question?). Yeah, sure. (Student: so what is ID30?) Okay, yeah, ID30 is my if you go to here
driver, ID30 is a register, where we have connected a level meter. So the value of level meter will come
in a register, which is inside the PLC ID30. And the potentiometer, which we don't need right now, I'll
remove it. Then in the output, we have a fill wall and we have a drainage valve or discharge valve. And
their respective register is QD30 and QD34. Now this "I" represent input, "D" represent double. So that's
why after 30, it is 34 because it's occupying four registers 30, 31, 32, 33. Similarly here, this double
register occupy four registers 30,31, 32, 33. Okay, that's the register is of 64 bit. That's why one register
is 16 bits, some multiple of four, it's 64. So it's occupying four register. Okay, so the das says we have to
scale the value of ID30, which means the level meter. So we'll go back to our PLC, and we have to write
this in SCL, oK because we are learning how to write a code and SCL which is a programming language in
Siemens widely used. So let's see how we can do that. So for that, the first step is if you're in the
program block, you have to click and click add new block and go to functions and take an SCL language.
However, you can select ladder and FBD as well, but go to SCL, and click OK. Once you click OK, you will
find this window and this window is from this block. And we can also rename this block and name it as
"scaling". Because here we are going to create our own function. Right. So the function says you have to
scale the value to 100%. Now we know that right here, our ID30 is getting a value of 0 to 10.

We need to scale it to 0 to 100% Okay, so the simple logic is we need a multiplication factor of 10,
because if you multiply 10.0 with 10 it is 100. So, what we can do is we have to first define some
variables. All right so in the input, what do we have? We have the value coming from sensor. All right,
and that value which is coming from sensor is in Real, because if you see here it says it's real value. So,
you have to make the data type Real. The sensor you can write ID30, you can write sensor you can write

Internal
ultrasonic or whatever input. This is irrelevant what name you give here. Now, we need an output,
because after scaling, you need to show the value. So here we will write "scaled sensor". This is a scaled
value, which will be in percentage, and this will be also a real value. So we have defined two variables,
so we have to multiply input with 10 and store in the output. So hey... (Student: Do we have other
option in datatype ?), yes, of course. Yeah, we have it here all the options, we have Real, Word, Integer,
Double integer, time. And this is hardware interfaces, Character, some Boolean bytes, we have all the
data types. Okay. So now, simple thing is you have to write "sensor", and it will automatically it should
automatically. It's not showing, but anyways, you can write, this is symbol, right, let me zoom it for you.
This is the symbol of addressing and if you take "sensor", it will automatically help you to write it. And
then you have to add colon, equal (:=) a sensor value, sorry, this will come to the right here will come
scaled value because the output here comes on the left, scaled value is your 10 multiple of sensor. Okay.
So whatever you multiply with sensor will be in your scale sensor, and you have to write semicolon (;).
So once you write this code, and when you go back to your main logic, just drag the scaling function
here and you will see your own customized block. And in this block, you have this coding. So you have
created your own function which you're using in your main logic. Now here what was the sensor, our
sensor was ID30. So just put ID30. And the output...our now the output you can use in a data register. Or
I can give you one more option. If you go back to your environment, we can put we can display this
value in a digital display here. Here I can rename that to "level in percentage". This is level in
percentage, go back to driver. And we have two outputs, to increase these outputs go to configuration.
And this is the analog outputs, make 3, go back here. You have one more and here, this is the level in
percentage. Connect this one to your extra output. And this is QD38 and this is a Double Int. So just go
to your PLC, just write QD38 okay, now let's download this logic in our PLC and let's see the results.
Alright, so right now you can see this is some percentage of level and here level is 0.0. Let's start the
process. Okay, I will just force the value here because you're not having proportional value inside. We
have to make sure this should be working. Yeah, QD38 is here.

Oh, wait a second.

I should change its datatype

as well.

here you have a conversion option to convert something from Real to Integer. Because our value was in
Real. So you can right here "Scaled sensor". This is the conversion option, wait a second...
semicolon....return function to value

Dint okay it was Dint

Oh it should work.

Okay, let me try one thing

Let me check how much value we are getting in PLC. However we are getting the value in percentage
here, but there is some restriction in using the real values in the display. But if you use an HMI, this is
just a software if you use an HMI and you can read here the values coming in percentage. So maybe you
can ignore the software bug but we are getting the value in percentage in our PLC, which we can display
in the HMI. But this is just a software bug because I cannot change this integer of software to real which
I want. But this is not an option here. So I will just put that here.

Internal
Okay.

Are you guys getting me? Okay, so the task 1 was to have percentage, now the second scaling was in
height, which is to 300. Okay, now we have to go back to our scaling logic. And we have to also scale
this in range of 0 to 300.

Now, how can you scale the value of 0 to 10 to 0 to 300? Can you guess? Guys, are you there with me?
Yeah, we are here. Hi, Kevin. Alright, so can you guess how can you scale the value to 0 to 300, from 0 to
10. We are getting 0 to 10 volts in the PLC and we not... we need to show the range in centimeter. So
you have to convert the range of 0 to 10.0 to 0 to 300.

(Student: Just to multiply with 30?)

Yeah, we just have to multiply. So we'll take one more output. Because right now it's scaled in
centimeter that is also Real. And here, we will put the output first "scaled_in_cm", which is equal into
your ID, the sensor, which is ID30 multiplied by 30. That's it. Because of the value is 10. Here, we need
the value 300. So if you see the multiplication factor, 300 divided by 10 is 30. You have 30 here, so we
have scaled in centimeter. Now the good thing is if you go back to your main logic, you have to update
your block. So right click, and update block call, click OK. So you have scaled in centimeter and I'm going
to read this value in a data register, which could be MD30. Okay, so let's see that. Now in centimeter. So
you can see right now it's 190 centimeter If you see here, it would be approximately 190. Okay. So if you
increase it, the value will be increased here, you will see the value of percentage being increased here,
and also the centimeter. Okay, this is very easy just to scale the values, we have to just read the sensor
and see the multiplication factor and just write the code, make your own function and displayed here. I
hope this part is clear. Okay, Kevin, you there? Just need. Yeah. All right. So let's proceed to the next
task. Display the scaled value on the panel however, we tried, but unfortunately, we don't have a Real
format in the panel here. So we cannot display it in the Real values. So we'll come to that part a bit later.
So, the next is interesting question it says make an auto function using SCL code such that it fills the tank
in such a way that if tank level is less than 40%, we will read ID30 if it is less than 40%, we have to make
the fill valve opening 100%. Now the fill valve opening is this one, this is the fill valve, this should be
100% if the level is below 40%. Now say that the level is above 40% and less than 80% between 40 and
80 when fill valve opening should be 50% and if the level is more than 80% it means it's about to fill, the
fill valve should be closed or should be 0%. So these are the three conditions we have given and it says
use toggle button to drain the valve at 50% flow rate Okay. Now if you have any questions regarding you
can ask me in between and this code we can write using "if else" statement. And it's very easy. So what
I'll do is I'll just copy this condition and we put it here. So, this was the scale logic we are no we are not
going to interrupt it, we will go to program and create a new block. Again function block and we can call
it let's call it semi automatic or automatic control ON/OFF. This is not proportional. This is an on/off
control. We will come to proportional after that. So this is again the same window and I will write a
comment here for you to understand. Question comes here. Okay, so the first sentence says if the level
is less than 40%. Now we know that we are getting the level in percentage in our register, if you see
here. QD38, this is in percentage, okay. So if we go back to automatic control, so let's define the inputs.
So in inputs we have, level and percentage, okay. And what we have in input, that's it, we have to
compare the only input which is level in percentage, and then we have to write the output, which was
our drain valve or fill valve. Okay. So output I will write "fill valve", the first step of writing the code is

Internal
always to define your input and outputs. Now the level and percentage was in Real, so mention real,
output was in Real, so it will be Real.

Now if you are good with your c++ skills, you might know how to write an IF-ELSE statements it's it's very
easy here as well. One option is you can take the instruction go to program control and use IF-ELSE
syntax from here or you can write by yourself. So since we are having three conditions, I'm going to take
"if else" and "else if" Okay, we have to write nested loops, okay. So, I will take this one and drag it here.
So that we can have multiple conditions here. The first condition says if tank level is less than 40%, so
here, it will come level in percentage. So first will be level in percentage. If this is less for the lesser sign,
40% we can write 40.0. Okay, then what should happen? It says fill valve should open 100% now the fill
valve was here. Write fill valve. It should be 100% means greater than and eual into (>=). Now fill valve,
as you see in our Factory IO is having a value of 0 to 10 volt, okay, so you don't have to write 100 here,
you just write 10.0 and put semicolon okay. Because our valve is not scaled to 0 to 100%, we have only
scale the input not the outputs. So, you just write 10.0, this will work, okay. Now else if, if the level is
greater than 40 and less than 80. So again I maybe I can copy that, is greater than 40, so I'll change the
sign, and less than 80, so, I will copy that and now it says and and is an AND gate. But practically, you can
here right simply "and" this is how you can easily write AND gate in the coding or you can also write the
symbol (&). So, however you like and if this is less than 80% okay, then what should happen ? fill valve
should be 50% open, so, copy this code put here, 50% is five okay because again the scale is not 0 to
100, 0 to 5. Else the third situation says the level is above 80%, valve should be 0%, valve should be off.
So, I will copy this part

above 80, I can also write here Else-If, it will be more suitable. Then the valve should be close... put here
and put here zero and now our logic is ready. Is there any doubt in this one? (Student: Okay), so this is
the logic for these three situations. Okay, but we still have to write the code for toggle button to drain
the level. Okay. Now if we come back to our environment, we can use this first button. This first start
button for draining okay, so let's see its connections. This is not connected anywhere. So we can connect
the Start button. Okay, okay, it's here is I0.0 okay. So, we have to read I0.0 if this button is pressed, we
have to start the draining at 50% okay. So, we have one more output, "drain valve", we will give the
address to this valve later, we are just defining the variables. So i will cut this comment from here and
put it here. Okay, now button is on which means button is a Boolean. So we have to take the input and
we will write drain input or I don't know drain button, okay. And this is Boolean because button is always
on or off. Okay. So take now here again we'll write If...drain button, so the address is true, you can write
equal into 1, 1 is high then what should happen ? the drain valve should be 50%. So, drain valve is...,
now we notice the symbol here, this means the value on the right will go to the value on the left but if I
don't use the column . This is comparing it okay. Drain valve is 5.0 okay. So, this is the two lines in the
logic for If the button is pressed, then drain valve will be 50% open. Now if you see this error this error
occurs because the loop is not closed. So I will write End If. Now the loop is close so there is no red
underline it means our code is correct. You can also compile it. So this is okay. Now just go back to main
logic and just drag your code here and you will see your block it says level in percentage, drain button,
fill valve, drain valve. The level in percentage as I told you was here QD38. We just write QD38. And
drain button was I0.0. So just put I0.0, press Enter. Fill valve and drain valve. Fill valve is we can put it..
wait. It already is here, QD30 is fill valve, QD34 is drain valve or discharge valve, just write QD30, QD34.
So everything is okay, download the logic. And let's see the results. Any doubt here before we proceed
Okay, so let's see, the operation. I will go, i will release this force because now we are controlling and

Internal
play. So since the level is below 40% you can see the level here below 4, the valve was 100% open, when
the level reach between 4 to 8, this will be 50% you can see it's changed to 50% and when the level is
above 80 you will notice this will be off, sometime the programming in SCL is easy because you can
make your own function and you can easily modify it and update it and use it in your own way. So above
80 should be off, if our logic is correct. Yeah, that's pretty much Okay. Any doubt in this one? This is just
following the code which we wrote here.

Yeah,

you can maybe you can also monitor that here. Yes, you can. If you just want to see one more time, you
can see that results here which result is true which is false. So, this If statement is true, which means the
level is above 80%. So, this result is true, which makes the fill valve to zero okay. Now, we have to check
the drain button here just go back and see the panel and when you press this one, you will find your
discharge is open by 50%. And the interesting thing is you will see the filling has been started by 5 by
50% because the level goes below 8. So, what is happening here we are using the liquid and it is also
controlling the level. So, we have maintained a certain level in the tank such that even if we are using
the liquid, we are discharging the liquid, our level is maintained, we have liquid all the time. Now, the
interesting part is if I increase the level of this discharge valve, if I make it like 75% so, what will happen
the level will goes down because failing is 50% and draining 75% the level eventually will go down. So,
let's try that I will write 7.5 and download the logic and now you will notice the drainage is more than
filling so level is going down okay. So, what will happen if it goes below 4 ,the filling will be 100% as per
our logic. So, even then if the filling is more than draining our level is maintained, you will just notice
now

this is like a step control or on/off control of liquid. This is not proportional. So that it go below 4 and
now you've seen the filling is 100% but then again it goes to 5 the moment it reaches above 4. You see
this thing this is one of the disadvantage if we use proportional control because we have on/off situation
here. Are you getting me ? So, this situation we can avoid using proportional control because this is
harmful for the equipment if you make something on you know 200% and 50% we have to have a
proportional control of the valve which is a smooth operation. So to avoid this situation, we go for
proportional control, bitbefore going to proportional I want you guys to understand these loops if and
else otherwise it will be difficult for you to proceed.

Okay.

You can you can also make a button here. For drainage you can use like a low drainage or fast drainage.
Suppose if I press this lower drainage or slow drainage, it should open the wall with 25%. If I click on the
fast drainage, it should open the wall with 75% okay, can you do that? Can you tell me how I can do it?
Like, I want to have one more button here. If that button goes high, the drainage should be 25%. If the
other button goes high, the drainage should be 75%, which is happening right now. But I need one more
button for 25%. What should I do?

We have to take one more button here. And then we have to write the same code. If that button is high,
it should be 2.5. But then we have to interlock it. If somebody presses both the buttons, nothing should
happen. Or you can define what should happen if somebody press both buttons. Or it should be 100%. I
don't know. So with this, you can define using if and else statement as well. So maybe you can take it as
your homework, I don't know, if you like having homework. Otherwise we can proceed. Yeah, so this

Internal
was automatic on/off control. And now next is the main part, it says make an arrangement to change
the setpoint of water level using potentiometer 0 to 100%. And write a code in SCL to achieve the
setpoint using only proportional control. Automatic proportional. Now, if you heard about PID control,
proportion is a part of control. And we generally use only proportional control if your rate of change of
error is very slow. Now what do I mean by that? Here, if I start filling the tank, you know, it's a huge
tank, and when you start filling it the level increase slowly. So in that case, we can use only proportional
control and it will work. In case if we have some other scenario for example, I have shown you in the last
lesson that we have a ball and which ball moves up and down by flow of air. In that case, because of
gravity and because of air ball movement is very sensitive because it was very lightweight. In that case,
we have to use PID. But in this case, we can only use proportional control. So let's go back to our main
logic. And we delete the automatic control block from here. But don't worry, the block is already here,
we are just not using it. So I'll go to program block and add a new block, go to functions and here you
will write "proportional control project" Okay, now here we have to write the code. Now if you know in
PID, we always deal with errors. Okay. Can you tell me what would be the error in our situation? In this
situation? What could be the error?

Anyone?

In a control system, what is the error? In any control system, we have a basic control system where we
have input, then we have controller Yeah, difference Exactly. So the error will be the difference between
what the user wants, and what's the actual feedback, that is the error. So in our case, let's first write
how we can calculate the error. So in error, we need the user input. So let's define the input and let's
call it setpoint setpoint is Yeah, (Student: Do we need any feedback in this?) yes of course the feedback
is the level meter, the level meter which is showing us the level is a feedback because this is the sensor
which is giving us the value okay. Exactly. So I will write sensor and put these values are in Real Okay.
Now, the error will be the difference between that. So, let's define the error as a temporary variable
because temporary variables are those which we use just for calculations in our logic. So I will write
"error" here an error is also Real cool. So I will write error and it shows the anyways error is equivalent
to set point minus sensor. So, set point minus sensor, this is the error and they should always in
temporary variable because this keeps on changing okay. Now, after the error, you have to write a
proportional logic. Now proportional logic means if you if you know the proportional control, it will only
actuate the output based on how much is the error. If the error is more, it will automatically make the
fill valve 100% open. If the error is less it will reduce the fill valve by some percentage which depends on
the error. So, proportional control is directly proportional to the error. So, what we write here is let's
give a comment "proportional control". Now in proportional control there is a term called "gain" right.
Suppose if the error is 50% and the proportion output is 50% the gain is 1 right. But if you increase the
gain, it will quickly reduce the error okay that's how you can relate the gain gain or proportion control
help you to quickly overcome the error. So, we will see how we can change the gain. So, as of now, I will
give a variable here input which is kP, kP is in Real, this I'll put a comment "proportional gain", we will
see the result of different gains in our logic okay. So, in proportion control, now we need an output. So,
here I am writing an output as we have output drain valve okay. And we also have an output filling valve

and we will also write an output which is U you know, in our control system, generally we refer to the
PID output or proportional gain output by the symbol U or by letter U This is very common in control
systems. So, I will right here this is our proportional controller output that will be suitable. But we don't
need U in here, we just need U in temporary because it's the calculation output okay. Oh, there is no

Internal
paste option okay. Okay, I will tell you what U is. So, proportional control output, now, that output will
be U. This is the output of the controller and that should be equal into your error

multiplied by the gain which is kP. Now, try to understand that, if the gain is 1, okay, and if the error is
50%, the output of control will be 50%, you're getting me. If the gain is 2 the output of controller will be
100%, it will open the valve by 100%. But we'll see more clearly once we start running the simulations.
So, now comes the output. Now, the output we have two outputs. So, this is really important you have
to understand the filling output which is the filling wall is directly proportional to your VAT proportional
controller output. So, I will just write equal into "U"

okay

because, the output directly goes to filling because we are reading when setpoint is less than sensor it
means, suppose my setpoint is 100% and the sensor is at 80% what do we need we need to fill the valve.
So, the error was 20% So, that 20% directly is equivalent to filling valve. So, in this case this is equal into
your proportion output, but this will be inversely proportional to your draining output. So, in draining
valve I will not take U but I will take -U. Why did I took "-"? Because if your set point, now try to
understand if your set point let's say it's 50%. I will put here, give you an example, if set point is 50% and
feedback or level is 100%. In that case what will be the error, 50 - 100 is -50. So, if I get -50 to drain
valve, nothing was the minus you know the minus will be multiplied by this minus it will be +50 and level
is 100, setpoint is 50, it should drain the valve. So, drain valve will be opened by 50% and here error is
minus 50. So, this will be closed because if you give something in minus to a filling valve, it will be close.
So, this works opposite to each other. Does that make sense? you will you will see You will see it. Let me
just download this logic. So this is the only logic we need to write a proportional control. And let's
download this one. And let's see the results. Okay. Oh, sorry, I have to do one more thing. You just drag
your proportional logic here. Okay. setpoint. Now setpoint let's take it from the panel. And here, I can
use this as setpoint, let's see where it is connected. Potentiometer If you want, I can rename it to
setpoint to avoid confusion. Okay, so the setpoint is ID34. So... sorry, sensor was ID30 as before, kP is
the gain, so let me put 2.0, 2 again. Drain valve, drain valve was QD30. And filling valve was QD34, we
can still confirm it. Yeah, that's great. Okay. Everything is good. So now, let's go to download. What is
that? Okay. Online. Wait, something happened here. I think we changed this one. It was MD30 before
maybe. Okay. So let me refresh it. So right now, the setpoint is zero. Let me reduce it, and setpoint is
zero, level is zero. So nothing is happening. There is some noise so I can see some liquid is coming
because some noise is there. So you can we can remove, ignore that. Let's come to proportional logic.
Go online. And now I'm going to give some setpoint here. Sorry. Should be (dear). Okay, so I'm going to
give a set point of let's say 26% Wait, wait, wait, what did I do? filling valve is okay. It's it's working in
reverse. That's problem. QD30, QD 34. Oh, sorry, this was 34 I just mismatch the outputs because it was
drained before QD34 here and QD30 here.

Cool. Okay,

coming back to this one. All right, now you can see the filling valve is on and it's trying to fill the valve, fill
the tank and it will go up to 2.6, this is the level meter and this is the set point. And because the setpoint
is below the feedback, that's why this is increasing the valve and as it is reaching this value, you can see
this is proportionally decreasing, why because our error is decreasing and if errors is decreasing, the
output is decreasing because this is directly proportional to error and the gain is fixed in this case. Are
you getting this one? Guys? Yes. Let me just explain again if I increase the setpoint 67% this is increased

Internal
proportionally fill valve. And as the level is increasing, this is decreasing because I said it's proportional
to the error okay. And if you notice now, it is taking time to reach the set point, this is a slow operation
Okay. Now there comes the importance of gain. If you notice that it is as 5.8 and it will take a minute to
read 6.7 if you want a quick action, you have to increase the kP, increase the gain. So if you see here
gain is 2. Now you have seen that response right? Let's see what happened if we need a lesser value. So
I'm going to reduce the setpoint and I will say drainage.. drainage is on, because the error is in minus
and when the minus multiply with the minus of the drainage and automatic control the drainage goes
on. That's why we use the minus to make the drainage on. If we don't use the minus both the drainage
and fill while they'll be open which is which will not make any sense to proportional logic. If it's not clear
I can explain it again but if you stay silent I don't know if you're getting it or if you're not getting it .
(Student: no we're getting it) all right all right. Now let's see the response by increasing the gain you will
see a quicker response so let's make it 5.0 okay. Let's download it and now this is going to reach here.
Let me increase to 8.2 and you will notice it will reach quickly than before I mean rate of change of error
has been reduced, error is reduced and you can see the response is quicker right. This happens when
you increase the gain, gain increases the rate of reducing the error in proportional control Okay, it will
quickly reach to 8.2 but still proportional and this gain will also affect the drainage, 5.8 you can see how
quickly drainage response is there. Let's increase it more let's make it 20 and download this one okay.
Now let's increase to oh sorry.. I made I made it zero, okay you can see that I made it zero and this is
decreasing.

So, this is this will be empty, the valve was 100% open even and.. when the value is 20. But if you
increase the gain at such level it will be problematic. We will see that. So let's say we need 18%, This
valve is 100% open and quickly closing I will notice that level has been increased to 1.9, although it will
be compensated by drainage but there is an overshoot okay. So in proportional control, if you increase
the gain more you will get an overshoot. Let me explain you what is an overshoot here? If we take a
presentation, suppose you have I don't have a paper and pen here so i would explain using PowerPoint.
Suppose your setpoint is 50% so that's my setpoint. Okay, and I will put here a comment 50%. And if our
proportion again, when we saw the first time it was...

sorry.

When kP was 10, which was pretty much okay. I will change its color. And kP was 10 we were actually
getting the value. Let me try it.

Like slideshow.

Yeah, that would be great. So when kP was 10

I needed pen. Yeah,

we were getting the value reaching perfectly fine like this. Okay. But when we increase the kP, this was
zero, let'... Let's imagine this is zero, and this is the output of filling, okay. But when we increase the Kp
to let's say, we increase it to 20. In that case, we had an overshoot like this one. Okay, this overshoot is
not required. This is this is very dangerous in control system, we don't need overshoots, we need a good
proportional control so that it will not overshoot the setpoint. So to avoid this area, we have to reduce
the gain. That's the gain play what you're doing control system, you reduce the gain to reduce the
overshoots. Okay, that's why our suitable gain would be around 10 to 15. And if we do that one, you will

Internal
notice there will no overshoot here. So level is 50%, it will reach 50 and this valve will be closed, it will
not go beyond 50 or 5. Yeah. You will notice here, it will close the moment it reached 5. So there is no
overshoot the level is exactly at 50%. But if we make it 20, the level goes to 5.1 or 5.2. And then it comes
back, although it comes back, but that's not required. We don't need overshoots. Okay, so this was
proportional control logic. And the logic is here. If you want you can write it. I didn't know. I didn't know
any any questions regarding that.

The next was like just you have to install a potentiometer in panels for the gain, I think there is some
problem in your mic because I'm listening my own voice again.

Eco.

Okay. So next is we have to change the gain using potentionmeter, that's the very easiest one, you just
have to take one more input, maybe you can duplicate that one. And I will put it here. Instead of
potentiometer 2 I will write kP, which is our gain. And the task says we have to make it a minimum and
maximum limit. So minimum limits, and let's put it 1 because if you put kP zero, that is not acceptable.
And the maximum limit should be let's say 10. Okay, so you have to again, write an IF and ELSE
statement to make the minimum and maximum limit between 0 to 10. And for that, you will take the
input here, if you don't see here, you can take one more input in your configuration, and you have an
input and put kP here. Now this is in Real. So you have to again, make a scaling code in the SCL to check
if the input and output range should be only between 1 to 10. Okay, 1 to 10 or 1 to 15. So, coming back
here, I would like to give you this as a homework, if you can write scaling. Here, you just have to make
sure the input ID38, this is coming in 0 to 10.0. You have to convert this range to 1 to 10. To How will
you do that? This is the kind of homework if you do it, that would be great. Because next what we are
going to do will be a little more advanced than today's lesson. All right. If you have any doubts, you can
ask me otherwise, we will close the session.

Same religion.

Oh, yeah, very good question. This is a Factory IO. And if you want to link it with Siemens IO, you need to
purchase the license, I can show you the license information in our website. Because this, although it is
this, we'll have a 30 days trial version for free, which you can download from our website. If you go to
the Starter Edition, you can try the 30 days free version ,link is should be here here. Yeah, you can
download the software from here, which is for 30 days trial version for free. But if you like to extend the
validity, you can purchase the license. Now we have different license if you want to just use control IO.
All right, I'll show you here. This logic, you can also design without Siemens, if you go to the driver, go to
Control IO. Let's say that it's starting Yeah, here, you can make the logic in this software. But the
problem is it only supports functional block. Like you will have function blocks, you will not have what
we were doing in Siemens. The software has small limitation. But this is not ... I don't know if you're
good with FBD you can use this software for making PID logics. There also you have addition,
subtraction, multiplication, and then timers, counters like this AND operation. This is RS flipflop, SR flip
flops set reset, but if you like to link it with Siemens, then you have to have a Siemens driver, which
comes here. The Siemens addition is this one. We have two editions. One is a lifetime validity, which
costs $419. And one is a one year license, which costs 140 dollars. So if you have a Siemens edition, you
can link your software with Siemens hardware. But if you just want to use the simulation as I'm using,
you can also do that. That is the pricing. Yeah. So it's up to you, you know, we use your pitch, or you just
need your laptop, oh you can use your laptop like this driver, which is a Siemens driver supports the

Internal
hardware, but also suppose the software, if you see these two PLCs in V5, V13, and V14, I'm using
PLCsim here, I'm not using any PLC right now for this explanation for this logic, I'm just using the
software. So it's up to you, if you have the software, just install it, and you can link it. Now to link the
software of Factory IO with Siemens TIA, there is this one logic, you have to write an SCL, which is this
one, I can give you this logic, just make a function. And this will link your Siemens TIA, to Factory IO, you
just have to select Siemens PLCsim here. Now since I'm using the ultimate version, I have all the drivers
of Allen Bradley, control IO, Modbus, Siemens, but if you buy the Siemens, you will only see these four
options LOGO, 300, 1200, and PLCsim. (Student: is there Schneider PLC also?) . What What did you say ?
Schneider dont, they don't have a specific module for Schneider. But I hope this can be linked with
Modbus TCP and client server, maybe OPC. There, you have to use third party software. But so far, I
don't think they have Schneider. Maybe they will update the software later on. As of now that's not the
option. Or maybe you can contact their control support. Maybe they will help you to link it. But I'm not
sure. Any other questions. I would be uploading the session after 24 hours. And maybe we'll find the link
on the Facebook group, also on the YouTube. Alright. So thank you for joining. I hope you enjoyed the
session. If you are happy. Sorry.

Can you say that again?

(Studen:I didn't get the last statement that you say)

oh, I said we are going to upload this video in our Facebook group. Also in the YouTube. If you want you
can review that. And for next session. If you're happy with today class you are welcome to join.

Sorry, yes.

For next session. I will put the information in the Facebook.

Yeah, yes.

All right. If you have anything else, you can also send me a message. So thank you for joining and I will
see you the next class. Have a nice day. Ciao, bye

Internal

You might also like